Use Case with the FiveTuple Example Design - 2023.2 English

Vitis Networking P4 Getting Started Guide (UG1373)

Document ID
Release Date
2023.2 English
To run the FiveTuple example design through the behavioral model, complete the following steps:
  1. Change directory to: <install_area>/Vitis_Networking_P4/<version>/examples/five_tuple/
  2. Compile fiveTuple.p4 using p4c-vitisnet. This generates the JSON file used in the behavioral model:

    p4c-vitisnet <install_area>/Vitis_Networking_P4/<version>/examples/five_tuple/fiveTuple.p4 -o fiveTuple.json

  3. Create a script file, fiveTuple_tc.txt, containing a command to run the traffic data, by running the following command:

    echo 'run_traffic traffic' > fiveTuple_tc.txt

  4. Add table entries for the FiveTuple Example Design to fiveTuple_tc.txt. The resulting file should look as follows:
    table_add FiveTuple InsertVLAN 0xfd5f0bc8 0x9aaa2010 0x11 0x2411 0x6cc1 => 0x1 0x1 0x111 
    table_add FiveTuple InsertVLAN 0x7cf6cd9c 0xcc930a03 0x11 0x211e 0x5b98 => 0x1 0x1 0x222
    table_add FiveTuple InsertVLAN 0xe90a5c71 0x6353a5ca 0x11 0x7320 0x85bb => 0x4 0x0 0x333
    table_add FiveTuple InsertVLAN 0xad8575e6 0xcc3d03d7 0x11 0x9e55 0x51fa => 0x4 0x0 0x444
    run_traffic packets
  5. Run the run-p4bm-vitisnet application to generate outputs from the model:

    run-p4bm-vitisnet -j fiveTuple.json -s fiveTuple_tc.txt

    This produces packets_out.user and packets_out.meta files that can be verified against simulated design data.