Running
the simulation
You can run a simulation in two ways:
-
From inside the IDE, by creating a project
as described earlier and using the simulation buttons from the toolbar.
-
At the command line, by directly invoking the simulator.
1 Running the simulation inside the IDE
After creating the project, you can start the simulator by clicking on
the
button. This will first start
the syntactic analyzer which will check the entire project and will print
error messages as it finds anything wrong (for this implementation, only
the first error is reported). You can go right to the place where the problem
was found by clicking on the error message.
When everything is syntactically OK, the simulation gets started. By
default, the interpreter enters into step-by-step mode, so only one instruction
will be executed. You can use the toolbar buttons to execute the code or,
alternatively, enter the commands by hand using the input line at the bottom
of the window. You can find the available command list in the chapter Running
the simulation from the command line.
All the messages generated by $display and other diagnose tasks
are displayed into the console.
1.1 Using the watch
When running the simulation inside the IDE, you can browse the Watch window.
It consists of a tree which contains all the module instances (and the
enclosed namespaces, such as tasks, functions, named blocks, etc.) inside
your project and their data with the actual values. The format is implicit
the complete (sign, size, etc.) binary format.
1.2 Using the waveform viewer
The Waveform Viewer window can be activated by clicking the
button on the toolbar. You can add variables from the watch by clicking
the desired name (it gets red) and clicking the "Add wave" button from
the Watch Window.
2 Running the simulation from the command line
For long simulations where interactivity is not a must, this mode is recommended.
The watch & runtime waveform viewing facilities are not available in
this mode.
2.1 Invocation
The synopsis for the engine invocation is:
rv [-dhspl] [-o <precompiled_dir>[:<precompiled_dir>]]
[--version] <verilog_files>
Options description:
-
d and p : Prints lots of debugging info. Inserted here only
for documentation purposes. Use it only if something goes wrong and want
to fill us a bug report.
-
s : Enters step-by-step mode after initialization.
-
h : Prints a brief help text.
-
o : Specifies additional directories for precompiled modules. Default
directories are the current working dir and the vIDE standard library directory
(called objects).
-
--version : Prints version and copyright and exits.
2.2 Console commands
The console commands are:
-
help : Prints a list with the available commands.
-
step : Executes one instruction.
-
unit : Executes all the instructions remaining for the current time
unit.
-
go : Continuously executes all the remaining instructions until
the end of the simulation is reached.
-
debug : Toggles on/off the "print debug info" mode. It is inserted
here only for documentation purposes, and should be used only for bug reports..
-
exit : Exits the simulator.
Note that the commands are matched by the first letters, and if the given
ones do not uniquely identify a command, the first matched one is assumed
(but we try to choose words which start with different letters, so only
the initial should suffice in most cases :).