codegen: rust: when a table size is specified constrain generated tables to that size.

未关闭
#30 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
rust
领域
compilers

调研方向

未指定源文件、测试或入口点。首先阅读 P4 规范第 14.2.1.5 节,并定位用于表大小属性的 Rust 代码生成路径;所需的目标 ASIC 语义和代码生成选项必须在实现之前确定。完成的标准应是生成的表遵循已配置的大小行为。

由索引模型根据 Issue 内容生成。

描述

codegen rust want

The primary purpose of the Rust code generation is to emulate real ASICs. To that end, when a table size property is provided, the underlying table that gets generated in Rust code should behave like the target ASIC does when size number of entries is reached.

The P4 spec is vague on what the semantics of table sizes are. From the P4 spec section 14.2.1.5 we have

If a table has a size value specified for it with value N, it is recommended that a compiler should choose a data plane implementation that is capable of storing N table entries. This does not guarantee that an arbitrary set of N entries can always be inserted in such a table, only that there is some set of N entries that can be inserted.

So there is no prescribed behavior here. We should probably have code generation options that can capture what the target ASIC being emulated does.

主要语言
Rust
星标
140
派生
14
平均合并
3 天 18 小时
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

oxidecomputer/p4 的其他 Issue

查看 oxidecomputer/p4 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。