-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[P4_Symbolic] Adding p4_symbolic/ir/expected/hex_string_transition.tx…
…t [Extend IR proto and translation to support parsers]
- Loading branch information
1 parent
c43f6b8
commit 02d75a0
Showing
1 changed file
with
349 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,349 @@ | ||
headers { | ||
key: "ethernet" | ||
value { | ||
name: "ethernet_t" | ||
id: 2 | ||
fields { | ||
key: "dst_addr" | ||
value { | ||
name: "dst_addr" | ||
bitwidth: 48 | ||
} | ||
} | ||
fields { | ||
key: "ether_type" | ||
value { | ||
name: "ether_type" | ||
bitwidth: 16 | ||
} | ||
} | ||
fields { | ||
key: "src_addr" | ||
value { | ||
name: "src_addr" | ||
bitwidth: 48 | ||
} | ||
} | ||
} | ||
} | ||
headers { | ||
key: "ipv4" | ||
value { | ||
name: "ipv4_t" | ||
id: 3 | ||
fields { | ||
key: "do_not_fragment" | ||
value { | ||
name: "do_not_fragment" | ||
bitwidth: 1 | ||
} | ||
} | ||
fields { | ||
key: "dscp" | ||
value { | ||
name: "dscp" | ||
bitwidth: 6 | ||
} | ||
} | ||
fields { | ||
key: "dst_addr" | ||
value { | ||
name: "dst_addr" | ||
bitwidth: 32 | ||
} | ||
} | ||
fields { | ||
key: "ecn" | ||
value { | ||
name: "ecn" | ||
bitwidth: 2 | ||
} | ||
} | ||
fields { | ||
key: "frag_offset" | ||
value { | ||
name: "frag_offset" | ||
bitwidth: 13 | ||
} | ||
} | ||
fields { | ||
key: "header_checksum" | ||
value { | ||
name: "header_checksum" | ||
bitwidth: 16 | ||
} | ||
} | ||
fields { | ||
key: "identification" | ||
value { | ||
name: "identification" | ||
bitwidth: 16 | ||
} | ||
} | ||
fields { | ||
key: "ihl" | ||
value { | ||
name: "ihl" | ||
bitwidth: 4 | ||
} | ||
} | ||
fields { | ||
key: "more_fragments" | ||
value { | ||
name: "more_fragments" | ||
bitwidth: 1 | ||
} | ||
} | ||
fields { | ||
key: "protocol" | ||
value { | ||
name: "protocol" | ||
bitwidth: 8 | ||
} | ||
} | ||
fields { | ||
key: "reserved" | ||
value { | ||
name: "reserved" | ||
bitwidth: 1 | ||
} | ||
} | ||
fields { | ||
key: "src_addr" | ||
value { | ||
name: "src_addr" | ||
bitwidth: 32 | ||
} | ||
} | ||
fields { | ||
key: "total_len" | ||
value { | ||
name: "total_len" | ||
bitwidth: 16 | ||
} | ||
} | ||
fields { | ||
key: "ttl" | ||
value { | ||
name: "ttl" | ||
bitwidth: 8 | ||
} | ||
} | ||
fields { | ||
key: "version" | ||
value { | ||
name: "version" | ||
bitwidth: 4 | ||
} | ||
} | ||
} | ||
} | ||
headers { | ||
key: "scalars" | ||
value { | ||
name: "scalars_0" | ||
} | ||
} | ||
headers { | ||
key: "standard_metadata" | ||
value { | ||
name: "standard_metadata" | ||
id: 1 | ||
fields { | ||
key: "_padding" | ||
value { | ||
name: "_padding" | ||
bitwidth: 3 | ||
} | ||
} | ||
fields { | ||
key: "checksum_error" | ||
value { | ||
name: "checksum_error" | ||
bitwidth: 1 | ||
} | ||
} | ||
fields { | ||
key: "deq_qdepth" | ||
value { | ||
name: "deq_qdepth" | ||
bitwidth: 19 | ||
} | ||
} | ||
fields { | ||
key: "deq_timedelta" | ||
value { | ||
name: "deq_timedelta" | ||
bitwidth: 32 | ||
} | ||
} | ||
fields { | ||
key: "egress_global_timestamp" | ||
value { | ||
name: "egress_global_timestamp" | ||
bitwidth: 48 | ||
} | ||
} | ||
fields { | ||
key: "egress_port" | ||
value { | ||
name: "egress_port" | ||
bitwidth: 9 | ||
} | ||
} | ||
fields { | ||
key: "egress_rid" | ||
value { | ||
name: "egress_rid" | ||
bitwidth: 16 | ||
} | ||
} | ||
fields { | ||
key: "egress_spec" | ||
value { | ||
name: "egress_spec" | ||
bitwidth: 9 | ||
} | ||
} | ||
fields { | ||
key: "enq_qdepth" | ||
value { | ||
name: "enq_qdepth" | ||
bitwidth: 19 | ||
} | ||
} | ||
fields { | ||
key: "enq_timestamp" | ||
value { | ||
name: "enq_timestamp" | ||
bitwidth: 32 | ||
} | ||
} | ||
fields { | ||
key: "ingress_global_timestamp" | ||
value { | ||
name: "ingress_global_timestamp" | ||
bitwidth: 48 | ||
} | ||
} | ||
fields { | ||
key: "ingress_port" | ||
value { | ||
name: "ingress_port" | ||
bitwidth: 9 | ||
} | ||
} | ||
fields { | ||
key: "instance_type" | ||
value { | ||
name: "instance_type" | ||
bitwidth: 32 | ||
} | ||
} | ||
fields { | ||
key: "mcast_grp" | ||
value { | ||
name: "mcast_grp" | ||
bitwidth: 16 | ||
} | ||
} | ||
fields { | ||
key: "packet_length" | ||
value { | ||
name: "packet_length" | ||
bitwidth: 32 | ||
} | ||
} | ||
fields { | ||
key: "parser_error" | ||
value { | ||
name: "parser_error" | ||
bitwidth: 32 | ||
} | ||
} | ||
fields { | ||
key: "priority" | ||
value { | ||
name: "priority" | ||
bitwidth: 3 | ||
} | ||
} | ||
} | ||
} | ||
pipeline { | ||
key: "egress" | ||
value { | ||
name: "egress" | ||
initial_control: "__END_OF_PIPELINE__" | ||
} | ||
} | ||
pipeline { | ||
key: "ingress" | ||
value { | ||
name: "ingress" | ||
initial_control: "__END_OF_PIPELINE__" | ||
} | ||
} | ||
parsers { | ||
key: "parser" | ||
value { | ||
name: "parser" | ||
initial_state: "start" | ||
parse_states { | ||
key: "parse_ipv4" | ||
value { | ||
name: "parse_ipv4" | ||
parser_ops { | ||
extract { | ||
header { | ||
header_name: "ipv4" | ||
} | ||
} | ||
} | ||
transitions { | ||
default_transition { | ||
next_state: "__END_OF_PARSER__" | ||
} | ||
} | ||
} | ||
} | ||
parse_states { | ||
key: "start" | ||
value { | ||
name: "start" | ||
parser_ops { | ||
extract { | ||
header { | ||
header_name: "ethernet" | ||
} | ||
} | ||
} | ||
transition_key_fields { | ||
field { | ||
header_name: "ethernet" | ||
field_name: "ether_type" | ||
} | ||
} | ||
transitions { | ||
hex_string_transition { | ||
value: "0x0000" | ||
mask: "0xfe00" | ||
next_state: "__END_OF_PARSER__" | ||
} | ||
} | ||
transitions { | ||
hex_string_transition { | ||
value: "0x0800" | ||
next_state: "parse_ipv4" | ||
} | ||
} | ||
transitions { | ||
default_transition { | ||
next_state: "__END_OF_PARSER__" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|