Open nniranjhana opened 5 years ago
Hi @sibanez12 can you check this out? I'd like to know how to go about the compilation process for a new project, apart from the tutorials?
The gen_testdata.py script assumes that you want to run at least one packet through your P4 program in simulation. For example,
MAC1 = "08:00:00:00:00:01"
MAC2 = "08:00:00:00:00:02"
IP1 = "10.0.0.1"
IP2 = "10.0.0.2"
pktCnt = 0
pkt = Ether(dst=MAC2, src=MAC1) / IP(dst=IP2, src=IP1)
pkt = pad_pkt(pkt, 64)
applyPkt(pkt, 'nf0', pktCnt)
pktCnt += 1
expPkt(pkt, 'nf1')
You can bypass the gen_testdata.py scripts by commenting out this line in the Makefile. Although I'm not sure that is wise. You're going to want to test your P4 program eventually.
Ah I see, thanks a lot! @sibanez12
The gen_testdata.py script assumes that you want to run at least one packet through your P4 program in simulation.
This is why I seem to have got the list index out of range error. It makes sense now. I will append the necessary code like you've stated and not bypass the gen_testdata.py and try. I guess compilation otherwise remains the same as for the other tutorial.
Hi P4->NetFPGA community, We have tried the switch_calc tutorial and now suppose I want to create and deploy my own P4 application from scratch in this repo. So I followed the first tip on this.
How would I go about the compilation process for this new project?
I tried following the one for switch_calc and ran make in the $P4_PROJECT_DIR without changing the P4 program template in the new project, or the gen_testdata.py and ran into the following error:
Also, is there a way to bypass the gen_testdata.py script checks and directly compile the P4 program? Is it recommended? As I am aware, I need to change the script according to my P4 program.