From b8897a7b351d50c569ee37386f50d60c35015bd3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 6 Jun 2019 22:34:32 +0200 Subject: [PATCH] Adjust headers to work with netpfga #1 make[1]: Entering directory '/home/nico/master-thesis/netpfga/minip4/src' p4c-sdnet -o minip4.sdnet --sdnet_info .sdnet_switch_info.dat minip4_solution.p4 headers.p4(12): error: Duplicate declaration of port_t; previous at typedef bit<9> port_t ^^^^^^ /opt/xilinx/SDNet/2018.2/data/p4include/sume_switch.p4(37) typedef bit<8> port_t; ^^^^^^ headers.p4(12): error: port_t: Duplicates declaration port_t typedef bit<9> port_t; ^^^^^^ /opt/xilinx/SDNet/2018.2/data/p4include/sume_switch.p4(37) typedef bit<8> port_t; ^^^^^^ error: 2 errors encountered, aborting compilation make[1]: *** [Makefile:5: all] Error 1 make[1]: Leaving directory '/home/nico/master-thesis/netpfga/minip4/src' make: *** [Makefile:31: frontend] Error 2 --- p4src/headers.p4 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/p4src/headers.p4 b/p4src/headers.p4 index 5abaf88..b6c30f4 100644 --- a/p4src/headers.p4 +++ b/p4src/headers.p4 @@ -4,12 +4,19 @@ #include +/**************************************** NetPFGA ****************************************/ + +/* already defined in sume_switch.p4 */ +#ifndef _SUME_SWITCH_P4_ +typedef bit<9> port_t; +#endif + /**************************************** types ****************************************/ typedef bit<48> mac_addr_t; typedef bit<32> ipv4_addr_t; typedef bit<128> ipv6_addr_t; -typedef bit<9> port_t; + typedef bit<16> mcast_t; typedef bit<16> task_t; typedef bit<16> table_t; /* to map debug messages - 16 bit to match shortenumfield */