5.4 Simx Commonly-Used Command Line Options

<< Click to Display Table of Contents >>

Navigation:  Chapter 5: VeriLogger Command Line Tools >

5.4 Simx Commonly-Used Command Line Options

Previous pageReturn to chapter overviewNext page

The VeriLogger command line simulator supports several simulation options that can be used to control and debug simulations. Most (but not all) simulation options may be added in any order and anywhere on the command line. To the simulator, the following statements are identical:

simx -s cpu.v memory.v io.v

simx cpu.v memory.v io.v -s 

simx cpu.v memory.v -s io.v

Note that simx can be replaced with vlogcmd in the commands above to run SynaptiCAD's interpreted simulator instead of the compiled code simulator.

Listed below are some commonly used simulation options supported by VeriLogger:

-s

The Stop option, -s, compiles the source code then enters the interactive console shell before the execution begins.

simx -s cpu.v memory.v io.v

-v <LibraryFilename>

Deprecated: Specify the name of a library filename using the -v option. If this option is used, VeriLogger will try to match any undefined modules to modules inside this library file. This option is deprecated in simx, since it's generally more efficient to compile library files into a compiled library instead.

-y <LibraryDirectory>

Specify a directory path to search for source code library files. Multiple source code library paths can be specified using multiple -y options. If this option is used, the simulator will attempt to match any undefined modules with files that have one of the file extensions set with the +libext option. The simulator does not look inside a file unless the undefined module name exactly matches the filename. The simulator will not look at any files unless file extensions have been set using the +libext option. The following examples show how to specify a directory path, a directory path with spaces, and how to use the +libext option (UNIX users should use a backslash):

simx model.v -y\mylibs +libext+.v

simx model.v -y"\My Libraries" +libext+.v

+define+macroname

Define a macro name with a blank value for use in conditional compilation. For example:

 +define+mymacro

+define+macroname[=macrovalue]

Define a macro name as a string. For example: +define+mymacro=1

Note: Simx automatically predefines a macro called __syncad. This macro can be used by user code to conditionally compile simx-specific source code. For example, to conditionally compile code that creates a btim dump file:

`ifdef __syncad

initial begin

  $btim_dumpfile("mysim.btim")

  $btim_AddDumpSignal("top");

  end

`endif

+tcl+filename

Read TCL simulator control commands from a file.

--work <worklib>  

Specifies the destination library name (3rd party documentation sometimes refers to this as the "working library"). If this option is not specified, the compiler will store compilation results to a default destination library called work. If no directory mapping is specified for work in the scd.lib file that normally defines library to directory mappings, a sub-directory called scd_work will be created in the current directory and work will be mapped to this new directory. See 2.10 Compiled Libraries for more details.

Specifying the HDL language of source files

To compile a source file properly, the compiler must determine what language the source file is written in. You can explicitly specify how to compile sets of files using a language option: --scd_systemverilog, --scd_verilog, and --scd_vhdl.

--scd_verilog <filename list>: compile files in file list as Verilog files.

--scd_vhdl <filename list>: compile files in file list as VHDL files.

--scd_systemverilog <filename list>: compile files in file list as SystemVerilog files.

Default language determination using source file extension

If the language of a file isn't directly specified using one of the above language options, then by default, the simulator will attempt to determine the language of the file using the file's extension: source files with a .vhd or .vhdl extension are treated as VHDL files, source files with a .sv extension are compiled as SystemVerilog files, and source files having a  .v extension are compiled as Verilog files. Also by default, any file with an unrecognized extension will be compiled as a Verilog file.

Overriding language determination to compile files as SystemVerilog files

+sv: If you compile with the +sv option, all files will be compiled as SystemVerilog files, except files that are explicitly specified in an --scd_verilog or --scd_vhdl option's file list.

Examples of source file language determination

Source files passed as explicit arguments of the options --scd_verilog/--scd_vhdl/--scd_systemverilog always compile as the specified language. These options accepts one or more filename arguments that must immediately follow the option. Below are some examples of how these options and the +sv option interact:

simx32 --scd_vhdl a.v b.v +linedebug

The above compiles both files as VHDL, even though they have a Verilog extension.

simx32 --scd_vhdl a.v +linedebug b.v 

The above will compile a.v as VHDL and b.v as Verilog (implicitly determined from .v file extension), because the +linedebug option lies between the file names.

simx32 --scd_vhdl a.v +linedebug b.v +sv

The above will compile a.v as VHDL (because of the --scd_vhdl option) and b.v as SystemVerilog (because the +sv option says any file whose language isn't explicitly specified should be compiled as a SystemVerilog file).