Skip to content

Commit 93b36f5

Browse files
author
Mihai Budiu
authored
Merge pull request #1107 from Abe149/Abe149/005___making_corrections_to_the_P4₁₆_spec._based_on_reading_version_1.2.2
making corrections to the P4₁₆ spec. based on reading version 1.2.2 [branch #5]
2 parents 09297b3 + 0c6a029 commit 93b36f5

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

p4-16/spec/P4-16-spec.mdk

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5628,7 +5628,7 @@ parserState
56285628

56295629
Each state has a name and a body. The body consists of a sequence of
56305630
statements that describe the processing performed when the parser
5631-
transitions to that state including:
5631+
transitions to that state, including:
56325632

56335633
- Local variable declarations,
56345634
- Assignment statements,
@@ -5800,12 +5800,12 @@ select (p.tcp.port) {
58005800
The expression `16w0 &&& 16w0xFC00` describes the set of 16-bit
58015801
values whose most significant six bits are zero.
58025802

5803-
Some targets may support parser value set, see Section [#sec-value-set]. Given
5803+
Some targets may support parser value sets; see Section [#sec-value-set]. Given
58045804
a type `T` for the type parameter of the value set, the type of the value set
58055805
is `set<T>`. The type of the value set must match to the type of all other
5806-
`keysetExpression` in the same `select` expression. If there is a mismatch, the
5807-
compiler must raise an error. The type of the values in the set must be one of
5808-
bit<>, int<>, tuple, struct, and serializable `enum`.
5806+
`keysetExpression`s in the same `select` expression. If there is a mismatch, the
5807+
compiler must raise an error. The type of the values in the set must be either
5808+
bit<>, int<>, tuple, struct, or serializable `enum`.
58095809

58105810
For example, to allow the control plane API to specify TCP reserved ports at
58115811
runtime, one could write:
@@ -5914,7 +5914,7 @@ packet_in {
59145914
}
59155915
~ End P4Pseudo
59165916

5917-
### Fixed width extraction { #sec-packet-extract-one }
5917+
### Fixed-width extraction { #sec-packet-extract-one }
59185918

59195919
The single-argument `extract` method handles fixed-width headers,
59205920
and is declared in P4 as follows:
@@ -5923,7 +5923,7 @@ and is declared in P4 as follows:
59235923
void extract<T>(out T headerLeftValue);
59245924
~ End P4Example
59255925

5926-
The expression `headerLeftValue` must evaluate to a l-value (see
5926+
The expression `headerLeftValue` must evaluate to an l-value (see
59275927
Section [#sec-lvalues]) of type `header` with a fixed width. If
59285928
this method executes successfully, on completion the `headerLvalue`
59295929
is filled with data from the packet and its validity bit is set to `true`. This
@@ -5933,7 +5933,7 @@ enough bits left in the packet to fill the specified header.
59335933
For example, the following program fragment extracts an Ethernet header:
59345934

59355935
~ Begin P4Example
5936-
struct Result { Ethernet_h ethernet; /* more field omitted */ }
5936+
struct Result { Ethernet_h ethernet; /* more fields omitted */ }
59375937
parser P(packet_in b, out Result r) {
59385938
state start {
59395939
b.extract(r.ethernet);
@@ -5964,15 +5964,15 @@ void packet_in.extract<T>(out T headerLValue) {
59645964
}
59655965
~ End P4Pseudo
59665966

5967-
### Variable width extraction { #sec-packet-extract-two }
5967+
### Variable-width extraction { #sec-packet-extract-two }
59685968

59695969
The two-argument `extract` handles variable-width headers, and is declared in P4 as follows:
59705970

59715971
~ Begin P4Example
59725972
void extract<T>(out T headerLvalue, in bit<32> variableFieldSize);
59735973
~ End P4Example
59745974

5975-
The expression `headerLvalue` must be a l-value representing a
5975+
The expression `headerLvalue` must be an l-value representing a
59765976
header that contains *exactly one* `varbit` field. The expression `variableFieldSize`
59775977
must evaluate to a `bit<32>` value that indicates the number of
59785978
bits to be extracted into the unique `varbit` field of the header

0 commit comments

Comments
 (0)