[netfpga] import generic parser

This commit is contained in:
Nico Schottelius 2019-07-23 12:22:31 +02:00
parent 6e162ca63b
commit cae8e6c7c0

View file

@ -33,21 +33,33 @@ struct digest_data_t {
* Parser * Parser
*/ */
@Xilinx_MaxPacketRegion(1024) // @Xilinx_MaxPacketRegion(1024)
parser TopParser(packet_in b, // parser TopParser(packet_in b,
out Parsed_packet p, // out Parsed_packet p,
out user_metadata_t user_metadata, // out user_metadata_t user_metadata,
out digest_data_t digest_data, // out digest_data_t digest_data,
inout sume_metadata_t sume_metadata) { // inout sume_metadata_t sume_metadata) {
state start { // state start {
b.extract(p.ethernet); // b.extract(p.ethernet);
user_metadata.unused = 0; // user_metadata.unused = 0;
digest_data.unused = 0; // digest_data.unused = 0;
transition accept; // transition accept;
} // }
// }
@Xilinx_MaxPacketRegion(1024)
parser TopParser(packet_in packet,
out headers hdr,
out metadata meta,
out digest_data_t digest_data,
inout sume_metadata_t standard_metadata) {
#include "parsers.p4"
digest_data.unused = 0; /* avoid compiler warning */
} }
/******************************************************************************** /********************************************************************************
* Main * Main
*/ */