Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been playing with AMD's P4 Behavioral Model, and I'm stashing my progress here.
Things mostly progress as documented here. In some cases I found the docs confusing, but basically I got through it.
Requirements
default.p4
underprogs/default/
.traffic_in.pcap
underprogs/default/
.run_traffic
while specifying the PCAP file above, and then exiting. Seecli_commands.txt
underprogs/default/
.Running
The command is
run-p4bm-vitisnet -j default.json -s cli_commands.txt
. The result is a new file,traffic_out.pcap
.Other info
Instead of a PCAP, it is also possible to provide packet info in a different, human-readable format with extension
.user
. Seetraffic_in.user
underprogs/default/
. If the BM does not see a PCAP with the correct name, it uses the.user
file if there is one. This also means that the result is a.user
file. You can see an example of this underprogs/five_tuple
.The instructions mention:
along with instructions on how to write this
.tcl
file. This did not work for me; I got an "Inappropriate ioctl for device" error. Besides, I was just able to make it work without doing anything to get into a "Vivado context". Please let me know if this divergence is of interest, and I'll make an issue with a minimal example!Above I have described the "script" style of working with the BM, which rolls together the "control plane" and "data plane" of the simulated network. It is possible to work with these separately, as described here. Below I reproduce the commands that worked for me.
p4bm-vitisnet default.json &
to launch the control plane process as a background task.p4bm-vitisnet-cli
. In the CLI now presented, run:run_traffic ./traffic
exit
traffic_out.pcap
will be created. If you had notraffic_in.pcap
but did have atraffic_in.user
sitting around, thentraffic_out.user
will be created.