Introduce sub-parser to retain sanity [try1/inf]
This commit is contained in:
parent
181870d14d
commit
44d74297ff
1 changed files with 18 additions and 5 deletions
|
@ -26,7 +26,21 @@ struct digest_data_t {
|
|||
|
||||
/********************************************************************************
|
||||
* Parser
|
||||
*/
|
||||
*/
|
||||
parser RealParser(
|
||||
packet_in packet,
|
||||
out Parsed_packet hdr,
|
||||
out user_metadata_t meta,
|
||||
out digest_data_t digest_data,
|
||||
inout sume_metadata_t standard_metadata) {
|
||||
inout sume_metadata_t sume_metadata) {
|
||||
|
||||
state start {
|
||||
packet.extract(hdr.ethernet);
|
||||
user_metadata.unused = 0;
|
||||
digest_data.unused = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Xilinx_MaxPacketRegion(1024)
|
||||
parser TopParser(
|
||||
|
@ -36,11 +50,10 @@ parser TopParser(
|
|||
out digest_data_t digest_data,
|
||||
inout sume_metadata_t sume_metadata) {
|
||||
|
||||
state start {
|
||||
b.extract(p.ethernet);
|
||||
user_metadata.unused = 0;
|
||||
digest_data.unused = 0;
|
||||
RealParser() realparser;
|
||||
|
||||
state fakestart {
|
||||
realparser.apply(b, p, user_metadata, digest_data, sume_metadata);
|
||||
transition accept;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue