VCS RTL Verification
VCS 数字逻辑仿真器和VCS MX混合HDL语言仿真器都是Synopsys的智能RTL验证解决方案的基石。VCS是业界领先的仿真器,支持本征断言(native assertion)描述、自动测试平台生成技术(testbench)、以及代码和断言覆盖引擎,确保智能化验证的实现。VCS中本征代码支持 (Native)技术确保了设计验证的效率、性能和质量,并缩短了验证周期。VCS中的本征代码技术实现了在单一工具中,支持可验证性设计(DFV),及 覆盖率驱动和约束的随机激励生成。其本征对断言的支持和所包含的丰富的断言检查工具库保证了设计人员能够方便地采用DFV技术来查找错误和提高验证质量。 此外,断言可以作为设计要求重复利用,在Synopsys的混合RTL规则验证产品Magellan中进行形式验证。
VCS对专用集成电路(ASIC)生产商的建模和仿真签核(Sign-off)提供了支持。
VCS对统一的设计和验证语言标准SystemVerilog提供支持。SystemVerilog增强了设计人员的能力,加快了验证速度并提高了验证的质量。
对于要求在RTL环境中使用SystemC模型进行验证的设计团队,VCS提供了支持OSCI SystemC的直接内核接口(DKI)和支持System Studio的直接内核接口(DKI)。
主要优点:
- 本征测试平台(testbench)、断言和完备的覆盖率测试技术,为Verilog 和混合HDL验证带来2-5倍的性能提升
- 为SystemVerilog设计和基于断言的验证提供支持,确保更高的设计和验证效率
- 提供最高的性能和容量,加快产品上市周期
- 通过集成NanoSim实现了具有最高处理能力的混合信号仿真环境
- 采用单个统一工具,实现Verilog和混合HDL RTL及SystemC的支持
- 支持所有主要的UNIX和Linux平台
VCS快速参考
1. Unix环境设置:
C-Shell
setenv VCS_HOME /usr/synopsys/vcs
if (-e ${VCS_HOME}/bin/environ.csh) then
source ${VCS_HOME}/bin/environ.csh
endif
if (-e ${VCS_HOME}/bin/environ.csh) then
source ${VCS_HOME}/bin/environ.csh
endif
Bourne-shell/Korn-shell
VCS_HOME=/usr/synopsys/vcs
export VCS_HOME
. ${VCS_HOME}/bin/environ.sh
export VCS_HOME
. ${VCS_HOME}/bin/environ.sh
2. 执行仿真:
# show_setup: display settings frome synopsys_sim.setup
# vlogan: 分析Verilog源文件,解析模块中的各个reference
vlogan [options] verilog_files
Options are as follows:
verilog_source_fileis the name of the Verilog source file to be analyzed+define+macrodefines any macros needed for ‘ifdef conditions defined in theVerilog source.-f filenameReads a file, filename, and passes all arguments from that file onto the vlogan command line.-l logfileRedirects all output from vlogan into the specified logfile.-qDisables verbose messaging.-v library_fileSearches for unresolved module references in file library_file-y search_dirSearches for unresolved module references in the directorysearch_dir+libext+extUses the extension ext when searching library directories-work logical_librarySpecifies the VHDL logical library to place the Verilog modulesinto. Any VHDL source that instances this Verilog code canreference this VHDL library to find the module.-resolveBy default, vlogan does not resolve instantiated VHDL designunits. This option tells vlogan to resolve VHDL design units aswell. If this option is not used, any VHDL design units areresolved during compilation.-sverilogEnables the analysis of SystemVerilog source code+vhdllib+libsSearch libraries for VHDL components in case they wereanalyzed in library other than “WORK”.(use with -resolve)+reflib+libsSearch libraries for Verilog components in case they wereanalyzed in library other than “WORK”. (use with -resolve).+librescanSearch from beginning of library list for all undefined Verilogmodules.+notimingchecksSpecifies no timing simulation (used for parsing only)+nospecifySpecifies no path delays (used for parsing only)
# vcs: 编译设计并生成仿真可执行文件,默认叫做simv
vcs <source_files> [libname.]design_unit [options]
Options are as follows:
+v2kEnables the use of new Verilog constricts in the 1364-2001standard.-full64Compiles the design in 64 bit mode and creates a 64 bitexecutable for simulating in 64 bit mode.-cm_libs yv|celldefineSpecifies compiling for coverage source files in Verilog librarieswhen you include the yv argument. Specifies compiling forcoverage module definitions that are under the ‘celldefinecompiler directive when you include the celldefine argument.You can specify both arguments using the plus (+) delimiter.+cli+[module_name=]1|2|3|4Enable CLI debugging.1 enables you to see the values of nets and registers and depositvalues to registers.2 also enables breakpoints on value changes of nets and registers.3 also enables you to force a value on nets.4 also enables you to force a value on a register.You can specify a module to enable CLI debugging only forinstances of the module.-lineEnables stepping through the code and source line breakpoints inDVE.+vpiEnables the use of VPI PLI access routines.-sverilogEnables the analysis of SystemVerilog source code-ntb_opts keyword_argumentThe keyword arguments are as follows:checkReports error, during compilation or simulation, when there isan out-of-bound or illegal array access.dep_checkEnables dependency analysis and incremental compilation.Detects files with circular dependencies and issues an errormessage when VCS cannot determine which file to compilefirst.no_file_by_file_ppBy default, VCS does file by file preprocessing on each inputfile, feeding the concatenated result to the parser. Thisargument disables this behavior.print_deps[=filename]Enter this argument with the dep_check argument. Thisargument tells VCS to display the dependencies for the sourcefiles on the screen or in the file that you specify.tb_timescale=valueSpecifies an overriding timescale for the testbench. Thetimescale is in the Verilog format (for example,10ns/10ns).use_sigpropEnables the signal property access functions. (for example,vera_get_ifc_name()).vera_portnameSpecifies the following:The Vera shell module name is named vera_shell.The interface ports are named ifc_signal.Bind signals are named, for example, as: \if_signal[3:0].You can enter more than one keyword argument, using the +delimiter, for example:-ntb_opts use_sigprop+vera_portname+nospecifySpecifies no path delays (used for parsing only)-override_timescale=time_unit/time_precisionOverrides the time unit and a precision unit for all the‘timescale compiler directives in the source code and,like the -timescale option, provides a timescale for allmodule definitions that precede the first ‘timescalecompiler directive. Do not include spaces when specifyingthe arguments to this option.-assert keyword_argumentThe keyword arguments are as follows:dumpoffDisables the dumping of SVA information in the VPD fileduring simulation.filterBlocks reporting of trivial implication successes. Thesehappen when an implication construct registers a success onlybecause the precondition (antecedent) portion is false (and sothe consequence portion is not checked). With this option,reporting only shows successes in which the whole expressionmatched.finish_maxfail=NTerminates the simulation if the number of failures for anyassertion reaches N. N must be supplied, otherwise no limit isset.global_finish_maxfail=NStops the simulation when the total number of failures, fromall SystemVerilog assertions, reaches N.maxcover=NDisables the collection of coverage information for coverstatements after the cover statements are covered N number oftimes. Nmust be a positive integer, it can’t be 0.+incdir+directory+Specifies the directories that contain the files you specified withthe ‘include compiler directive. You can specify more that onedirectory, separating each path name with the “+” character.-y directory_pathnameSpecifies a Verilog library directory to search for moduledefinitions.+define+macro_name=value+Defines a text macro. Test for this definition in your Verilogsource code using the ‘ifdef compiler directive.-cm line|cond|fsm|tgl|pathSpecifies compiling for the specified type or types of coverage.The arguments specifies the types of coverage:lineCompile for line or statement coverage.condCompile for condition coverage.fsmCompile for FSM coverage.tglCompile for toggle coverage.pathCompile for path coverage.-cm_noconstTells VCS not to monitor for conditions that can never be met orlines that can never execute because a signal is permanently at a 10r 0 value.-cm_cond argumentsModifies condition coverage as specified by the argument orarguments:basicOnly logical conditions and no multiple conditions.stdThe default: only logical, multiple, sensitized conditions.fullLogical and non-logical, multiple conditions, no sensitizedconditions.allopsLogical and non-logical conditions.eventSignals in event controls in the sensitivity list position areconditions.anywidthEnables conditions that need more than 32 bits.sopSpecifies condition SOP coverage. It also tells VCS that whenit reads conditional expressions that contain the ^ bitwiseXOR and ~^ bitwise XNOR operators, it reduces theexpression to negation and logical AND or OR.forEnables conditions in for loops.tfEnables conditions in user defined tasks and functions.You can specify more than one argument. If you do use the + plusdelimiter between arguments, for example:-cm_cond basic+allops-cm_tgl mdaEnables toggle coverage for Verilog 2001 multidimensionalarrays and SystemVerilog unpacked arrays. Not requires forpacked SystemVerilog arrays.-P pli.tabSpecifies a PLI table file.+libext+extensionSpecifies that VCS only search the source files in a Veriloglibrary directory with the specified extension. You can specifymore than one extension, separating each extension with the “+”character. For example, +libext++.v specifies searches libraryfiles with no extension and library files with the .v extension.Enter this option when you enter the -y option.-v filenameSpecifies a Verilog library file to search for module definitions.
# simv: 启动一个simulation session.
simv [options]
Options are as follows:
-cm line|cond|fsm|tgl|path|assertSpecifies monitoring for the specified type or types of coverage.The arguments specifies the types of coverage:lineMonitor for line or statement coverage.condMonitor for condition coverage.fsmMonitor for FSM coverage.tglMonitor for toggle coverage.pathMonitor for path coverage.branchMonitor for branch coverage.assertMonitor for SystemVerilog assertion coverage.If you want VCS to monitor for more than one type of coverage,use the plus (+) character as a delimiter between arguments, forexample:-cm line+cond+fsm+tgl-cm_name filenameSpecifies the name of the report files.
一个例子:
vcs
+v2k
-full64
-cm_libs yv
+cli
+
3
-line
+vpi
-sverilog
-ntb_opts dtm \
-notimingchecks +nospecify -override_timescale = 1ns / 10ps \
-assert vpiSeqFail -assert enable_diag +define +ASSERT_ON \
+incdir + /home /tools_new /synopsys /VCS -D - 2010. 06_AMD64 /packages /sva +
-y /home /tools_new /synopsys /VCS -D - 2010. 06_AMD64 /packages /sva \
+define +DEBUG_OPTION +define +MAX_ERR_NUM = 10000 -cm_noconst -cm_cond full -cm_tgl portsonly \
-P /home /tools_new /novas /Novas2010_verdi /share /PLI /vcs2006. 06 /LINUX64 /debussy.tab \
/home /tools_new /novas /Novas2010_verdi /share /PLI /vcs2006. 06 /LINUX64 /pli.a \
+libext +.v +
+incdir + ~ /project /Berry /vmodel /common /rtl + ~ /project /Berry /vmodel /common /tb + ~ /project /Berry /vmodel /vdu /tb ~ /project /Berry_gen /vmodel /vdu /tb + \
-y ~ /project /Berry /vmodel /common /rtl
-y ~ /project /Berry /vmodel /common /tb
-y ~ /project /Berry /vmodel /vdu /rtl
-y ~ /project /Berry /vmodel /vdu /tb
-y ~ /project /Berry_gen /vmodel /vdu /tb
-y ~ /project /Berry /vmodel /mbist /rtl \
-y /home /tools_old /Misc /Xilinx /ISE_DS /ISE /verilog /src /unisims \
-v /home /TSMC /TSMC -CL013G /SC_metro_fb_060907 /aci /sc -m /verilog /tsmc13_m.v \
/home /tools_old /Misc /Xilinx /ISE_DS /ISE /verilog /src /glbl.v
~ /project /Berry /vmodel /vdu /tc /vdu_unit_960h_03.v
-file ~ /project /Berry /vmodel /vdu /scripts /vcs_option
## file: vcs_option
-notimingchecks +nospecify -override_timescale = 1ns / 10ps \
-assert vpiSeqFail -assert enable_diag +define +ASSERT_ON \
+incdir + /home /tools_new /synopsys /VCS -D - 2010. 06_AMD64 /packages /sva +
-y /home /tools_new /synopsys /VCS -D - 2010. 06_AMD64 /packages /sva \
+define +DEBUG_OPTION +define +MAX_ERR_NUM = 10000 -cm_noconst -cm_cond full -cm_tgl portsonly \
-P /home /tools_new /novas /Novas2010_verdi /share /PLI /vcs2006. 06 /LINUX64 /debussy.tab \
/home /tools_new /novas /Novas2010_verdi /share /PLI /vcs2006. 06 /LINUX64 /pli.a \
+libext +.v +
+incdir + ~ /project /Berry /vmodel /common /rtl + ~ /project /Berry /vmodel /common /tb + ~ /project /Berry /vmodel /vdu /tb ~ /project /Berry_gen /vmodel /vdu /tb + \
-y ~ /project /Berry /vmodel /common /rtl
-y ~ /project /Berry /vmodel /common /tb
-y ~ /project /Berry /vmodel /vdu /rtl
-y ~ /project /Berry /vmodel /vdu /tb
-y ~ /project /Berry_gen /vmodel /vdu /tb
-y ~ /project /Berry /vmodel /mbist /rtl \
-y /home /tools_old /Misc /Xilinx /ISE_DS /ISE /verilog /src /unisims \
-v /home /TSMC /TSMC -CL013G /SC_metro_fb_060907 /aci /sc -m /verilog /tsmc13_m.v \
/home /tools_old /Misc /Xilinx /ISE_DS /ISE /verilog /src /glbl.v
~ /project /Berry /vmodel /vdu /tc /vdu_unit_960h_03.v
-file ~ /project /Berry /vmodel /vdu /scripts /vcs_option
## file: vcs_option
-CFLAGS "-g -ggdb -daH -I$$VCS_HOME/include -I$APL_SRC/vmodel/vdu/tb -I$APL_SRC/cmodel/vdu "
$APL_SRC/vmodel/vdu/tb/vdu_dpi.c
$APL_SRC/cmodel/vdu/blz_vdu_glbvar.c
...
simv
+tc
=vdu_unit_960h_03
+seed
=
20060407
+notimingcheck
+dumpon
=
1
+dumpend
=
-
1
+dumpbgn
=
0
+dumpmodule
=all
+noclkgate
=
0
+gate
=
0
-assert report
=sva.rpt
-assert quiet
0
-assert nopostproc
-cm_name vdu_unit_960h_03_20060407
-cm
-cm_noconst
| tee vcs_sim.log
3. PLI Table的格式:
# 每行内容如下格式:
$name PLI_specifications [ACC_capabilities]
其中:
$name 用户定义的系统任务或系统函数
PLI_specifications 指定运行时,VCS调用的C函数
ACC_capabilities 需要加入,移除或在不同hierarchy间改变的ACC功能
# PLI指定:
格式如下:call=functioncheck=functionmisc=functiondata=integersize=numberargs=nocelldefineplipersistent
# ACC功能:
acc=(+=)|-=|:=capibities:module_name[+]|%CELL|%TASK|*其中:acc 关键字=(+=)|-=|:= add/remove/changecapibilities 冒号分隔PLI函数可用的ACC功能:r/readrw/read_writecbk/call_back...# VCS配置文件可用来指定对设计的每个部分采用Radiant technology optimization 和 two state simulation.文件语法如下:module{list_of_module_identifiers} {list_of_attributes};instance{list_of_module_identifiers} {list_of_attributes};tree [(depth)]{list_of_module_identifiers} {list_of_attributes};Radiant technology的属性:noOptnoPortOptOptPortOpttwo state simulation的属性:2value4value
4. SCL和CLI命令:
# 仿真控制语言 SCL(Simulation Control Language):
查看命令用法
> help -verbose command_name
或:
> command_name -help
VCSMX中SCL是Tcl,包含了一些VCS MX专用的命令和变量。列举如下:
alias name definition
apropos ...
...
# 命令行接口 CLI(Command Line Interface)
. (period) 继续仿真
? 显示CLI命令简单描述
always #relative_time | [@posedge|@negedge]
break #...
...
5. Post Processing功能:
# vpd2vcd: 转换VPD输出到VCD输出
vpd2vcd [options] vpd_file [vcd_file]
# vcdiff: 比较两个VCD文件
vcdiff vcd_file1 vcd_file2 [options]
*附-关于VCS Basic
VCS初级版不包括以下功能:
1.
Testbench technology: SystemVerilog/OpenVera
2.
Assertion technology: SystemVerilog/OpenVera
3.
Coverage technology: code coverage(Coverage Metrics) / functional coverage(TB/Assertion)
4. Mixed signal simulation with NanoSim
如果设计源代码包含testbench/aasertion内容,VCS Basic报错并停止编译。
比如:
~ 用来报告OpenVera的assertions coverage的fcovReport功能,在VCS Basic中不被支持。
~ 用来报告SystemVerilog的assertions coverage的
assertCovReport功能,不支持。
~ 用来显示code coverage结果与打印报告的
cmView功能,不支持。
关于Licensing
VCS Basic需要与VCS不同的license.
禁用的Compile-Time选项
# SystemVerilog Assertion内容:-sverilog用于使能SystemVerilog内容,但是如果用于使能assertions内容就会报错。
-assert -sv_pragma
# Coverage Metrics:
-cm -cm_cond -cm...
# Mixed Signal Simulation
+ad
禁用的Run-Time选项
# SystemVerilog Assertion内容:
-assert -cm assert -cm_assert_dir
# Coverage Metrics
-cm -cm_dir ...