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 you place a Vitis
Model Composer Hub block at the top of the design. Suppose also that in the Hub block,
you select the Generate HDL
testbench check box on the Export tab. When you click Export, 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.