Supported P416 Language Features - 2025.1 English - UG1308

Vitis Networking P4 User Guide (UG1308)

Document ID
UG1308
Release Date
2025-05-29
Version
2025.1 English
The following table identifies supported and not supported P416 language features.
Note: Conditional statements are not supported inside actions.
Table 1. P416 Language Features
Context Supported Not Supported
Data Types

void (extern functions only)

match_kind (architecture defined)

error (architecture and user defined)

Integers (unsigned: bit and varbit)

bool

void (others)

match_kind (user defined)

ParserTimeout error

String ( @name “…”)

Integers (others)
Derived Types

enum (architecture specific)

header (and header stack)

struct

package (architecture specific)

typedef

const

enum (user defined)

header (push and pop methods)

header_union

tuple

package (user defined)
Expressions

Cast

Variables

Operators (!, ~, -, +, *, >>, <<, &, ^, |)
Operators (/, %, ?)
Statements

assign

if, else

block

exit

return

switch

Parsing

state

extract (fixed width extraction)

extract (variable width extraction)

transition (user defined)

transition (accept and reject)

select (no overlap with mask/range)

verify

lookahead 1

(extract to underscore, or advance)

length

select with overlapsskipping bits (mask/range)

sub-parsers

Control

action

table (key, actions, default_action, entries, size and implementation statement)

emit

apply

extern (user)

Externs (Built-in Counter, Checksum, InternetChecksum, Register)

Other Externs
  1. A potential workaround for the “lookahead” functionality can be achieved by using the “extract” method. This involves re-defining headers, to split them into a shorter “generic” header which can be extracted first, before deciding what the next transition select should be and the remainder of the header parsing.