For demo purpose, use the BFT example design shipped with Vivado IDE.
- Open the BFT example design in Vivado IDE.
- Call
launch_simulation
with Vivado as the selected simulator. You should see the ports shown in the following waveform.
- Select the desired scope for which you want to generate test bench as shown
in the following figure:
- Right-click the selected scope and select Generate VCD Port.
- Delete all existing signals on the waveform and select Add to Wave Window for the selected scope.Note: Step 5 is used to demonstrate that the generated test bench is driving the design unit correctly.
- Use
restart
,run
2000 ns
andclose_vcd -ports
commands on Tcl console to dump the signal activity. This logs the signal from time 0 to 2000 ns on the waveform as shown in the following figure:
- Use
create_testbench -name demo_tb -add_to_simset demo_simset -set_as_top
command on Tcl console to generate test bench. This creates your test bench with the module namedemo_tb
and creates ademo_simset
with this test bench as top module.
- Use
launch_simulation
command to run the simulation with the newly generated test bench. - Compare the input/output of the waveform with the waveform of your original design; the input/output is the same.
This is how you can create a test bench for your sub-design and use the generated test bench independently with any standard simulator.