Batch simulation exec files support the following commands, and also the waveform display
(or rather, saving), code coverage and signal access
- read_hw_file(string filename)
- discard the current instantiations, and read the given hardware file, which
should be an instantiation exec_file
reset the current instantiations
step the given number of cycles
setenv(string name, string value)
set an environment option for the hardware instantation file to read; this is
the mechanism used for passing arguments to the instantiation files
display the state registered by the instantiations; useful for debugging
A simulation batch might then look like:
setenv "width" 16
setenv "module_name" hierarchy_test_harness
setenv "module_mif_filename" "hierarchy_test_harness.mif"
This simulation file sets three arguments for the hardware instantiation, then reads a hardware instantiation batch file.
It can then run a simulation (reset, step), before its work is completed.
The hardware instantiation file should have suitable test harnesses that produce pass and fail messges.
Additionally waveforms can be generated from a batch file, using the waveform exec file enhancements, for example like this (replacing the reset and step):
vcd_file_open hierarchy hierarchy.vcd
vcd_file_add hierarchy vector_input_0 vector_input_1 vector_output_0 vector_output_1
Furthermore, code coverage may be gathered for a simulation, or a module in the simulation,
using the waveform exec file enhancements, for example like this (again replacing the reset and step):
This will build on a current code coverage file, so incremental code coverage can be performed