Questa Sim Qrun User
Questa Sim Qrun User
Questa Sim Qrun User
This material contains trade secrets or otherwise confidential information owned by Siemens Industry Software, Inc.,
its subsidiaries or its affiliates (collectively, "Siemens"), or its licensors. Access to and use of this information is
strictly limited as set forth in Customer's applicable agreement with Siemens. This material may not be copied,
distributed, or otherwise disclosed outside of Customer's facilities without the express written permission of
Siemens, and may not be used in any way not expressly authorized by Siemens.
This document is for information and instruction purposes. Siemens reserves the right to make changes in
specifications and other information contained in this publication without prior notice, and the reader should, in all
cases, consult Siemens to determine whether any changes have been made. Siemens disclaims all warranties with
respect to this document including, without limitation, the implied warranties of merchantability, fitness for a
particular purpose, and non-infringement of intellectual property.
The terms and conditions governing the sale and licensing of Siemens products are set forth in written agreements
between Siemens and its customers. Siemens' End User License Agreement may be viewed at:
www.plm.automation.siemens.com/global/en/legal/online-terms/index.html.
No representation or other affirmation of fact contained in this publication shall be deemed to be a warranty or give
rise to any liability of Siemens whatsoever.
TRADEMARKS: The trademarks, logos, and service marks ("Marks") used herein are the property of Siemens or
other parties. No one is permitted to use these Marks without the prior written consent of Siemens or the owner of
the Marks, as applicable. The use herein of third party Marks is not an attempt to indicate Siemens as a source of a
product, but is intended to indicate a product from, or associated with, a particular third party. A list of Siemens'
trademarks may be viewed at: www.plm.automation.siemens.com/global/en/legal/trademarks.html. The registered
trademark Linux® is used pursuant to a sublicense from LMI, the exclusive licensee of Linus Torvalds, owner of the
mark on a world-wide basis.
Chapter 1
Qrun Command Operation and Simulation Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Major Features and Command Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Qrun Argument Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Option Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Re-Running Qrun. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Supported Languages and File Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Modelsim.ini Option Sets Support for Qrun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Contents of Qrun Output Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Qrun Log Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Chapter 2
Common qrun Command Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Creating and Managing Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Parallel Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Option Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Location of the Top Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
VHDL Compilation Order with the -autoorder Argument . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Directing Tools to Run Specific Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Debugging with the qrun -script and -env Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Converting a Makefile or Transcript File to a qrun Command . . . . . . . . . . . . . . . . . . . . . . . 26
Overriding Default Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
PDU Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Qrun Command History. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Qrun Command Line Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Chapter 3
Qrun Support for Simulation Methodology Flows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Pre-Built Qrun Simulation Methodology Flows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Forcing a Verification Flow Step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Incremental Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Qrun and Setting Up Regressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
UVM Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Mixed Language Compilation and Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Chapter 4
Qrun Command Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
qrun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
The qrun command simplifies the use of Questa SIM by automatically combining the compile,
optimize, and simulate functions into a single step.
The following figures shows the Questa SIM verification flow and the commands defining each
step, all being managed by the qrun command. With the qrun command, you can build a single-
step verification flow.You do not need to explicitly invoke the separate compile, optimize, and
simulate commands (such as vlog, vopt, vcom, vsim) Knowledge of the two and three-step flow
is built into the command. The knowledge includes which underlying tool arguments to use.
The term “tool” is used to denote the compile, optimize, and simulate functions.
Qrun arguments are optional. On invocation, qrun compiles, optimizes, and simulates
"<myfiles>" without explicit direction (arguments) by you.
Consider the following Hello World SystemVerilog module. The filename is hello.sv.
module IP;
initial begin
$display("Hello world");
end
endmodule
You can issue the following command to compile, optimize, and simulate the previous file:
qrun hello.sv
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Operation and Simulation Flow
Notice that there no arguments on the command line. You can see how qrun is managing the
flow in the edited transcript.
If you use tool arguments on qrun command line, then the qrun command passes the arguments
to the appropriate tool as in:
Qrun recognizes that the “-o hello_opt” argument is passed to the vopt command. The following
transcript illustrates this.
You are not required to explicitly specify tool names when putting arguments on the qrun
command line. The qrun command knows which arguments are associated with a tool without it
being explicitly stated or written on the command line.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Operation and Simulation Flow
Major Features and Command Summary
Re-Running Qrun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Supported Languages and File Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Modelsim.ini Option Sets Support for Qrun. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Contents of Qrun Output Directory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Qrun Log Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Operation and Simulation Flow
Major Features and Command Summary
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Operation and Simulation Flow
Major Features and Command Summary
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Operation and Simulation Flow
Qrun Argument Types
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Operation and Simulation Flow
Option Groups
• Arguments which qrun passes to tools such as vlog or vopt. Qrun recognizes which tool
to pass an argument to without you specifying the tool. For example the following
command line contains the argument -nocvgzwopt.
qrun ... -nocvgzwopt ...
The qrun command passes the -nocvgzwopt argument to vsim without you explicitly
specifying the vsim command as the command using the argument.
You can obtain command line help for any argument you specify without knowing which tool
uses the argument. To use this feature append -help to the command line as in:
vsim options:
------------------------------------------------------------------------
-nocvgzwopt Enable sampling for zero weight covergroup
items
The qrun -help command returns a summary of the -nocvgawopt argument and lists it as a vsim
command option.
Option Groups
A qrun option group is a group of options applied to a given set of files and libraries.Option sets
allow you manage many arguments applied to a set of directories and files. The set of options
you choose are only valid within the option group. You can have multiple option groups on the
qrun command line.
The rules for constructing an option group are:
For example:
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Operation and Simulation Flow
Re-Running Qrun
In the previous command, there are three sub-arguments to the -makelib option group. In turn,
qrun invokes the following commands:
The following example set shows how to use an option group to pass multiple arguments to the
vlog command, followed by the options for qrun to pass to the vopt command. The option group
is terminated by -end.
1. The option set begins with “-vlog.options” keywords directing qrun to pass the
subsequent options to the vlog command.
2. The list of options: “-l vlog.log +define+A=345”
3. Terminate the option set with the -end argument.
qrun test.sv -vlog.options -l vlog.log +define+A=345 -end
Re-Running Qrun
If you re-invoke the same command with no source code or command line argument changes,
then the qrun command skips compilation and optimization and invokes vsim. The resulting
summary part of the transcript would be:
qrun hello.sv
...
# *** Summary *********************************************
# qrun: Errors: 0, Warnings: 0
# vsim: Errors: 0, Warnings: 0
# Totals: Errors: 0, Warnings: 0
The qrun command puts all the results in a directory called qrun.out. .
If you want to rerun the entire compile, optimize, and simulate flow, use the -clean or -cleanlib
arguments to delete and reset the work directories--and then re-invoke qrun hello.sv.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Operation and Simulation Flow
Modelsim.ini Option Sets Support for Qrun
Table 1-2. Default File Extensions and Associated Types and Languages
Type File Extension Language
vlog .v, .vp, .vs, .V, .VP, .VS Verilog
vlog95 .v95, .V95, .v95p, .V95P Verilog 95
svlog .sv, .SV, .svp, .SVP, .svi, .svh, .vlib, .VLIB SystemVerilog
vhdl .vhd, .vhdp, .vhdl, .vhdlp, .VHD, .VHDP, VHDL
.VHDL, .VHDLP
vhdl .vhcfg VHDL Configuration
pslvlog .pslvlog PSL for Verilog
pslvhdl .pslvhdl PSL for VHDL
pslvlog .pslvlog PSL for Verilog
pslvhdl .pslvhdl PSL for VHDL
C .c C
cpp .cpp, .cc, .cxx C++
as .s Assembly
obj .o Object file
so .so .sl Shared object
spice scs .sp Spice
database .bin .db Database for Visualizer
<option_name> = <options>
Once you define the option set in the modelsim.ini file, you reference it in qrun using the -
optionset argument.The following example show how to define an option set called
UVMDEBUG in the modelsim.ini file:
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Operation and Simulation Flow
Modelsim.ini Option Sets Support for Qrun
Note, once again, in the modelsim.ini file you are not required to explicitly state which tool will
take the arguments: qrun does that for you. Pass the modelsim.ini option set definition to qrun
using the -optionset argument:
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Operation and Simulation Flow
Contents of Qrun Output Directory
When you specify the -outdir argument, qrun creates a directory with the specified name, and
uses that directory for all output.
Parameters
• history
—The “history” file keeps track of the qrun commands you have executed. You can re-
invoke previous commands with the argument history[=N[+redo]].
• history.cnt, stats_log, top_dus
— These are general housekeeping files which you should not alter.
• session
— The "session" file contains timestamp information to prevent unnecessary re-compilation
and re-optimization.
• work
— This directory contains all the libraries you specified with qrun. You can place the
libraries anywhere on your network.
Examples
The qrun.out directory contains these standard files and directories:
qrun test.sv
ls -al qrun.out
-rw-rw-r-- 1 mgc manuals 137 Mar 22 11:13 history
-rw-rw-r-- 1 mgc manuals 2 Mar 22 11:13 history.cnt
-rw-rw-r-- 1 mgc manuals 766 Mar 22 11:13 session
-rw-rw-r-- 1 mgc manuals 116 Mar 22 11:13 stats_log
-rw-rw-r-- 1 mgc manuals 100 Mar 22 11:13 top_dus
-rw-rw-r-- 1 mgc manuals 4 Mar 22 11:12 version
drwxrwxr-x 5 mgc manuals 4096 Mar 22 11:13 work/
You can clear out the output files and directory using two arguments. They apply to the output
files and directory of the current command line.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Operation and Simulation Flow
Qrun Log Files
• -cleanlib [-outdir <output_directory>]. The -cleanlib option only cleans the specified
library, and leaves behind the history and other files. If you do not specify an output
directory name, then the qrun command deletes by default the qrun.out directory.
• -clean [-outdir <output_directory>]. Removes the entire qrun.out or the specified output
directory. If you do not specify a output directory name, then the qrun command deletes
by default the qrun.out directory.
You can first check if any of the reference or design libraries needs to be refreshed before
executing any other commands.
qrun -refreshlibs -reflib lib1 -reflib lib2 -makelib lib3 file1.v file2.v -end top.vhd
None of the compile, optimize, simulate tools (vlog, vopt, vsim) produce log files by default. To
create tool log files, use the argument <tool>.option, For example:
In the this example, “log” is a legal argument to both the vsim and vlog commands.
You can put all the log argumens all on the same qrun command line, as in:
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Chapter 2
Common qrun Command Arguments
• The libpath argument is a Linux/Windows path to where qrun creates the library. The
logical argument is the logical name of the library mapped to the physical library. If you
do not specify a logical name, then qrun does not perform a logical mapping.
• The files argument specifies the source files compiled into the library.
• Optional arguments allow you to apply various tool arguments to the specified files.
Following is a basic example.
The command invokes the vlib and vmap tools, as well as vlog, vopt, and vsim.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Common qrun Command Arguments
Creating and Managing Libraries
Only the files and options within the -makelib -end command set are compiled by qrun into the
library. You terminate the -makelib option set with either the -end or -endlib arguments. If qrun
encounters another -makelib argument, qrun terminates the previous argument. You can have
more than one -makelib/-endlib command set on the qrun command line.
Compile files specified in mylib_files.txt into library "mylib" with arguments from -f file and -
93.
The following specifies a custom source file extension .myvhdl for the VHDL files specified in
the -makelib collection libvhdl.
When the qrun command line becomes more complicated, use the -f <filename> and -makelib
arguments to ease complexity. The following example shows how to construct four-way set
associative phased cache simulation.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Common qrun Command Arguments
Creating and Managing Libraries
If you want to explicitly build the libraries separately, you can use the qrun command as shown
in the following example:
You put each one of the --makelib arguments into their own *.f file, which is named qrun.f as
follows:
Contents of qrun.f
-makelib rtllib -f rtl_src.f -endlib
-makelib gatelib -f mux_src.f -endlib
-makelib tb_lib -f tb_src.f -endlib
The qrun command to build the libraries, optimize the files, and simulate is:
qrun -f qrun.f
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Common qrun Command Arguments
Parallel Compilation
The qrun command takes the device from compilation, optimization, to simulation without you
specifying any tool argument:
If you list the qrun.out directory, you can see that qrun has created directories for the three
libraries.
You can pre-compile files and reference libraries with -the reflib argument. Its syntax is:
A related argument to -makelib is the -filemap argument. It allows you to specify how groups of
files are to be compiled. Its syntax is:
Compilation Order
Qrun processes all commands that are not inside –makelib/-endlib first. This can caused a
problem because sometimes the source files in that first compile required packages that were
compiled later in a –makelib/-endlib.Use the -usecmdlineorder argument to control compilation
order.
Qrun processes all arguments in command line order. This gives you the ability to determine the
order of compilation so that packages are compiled before the source files that import them.
Parallel Compilation
In many cases, qrun compiles into several different user specified libraries. Qrun can perform
multiple compiles in parallel using the -parallel argument.
The vlog and other compilation commands on their own do not support true parallel
compilation, With true parallel compilation, the compilers would run completely independently.
The qrun command manages separate compilations into multiple libraries using the -parallel
argument. Some compilations happen sequentially and others happen in parallel.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Common qrun Command Arguments
Parallel Compilation
• Compiles into the same library are compiled sequentially. Compiles to the same library
must use separate -makelibs invocations. The qrun command does not support parallel
compilation into the same library. Qrun determines the ordering of the compiles.
• Several vlog and vcom compilations can only run independently if they are writing into
separate libraries that don't have any inter-dependencies.
• When multiple -makelib commands point to the same library, qrun creates a lock file so
that only one compile can occur at a time. Subsequent compiles to that library wait until
qrun removes the lock file from the library when the current compile finishes. This
causes the concurrent compiles to run sequentially.
• Qrun determines which libraries can be compiled in parallel based on the -L and -reflib
switches. switches in the -makelib/-end commands
• Qrun will treat any library specified with –L on the qrun command line as a package
library. The remaining libraries are considered to be "design libraries”. If you structure
the –L’s in such a way that there is cyclic dependencies, they run in the sequence
specified on the qrun command line.
• Use -jcomp <number of options> argument to determine how many compiles to run in
parallel. Jcomp is supported on Microsoft Windows.
• The -parallel switch is supported on Microsoft Windows.
• Qrun compiles mixed language designs in this order:
a. All SystemC files.
b. All Verilog and SystemVerilog files.
c. All VHDL files.
Example
In the following example uses the following work directories. Note that blockA_lib and
blockB_lib have a dependency on pkglib.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Common qrun Command Arguments
Option Groups
In the previous case qrun operates in the following order breaking down the operation by vlog
compiles. The other libraries depend on pkglib, and as a result pkglib must be compiled first.
Once pkglib compiles, it can be used for parallel compiles. Line 2a and 2b while being compiled
in parallel after line 1, qrun orders them sequentially compiled as there are two compiles into
blockB_lib. Qrun only allows one compile into any library. Qrun basically batch compiles lines
2a and 2b.
Usage Notes
Follow are notes for efficient use of parallel compilation.
• If you specify"-jcomp 0", qrun turns off parallel flow. Qrun invokes normal sequential
flow.
• Execute independent vlog commands in parallel and wait for all jobs to finish.
• Execute vcom -autoorder -noautoorderrefresh -work <lib> ... in parallel and wait for all
jobs to finish.
• Execute vcom (sccom) -refresh_marked -work <lib> ... in parallel and wait for all jobs
to finish,
Option Groups
A qrun option group is a group of options applied to a given set of files and libraries.Option sets
allow you manage many arguments applied to a set of directories and files. The set of options
you choose are only valid within the option group. You can have multiple option groups on the
qrun command line.
The rules for constructing an option group are:
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Common qrun Command Arguments
Location of the Top Module
For example:
In the previous command, there are three sub-arguments to the -makelib option group. In turn,
qrun invokes the following commands:
The following example set shows how to use an option group to pass multiple arguments to the
vlog command, followed by the options for qrun to pass to the vopt command. The option group
is terminated by -end.
1. The option set begins with “-vlog.options” keywords directing qrun to pass the
subsequent options to the vlog command.
2. The list of options: “-l vlog.log +define+A=345”
3. Terminate the option set with the -end argument.
qrun test.sv -vlog.options -l vlog.log +define+A=345 -end
Note
The qrun command cannot determine the top level module when you use the -script
argument. As a result. when you use the -script argument, explicitly specify the location of
top.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Common qrun Command Arguments
VHDL Compilation Order with the -autoorder Argument
In the previous command, qrun disptaches to vsim the argument “-l my_sim_logfile”.
<-|+><tool>.<tool option>
If you only specify one tool, then the -end statement is not required. You can specify multiple
argument associations, but the line must be terminated with an -end statement.
The syntax for applying multiple options for a tool is the following. It is also an option group.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Common qrun Command Arguments
Debugging with the qrun -script and -env Arguments
This example shows how you can direct the vlog command to use any number of legal
arguments:
The qrun command puts the commands it invoked in csh.run. The -clean argument removes any
libraries, so there will be no incremental compile. The -top argument locates the top module for
qrun.
You can send the contents of the csh.run file to the terminal using, use the following command:
cat csh.run
vlib -quiet qrun.out/work
vlog hello.sv -work qrun.out/work
vopt top -work qrun.out/work -o qrun_opt
vsim -lib qrun.out/work -c -do 'run -all; quit -f' qrun_opt
The qrun command invokes vlib, vlog, vopt, and then vsim.
The following qrun command implements a coverage flow for all Verilog files within a
directory:
You can append the -script <filename> argument to the command line to view what commands
qrun invoked:
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Common qrun Command Arguments
Converting a Makefile or Transcript File to a qrun Command
Appending the -env myenv argument creates a myenv file which shows which tools were
invoked by qrun, their arguments, plus any environment variables in the current shell:
REMOTEHOST=ORW-ESTVENS-920.wv.mentorg.comMANPATH=/usr/openwin/share/man:/
usr/man:/wv/dft/tools/share/man:/wv/dft/tools/ixl/man:/usr/wvcontrib/
man:/usr/wvcontrib/man/man1:/wv/let18/project/online/vendors/olias/olias/
man
VNCDESKTOP='orw-test-vm:50 '
SSH_AGENT_PID=2270
XDG_SESSION_ID=564
HOSTNAME=orw-test-vm
IMSETTINGS_INTEGRATE_DESKTOP=yes
SHELL=/bin/csh
SSH_CLIENT='147.34.71.109 52157 22'
....
....
vlib -quiet qrun.out/work
vlog buffer.v cacheModule.v comparator.v CtrlCkt.v ...
vopt testbench -work qrun.out/work -o qrun_opt +cover=secb
vsim -lib qrun.out/work -c -do 'coverage save -onexit cov_$Sv_Seed.ucdb'
-do 'run -all; quit -f' qrun_opt
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Common qrun Command Arguments
Overriding Default Arguments
Note
Do not remove their arguments.
PDU Usage
PDU libraries require the use of the vopt -access switch in particular cases.
In some cases you may require use of the vopt –access inside the –makepdu/-end command if
you have hierarchical references that crosses the PDU boundary. For example. if a PDU is
instantiated under the top module, and the top module contains a hierarchical reference to an
object inside the PDU, then you should add –access to that object inside the –makepdu
command.
The user should apply the –access argument to module instances or objects (registers, nets)
inside the PDU. Like +acc, the -access argument can significantly degrade performance.
If you have objects inside the PDU that need access you can use –access=rw+/. (global read/
write access). However this can negatively impact performance. If you only have a few objects,
then you can use -access=rw+m1/u2/u2/m1_bot2_reg that points specifically the objects that
need visibility which have less performance impact.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Common qrun Command Arguments
Qrun Command History
-makelib lib1
top.sv test1.sv test2.sv test3.sv
-end
-top top
-do "run -all"
qrun -history<=Num>>+redo
qrun -history
1 14:32 qrun a.vhd
2 14:50 qrun b.vhd c.sv
3 16:20 qrun -mfcu -93 +acc -o opt -c a.sv b.sv c.vhd
qrun -history=2
2 14:50 qrun b.vhd c.sv
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Common qrun Command Arguments
Qrun Command Line Help
Re-run the second command previously executed. Using the previous example, qrun executes
“qrun b.vhd c.sv”.
qrun -history=2+redo
The qrun -help argument is organized to provide help on various categories, individual
arguments, and the entire set of arguments for qrun.
To get a summary of all the qrun commands along with their categories, issue the following
qrun command.
The following command shows how to list all the categories of command types:
qrun -help
Produces:
One feature of -help is that you can get help on any argument on the qrun command line. You
may omit source files or libraries. The following shows how to get help on two specific
arguments which are -93 and -coverage:
The previous command issues the following. Note that the qrun help identifies every tool
associated the switch.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Common qrun Command Arguments
Qrun Command Line Help
vcom options:
-------------------------------------------------------------------------
-93 Enable support for VHDL 1076-1993 in VHDL-style.
PSL files specified with -pslfile_vh <file>vsim options
-------------------------------------------------------------------------
-coverage Allows enabled coverage statistics to be kept
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Chapter 3
Qrun Support for Simulation Methodology
Flows
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Support for Simulation Methodology Flows
Pre-Built Qrun Simulation Methodology Flows
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Support for Simulation Methodology Flows
Pre-Built Qrun Simulation Methodology Flows
In the following command, the qrun command invokes the Visualizer tool in post-simulation
mode with all the generated Visualizer debug databases.
The result is to invoke Visualizer on the database (.bin) file produced by vsim.
Override the default arguments qrun passes to the commands by invoking explicit arguments. In
the following override example you are not required to specify the tool.
You can use the following command to enable the coverage flow with qrun.
The following transcript demonstrate a coverage flow. You are not required to supply the
arguments on the command line.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Support for Simulation Methodology Flows
Forcing a Verification Flow Step
...
vsim -lib qrun.out/work -c -do "coverage save -onexit cov_$Sv_Seed.ucdb" -
do "run -all; quit -f" qrun_opt -appendlog -logfile qrun.log
....
# Loading sv_std.std
# Loading work.top(fast)
# coverage save -onexit cov_$Sv_Seed.ucdb
# run -all
# a: 1, b:15, c: 5
# a: 5, b: 8, c: 5
...
# ** Note: $finish : test.sv(26)
# Time: 190 ns Iteration: 1 Instance: /top
# Saving coverage database on exit...
...
You invoke the Quest SIM Classic GUI with the following command:
2. Issue the following command to force qrun to stop after vopt executes.
qrun test.sv -optimize
3. Issue the following command to force qrun to only run a simulation. Qrun does not
check to determine if another recompile or re-optimize is required.This also forces qrun
to simulate even if switches or source files have changed.
qrun test.sv -simulate
Incremental Compilation
When you re-invoke the qrun command, the command verifies whether recompilation or re-
optimization of the design is necessary.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Support for Simulation Methodology Flows
Qrun and Setting Up Regressions
• The content of the source files have not changed since the last run, including source files
supplied with -y and -v arguments.
• The order of the source files specified on the command line, including the order of -v
and -y arguments, has not changed
• Any argument that impacts compilation or optimization has not changed. For example,
adding -93 causes a recompile. However, adding or modifying -do or -sv_seed, does not
cause a recompile.
1. Compile and optimize only; and, explicitly name the output directory. Use the -optimize
argument to force qrun to only compile and optimize.
# compile and optimize
qrun –f qrun.f –optimize –snapshot <snapshot name>
# this compiles and optimizes the design and testbench
2. Simulate with qrun using individualized test arguments. Use the -simulate argument to
direct qrun to only simulate your individual tests.
# run simulations
qrun –simulate –snapshot <snapshot name> [-sv_seed <seed value>]
[+UVM_TESTNAME=<testname>]
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Support for Simulation Methodology Flows
UVM Usage
It is not necessary for you to break the compile/optimize and simulate flow into two separate
steps. The previous flow uses the –simulate argument to skip the check to determine if the
source code should be compiled and optimized. This ensures that no compilation occurs if a
source files is accidentally modified while the regressions are running.
Because qrun does incremental compilation, the following flow example will also compile and
optimize once, then simulate without recompiling. In the following example, qrun –clean will
remove all qrun generated files. There will be some small overhead for the incremental
compilation check. Note the following:
• The first “qrun –f qrun.f …” command compiles, optimizes, and simulates test1.
• The following “qrun –f qrun.f …” commands only run the simulation with the specified
UMV testname and SV seed value.
# Clean up qrun output files
qrun -clean# Run the simulations
qrun -f qrun.f +UVM_TESTNAME=test1
qrun -f qrun.f +UVM_TESTNAME=test2 -sv_seed 500
qrun -f qrun.f +UVM_TESTNAME=test2 -sv_seed 25
qrun -f qrun.f +UVM_TESTNAME=test2 -sv_seed 1255
UVM Usage
UVM class library methodology is used extensively within verification testbenches. Qrun has
support for setting up UVM libraries.
Note the following:
• The -uvm argument when used without -uvmhome references the precompiled UVM
library umv-1.1d in the Questa installation tree by default.
• For the argument :-uvmhome=[uvm-1.1c|uvm-1.1d|uvm-1.2| path to source code:
o Use this switch to change the version of the UVM library that qrun uses.
o uvm-1.1c, uvm-1.1d, uvm-1.2 all refer to the Questa pre-compiled UVM libraries.
o "path to source code" causes qrun to compile the UVM source code at that location.
• The argument -uvmexthome <Questa Intallation>/questasim/verilog_src/
questa_uvm_pkg-1.2 is used in conjunction with -uvmhome="path to source code".
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Support for Simulation Methodology Flows
Mixed Language Compilation and Simulation
If you need Verilog or VHDL files compiled at an earlier point, you can use the -precompile
argument whose syntax is:
The specified files will be compiled before the normal order of compilation.
In this example, qrun first compiles the VHDL file test1.vhd with the argument -mixedsvvh.
Note that you can also specify entire libraries for pre-compilation.
You can define macros available for use by all C, C++, SystemC, Verilog and SystemVerilog
programs using the -defineall argument, whose syntax is:
For example:
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Support for Simulation Methodology Flows
Mixed Language Compilation and Simulation
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Chapter 4
Qrun Command Reference
qrun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Reference
qrun
qrun
Compiles, optimizes and simulates a design by taking all input files and arguments together and
automatically executing the correct tool and command-line arguments for each file.
Syntax
This subsection lists qrun command arguments by functional category.The Arguments section
groups the argument descriptions in alphabetical order.
qrun [files] [options]
General: most common options
[-32 | -64] [-f | F <optionfile>] [-help [options|topic]] [-verbose] [-version]
Compiler Control: options for compiler, and optimizer controls
[-autoorder] [-cdebug] [-debug, <arg>, <arg>, ...] [-defineall <macro[= value]>] [[-
noautoorder]] [-parallel] [-usecmdlineorder] [-uvm] [ -uvmexthome <QUESTA_HOME/
questasim/verilog_src/questa_uvm_pkg-1.2>]
Design units and libraries
[-clean] [-cleanlib] [-o <design_unit>] [-makepdu <pdu_name> [/path/to/lib.]<du_name>
<options> -end]-o <design_unit> [-outdir <directory>] -snapshot <snapshot_name> [-top
<design_unit>]
File and Tool Association
[-defaultext=<tool>] [,<tool>.<argument>] [-<tool>.ext=[+][ext],[ext],[ext]...] [<-
|+><tool>.<tool option>] [-<tool>.options -opt1 -opt2 +op3 ... -end]
Flow Controls
[+UVM_TESTNAME=<testname>] [-compile][-coverage] [-debug, <arg>, <arg>, ...] [-
designfile <bin-filename>] [-gui[=interactive | postsim]] [-load_elab <filename>] [-noincr]
[-optimize] [-qwavedb=<options>] [-uvmcontrol]-visualize
Formal/CDC
[-autocheck] [-cdc][-covercheck] [-cuname <file>] [-fx] [-genucdb [filename]] [-goal] [-hcdc]
[-hrdc] [-lint] [--methodology] -od] [-propcheck] [-protocol] [-rdc [-rdc] [-report_clock] [-
reset] [-reset] [-sdc [-simulate] [-timeout] [-xcheck]
Messages
[-error <msgNumber>[,<msgNumber> ...]] [-fatal <msgNumber>[,<msgNumber> ...]] [-
note <msgNumber>[,<msgNumber> ...]] [-permissive] [-suppress <msgNumber/
msgGroup>[,<msgNumber/msgGroup>...]] [-warning <msgNumber>[,<msgNumber> ...]]
Script, Environment, History, and Logging
[-env <filename> [<format>]] [-history=<arg>] [[-log | -l | -logfile] [<filename>]] [-script
<filename>] [-stats[=[+-]<args>]]
Subgroup options for handle grouping files and options
[-filemap <vcom/vlog files, arguments> -endfilemap] [-makelib <libpath[:logical]> <vcom/
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Reference
qrun
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Reference
qrun
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Reference
qrun
• -hcdc
Specify abstract model generation.
• -hrdc
Specify abstract model generation (-hrdc).
• -history=<arg>
Prints out or re-executes a previously used command. Without the use of arguments, the
qrun command returns all previous commands. Qrun will store a 'history' file in its output
directory. This file will be maintained containing the list of all 'qrun' commands that have
been executed. A 'logs' directory will contain an output file from each run, named to
correspond to a history item. Invoking '-history' with a command-line argument will list the
history providing an argument to redo the item.
In the following argument list, N represents a number or a range of numbers.
-history=<N> — Prints command N.
=<N>+redo — Reruns the command N.
-history=N+clear — Clear command N
-history=clear — Clear all commands.
• -help [options|topic]
Lists all qrun command arguments if you do not specify any arguments.
You can specify that the qrun command give you available information on either topics or a
tool.
• -lint
Enable Lint flow.
• -load_elab <filename>
Load simulation from previous elaboration.
• [-log | -l | -logfile] [<filename>]
Prints a log to either the terminal or filename. Both “l” and “log” aliases for logfile.
• [-noautoorder]
Turns off autoordering for VHDL files.
• -noincr
Disable incremental compilation and optimization.
• -makelib <libpath[:logical]> <vcom/vlog files, options> -end|-endlib
Compile Verilog and VHDL files into library libpath. The optional logical name is mapped
to the path. The library name can be the physical or the logical library name. A makelib
argument is terminated with another sub-list argument like -makelib or -filemap or by using
the -end argument. The command creates the library if it does not exit.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Reference
qrun
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Reference
qrun
• -permissive
Relaxes some language error checks to warnings.
• -precompile [libpath[:logical]] <vcom/vlog files, options> -end
Compile the Verilog and VHDL files with the given arguments before other files.
• -propcheck
Specify protocol generation (cdc generate protocol).
• -protocol
Enable propcheck flow for Formal flow.
• -qwavedb=<options>
Set options for Visualizer GUI.
• -snapshot <snapshot_name>
Specify snapshot (optimized design) name. Does the same as the -o switch but -snapshot is
more descriptive.
• -rdc
Enable RDC flow.
• -refreshlibs
First checks if any of the reference or design libraries needs to be refreshed before executing
any other commands.
• -reflib <library>
Add the specified library to all search paths. This argument would be required if qrun
creates and manages all the libraries in the design. Files can be precompiled into a library
with -compile and -makelib argument and then referred to in a subsequent qrun command
with the -reflib argument. The reflib argument adds the library to the list of libraries to
search for a given design unit.
• -report_clock
Specify clock reporting only.
• -reset
Specify clock reporting only (-report_reset).
• -scgenmod <options> <design unit> <output file> -end
Create a foreign module for SystemC.
• -script <filename>
Write the commands that would be executed by qrun into 'filename'. Qrun will exit without
executing those commands.
• -sclink <arguments> -end
Provide arguments for 'sccom -link' command.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Reference
qrun
• -sdc
Specify SDC file (sdc load ).
• -simulate
Only simulate the design, without compiling or optimizing.
• -stats[=[+-]<args>]
Enables or disables compile stats. Args can have the following values.
=[+-] — Controls activation of the feature or mode. The plus character ( + ) enables the
stat, and the minus character ( - ) disables the state.
all — Display all statistics features (cmd, msg, perf, time). Mutually exclusive with none
argument. When specified in a string with other arguments, all is applied first.
cmd — (default) Echo the command line.
msg — (default) Display error and warning summary at the end of command execution.
none — Disable all statistics features. Mutually exclusive with all argument. When
specified in a string with other arguments, none is applied first.
perf — Display time and memory performance statistics.
time — (default) Display Start, End, and Elapsed times.
• -suppress <msgNumber/msgGroup>[,<msgNumber/msgGroup>...]
Suppress the listed messages with either message number or group.
• -sysc <sccom source files> <sscom options> -end
Compile SystemC source files with the specified options. The -sysc/-end switches are
required for systemC source files and options. This is how qrun distinguishes SystemC C/
C++ files from DPI or VPI source files. The -end is optional. The command set can also be
terminated with -makelib or -filemap.
• -timeout
Specify time out.
• -<tool>.log <filename>
Print the log for a particular tool to specified filename.
• ,<tool>.<argument>
Allows you to execute any command with the specified argument. An example of the syntax
is "-vlog.l <logfile name>". This invokes the -l argument of the vlog command. The intent
of this syntax is to direct qrun to which tool a switch should be applied. It is similar to the -
<tool>.options <switches> -end command, except it is used for a single switch instead of
one or more switches with the .options syntax.
• <-|+><tool>.<tool option>
Allows you to associate a single argument to a specific tool.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Reference
qrun
-|+ — If the tool option is a plusargs (starts with a +), the invocation is
+<tool>.<option>. For example: +vlog.acc.
If it starts with a '-', then the invocation is -<tool>.<option>. For example: -
vlog.fsmdebug.
• -<tool>.options -opt1 -opt2 +op3 ... -end
Associates a list of options with a tool. You can specify multiple arguments with a tool, but
you must terminate the command line with a “-end” statement. The tool argument maybe
vlog, vopt, vsim or any other supported tool. There is no plusargs associated with <tool>
with the list of options
• -top <design_unit>
Specifies design_unit as the top for simulation. The top level design units of for VHDL and
SystemC are not automatically detected. As a result, VHDL and SystemC top must be
specified by the -top argument.
All compiled but unreferenced Verilog and SystemVerilog modules will be treated as top
level instances for optimization and simulation, unless you use the -top argument. They also
become top level modules unless you specify -svext=uslt with the qrun command.
• -<tool>.ext=[+][ext],[ext],[ext]...
Associates a file type with a tool or language. The qrun command supports several default
suffixes listed in the following table.
You can override these using the -<tool>.ext argument, along with an '=' to replace the list,
or a '+' to add to the list. For example:
qrun -vlog.ext=.v,.vv,.vh :Replace Verilog suffixes list
qrun -vcom.ext=+.vhdh,.xyz : Add '.vhdh'& .xyz to VHDL list
Table 4-1. Default File Extensions and Associated Types and Languages
Type File Extension Language
vlog .v, .vp, .vs, .V, .VP, .VS Verilog
vlog95 .v95, .V95, .v95p, .V95P Verilog 95
svlog .sv, .SV, .svp, .SVP, .svi, .svh, .vlib, .VLIB SystemVerilog
vhdl .vhd, .vhdp, .vhdl, .vhdlp, .VHD, .VHDP, VHDL
.VHDL, .VHDLP
vhdl .vhcfg VHDL Configuration
pslvlog .pslvlog PSL for Verilog
pslvhdl .pslvhdl PSL for VHDL
pslvlog .pslvlog PSL for Verilog
pslvhdl .pslvhdl PSL for VHDL
C .c C
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Reference
qrun
Table 4-1. Default File Extensions and Associated Types and Languages
Type File Extension Language
cpp .cpp, .cc, .cxx C++
as .s Assembly
obj .o Object file
so .so .sl Shared object
spice scs .sp Spice
[+] — The “+” sign adds to the association list. Without the “+” sign, associations are
replaced. For example, the command “qrun -vlog.ext=.v,.vv,.vh” replaces the Verilog
suffixes list. The command “qrun -vcom.ext=+.vhdh,.xyz : Add '.vhdh'& .xyz to
VHDL list
<tool> —The tool to associate a file type.
• -usecmdlineorder
Qrun processes all arguments in command line order. This gives you the ability to determine
the order of compilation so that packages are compiled before the source files that import
them.
Qrun processes all commands that are not inside –makelib/-endlib first. This can caused a
problem because sometimes the source files in that first compile required packages that
were compiled later in a –makelib/-endlib.
• +UVM_TESTNAME=<testname>
Defines the +UVM_TESTNAME test name to be used for UVM designs.
• -uvm
Include the UVM library. Optionally specified with -uvmhome.
• -uvmcontrol
Control specific UVM-aware debug options.
• -uvmhome <path-to-UVM-library|UVM-version-string>
Specifies UVM library to use with -uvm. . You can specify a path to the library or a version
number.
• -uvmexthome <QUESTA_HOME/questasim/verilog_src/questa_uvm_pkg-1.2>
Compile the QuestaSIM UVM extensions into the work library.
• -verbose
Display verbose statistics information when available.
• -version
Prints the version of qrun.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Reference
qrun
• -visualize
Enable the Visualizer GUI and flow.
• -warning <msgNumber>[,<msgNumber> ...]
Report the listed messages as warnings.
• -xcheck
Enable xcheck flow for Formal flow.
Examples
The following shows how to associate both a single and multiple options to a tool.
qrun \
+vlog.acc \
-vlog.options -fsmdebug +acc -end \
-makelib toplib t2.sv -endlib \
-makelib dutlib dut.sv -endlib
In this example, the qrun command causes all logs from vlog to be redirected to vlog.log. This is
also the same for vopt and vcom. The logs from the rest of the programs will be only printed to
the terminal unless a -l argument is used to capture them.
qrun +vlog.cover+bcs...
Compile file1.vhd and file2.vhd into the library "mylib" with argument. -93.
Compile files specified in mylib_files.txt into library "mylib" with arguments from -f file and -
93.
This command specifies a custom source file extension .myvhdl for the VHDL files specified in
the -makelib collection libvhdl.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Reference
qrun
qrun -history
1 14:32 qrun a.vhd
2 14:50 qrun b.vhd c.sv
3 16:20 qrun -mfcu -93 +acc -o opt -c a.sv b.sv c.vhd
qrun -history=2
2 14:50 qrun b.vhd c.sv
Re-run the second command previously executed. Using the previous example, qrun executes
“qrun b.vhd c.sv”.
qrun -history=2+redo
Pass arguments and files to the 'sccom -link' command, use -sclink <options/files> argument.
qrun -sysc -g -DMYDEF a.cc b.c -top tb -sclink -scv lib1.o lib2.o
To incorporate a 'foreign' module from VHDL or Verilog, use -precompile to compile the HDL
first, and use the '-scgenmod <options> <design-unit name> <output file name> -end' argument:
qrun -precompile myvlog.sv -end -scgenmod svmodule svmodule.h -end -sysc a.cc -top tb
The -mixedsvvh is a list argument specifying the list of VHDL and SV files to be shared across
the mixed-language boundary.Mixed design with package sharing with -mixedsvvh argument.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.