HDL Testbench - 2024.1 English

Vitis Model Composer User Guide (UG1483)

Document ID
Release Date
2024.1 English

Ordinarily, Vitis Model Composer designs are bit and cycle-accurate, so Simulink simulation results exactly match those seen in hardware. There are, however, times when it is useful to compare Simulink simulation results against those obtained from an HDL simulator. In particular, this makes sense when the design contains black boxes. The Generate HDL testbench check box in the Vitis Model Composer Hub block makes this possible.

Suppose the design is named <design>, and a Vitis Model Composer Hub block is placed at the top of the design. Suppose also that in the Hub block the Generate HDL testbench check box is selected on the Export tab. When the Export button is clicked, Model Composer produces the usual files for the design, and in addition writes the following:

  • A file named <design>_tb.vhd/.v that contains a test bench HDL entity.
  • Various .dat files that contain test vectors for use in an HDL test bench simulation.

You can perform RTL simulation using the Vivado Integrated Design Environment (IDE). For more details, refer to the document Vivado Design Suite User Guide: Logic Simulation (UG900).

Model Composer generates the .dat files by saving the values that pass through gateways. In the HDL simulation, input values from the .dat files are stimuli, and output values are expected results. The test bench is simply a wrapper that feeds the stimuli to the HDL for the design, then compares HDL results against expected ones.