Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Questa Sim Qrun User

Download as pdf or txt
Download as pdf or txt
You are on page 1of 50

SIEMENS EDA

Questa® SIM Qrun User’s


Manual
Software Version 2022.1
Unpublished work. © 2022 Siemens

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.

Support Center: support.sw.siemens.com


Send Feedback on Documentation: support.sw.siemens.com/doc_feedback_form
Table of Contents

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

Questa® SIM Qrun User’s Manual, v2022.1 3


Table of Contents

4 Questa® SIM Qrun User’s Manual, v2022.1


Chapter 1
Qrun Command Operation and Simulation
Flow

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.

Figure 1-1. Questa SIM Verification Flow and qrun Command

The term “tool” is used to denote the compile, optimize, and simulate functions.

The basic syntax of the qrun command is:

qrun <myfiles> <optional arguments>

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

Questa® SIM Qrun User’s Manual, v2022.1 5

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.

QuestaSim vlog Compiler 2019.04 Apr 11 2019


...
vlog hello.sv -work qrun.out/work -csession=incr -writesessionid
"+qrun.out/top_dus" -statslog qrun.out/stats_log
...
...
Errors: 0, Warnings: 0
QuestaSim vopt ...
vopt -findtoplevels qrun.out/top_dus -work qrun.out/work -o qrun_opt -
statslog qrun.out/stats_log
...
Analyzing design...
-- Loading module IP
Optimizing 1 design-unit (inlining 0/1 module instances):
-- Optimizing module IP(fast)
Optimized design name is qrun_opt
Errors: 0, Warnings: 0
Reading pref.tcl
# vsim -lib qrun.out/work -c -do "run -all; quit -f" qrun_opt -appendlog -
logfile qrun.log ...
...
# Loading sv_std.std
# Loading work.IP(fast)
# run -all
# Hello world
# quit -f# *** Summary *********************************************
# qrun: Errors: 0, Warnings: 0
# vlog: Errors: 0, Warnings: 0
# vopt: Errors: 0, Warnings: 0
# vsim: Errors: 0, Warnings: 0
# Totals: Errors: 0, Warnings: 0

If you use tool arguments on qrun command line, then the qrun command passes the arguments
to the appropriate tool as in:

qrun hello.sv -o hello_opt

Qrun recognizes that the “-o hello_opt” argument is passed to the vopt command. The following
transcript illustrates this.

vopt -o hello_opt -findtoplevels qrun.out/top_dus -work qrun.out/work -


statslog qrun.out/stats_log

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.

Major Features and Command Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7


Qrun Argument Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Option Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

6 Questa® SIM Qrun User’s Manual, v2022.1

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

Major Features and Command Summary


The qrun command has these major features.
• All tool arguments and source files go on the same qrun command line.
o All vlog, vopt, vsim arguments go on the qrun command line unmodified.
o Supports two or three step flows.
• Simplifies the building of a mixed-language design by choosing the appropriate tool and
arguments to compile for each file.
• Automatically detects file dependencies to compile files in the appropriate order.
• Supports default autoorder of VHDL files.
• Maintains a history of previously executed commands, allowing you to browse
command list. Next, you can re-run a line without having to specify all the previous
arguments.
• Provides a way to output a shell script.
• Supports Pre-optimized Design Unit (PDU).
• Supports user over-rides of command defaults.
• Manages Libraries
o No need to call vlib/vmap directly,
o All libraries can be created inside or outside the standard qrun output directory.
• The qrun command can determine VHDL source file ordering.
• Provides pre-built flows for coverage, debug, UVM, and other flows. No need to
construct arguments for multiple tools.
Table 1-1lists all the qrun arguments by functional category. Invoke qrun -help all on the
command line to obtain the list.
Table 1-1. Qrun Argument Summary
qrun Arguments Usage Summary
General Arguments

Questa® SIM Qrun User’s Manual, v2022.1 7

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

Table 1-1. Qrun Argument Summary (cont.)


qrun Arguments Usage Summary
-32, -64 Run in either 32-bit or 64-bit mode.
-verbose Print additional output.
-version Print the version of the qrun command.
Compiler/Optimization Controls
-autoorder An -autoorder compilation determines the proper order of
VHDL design units, independent of the order that you listed
the files on the command line. On by default.
-cdebug Pass appropriate 'C' debugging flags to vlog and sccom.
-debug,<arg>,<arg> Pass appropriate debugging flags to all tools
-defineall <macro[= value]> Define <macro> for all compilers.
-noautoorder Turns off autoordering.
-usecmdlineorder Qrun processes all arguments in command line order.
-uvm Include the UVM library, optionally specified with
uvmhome.
-uvmexthome <QUESTA_HOME/ Compile the Questa UVM extensions into the work
questasim/verilog_src/ library.
questa_uvm_pkg-1.2>
-uvmhome <path-to-UVM- Specifies UVM library to use with -uvm.
libraryUVM-version-string>
Design units and libraries
-clean Remove 'qrun.out', or the directory specified with -outdir.
-cleanlib Like -clean, but just remove the libraries.
-o <design_name> Specify optimized output design name.
-outdir <filename> Store libraries and data in 'filename' instead of the default,
'qrun.out'.
-top <design_unit> Specify 'design_unit' as the top for simulation.
Option and file specifications
-defaultext=<tool> Specify file extensions for default language
-<tool>.ext=[+][ext],[ext],[ext]... Specify file extensions for the tool. A '+' adds to the current
list.
-<tool>.options <option list for Apply the included options to 'tool' (vlog, vopt, vsim, etc).
'tool'> -end
Flow Methodology Controls

8 Questa® SIM Qrun User’s Manual, v2022.1

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

Table 1-1. Qrun Argument Summary (cont.)


