While coding the test bench for the AXI VIP , the following requirements must be met. Otherwise, the AXI VIP does not work. These are the requirements for all VIPs.
1. Create module test bench as all other standard SystemVerilog test benches.
module testbench();
…
endmodule
2. Import two required packages: axi_vip_pkg and <component_name>_pkg . The <component_name>_pkg includes agent classes and its subclasses for AXI VIP . For each VIP instance, it has a component package which is automatically generated when the outputs are created. This component package includes a typedef class of a parameterized agent. Xilinx recommends importing this package because reconfiguration of the VIP has no impact of the test bench. This Figure shows how to retrieve the <component_name>_pkg from a standalone AXI VIP.
This Figure shows how to retrieve the <component_name>_pkg from an IP integrator design. First, select the VIP and in the Block Properties window click Properties . Then, under the CONFIG column select Component_Name .
3. Declare agents. One agent for one AXI VIP has to be declared. Depending on the AXI VIP interface mode, different typedef class should be called for declaration of the agent.
Table 6-2: Declare Agents
Name |
Description |
---|---|
<component_name>_mst_t |
Master VIP |
<component_name>_slv_t |
Slave VIP without memory model |
<component_name>_slv_mem_t |
Slave VIP with memory model |
<component_name>_passthrough_t |
Pass-through VIP without memory model |
<component_name>_passthrough_mem_t |
Pass-through VIP with memory model |
4. Create a new for the agent and pass the hierarchy path of IF correctly into the new function. Before the agent is set to new , run the simulation with an empty test bench to find the hierarchy path of the AXI VIP instance. A message like this shows up and then puts the path into a new function (see This Figure ).
agent = new("my VIP agent", <hierarchy_path>.IF);