You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BMv2 actions already implement conditional and unconditional forward or backward jump instructions, within the primitive actions of a single P4 action, so it should be possible to implement loops there with only moderate changes to the p4c BMv2 back end code. See:
the implementation of arbitrary if statements within actions for possible inspiration: p4lang/p4c@c11bb8b
Things to think carefully about when working on this:
we want break, continue, and exit statements in arbitrary places in a loop, including within if statements inside of a loop body, to work correctly.
we want nested loops to work correctly.
Note that implementation arbitrary loops in the body of a control likely requires generalizing other parts of the BMv2 JSON file format / data model, probably with a lot of overlap with this project idea: #8
The text was updated successfully, but these errors were encountered:
BMv2 actions already implement conditional and unconditional forward or backward jump instructions, within the primitive actions of a single P4 action, so it should be possible to implement loops there with only moderate changes to the p4c BMv2 back end code. See:
Things to think carefully about when working on this:
break
,continue
, andexit
statements in arbitrary places in a loop, including withinif
statements inside of a loop body, to work correctly.Note that implementation arbitrary loops in the body of a control likely requires generalizing other parts of the BMv2 JSON file format / data model, probably with a lot of overlap with this project idea: #8
The text was updated successfully, but these errors were encountered: