P4 spec coverage¶
What P4-16 language spec constructs P4Py currently supports.
P4Py targets v1model and eBPF. The tables below map supported constructs to their spec sections.
Types¶
Construct |
Supported |
Spec section |
Notes |
|---|---|---|---|
|
Yes |
Only numeric type |
|
|
No |
||
|
No |
||
|
Yes |
Action params, control output |
|
|
Yes |
Flat only, all fields |
|
Header stacks |
No |
||
|
Yes |
Header, |
|
|
No |
||
|
No |
Parser¶
Construct |
Supported |
Spec section |
Notes |
|---|---|---|---|
Parser declaration |
Yes |
||
Named states |
Yes |
First state is implicit start |
|
|
Yes |
||
Unconditional transition |
Yes |
||
|
Yes |
Single field, integer or default cases |
|
|
No |
||
Sub-parsers |
No |
||
Value sets |
No |
Expressions¶
Construct |
Supported |
Spec section |
Notes |
|---|---|---|---|
Integer literals |
Yes |
Decimal, hex, width-annotated |
|
Bool literals |
Yes |
|
|
List expressions |
Yes |
For checksum data args |
|
Field access |
Yes |
|
|
|
Yes |
||
Bitwise ( |
No |
||
Shifts ( |
No |
||
Comparison ( |
No |
Only in |
|
Slicing |
No |
||
Concatenation ( |
No |
||
Casts |
No |
||
|
Yes |
In control apply blocks only |
|
|
No |
||
|
No |
Statements¶
Construct |
Supported |
Spec section |
Notes |
|---|---|---|---|
Assignment |
Yes |
||
Method call |
Yes |
|
|
Function call |
Yes |
|
|
|
Yes |
Condition must be |
|
|
Yes |
On |
|
Block statements |
No |
Control blocks¶
Construct |
Supported |
Spec section |
Notes |
|---|---|---|---|
Control declaration |
Yes |
||
Actions |
Yes |
Direction-less parameters only |
|
Tables |
Yes |
||
|
Yes |
||
|
Yes |
||
|
No |
||
|
No |
||
|
Yes |
||
|
Yes |
Deparsing¶
Construct |
Supported |
Spec section |
Notes |
|---|---|---|---|
Deparser declaration |
Yes |
||
|
Yes |
See also¶
v1model coverage for v1model-specific constructs.
eBPF model coverage for eBPF-specific constructs.