[netpfga] re-introduce old parser, rename variables

This commit is contained in:
Nico Schottelius 2019-07-23 16:06:18 +02:00
parent 1be73a0e50
commit e6951c6210

View file

@ -45,23 +45,24 @@ struct digest_data_t {
// 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 {
// b.extract(p.ethernet);
// user_metadata.unused = 0;
// digest_data.unused = 0;
// transition accept;
// }
// } // }
@Xilinx_MaxPacketRegion(1024) @Xilinx_MaxPacketRegion(1024)
parser TopParser(packet_in packet, parser TopParser(packet_in packet,
out headers hdr, out headers hdr,
out metadata meta, // out metadata meta,
out user_metadata_t user_metadata,
out digest_data_t digest_data, out digest_data_t digest_data,
inout sume_metadata_t standard_metadata) { inout sume_metadata_t standard_metadata) {
state start {
packet.extract(hdr.ethernet);
user_metadata.unused = 0;
digest_data.unused = 0;
#include "parsers.p4" transition accept;
}
// #include "parsers.p4"
} }
@ -87,6 +88,8 @@ control TopPipe(inout headers hdr,
// #include "actions_arp.p4" // includes v4_arp, v4_egress // #include "actions_arp.p4" // includes v4_arp, v4_egress
// #include "actions_delta_checksum.p4" // non payload based checksumming // #include "actions_delta_checksum.p4" // non payload based checksumming
// apply { // apply {
// if(hdr.ipv6.isValid()) { // if(hdr.ipv6.isValid()) {
// if(nat64.apply().hit) { /* generic / static nat64 done */ // if(nat64.apply().hit) { /* generic / static nat64 done */
@ -181,6 +184,13 @@ control TopPipe(inout headers hdr,
sume_metadata.dst_port = 1; sume_metadata.dst_port = 1;
} }
// action send_testdata_to_port1() {
// // python: MAC2 = "08:22:22:22:22:08"
// if(hdr.ethernet.dst_addr == 0x082222222208) {
// sume_metadata.dst_port = 1;
// }
// }
action send_to_all_ports() { action send_to_all_ports() {
/* Taken from commands.txt of the "int" project: /* Taken from commands.txt of the "int" project:
table_cam_add_entry forward set_output_port 0xffffffffffff => 0b01010101 table_cam_add_entry forward set_output_port 0xffffffffffff => 0b01010101
@ -245,11 +255,11 @@ control TopDeparser(packet_out packet,
// inout sume_metadata_t sume_metadata) { // inout sume_metadata_t sume_metadata) {
// apply { apply {
// packet.emit(hdr.ethernet); packet.emit(hdr.ethernet);
// } }
#include "deparser.p4" // #include "deparser.p4"
} }