++debug of netfpga compile

This commit is contained in:
Nico Schottelius 2019-07-21 14:37:31 +02:00
parent 128da41060
commit 55a363055b
3 changed files with 38 additions and 46 deletions

View file

@ -2347,7 +2347,6 @@ actual < tuple_out_digest_data, tuple_out_sume_metadata > = < 0000000000000000
$finish called at time : 2735572 ps : File
"/home/nico/projects/P4-NetFPGA/contrib-projects/sume-sdnet-switch/projects/minip4/nf_sume_sdnet_ip/SimpleSumeSwitch/Testbench/Check.v"
Line 120
#+END_CENTER
Error message created in
@ -2379,7 +2378,6 @@ INFO: [Common 17-206] Exiting xsim at Sat May 25 14:38:05 2019...
[14:38] rainbow:SimpleSumeSwitch%
#+END_CENTER
Analysing Makefile in testdata + scripts
******** get_testdata.py: generates some pcap with some packets
@ -5876,13 +5874,43 @@ compile-20190713-1935-failure compile-2019-07-21-122852 step4-2019-07-21-1
nico@nsg-System:~/projects/P4-NetFPGA/contrib-projects/sume-sdnet-switch/projects/minip4$
#+END_CENTER
**** TODO try3: find out again, what generates config_writes.py
**** DONE try3: find out again, what generates config_writes.py: likely step6
CLOSED: [2019-07-21 Sun 14:11]
***** Solution: Commented out code by me for debugging
#+BEGIN_CENTER
nico@nsg-System:~/projects/P4-NetFPGA/contrib-projects/sume-sdnet-switch/projects/minip4$ cd $P4_PROJECT_DIR && make config_writes
/home/nico/projects/P4-NetFPGA/contrib-projects/sume-sdnet-switch/bin/gen_config_writes.py nf_sume_sdnet_ip/SimpleSumeSwitch/config_writes.txt 0x44020000 testdata
orig dic: OrderedDict([(0, ('00000020', '00000001')), (1, ('00000020', '00000000'))])
new dic: OrderedDict()
nico@nsg-System:~/projects/P4-NetFPGA/contrib-projects/sume-sdnet-switch/projects/minip4$
#+END_CENTER
**** TODO try4: find out why empty "new dic: OrderedDict()" is a problem - unclear
**** TODO try5: use older version of gen_testdata
Previous output and new output of tuple expect:
#+BEGIN_CENTER
nico@nsg-System:~/projects/P4-NetFPGA/contrib-projects/sume-sdnet-switch/projects/minip4$ cat testdata/Tuple_expect.txt
0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000001010000
nico@nsg-System:~/projects/P4-NetFPGA/contrib-projects/sume-sdnet-switch/projects/minip4$ cat testdata/Tuple_expect.txt
0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000001010000
0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000001040000
#+END_CENTER
*** TODO Further notes P4/master thesis
- Cannot easily run P4 on notebook - changes to the system very
invasive
- Varous compiler bugs/limitations
- Very very deep rabbithole problems
- Hanging/sleeping issue -- unclear whether it does something or not
- Hanging/sleeping issue -- unclear whether it does something or
not
- Open impl_1 error with unclear reason
- logfiles referenced that don't exist
Run output will be captured here: /home/nico/projects/P4-NetFPGA/contrib-projects/sume-sdnet-switch/projects/minip4/simple_sume_switch/hw/project/simple_sume_switch.runs/synth/runme.log
nico@nsg-System:~/master-thesis/netpfga/log$ ls -alh /home/nico/projects/P4-NetFPGA/contrib-projects/sume-sdnet-switch/projects/minip4/simple_sume_switch/hw/project/simple_sume_switch.runs/synth/runme.log
ls: cannot access '/home/nico/projects/P4-NetFPGA/contrib-projects/sume-sdnet-switch/projects/minip4/simple_sume_switch/hw/project/simple_sume_switch.runs/synth/runme.log': No such file or directory
** The NetPFGA saga
Problems encountered:

View file

@ -7,7 +7,7 @@ echo "First source all variables and THEN run this script"
read something
# Step 1..3: create code
# Step 4
# Step 4:
cd $P4_PROJECT_DIR && make
# Step 5

View file

@ -1,14 +1,10 @@
#!/usr/bin/env python
# from switch_calc_headers import *
from scapy.all import *
from nf_sim_tools import *
from collections import OrderedDict
import sss_sdnet_tuples
########################
# pkt generation tools #
########################
pktsApplied = []
pktsExpected = []
@ -47,6 +43,7 @@ def applyPkt(pkt, ingress, time):
sss_sdnet_tuples.sume_tuple_in['src_port'] = nf_port_map[ingress]
sss_sdnet_tuples.sume_tuple_expect['src_port'] = nf_port_map[ingress]
pkt.time = time
print("apply packet on {} at {}: {}".format(ingress, time, pkt.__repr__()))
nf_applied[nf_id_map[ingress]].append(pkt)
def expPkt(pkt, egress):
@ -60,6 +57,8 @@ def expPkt(pkt, egress):
nf_expected[1].append(pkt)
nf_expected[2].append(pkt)
nf_expected[3].append(pkt)
print("exppkt packet on {}: {}".format(egress, pkt.__repr__()))
def print_summary(pkts):
for pkt in pkts:
@ -119,42 +118,7 @@ def test_port1():
pktCnt += 1
expPkt(pkt, 'nf0')
# Test that packets are being mirrored
def test_mirror():
pktCnt = 0
# First ethernet
pktCnt += 1
pkt = Ether(dst=MAC2, src=MAC1)
pkt = pad_pkt(pkt, 64)
applyPkt(pkt, 'nf0', pktCnt)
pktCnt += 1
pkt = Ether(dst=MAC1, src=MAC2)
pkt = pad_pkt(pkt, 64)
expPkt(pkt, 'nf0')
# # Second IP
# pktCnt += 1
# pkt = Ether(dst=MAC2, src=MAC1) / IPv6(src="fe80::1", dst="fe80::2")
# pkt = pad_pkt(pkt, 64)
# applyPkt(pkt, 'nf0', pktCnt)
# pktCnt += 1
# pkt = Ether(dst=MAC1, src=MAC2) / IPv6(src="fe80::2", dst="fe80::1")
# pkt = pad_pkt(pkt, 64)
# expPkt(pkt, 'nf0')
# # Third tcp
# pktCnt += 1
# pkt = Ether(dst=MAC2, src=MAC1) / IPv6(src="fe80::1", dst="fe80::2") / TCP(sport=42, dport=23)
# pkt = pad_pkt(pkt, 64)
# applyPkt(pkt, 'nf0', pktCnt)
# pktCnt += 1
# pkt = Ether(dst=MAC1, src=MAC2) / IPv6(src="fe80::2", dst="fe80::1") / TCP(sport=23, dport=42)
# pkt = pad_pkt(pkt, 64)
# expPkt(pkt, 'nf0')
#test_mirror()
test_port1()
write_pcap_files()
# don't write at the moment, just help debugging
# write_pcap_files()