Appendix A Revision History
- Improved type nesting rules (Section[#sec-type-nesting]).
- Clarified that directionless extern parameters are passed by reference.
-
Introduced distinction between local compile-time known and compile-time known values (Section[#sec-compile-time-known]).
-
Added header stack expressions (Section [#sec-hs-init]).
- Allow casts from a type to itself (Section [#sec-casts]).
- Added an invalid header or header union expression
{#}(Sections [#sec-ops-on-hdrs] and [#sec-expr-hu]). - Added a concept of numeric values (Section [#sec-numeric-values]).
- Added a section on operations on extern objects (Section [#sec-extern-operations]).
- Added note in sections operations on types for types that support compile-time size determination.
- Clarified that header stacks are arrays of headers or header unions.
- Added distinctness of fields for types that have fields including error, match kind, struct, header, and header union.
- Clarified types
bit<W>,int<W>, andvarbit<W>encompass the case where the width is a compile-time known expression evaluating to an appropriate integer (Section [#sec-unsigned-integers], Section [#sec-signed-integers], Section [#sec-dynamically-sized-integers]). - Clarified restrictions for parameters with default values (Section [#sec-calling-convention-justification]).
- Added optional trailing commas (Section [#sec-trailing-commas]).
- Clarified the scope of parser namespaces (Section [#sec-parser-decl]).
- Specified that algorithm for generating control-plane names for keys is optional (Section [#sec-cp-keys]).
- Clarified types of expressions that may appear in
select(Section [#sec-select]). - Added description of semantics of the core.p4 match kinds (Section [#sec-table-keys]).
- Explicitly disallow overloading of parsers, controls, and packages (Section [#sec-extern-objects]).
- Clarified implicit casts present in select expressions (Section [#sec-select]).
- Clarified that slices can be applied to arbitrary-precision integers (Section [#sec-varint-ops]).
- Clarified that direct invocation is not possible for objects that have constructor arguments (Section [#sec-direct-invocation]).
- Added comparison for tuples as a legal operation (Section [#sec-tuple-exprs]).
- Clarified the behavior of
lookaheadon header-typed values (Section [#sec-packet-lookahead]). - Added
static_assertfunction (Section [#sec-static-assert]). - Clarified semantics of ranges where the start is bigger than the end (Section [#sec-ranges]).
- Allow ranges to be specified by serializable enums (Section [#sec-ranges]).
- Specified type produced by the
*sizeInB*methods (Section [#sec-minsizeinbits]). - Added section with operations on
match_kindvalues (Section [#sec-match-kind-exprs]). - Renamed infinite-precision integers to arbitrary-precision integers (Section [#sec-arbitrary-precision-integers]).
- compiler-inserted
default_actionis notconst(Section [#sec-tables]). - Clarified the restrictions on run time for tables with
const entries(Section [#sec-entries]). - renamed list expressions to tuple expressions
- Added
listtype (Section [#sec-list-types]). - Defined
entriestable property withoutconst, for entries installed when the P4 program is loaded, but the control plane can later change them or add to them (Section [#sec-entries]). -
Clarified behavior of table with no
keyproperty, or if its list of keys is empty (Section [#sec-table-keys]). -
Extended
minSizeInBitsandminSizeInBytesto apply to more expressions (Section [#sec-minsizeinbits]). - Added support for
maxSizeInBitsandmaxSizeInBytes(Section [#sec-minsizeinbits]). - Added support for empty lists of const entries in tables (Section [#sec-entries]).
- Added support for
switchstatements in actions (Section [#sec-actions]). - Added support for direct invocation of controls and parsers (Section [#sec-parameterization]).
- Added parser
value_setto list of control-plane visible names (Section [#sec-cp-names]). - Added
match_kindas a base type (Section [#sec-match-kind-type]). - Removed structure initializers as they are subsumed by structure-valued expressions (Section [#sec-structure-expressions]).
- Specified operations on values typed as type variables (Section [#sec-type-variable-operations]).
- Clarified semantics of compile-time known values (Section [#sec-compile-time-known]).
- Clarified semantics of directionless parameters (Section [#sec-calling-convention]).
- Clarified semantics of arbitrary precision integers (Section [#sec-arbitrary-precision-integers]).
- Clarified semantics of bit slices, shifts, and concatenation (Section [#sec-bit-ops]).
- Clarified semantics of optional parameters (Section [#sec-optional-parameters]).
- Clarified restrictions on extern method and function invocation (Section [#sec-calling-restrictions]).
-
Clarified semantics of implicit casts (Section [#sec-implicit-casts]).
-
Added support for accessing tuple fields (Section [#sec-tuple-exprs]).
- Added support for generic structures (Section [#sec-type-spec]).
- Added support for integers,
enums, anderrors inswitchstatements (Section [#sec-switch-stmt]). - Added support for additional enumeration types (Section [#sec-enum-types]).
- Added support for abstract methods (Section [#sec-abstract-methods]).
- Added support for conditional statements and empty statements in parsers (Section [#sec-parser-state-stmt]).
- Added support for casts from
inttobool(Section [#sec-casts]). - Added support for 0-width bitstrings and varbits (Section [#sec-uninitialized-values-and-writing-invalid-headers]).
- Clarified that
default_actionisNoActionif otherwise unspecified (Section [#sec-tables]). - Clarified the types of expressions that may be used as indexes for header stacks (Section [#sec-expr-hs]).
- Clarified representation of Booleans in headers (Section [#sec-header-types]).
- Clarified representation of empty types (Section [#sec-uninitialized-values-and-writing-invalid-headers]).
- Clarified that action data can be specified by the control plane,
default_actiontable property, orconst entriestable property (Section [#sec-actions]). - Fixed several typos and inconsistencies in grammar (Section [#sec-grammar]).
-
Eliminated annotations on
constentries in grammar (Section [#sec-grammar]). -
Added structure-value expressions (Section [#sec-structure-expressions]).
- Added support for default values (Section [#sec-default-values]).
- Added support for concatenating signed strings (Section [#sec-concatenation]).
- Added key-value and list-structured annotations (Section [#sec-annotations]).
- Added
@pureand@noSideEffectsannotations (Section [#sec-extern-annotations]). - Added
@noWarnannotation (Section [#sec-nowarn-anno]). - Generalized typing for masks to allow serializable
enums (Section [#sec-cubes]). - Restricted the right operands of bit shifts involving arbitrary-precision integers to be constant and positive (Section [#sec-varint-ops]).
- Clarified copy-out behavior for
return(Section [#sec-return-stmt]) andexit(Section [#sec-exit-stmt]) statements. - Clarified semantics of invalid header stacks (Section [#sec-uninitialized-values-and-writing-invalid-headers]).
- Clarified initialization semantics (Section [#sec-lvalues] and [#sec-calling-convention]), especially for headers and local variables.
- Clarified evaluation order for table keys (Section [#sec-mau-semantics]).
-
Fixed grammar to clarify parsing of right shift operator (
>>), allow empty statements in parser (Section [#sec-parser-state-stmt]), and eliminate annotations on const entries (Section [#sec-entries]). -
Added
table.apply().miss(Section [#sec-invoke-mau]). - Added
stringtype (Section [#sec-string-type]). - Added implicit casts from enum values (Section [#sec-enum-exprs]).
- Allow 1-bit signed values
- Define the type of bit slices from signed and unsigned values to be unsigned.
- Constrain
defaultlabel position forswitchstatements. - Allow empty tuples.
- Added
@deprecatedannotation. - Relaxed the structure of annotation bodies.
- Removed the
@pkginfoannotation, which is now defined by the P4Runtime specification. - Added
inttype (Section [#sec-arbitrary-precision-integers]). - Added error
ParserInvalidArgument(Sections [#sec-packet-extract-two], [#sec-skip-bits]). - Clarified the significance of order of entries in
const entries(Section [#sec-entries]). -
Added methods to calculate header size (Section [#sec-ops-on-hdrs]).
-
Top-level functions (Section [#sec-functions])
- Functions may be declared at the top-level of a P4 program.
- Optional and named parameters (Section [#sec-calling-convention])
- Parameters may be specified by name, with a default value, or designated as optional.
enumrepresentations (Section [#sec-enum-exprs])enumvalues to be specified with a concrete representation.
- Parser values sets (Section [#sec-value-set])
value_setobjects for control-plane programmableselectlabels.
- Type definitions (Section [#sec-newtype])
- New types may be introduced in programs.
- Saturating arithmetic (Section [#sec-bit-ops])
- Saturating arithmetic is supported on some targets.
- Structured annotations (Section [#sec-annotations])
- Annotations may be specified as lists of key-value pairs
- Globalname (Section [#sec-name-annotations])
- The reserved
globalnameannotation has been removed.
- The reserved
- Table
sizeproperty (Section [#sec-size-table-property])- Meaning of optional
sizeproperty for tables has been defined.
- Meaning of optional
- Invalid headers (Section [#sec-ops-on-hdrs])
- Clarified semantics of operations on invalid headers.
- Calling restrictions (Section [#sec-calling-restrictions])
- Added restrictions on kinds of values that may be passed as arguments to calls.
- Bitwise operator precedence (Section [#sec-grammar])
- Modified precedence conventions so that bitwise operators
&|and^have higher precedence than relation operators<><=>=.
- Modified precedence conventions so that bitwise operators
- Computed bitwidths (Section [#sec-base-types])
- Added support for specifying widths using expressions in
bitandvarbittypes.
- Added support for specifying widths using expressions in