Introduction: How to Use Vivado Simluation

Picture of How to Use Vivado Simluation

I have done this simulation project for an online class. The project is written by Verilog. We will use simulation in Vivado to visualize the waveform in enable_sr(enable digit) from the stop watch project previously created. In addition, we will use the system task to display error made by us in the design.

Step 1: Add Sources and Choose “Add or Create Simulation Sources

Picture of Add Sources and Choose “Add or Create Simulation Sources

Step 2: Create File Called Enable_sr_tb

Picture of Create File Called Enable_sr_tb

Step 3: Create Testbench File

1. Import the module enable_sr from stop watch project. That is the file we want to simulate

2. Create testbench module enable_sr_tb();

3. Key in inputs and outputs of the module enable_sr(). Remember the inputs for enable_sr is now in register type while the outputs become net type.

4. Instantiate the unit under test (uut) which is the enable_sr

5. Generate clock which period (T) is 20ns

6. Use the conditional statement to create error checking system. In this example, we want to check whether there are more than one digits are active.

Note: In the original enable_sr() file, we should initial the pattern as 4’b0011 so that there are two digits are active to create error.

7. Use system task $display to show the error

8. Use system task $finish to complete the simulation at time 400ns

Step 4: Set the Enable_sr_tb As the Top Level Under the Simulation

Picture of Set the Enable_sr_tb As the Top Level Under the Simulation

Step 5: Run Synthesis & Behavioral Simulation

Picture of Run Synthesis & Behavioral Simulation
  1. Before running behavioral simulation, run the synthesis to make sure that there isn't any syntax errors in the testbench file and unit under test file
  2. Run the behavioral simulation

Step 6: Evaluate the Simulation Result

Picture of Evaluate the Simulation Result

You will see the simulation windows. It contains different panels.

You will see the error message in the console panel. This shows more than one digits are active during the simulation period.

You can also see the waveform in the scope

Attached is the project file.

Comments

About This Instructable

784views

8favorites

License:

Bio: I work in the Digilent sales team and promote engineering education hardware to students, educator or who wants to learn engineering and technology. I like ... More »
More by alexwonglik:UART communication on Basys 3, FPGA dev board powered by Xilinx Artix 7 Part IIUART communication on Basys 3, FPGA dev board powered by Xilinx Artix 7 Part IDebonucing Button on Basys 3, Xilinx FPGA Development Board
Add instructable to: