- Precompiled DPI library binary
- VitisNetP4 instance (config dependent) SystemVerilog package file
- VitisNetP4 DPI (non-config dependent) SystemVerilog package file
- Test bench Control block
When the example design is generated, the precompiled DPI library can be found in the following location:
/<proj_location>/vitis_net_p4_0_ex/imports/vitis_net_p4_drv_dpi.so
This precompiled shared object (.so) file contains:
- The control plane drivers for tables and externs, for example,
XilVitisNetP4BcamInsert(). - A set of utility functions specific to supporting the use of the control
plane drivers inside a SystemVerilog simulation. The names of all such functions
start with "XilVitisNetP4Dpi", for example,
XilVitisNetP4DpiCreateEnv().
The following SystemVerilog package files are also generated and can be found at the following locations:
/<proj_location>/vitis_net_p4_0_ex/vitis_net_p4_0_ex.gen/sources_1/ip/vitis_net_p4_0/src/hw/simulation/vitis_net_p4_dpi_pkg.sv
/<proj_location>/vitis_net_p4_0_ex/vitis_net_p4_0_ex.gen/sources_1/ip/vitis_net_p4_0/src/verilog/vitis_net_p4_0_pkg.sv
The first package contains a declaration of all the DPI constants, parameters, structs, and functions provided by the library, as well as all of the imports for the functions found in the DPI library binary. The second package has the specific configurations from the P4 program, which varies depending on the p4 file and configuration used. These package files should be referenced to understand which functions are present in the DPI library and what parameters they accept.
The control block of the test bench is where the DPI library is used in practice, and it is found at the following location:
/<proj_location>/vitis_net_p4_0_ex/vitis_net_p4_0_ex/imports/example_control.sv
The control block is a useful reference for users who wish to develop their own test bench, as it illustrates in practice how to use the functions provided by the DPI library, which is described in further detail in the next sections.