P4 Language Tutorials

Simplify Packet Processing Design with P4 and Vivado Tools (WP555)

Document ID
WP555
Release Date
2024-01-24
Revision
1.0 English

The P4 language tutorials [2] provide a set of 12 P4 programs that were created independently from VNP4. They target the BMv2 simple switch (v1model architecture). With a few updates, the programs can be modified to retarget the VNP4 pipeline architecture (XSA). The following table provides a summary of the designs along with device resource utilization numbers for those that are currently supported in VNP4. These designs were configured for a 100 Gb/s setup. The last column demonstrates that for the larger designs, it is typically the P4 tables that dominate the logic utilization, rather than the packet parsing and editing. To put these utilization numbers in context, a 10G Ethernet MAC and PCS/PMA IP use approximately 10k LUTs [7]. Three of these P4 programs include language or extern features that are not yet supported in VNP4 (for example, the register extern).

Note: Utilization numbers are based on 100 Gb/s setup, where TDATA_NUM_BYTES = 64 and the PKT_RATE = 150.
Table 1. P4 Design Examples
P4 Program Name Supported with VNP4 LUTs Total Flip-Flops Block RAMs UltraRAMs Latency (Cycles) Tables as % of LUTs
Basic Forwarding Yes 28339 43929 138 0 53 91%
Basic Tunnel Yes 30993 48291 146 0 54 88%
P4 Runtime Yes 35825 56894 158 32 83 77%
Explicit Congestion Notification Yes 28346 44070 138 0 53 90%
Multi-hop Route Inspection Yes 29715 46448 138 0 60 86%
Source Routing Yes 2675 5472 2 0 30 0%
Calculator Yes 2382 5208 3 0 24 5%
Load Balancing No
Quality of Service Yes 28341 44000 138 0 53 90%
Firewall Support for register Extern underway
Link Monitoring Support for register Extern underway

MultiCast

Yes 3154 5554 10 0 37 69%
  1. Testing and analysis by AMD as of 11/24/23, using AMD Vivado™ Design Suite 2023.2 and an AMD Virtex™ UltraScale+™ device (xcvu37p-fsvh2892-2L-e), with out-of-context synthesis and implementation, and utilization numbers from a post-place utilization report. Actual results can vary. VIV-009.