Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rcgoodfellow opened this issue Jul 3, 2023 · 0 comments

Comments

@rcgoodfellow
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant