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

Add support for enums in bmv2 backend #247

Merged
merged 1 commit into from
Jan 21, 2017
Merged

Conversation

antoninbas
Copy link
Member

Starting with version 2.3, the bmv2 JSON supports declaring enums. See
p4lang/behavioral-model#270 for more
information.

The bmv2 backend was already converting enums to integers (under certain
conditions). In this PR, we simply reteieve the mapping enums -> int and
dump it to the JSON file. In order to do this, the ConvertEnums midend
pass had to be slightly modified to give the backend access to the
produced mapping.

Starting with version 2.3, the bmv2 JSON supports declaring enums. See
p4lang/behavioral-model#270 for more
information.

The bmv2 backend was already converting enums to integers (under certain
conditions). In this PR, we simply reteieve the mapping enums -> int and
dump it to the JSON file. In order to do this, the ConvertEnums midend
pass had to be slightly modified to give the backend access to the
produced mapping.
@antoninbas antoninbas merged commit 952b16a into master Jan 21, 2017
@antoninbas antoninbas deleted the bmv2-enum-support branch January 21, 2017 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants