Setting the IP Parameters from the Command Line (Vivado Console) - 2022.2 English

Vitis Networking P4 User Guide (UG1308)

Document ID
UG1308
Version
2022.2 English
Revision

All of the IP Parameters can optionally be applied from the command line in the Vivado console, as an alternative to opening the IP Customization GUI. This is typically preferable for a scripted approach to re-generating a P4 design in Vivado. The easiest way to determine the syntax for these command line parameters is to use the IP Customization GUI first and then copy the resulting commands from the Vivado console or the Vivado Journal file (.jou).

For some of the per-table parameters, there are a collection of indexed parameters to facilitate the display and setting of these per-table parameters in the IP Customization GUI. However these indexed parameters can be ignored from the command line perspective. Instead, there is a consolidated parameter in the format of a Tcl Dictionary which is more convenient to modify from the command line.

The first step is to make sure that the P4_FILE parameter has been set, so that the P4 program is already compiled and the other parameter values are automatically populated with the values based on the P4 program. Next, the Tcl dictionary value can be read from the parameter. Then the individual per-table settings can be updated in that Tcl dictionary value before re-applying the updated parameter back to the IP.

Here is an example of updating the ram_style parameters per table in the example design forward.p4:
# Get the complete TCL dictionary value of parameters for the CAMs
set cam_table_params [get_property CONFIG.CAM_TABLE_PARAMS [get_ips <p4_instance>]]
# Modify the specific parameters per-table as required
dict set cam_table_params MyProcessing.forwardIPv4 ram_style URAM
dict set cam_table_params MyProcessing.forwardIPv6 ram_style BRAM
# Apply the updated parameter settings
set_property CONFIG.CAM_TABLE_PARAMS $cam_table_params [get_ips <p4_instance>]

The IP Customization GUI can then be opened to verify that the new parameter settings are in place as intended.

Details of the other Tcl Dictionary format parameters that can be set from the command line in a similar way are given in the following table.

Table 1. Tcl Dictionary Format Parameters
Parameter Name Identifier Sub-parameter Name Allowed Values Notes
DIRECT_TABLE_PARAMS <control_name>.<table_name> ram_style GLOBAL, URAM, BRAM, DRAM Default is GLOBAL. Note: DRAM refers to Distributed RAM (LUTRAM)
CAM_TABLE_PARAMS <control_name>.<table_name> ram_style GLOBAL, URAM, BRAM, DRAM Default is GLOBAL
clock CAM, AXIS Default is CAM
mode BCAM, STCAM, TCAM Read-only (determined by P4 program)
opt GLOBAL, RAM, LOGIC Default is GLOBAL
USER_METADATA_ENABLES <metadata_field_name> input true, false Default is true
output true, false Default is true