| |
通常一个典型的NC仿真命令是这样的:
irun -sv -access rwc
*.sv -define rtl_sim -input run.tcl&
其中-access rwc 表示NC生成的波形是可读可写可连接的,如果要开波形,必须加这个选项;
-input run.tcl表示你需要传递进来一个tcl文件来控制仿真,例如想为Verdi
dump fsdb文件而又不想放在TB里做。我的一个典型run.tcl是这样的:
call fsdbDumpfile tb_top.fsdb
call fsdbDumpvars 0 tb_top
run
exit
irun: 12.20-s029: (c) Copyright 1995-2014 Cadence Design
Systems, Inc.
Usage:
irun
[options] files
File languages: verilog, SystemVerilog, Vhdl, e, System-C, C,
C++
In addition to the dash options all ncverilog
plus options can be used.
Options shown below in lowercase can also be
entered in uppercase.
For example, both -top and -TOP are valid.
If you
need more information about an option listed below, use the search
facility
in the online help system. In the "Search for" text box,
enter
the name of the option, including the dash.
The dash must be escaped.
(\-profile, for example)
-helpall Display all supported option
-helphelp Print out all the options
controlling help
-helpsubject
<subject> Display help on the
specified subject
-helpshowsubject Show
all the subjects for -helpsubject
-64bit Invoke 64bit version
-gui Invoke the Graphical
User Interface
-q Suppress informational
messages(i.e., Quiet mode)
-f
<filename> Scan file
for args relative to irun invocation
-elaborate Parse and elaborate, do NOT
simulate
-R Simulate using the
last ncelab generated snapshot
-incdir
<dirs> Specify
directories to search for `include files
-v <file> Specify a library file to be
used
-y <directory> Specify a library directory to be
used
-libext
<ext> Specify
extensions to be used for the -y search
-top
<lib.cell:view> Specify the
top-level unit
-l
<filename> Set logfile
name
-access
<+/-rwc> Turn on read, write and/or connectivity
access
-input
<file> Read TCL
commands from file
-define
<macro> Define a macro
from command line
-pragma Enable pragma processing
-gateloopwarn Enable potential zero-delay gate loop warning
-coverage
<string> Enable coverage
instrumentation
-assert Enable PSL language
features
-nospecify Suppress timing information
from specify blocks
-extbind <arg> Option for SV binds in textfile.
-parseinfo
include=<du> Enable verbose
information for tick-include
Example commands to invoke irun
irun sio85.v
irun xor.v bot.vhd
xor_verify.e
irun -f run.f
irun a.v b.v c.vhd
-c
irun -R -input
commands.tcl
irun -helpsubject
specman
Nc-verilog仿真工具可以通过参数向测试环境传递参数,我猜测这样做的好处是可以不必重新编译。具体做法是在ncsim这个命令选项后加参数,例如:
ncsim +test_num=5 +num_events=40000 top
然后在testbench中可以这样把两个变量传递进来:
if($value$plusargs("test_num=%d", test_num))
$display
("Running test number %d",test_num);
if($value$plusargs("num_events=%d", num_events))
$display
("Running %d number of events",num_events);