p4lang / p4c-behavioral

[deprecated] P4 compiler for the behavioral model
Apache License 2.0
18 stars 23 forks source link

modify_field action does not work with registers #8

Closed Mahdth closed 9 years ago

Mahdth commented 9 years ago

modify_field action only work with type field and integer value but not with register.

how can I write a value to register or copy the register value to header field in this case?

antoninbas commented 9 years ago

For implementation reasons, we chose not to support registers with the modify_field action primitive (yet). However, you can use register_read and register_write to copy a register to / from a field. Please look them up in the list of supported primitives: https://github.com/p4lang/p4-hlir/blob/master/p4_hlir/frontend/primitives.json

Mahdth commented 9 years ago

Thank you