QuestaSim Guide

Ultra brief introduction to QuestaSim for new users.

Prerequisite: QuestaSim installed, environmental variables set and added to $PATH, see Setup.

Compiling & loading

Example: Running light from Ex. 1: HDL entry and simulation

Using the flow:

flow student_rlight_tb.sim_rtl_questa

Manual:

vlib work                                                                   # create directory work as the library "work" to complile the source texts to
vlog src/rtl/rvlab_fpga/pkg/top_pkg.sv  src/rtl/tlul/pkg/tlul_pkg.sv        # compile the packages before the files which use them !
vlog -mfcu src/rtl/inc/prim_assert.sv src/rtl/tlul/tlul_adapter_reg.sv src/rtl/tlul/tlul_err.sv
vlog src/rtl/student/student_rlight.sv src/fv/tlul_test_host.sv src/fv/student_rlight_tb.sv # compile the design and testbench
vsim work.student_rlight_tb                                                 # start the simulator and load the design rlight_tb

Verilog modules can be compiled in any order as linking happens at run time. Packages must be compiled before use.

These steps compile student_rlight, start the simulator loading student_rlight_tb (click to enlarge):

../_images/QuestaSim_design.drawio.svg

Tracing & formatting signals

During simulation QuestaSim only records signals which have been added to the wave window:

  1. The “sim” view contains a hierarchical view of the loaded design.

2/3. All signals of the selected instance are shown in the “Objects” window.

  1. Drag & drop the signals you want to trace to the wave window.

  2. Format the wave view

  • use “Combine Signals” to create a vector of individual selected (use shift) signals e.g. in netlist simulation when a vector has been split up into individual flip flops.

  • use “Radix” for e.g. hexadecimal or binary display and “Format” for e.g. analog signals

  1. Save the Wave formatting. “File -> Save Format”. Save the resulting .do file as src/design/wave/<toplevel name>.do so it is automatically loaded by the flow.

Run the simulation

I. restart

II. run -all

View the results

  1. Fit the entire simulation run to the wave view.

  2. Use click & drag the middle mouse button inside the wave view to zoom.

  3. Place a time cursor.

  4. Move the cursor to the next edge of the selected signal in the wave view (e.g. to find the next TL-UL transfer).

Other features

From the “View” menu

  • “Dataflow”: Drag & Drop a signal to trace it through the hierarchy.

  • loads more (Profiler, ….)