1
1
Title : P4~16~ Language Specification
2
- Title Note: version 1.2.4
2
+ Title Note: version 1.2.5
3
3
Title Footer: &date;
4
4
Author: The P4 Language Consortium
5
5
Heading depth: 5
@@ -3466,7 +3466,7 @@ to bit-strings of the same width:
3466
3466
3467
3467
Bit-strings also support the following operations:
3468
3468
3469
- - Logical shift left and right by a non-negative integer value (which need not be
3469
+ - Logical shift left and right by a non-negative integer value (which need not be
3470
3470
a compile-time known value), denoted by `<<` and `>>` respectively.
3471
3471
In a shift, the left operand is unsigned, and right operand must be either an
3472
3472
expression of type `bit<S>` or a non-negative integer value that is known at
@@ -3783,7 +3783,7 @@ The following casts are legal in P4:
3783
3783
- casts of a tuple expression to a header stack type
3784
3784
- casts of an invalid expression `{#}` to a header or a header union type
3785
3785
- casts where the destination type is the same as the source type
3786
- if the destination type appears in this list (this excludes
3786
+ if the destination type appears in this list (this excludes
3787
3787
e.g., parsers or externs).
3788
3788
3789
3789
### Implicit casts { sec-implicit-casts }
@@ -4312,7 +4312,7 @@ expressions are legal:
4312
4312
- `hs[index]`: produces a reference to the header at the
4313
4313
specified position within the stack; if `hs` is an l-value,
4314
4314
the result is also an l-value. The header may be invalid. Some implementations
4315
- may impose the constraint that the index expression must be a compile-time known value.
4315
+ may impose the constraint that the index expression must be a compile-time known value.
4316
4316
A P4 compiler must give an error if an index that is a compile-time known value is out of range.
4317
4317
4318
4318
Accessing a header stack ``hs`` with an index less than `0` or
@@ -4401,7 +4401,7 @@ void pop_front(int count) {
4401
4401
}
4402
4402
~ End P4Pseudo
4403
4403
4404
- Similar to structs and headers, the size of a header stack is a compile-time known value
4404
+ Similar to structs and headers, the size of a header stack is a compile-time known value
4405
4405
(Section [#sec-minsizeinbits]).
4406
4406
4407
4407
Two header stacks can be compared for equality (`==`) or inequality (`!=`)
@@ -4424,7 +4424,7 @@ expression ...
4424
4424
The `typeRef` is a header stack type. The `typeRef` can be omitted if
4425
4425
it can be inferred from context, e.g., when initializing a variable
4426
4426
with a header stack type. Each expression in the list must evaluate
4427
- to a header of the same type as the other stack elements.
4427
+ to a header of the same type as the other stack elements.
4428
4428
4429
4429
Here is an example:
4430
4430
@@ -7053,7 +7053,7 @@ because of the `@noWarn("duplicate_priorities")` annotation.
7053
7053
#### Size {#sec-size-table-property}
7054
7054
7055
7055
The `size` is an optional property of a table. When present, its
7056
- value must always be a compile-time known value that is an integer. The `size` property
7056
+ value must always be a compile-time known value that is an integer. The `size` property
7057
7057
is specified in units of number of table entries.
7058
7058
7059
7059
If a table is specified with a `size` property of value `N`, it is
@@ -8322,7 +8322,7 @@ a key and a value `expression`. Note the syntax for `expression` is rich, see
8322
8322
Appendix [#sec-grammar] for details.
8323
8323
8324
8324
All `expression`s within a `structuredAnnotationBody` must be compile-time known
8325
- values with a result type that is either: `string`, `int`, or `bool`.
8325
+ values with a result type that is either: `string`, `int`, or `bool`.
8326
8326
In particular, structured `expression`s (e.g. an `expression` containing an
8327
8327
`expressionList`, a `kvList`, etc.) are not allowed. Note that P4Runtime
8328
8328
information (P4Info) may stipulate additional restrictions. For example, an
@@ -8619,14 +8619,21 @@ The P4 compiler should provide:
8619
8619
8620
8620
- Errors when annotations are used incorrectly (e.g., an annotation
8621
8621
expecting a parameter but used without arguments, or with arguments
8622
- of the wrong type
8622
+ of the wrong type)
8623
8623
- Warnings for unknown annotations.
8624
8624
8625
8625
# Appendix: Revision History { #sec-revision-history; @h1:"A" }
8626
8626
8627
- ## Summary of changes made in version 1.2.4
8627
+ ## Summary of changes made in unreleased version
8628
8628
8629
+ ## Summary of changes made in version 1.2.5, released October 11, 2024
8630
+
8631
+ * Improved type nesting rules (Section[#sec-type-nesting]).
8632
+ * Clarified that directionless extern parameters are passed by reference.
8629
8633
* Introduced distinction between local compile-time known and compile-time known values (Section[#sec-compile-time-known]).
8634
+
8635
+ ## Summary of changes made in version 1.2.4,released May 15, 2023
8636
+
8630
8637
* Added header stack expressions (Section [#sec-hs-init]).
8631
8638
* Allow casts from a type to itself (Section [#sec-casts]).
8632
8639
* Added an invalid header or header union expression `{#}` (Sections [#sec-ops-on-hdrs] and [#sec-expr-hu]).
0 commit comments