Computer Laboratory

ECAD and Architecture Practical Classes

Simulation in Modelsim

Having booted to PWF Linux, open a terminal. Start the Modelsim program from the command line and put in background: vsim &

Modelsim

As well having a graphical interface, Modelsim also has a scriptable command interface. Commands can either be typed line by line at the prompts Modelsim> and VSIM N> or saved to a ".do" script and run. We've provided you with ttcsim.do which will simulate the TTC running the add.rmb machine code that the assembler created.

Just type do ttcsim.do into the Modelsim command prompt. It is possible that you'll need to cd into the directory where you downloaded the script. Modelsim will then simulate the design as if the circuit had been running for up to 30ns.

The simulation outputs results and an instruction execution trace (via $display statements in the SystemVerilog). Waveform traces will also be produced, though you will probably not need to look at these.

Take a look at ttcsim.do. The script contains the line: vsim -Gprogpath_rmb=add.rmb -Gdebug_trace=1 TestTinyComp

TestTinyComp
Refers to the test harness root module inside ttc_test.sv, which will provide test input stimuli.
add.rmb
The program run by the test harness. Change add.rmb to change which machine code is loaded before the simulation starts.
-Gdebug_trace
Test harness parameter. Change from 0 to 1 to produce a full execution trace.
Previous  |  Contents  |  Next