qrun Arguments Usage Summary
+UVM_TESTNAME=<testname> Defines the +UVM_TESTNAME test name to be used for
UVM designs.
-compile Just compile the design. Do not optimize or simulate.
-coverage Allows enabled coverage statistics to be kept.
-simulate Force qrun to simulation without compilation and
optimization.
-designfile <bin-filename> Specifies a name for the Visualizer .bin file.
-gui[=interactive|postsim] Specify mode in which to bring up the GUI. If 'postsim', qrun
will not compile, optimize, or simulate.
-load_elab <filename> Load simulation from previous elaboration
-noincr Disable incremental compilation and optimization.
-optimize Compile and optimize the design. Do not simulate.
-qwavedb=<options>... Set options for Visualizer GUI.
-uvmcontrol=<arg> Control specific UVM-aware debug options
visualizer[=desgin file name Turn on Visualizer GUI. Default name for design file is
design.bin.
Options to suppress or downgrade errors
-error Report the listed messages as errors.
<msgNumber>[,<msgNumber>...]
-fatal Report the listed messages as fatal.
<msgNumber>[,<msgNumber>...]
-note Report the listed messages as notes.
<msgNumber>[,<msgNumber>...]
-permissive Relax some language error checks to warnings.
-suppress <msgNumber/ Suppress the listed messages using number or
msgGroup>[,<msgNumber/ group.
msgGroup>...]
-warning Report the listed messages as warnings.
<msgNumber>[,<msgNumber>...]
Scripts, environment, history, logging
-env <filename>[(format)] Store the commands and the current environment in
'filename', but do not execute the commands. The 'format' is
in the style of printf with two '%s' specifiers, the first for the
name and the second for the value.

Questa® SIM Qrun User’s Manual, v2022.1 9

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

Table 1-1. Qrun Argument Summary (cont.)


qrun Arguments Usage Summary
-history=<arg> Print previous commands. -history=N: Print command N. -
history=N+redo: Rerun command N. -history=N+clear: Clear
command N. -history=clear: Clear all commands. (N is a
number, or a range of number. Ex:3-6)
-l <filename> All output goes to 'filename'. -<tool>.log <filename>: Output
for <tool> goes to 'filename'.
-log <filename> All output goes to 'filename'. -<tool>.log <filename>: Output
for <tool> goes to 'filename'.
-logfile <filename> All output goes to 'filename'. -<tool>.log <filename>: Output
for <tool> goes to 'filename'.
-script <filename> Write the commands that would be executed by qrun into
'filename'. Qrun will exit without executing those commands.
-stats[=[+-]<args>] Enables compiler statistics. <args> are all, none, time, cmd,
msg, perf, verbose, list, kb.
Grouping files and options
-filemap <vcom/vlog files, options> - Compile the Verilog and VHDL files with the given options
end|-endfilemap added.
-makelib <libpath[:logical]> <vcom/ Compile the Verilog and VHDL files into library 'libname'.
vlog files, options> -end|-endlib The optional 'logical' name will be mapped to the path.
-precompile Compile the Verilog and VHDL files with the given options
[libpath[:logical]]<vcom/vlog files, before other files.
options> -end
-reflib <library> Adds a library to the search path. Similar to the vopt -L
<library> switch.
SystemC Support
-scgenmod <options> <design unit> Create foreign module for SystemC.
<output file> -end
-sclink <arguments> -end Provide arguments for 'sccom -link'
-sysc Compile C/C++ for SystemC

Qrun Argument Types


There are two types of qrun arguments.
• Arguments specifically for qrun to execute such as -makelib and -script.

10 Questa® SIM Qrun User’s Manual, v2022.1

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:

qrun -nocvgzwopt -help

The previous command returns the following:

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:

1. Begin an option group with the operation you want to perform


2. Provide a list of options
3. Terminate the option group with an -end statement.
The following are examples for the -makelib and -filemap option groups.

-makelib <library> <files> <options> -end|-endlib


-filemap <options> <files> -end|-endfile

For example:

qrun -makelib mylib *.v -end

Questa® SIM Qrun User’s Manual, v2022.1 11

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:

vlib -quiet qrun.out/mylib


vmap -c -quiet mylib qrun.out/mylib

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.

Supported Languages and File Types


The qrun command supports the following simulation languages.
• SystemVerilog/Verilog
• VHDL
• SystemC and C/C++ (DPI/PLI/FLI) source and compiled object files.
The follow table lists the files and tools supported by qrun.

12 Questa® SIM Qrun User’s Manual, v2022.1

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

Modelsim.ini Option Sets Support for Qrun


You can define option sets in the modelsim.ini file to create qrun shortcuts. This feature is
shared by all QuestaSIM tools.
The first step is to edit the modelsim.ini file and define an option set. A modelsim.ini option set
is defined as:

<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:

// In the modelsim.ini file.


UVMDEBUG = -uvmcontrol=all -msgmode both -displaymsgmode both -classdebug
-onfinish stop
VOPTDEBUG = +acc -debugdb

Questa® SIM Qrun User’s Manual, v2022.1 13

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:

qrun -optionset UVMDEBUG file1.sv file2.sv file3.vhd

14 Questa® SIM Qrun User’s Manual, v2022.1

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

Contents of Qrun Output Directory


Every invocation causes the creation or updating of an output directory.
By default, the qrun command writes all output to the./qrun.out directory. If the directory does
not exist, qrun creates it.
Format
You can change the location and name of the output directory as follows:

qrun -outdir <directory_name>

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.

Questa® SIM Qrun User’s Manual, v2022.1 15

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

Qrun Log Files


By default, qrun logs the transcript of any invocation in a file called qrun.log in the current
working directory.
You can change the file name of the log file with the -log argument:

qrun -log <log_file_name>

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:

qrun -vsim.log my_vsim_log


qrun -vlog.log my_vlog_log

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:

qrun *.sv -vlog.log my_vlog_log -vopt.log my_vopt_log -vsim.log my_vsim_log

16 Questa® SIM Qrun User’s Manual, v2022.1

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

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

Creating and Managing Libraries


You create and map work libraries using the -makelib argument which is an option group
argument. By default the work library is created in the./qrun.out/work library.
The syntax for the creating a library is:

qrun -makelib <libpath[:logical]> <files>, [options] -end|-endlib

• 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.

% qrun -makelib mylib *.v -end

The command invokes the vlib and vmap tools, as well as vlog, vopt, and vsim.

Questa® SIM Qrun User’s Manual, v2022.1 17

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

vlib -quiet qrun.out/mylib


vmap -c -quiet mylib qrun.out/mylib

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.

Using -makelib With Other Arguments


Using -makelib with other options enables you to execute entire sets of source files. In the
following example, you compile file1.vhd and file2.vhd into library "mylib" with the argument
-93. The -compile switch forces qrun to perform the compile step and not optimization nor
simulation.

qrun -compile -93 -makelib mylib file1.vhd file2.vhd -endlib ...

Compile files specified in mylib_files.txt into library "mylib" with arguments from -f file and -
93.

qrun -compile -93 -makelib mylib -f mylib_files.txt -endlib ...

The following specifies a custom source file extension .myvhdl for the VHDL files specified in
the -makelib collection libvhdl.

qrun -makelib libvhdl -vcom_ext +.myvhdl bar.myvhdl -endlib tb_top.vhd

This example shows the specification of a physical library.

qrun -makelib /usr1/myarea/gates buf.v and2.v -endlib ...

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.

Figure 2-1 shows the structure of the phased cache:

• The device has three libraries: tb_lib, gatelib and rtllib.


• All of the associated library source files have been put into their own separate *.f files:
tb_src.f, mux_src.f, and rtl_scr.f.

18 Questa® SIM Qrun User’s Manual, v2022.1

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

Figure 2-1. Library Structure for an Associative Phase Cache

If you want to explicitly build the libraries separately, you can use the qrun command as shown
in the following example:

qrun -makelib rtllib -f rtl.scr.f -endlib


-makelib gatelib -f mux_scr.f -endlib
-makelib tb_lib -f b_scr.f -endlib

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

Questa® SIM Qrun User’s Manual, v2022.1 19

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:

# *** Summary *********************************************


# qrun: Errors: 0, Warnings: 0
# vlog: Errors: 0, Warnings: 0
# vopt: Errors: 0, Warnings: 0
# vsim: Errors: 0, Warnings: 0
# Totals: Errors: 0, Warnings: 0

If you list the qrun.out directory, you can see that qrun has created directories for the three
libraries.

. .. gatelib history history.cnt rtllib session stats_log tb_lib


top_dus version work

You can pre-compile files and reference libraries with -the reflib argument. Its syntax is:

qrun -reflib <library_name>

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:

qrun -filemap <options> <files> -endfile

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.

Qrun Command Parallel Compilation Rules


The qrun command for parallel compilation follows these rules.

20 Questa® SIM Qrun User’s Manual, v2022.1

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.

• pkglib: Library containing packages used by other design libraries.


• blockA_lib: Library containing all Block A components, uses packages from pkglib
• blockB_lib: Library containing all BlockB components, uses packages from pkglib.
qrun –parallel –compile

-makelib pkglib <pkg_opt_set_1> -f pkglib_src_set_1.f –endlib

-makelib pkglib <pkg_opt_set_2> -f pkglib_src_set_2.f –endlib

-makelib blockA_lib –L pkglib <blockA_opt_set> –f blockA_src.f –endlib

Questa® SIM Qrun User’s Manual, v2022.1 21

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

-makelib blockB_lib –L pkglib <blockB_opt_set_1> -f blockB_src_set_1.f -


endlib

-makelib blockB_lib –L pkglib <blockB_opt_set_1> -f blockB_src_set_2.f –


endlib

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.

1. vlog –work blockA_lib –L pkglib <blockA_opt_set> –f blockA_src.f

2a. vlog –work blockB_lib –L pkglib <blockB_opt_set_1> -f


blockB_src_set_1.f

2b. vlog –work blockB_lib –L pkglib <blockB_opt_set_1> -f


blockB_src_set_2.f

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:

1. Begin an option group with the operation you want to perform


2. Provide a list of options

22 Questa® SIM Qrun User’s Manual, v2022.1

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

3. Terminate the option group with an -end statement.


The following are examples for the -makelib and -filemap option groups.

-makelib <library> <files> <options> -end|-endlib


-filemap <options> <files> -end|-endfile

For example:

qrun -makelib mylib *.v -end

In the previous command, there are three sub-arguments to the -makelib option group. In turn,
qrun invokes the following commands:

vlib -quiet qrun.out/mylib


vmap -c -quiet mylib qrun.out/mylib

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

Location of the Top Module


The qrun command can usually locate the top level module for simulation even if you do not
provide a name and location.
However, some test benches contain many top level modules or architectures, so it is good
practice to manually specify a top module. To specify the top module, use the -top argument as
in:

qrun -top top

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.

Questa® SIM Qrun User’s Manual, v2022.1 23

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

VHDL Compilation Order with the -autoorder


Argument
The qrun -autoorder argument determines the proper compilation order of VHDL design units,
independent of the order that you listed the files on the command line. Autoorder is turned on by
default. To turn off autoordering, use the -noautooder argument. If you use -noautoorder, you
must list VHDL files in their proper compilation order on the qrun command line.
When you use the -noautoorder argument within an option argument such as -makelib it only
applies to the option. In this case, the -noautoorder argument only applies to any files listed in
the options argument. In the following command example, qrun applies the -noautoorder
argument only to the files specified in the option group -makelib. For example:

qrun -makelib ./mylib -noautorder ./src/*.vhd -endlib


counter.vhd test.vhd

Autoorder is on by default for the files counter.vhd and test.vhd.

Directing Tools to Run Specific Arguments


Qrun dispatches all arguments to the appropriate tools. There are circumstance, however, when
you want to explicitly direct a particular argument to a specific tool. For example, vsim, vlog,
and vopt do not create their own log files by default. You can use the tools to create their own
specific log files.
The command to only generate a vsim log file is:

qrun -vsim.l my_sim_logfile …"

In the previous command, qrun disptaches to vsim the argument “-l my_sim_logfile”.

The syntax to direct a singular argument to a specific tools is:

<-|+><tool>.<tool option>

where tool is vlog, vcom, vopt, vsim, or sccom.

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.

qrun -vlog.pedantic a.sv b.vhd

The syntax for applying multiple options for a tool is the following. It is also an option group.

-<tool>.options -opt1 -opt2 +op3 ... -end

24 Questa® SIM Qrun User’s Manual, v2022.1

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:

qrun -vlog.options -pedantic - ... -end

Debugging with the qrun -script and -env


Arguments
The qrun -script and -env arguments allows it to capture all the commands and all environment
settings when invoked.
• -script <filename> — Produces a listing of every tool command and its arguments
invoked by qrun for a particular command line invocation
• -env <filename> — Performs the same actions as the -script argument and lists all of the
currently available window/terminal environment settings and variables
Using the hello.sv example, you get a listing of all the commands invoked by qrun:

qrun hello.sv -script csh.run -clean -top top

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:

qrun *.v –coverage +cover=secb –script t.csh –top testbench

You can append the -script <filename> argument to the command line to view what commands
qrun invoked:

qrun *.v –coverage +cover=secb –top testbench -script myscript_output

Questa® SIM Qrun User’s Manual, v2022.1 25

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

The file myscript_output contains a listing of the commands invoked by qrun:

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 -coverage -do 'coverage save -onexit
cov_$Sv_Seed.ucdb'
-do 'run -all; quit -f' qrun_opt

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

Converting a Makefile or Transcript File to a


qrun Command
You may want to convert existing makefiles to a qrun command for ease of use and future
updates. You can also convert transcript files to a qrun command.
Prerequisites
• An existing makefile or QuestaSIM transcript file.
Procedure
1. Capture the output of “make –n <target>” and put into a *.f file.
2. Replace any instances of the vlib and vmap commands with –makelib … -lib arguments
or remove them because qrun creates a work library.
3. Replace –l <logfile> with –tool.l <logfile> to generate tool specific log files.
4. Put “-top” before the top level DUT.

26 Questa® SIM Qrun User’s Manual, v2022.1

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

5. Remove the top-level DUT from the vsim command line.


6. Remove –visualizer or the –gui arguments and replce them with –visualizer and –
gui=interactive arguments.
7. Remove the tool names (vlog, vopt, etc) from the qrun command lines.

Note
Do not remove their arguments.

Overriding Default Arguments


You can override any default setting by explicitly specifying the argument on the qrun
command line. You are not required to specify the tool. Qrun knows which tool to pass the new
setting.

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.

Following shows the use of -access and visualizer with PDUs.

Questa® SIM Qrun User’s Manual, v2022.1 27

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

// Create library lib1 in qrun.out and compile all source into it


//+define+DISPLAY_ON
//+define+LONG_TEST
-makelib lowerLibs
lower_mods.sv
-end

-makelib lib1
top.sv test1.sv test2.sv test3.sv
-end

// Create a PDU from module m1 in lib1


-makepdu m1_opt_pdu lib1.m1
-L lowerLibs

// Add design access


-access=rw+m1/u2/u2/m1_bot2_reg
// Create a visualizer design.bin file for the PDU
-designfile m1_opt_design.bin -debug-end

// Create a PDU from module m2 in lib1


// This PDU will be a "blackbox" in Visualizer since we don't generate
// a design.bin for this PDU
-makepdu m2_opt_pdu lib1.m2
-L lowerLibs
-end

-top top
-do "run -all"

// Invoke visualizer in live simulation mode


-gui -visualizer

Qrun Command History


The qrun command keeps a history of all commands within a given qrun.out directory. In
addition, you can use the -history argument to look up and replay commands.
The syntax of the -history swich is:

qrun -history<=Num>>+redo

The following shows a simple example of using the -history switch.

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

Run qrun -history to show the second executed command.

qrun -history=2
2 14:50 qrun b.vhd c.sv

28 Questa® SIM Qrun User’s Manual, v2022.1

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

Qrun Command Line Help


Qrun contains an extensive command line help feature.
The basic syntax for the help feature is:

qrun -help [option]

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.

qrun -help all

The following command shows how to list all the categories of command types:

qrun -help

Produces:

General List most common general options


Compiler List options for compiler, and optimizer controls
Design List options for design units, and libraries
File List options for file and option specifications
Flow List options for Flow (Coverage, PA, Debug, ...)
Messages List all warn, error, note, fatal messages options
Script List options for scripts, environment, history, and log
Subgroup List options for handle grouping files and options
SystemC List options supporting for SystemC

Get help listing of all commands within a Flow category:

qrun -help Flow

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:

qrun -93 -coverage -help

The previous command issues the following. Note that the qrun help identifies every tool
associated the switch.

Questa® SIM Qrun User’s Manual, v2022.1 29

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

30 Questa® SIM Qrun User’s Manual, v2022.1

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

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

Pre-Built Qrun Simulation Methodology Flows


The qrun command contains a number of predefined flows to implement various simulation
methodologies. With these predefined flows, you are not required to put together switches for
tools such as vlog or vsim. The qrun command applies the arguments to the underlying tools to
create the methodology flow.
The following figure shows different verification methodologies. The qrun flows use the
underlying tools without complex setup.

Questa® SIM Qrun User’s Manual, v2022.1 31

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

Figure 3-1. Types of Verification Methodologies

Table 3-1. Qrun Supported Flows


Flow Information Flow Switches and Options
GUI flow -gui[=int[eractive]|postsim]
• The –gui switch tells qrun to bring up the GUI in
interactive or postsim mode.
• –gui=postsim only brings up the GUI in postsim mode.
Qrun will not compile, optimize, or simulate the
design.
• The default is to bring up the Questa classic gui in
interactive mode.
• If -visualizer is on the command line, qrun opens the
Visualizer GUI with the appropriate database files.
Coverage Flow -coverage
• Collects coverage and creates a UCDB file.
• Allows enabled coverage statistics to be collected.
Debug Flow -debug[,<livesim|cell|etc>+]
• Launches QuestaSIM GUI or Visualizer. Passes
appropriate debugging flags to all tools,
• The –debug switch adds different options to the tool
command lines based on which GUI is selected.

32 Questa® SIM Qrun User’s Manual, v2022.1

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

Table 3-1. Qrun Supported Flows (cont.)


Flow Information Flow Switches and Options
C (language) Debug Flow -cdebug
• Passes appropriate 'C' debugging flags to vlog.
• Add –g to the C/C++ compilers and –ccflags –g to all
the vlog command lines, and –g sccom command
lines.
UVM Flow UVM
• Allows you to select which UVM version or source
code to use.
• Automatically includes required +incdir switches.
Compiles uvm_dpi.cc.
Visualizer Flow -visualizer[=designfile_name]
• The default GUI is the Questa Classic GUI. If the
visualizer switch is used on the qrun command line,
then qrun uses the options associated with Visualizer
in both postsim and interactive modes.
You can invoke either the QuestaSIM Classic GUI or Visualizer in interactive or postsim mode.
Qrun automatically sets all switches that are necessary to capture the relevant debug
information. In interactive mode, the GUI invokes at the command prompt so you can log any
necessary signals and set breakpoints.

In the following command, the qrun command invokes the Visualizer tool in post-simulation
mode with all the generated Visualizer debug databases.

qrun test.sv gui= postsim –visualizer

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.

qrun –designfile mydesign.bin -qwavedb=+memory –visualizer –gui=interactive

You can use the following command to enable the coverage flow with qrun.

qrun test.sv -coverage

The following transcript demonstrate a coverage flow. You are not required to supply the
arguments on the command line.

Questa® SIM Qrun User’s Manual, v2022.1 33

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:

qrun test.sv -gui

Forcing a Verification Flow Step


Qrun gives you the option of forcing three steps of the verification flow: compile, optimization,
and simulation.
Prerequisites
• A legal SystemVerilog file with the name test.sv. Use one of the three options below.
Procedure
1. Issue the following command to force qrun to stop after the compile step.
qrun test.sv -compile

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.

34 Questa® SIM Qrun User’s Manual, v2022.1

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 qrun command goes directly to simulation if the following is true:

• 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.

Qrun and Setting Up Regressions


Using arguments for controlling qrun’s invocation of the compile, optimize, and simulate steps,
you can use qrun to run regression tests.
In the following examples, all source files and compile, optimization, and simulations switches
are contained in a qrun.f file. Use the –snapshot argument to name the compile/optimize output.
It is also used to indicate which snapshot to simulate.

One method to using qrun to control regression tests is as follows:

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>]

An extended example follows:

# Clean up qrun output files


qrun -clean

# Compile and optimize the design and testbench


qrun -f qrun.f -optimize -snapshot rtl_sims -nosva +notimingchecks
+nospecify

# Run the simulations


qrun -simulate -snapshot rtl_sims +UVM_TESTNAME=test1
qrun -simulate -snapshot rtl_sims +UVM_TESTNAME=test2 -sv_seed 500
qrun -simulate -snapshot rtl_sims +UVM_TESTNAME=test2 -sv_seed 25
qrun -simulate -snapshot rtl_sims +UVM_TESTNAME=test2 -sv_seed 1255

Questa® SIM Qrun User’s Manual, v2022.1 35

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".

Mixed Language Compilation and Simulation


The qrun command compiles VHDL-Verilog/SystemVerilog and VHDL-SystemC designs with
no package sharing in a specific order. This package sharing ensures that a VHDL design can
support entity instantiation of design units of the other language.

36 Questa® SIM Qrun User’s Manual, v2022.1

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

The qrun command compiles VHDL-Verilog/SystemVerilog and VHDL-SystemC designs with


no package sharing in the following order.

1. All SystemC files


2. All Verilog and SystemVerilog files
3. All VHDL files
This package sharing ensures that a VHDL design can support entity instantiation of design
units of the other language.

If you need Verilog or VHDL files compiled at an earlier point, you can use the -precompile
argument whose syntax is:

-precompile [<library>] <files and options> [-end]

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.

qrun -precompile test1.vhd -mixedsvvh -end test1.sv

You can define macros available for use by all C, C++, SystemC, Verilog and SystemVerilog
programs using the -defineall argument, whose syntax is:

qrun -defineall <macro_name>[=<macro_value>]

For example:

qrun -defineall foo


qrun -defineall MAXWIDTH=32

Questa® SIM Qrun User’s Manual, v2022.1 37

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

38 Questa® SIM Qrun User’s Manual, v2022.1

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

Questa® SIM Qrun User’s Manual, v2022.1 39

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/

40 Questa® SIM Qrun User’s Manual, v2022.1

Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Reference
qrun

vlog files, options> -end|-endlib] [-precompile [libpath[:logical]] <vcom/vlog files,


options> -end] [-reflib <library>] [-refreshlibs]
SystemC
[-scgenmod <options> <design unit> <output file> -end] [-sclink <arguments> -end] [-sysc
<sccom source files> <sscom options> -end]
Arguments
• -32 | -64
Run in 32 or 64 bit mode.
• -autocheck
Enable autocheck for Formal flow.
• -autoorder
Perform an -autoorder compilation on all -makelib subgroups.The argument compiles
VHDL files in the proper order regardless of the order specified on the command line.
Source files outside -makelib subgroups can be specified in any order. This feature is turned
on by default and does not need to be specified. The argument -noautoorder turns off this
feature.
• -cdc
Enable cdc flow.
• -cdebug
Pass appropriate “c” debugging flags to vlog and sccom.
• -clean
Removes the directory qrun.out or the directory specified with the -outdir argument. The -
clean argument cleans the content of the output sub-directory related to this run of qrun. The
sub-directory will be <output_dir>/<platform>_<version>.
• -cleanlib
Removes libraries. The -cleanlib argument only cleans the library and leaves behind the
history and other files.
• -compile
Compile the design without optimization or running a simulation.
• -covercheck
Enable covercheck flow for Formal flow.
• -coverage
Enables the coverage flow.
• -cuname <file>
Specify CU name

Questa® SIM Qrun User’s Manual, v2022.1 41

Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Reference
qrun

• -debug, <arg>, <arg>, ...


Pass appropriate debugging flags to all tools.
• -defaultext=<tool>
Specify file extensions for default language.
• -defineall <macro[= value]>
Define <macro> for all compilers. The -defineall argument provides a way to provide a
single definition of a macro to be available in all of these languages: - C, C++, SystemC,
Verilog and SystemVerilog.
• -designfile <bin-filename>
Specifies the name of the Visualizer design.bin file.
• -env <filename> [<format>]
Store the commands and the current environment in filename. The format argument is in the
style of printf with two '%s' specifiers. The first '%s specifier is for the name, and the second
for the value. You must put quotes around filename and format. For example:
qrun test.sv -env "myenv(setenv %s %s )"

• -error <msgNumber>[,<msgNumber> ...]


Reported the listed messages as errors.
• -f | F <optionfile>
This '-f file' argument causes qrun to read arguments from the specified file. The syntax of
the file is same as described in the QuestaSIM Reference Manual.
• -fatal <msgNumber>[,<msgNumber> ...]
Report the listed messages as fatal.
• -filemap <vcom/vlog files, arguments> -endfilemap
Compile the Verilog and VHDL files with the given arguments. You can terminate the
argument list using -end also. You cannot use +define statements using -filemap.
• -fx
Specify FX generation (cdc generate fx).
• -genucdb [filename]
Specify ucdb file name
• -goal
Specify goal (ignore goal if methodology not specified)
• -gui[=interactive | postsim]
Specific mode in which to bring up the GUI. If postsim, then qrun will not compoile,
optimize, or simulate.

42 Questa® SIM Qrun User’s Manual, v2022.1

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.

Questa® SIM Qrun User’s Manual, v2022.1 43

Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Reference
qrun

The -stat arguments is not allowed within -makelib


• -makepdu <pdu_name> [/path/to/lib.]<du_name> <options> -end
Optimize the desired design units into a PDU called 'output'.
o The “lib.” prefix to <du_name> is the library to read the DU from.
• lib can be a logical name or a physical path to the library
o Vopt requires that the PDU be written into the same library that the DU is read from
• The PDU will use the value of "lib." to determine the library that is is written to.
o makepdu/end commands can be mixed with other non-pdu compile, optimization,
and simulation commands.
• qrun will create the PDU's in separate vopt invocations .
• A toplevel vopt will be run to bring all the PDU's and non-pdu DU's together.
• Subsequent qrun invocations will skip the PDU generation steps if there are no
source/switch changes.
• --methodology
Specify methology and goal.
• -note <msgNumber>[,<msgNumber> ...]
Report the listed messages as notes.
• -o <design_unit>
Specify optimized output design name.
• -od
Specify output directory for qverify.
• -optimize
Compile and optimize the design. Does not simulate the design. When you specify this
argument, qrun compiles the source files provided on the command line, and then the design
by calling vopt. If the design has been optimized previously, then qrun will call vopt only if
the design or the arguments have not changed since the last optimize step.
• -outdir <directory>
Store libraries and data in the specified directory instead of the default directory qrun.out.
By default qrun creates an output directory qrun.out if one does not exist in the current
directory. When you use the -outdir argument, qrun creates and uses the output directory
specified by the -outdir argument.
• -parallel
Use parallel compilation where it can be used.

44 Questa® SIM Qrun User’s Manual, v2022.1

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.

Questa® SIM Qrun User’s Manual, v2022.1 45

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.

46 Questa® SIM Qrun User’s Manual, v2022.1

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

Questa® SIM Qrun User’s Manual, v2022.1 47

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.

48 Questa® SIM Qrun User’s Manual, v2022.1

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.log vlog.log -vcom.log vcom.log -vopt.log vopt.log ...

Invoke Visualizer on a SystemVerilog design.

qrun *.sv -gui -visualizer

Apply the -pedantic switch only to Verilog files:

qrun -vlog.pedantic a.sv b.vhd

Run vsim -c -suppress 12110 using the qrun command.

qrun -vsim.c -vsim.suppress 12110 ...

Apply the +cover argument to vlog only.

qrun +vlog.cover+bcs...

Compile file1.vhd and file2.vhd into the library "mylib" with argument. -93.

qrun -compile -93 -makelib mylib file1.vhd file2.vhd -endlib

Compile files specified in mylib_files.txt into library "mylib" with arguments from -f file and -
93.

qrun -compile -93 -makelib mylib -f mylib_files.txt -endlib

This command specifies a custom source file extension .myvhdl for the VHDL files specified in
the -makelib collection libvhdl.

qrun -makelib libvhdl -vhdl_ext +.myvhdl bar.myvhdl -endlib tb_top.vhd

Questa® SIM Qrun User’s Manual, v2022.1 49

Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Qrun Command Reference
qrun

Specifying aphysical library for -makelib.

qrun -makelib /usr1/myarea/gates buf.v and2.v -endlib

The -history switch with output.

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

Run qrun -history to show the second executed command.

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

The previous command produces:

sccom -link -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.

qrun -filemap -mixedsvvh <list of VHDL and SV packages> -end

50 Questa® SIM Qrun User’s Manual, v2022.1

Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.

You might also like