reset the code base to working version again

Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
This commit is contained in:
Nico Schottelius 2019-07-24 09:36:24 +02:00
parent 9368312ff3
commit 181870d14d
3 changed files with 138 additions and 19 deletions

View file

@ -6343,6 +6343,28 @@ endtask
#+END_CENTER #+END_CENTER
*** DONE the netpfga madness: Renaming variables breaks the compilation.
CLOSED: [2019-07-24 Wed 09:33]
#+BEGIN_CENTER
@Xilinx_MaxPacketRegion(1024)
control TopDeparser(
- packet_out b,
- in Parsed_packet p,
+ packet_out packet,
+ in Parsed_packet hdr,
in user_metadata_t user_metadata,
inout digest_data_t digest_data,
inout sume_metadata_t sume_metadata) {
apply {
- b.emit(p.ethernet);
+ packet.emit(hdr.ethernet);
}
+
+
}
#+END_CENTER
*** TODO Further notes P4/master thesis *** TODO Further notes P4/master thesis
- Cannot easily run P4 on notebook - changes to the system very - Cannot easily run P4 on notebook - changes to the system very
invasive invasive

100
netpfga/log/breaking-diff Normal file
View file

@ -0,0 +1,100 @@
--- minip4_solution-mirror.p4 2019-07-23 23:17:55.151317107 +0200
+++ minip4_solution.p4 2019-07-24 09:11:13.430196299 +0200
@@ -4,8 +4,8 @@
typedef bit<48> EthAddr_t;
header Ethernet_h {
- EthAddr_t dstAddr;
- EthAddr_t srcAddr;
+ EthAddr_t dst_addr;
+ EthAddr_t src_addr;
bit<16> etherType;
}
@@ -30,14 +30,14 @@
@Xilinx_MaxPacketRegion(1024)
parser TopParser(
- packet_in b,
- out Parsed_packet p,
+ packet_in packet,
+ out Parsed_packet hdr,
out user_metadata_t user_metadata,
out digest_data_t digest_data,
- inout sume_metadata_t sume_metadata) {
+ inout sume_metadata_t standard_metadata) {
state start {
- b.extract(p.ethernet);
+ packet.extract(hdr.ethernet);
user_metadata.unused = 0;
digest_data.unused = 0;
@@ -45,19 +45,20 @@
}
}
+
/********************************************************************************
* Main
*/
control TopPipe(
- inout Parsed_packet p,
+ inout Parsed_packet hdr,
inout user_metadata_t user_metadata,
inout digest_data_t digest_data,
inout sume_metadata_t sume_metadata) {
action swap_eth_addresses() {
- EthAddr_t temp = p.ethernet.dstAddr;
- p.ethernet.dstAddr = p.ethernet.srcAddr;
- p.ethernet.srcAddr = temp;
+ EthAddr_t temp = hdr.ethernet.dst_addr;
+ hdr.ethernet.dst_addr = hdr.ethernet.src_addr;
+ hdr.ethernet.src_addr = temp;
/* set egress port */
sume_metadata.dst_port = sume_metadata.src_port;
@@ -80,12 +81,12 @@
}
action do_nothing() {
- EthAddr_t temp = p.ethernet.dstAddr;
+ EthAddr_t temp = hdr.ethernet.dst_addr;
}
table lookup_table {
key = {
- p.ethernet.dstAddr: exact;
+ hdr.ethernet.dst_addr: exact;
}
actions = {
@@ -109,15 +110,17 @@
@Xilinx_MaxPacketRegion(1024)
control TopDeparser(
- packet_out b,
- in Parsed_packet p,
+ packet_out packet,
+ in Parsed_packet hdr,
in user_metadata_t user_metadata,
inout digest_data_t digest_data,
inout sume_metadata_t sume_metadata) {
apply {
- b.emit(p.ethernet);
+ packet.emit(hdr.ethernet);
}
+
+
}
/********************************************************************************
@@ -128,4 +131,4 @@
TopParser(),
TopPipe(),
TopDeparser()
-) main;
+) main;
\ No newline at end of file

View file

@ -4,8 +4,8 @@
typedef bit<48> EthAddr_t; typedef bit<48> EthAddr_t;
header Ethernet_h { header Ethernet_h {
EthAddr_t dst_addr; EthAddr_t dstAddr;
EthAddr_t src_addr; EthAddr_t srcAddr;
bit<16> etherType; bit<16> etherType;
} }
@ -30,14 +30,14 @@ struct digest_data_t {
@Xilinx_MaxPacketRegion(1024) @Xilinx_MaxPacketRegion(1024)
parser TopParser( parser TopParser(
packet_in packet, packet_in b,
out Parsed_packet hdr, 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 standard_metadata) { inout sume_metadata_t sume_metadata) {
state start { state start {
packet.extract(hdr.ethernet); b.extract(p.ethernet);
user_metadata.unused = 0; user_metadata.unused = 0;
digest_data.unused = 0; digest_data.unused = 0;
@ -45,20 +45,19 @@ parser TopParser(
} }
} }
/******************************************************************************** /********************************************************************************
* Main * Main
*/ */
control TopPipe( control TopPipe(
inout Parsed_packet hdr, inout Parsed_packet p,
inout user_metadata_t user_metadata, inout user_metadata_t user_metadata,
inout digest_data_t digest_data, inout digest_data_t digest_data,
inout sume_metadata_t sume_metadata) { inout sume_metadata_t sume_metadata) {
action swap_eth_addresses() { action swap_eth_addresses() {
EthAddr_t temp = hdr.ethernet.dst_addr; EthAddr_t temp = p.ethernet.dstAddr;
hdr.ethernet.dst_addr = hdr.ethernet.src_addr; p.ethernet.dstAddr = p.ethernet.srcAddr;
hdr.ethernet.src_addr = temp; p.ethernet.srcAddr = temp;
/* set egress port */ /* set egress port */
sume_metadata.dst_port = sume_metadata.src_port; sume_metadata.dst_port = sume_metadata.src_port;
@ -81,12 +80,12 @@ control TopPipe(
} }
action do_nothing() { action do_nothing() {
EthAddr_t temp = hdr.ethernet.dst_addr; EthAddr_t temp = p.ethernet.dstAddr;
} }
table lookup_table { table lookup_table {
key = { key = {
hdr.ethernet.dst_addr: exact; p.ethernet.dstAddr: exact;
} }
actions = { actions = {
@ -110,17 +109,15 @@ control TopPipe(
@Xilinx_MaxPacketRegion(1024) @Xilinx_MaxPacketRegion(1024)
control TopDeparser( control TopDeparser(
packet_out packet, packet_out b,
in Parsed_packet hdr, in Parsed_packet p,
in user_metadata_t user_metadata, in user_metadata_t user_metadata,
inout digest_data_t digest_data, inout digest_data_t digest_data,
inout sume_metadata_t sume_metadata) { inout sume_metadata_t sume_metadata) {
apply { apply {
packet.emit(hdr.ethernet); b.emit(p.ethernet);
} }
} }
/******************************************************************************** /********************************************************************************