vcs rtl tool 簡介

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
 
Bourne-shell/Korn-shell
VCS_HOME=/usr/synopsys/vcs
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_file
is the name of the Verilog source file to be analyzed
+define+macro
defines any macros needed for ‘ifdef conditions defined in the
Verilog source.
-f filename
Reads a file, filename, and passes all arguments from that file on
to the vlogan command line.
-l logfile
Redirects all output from vlogan into the specified logfile.
-q
Disables verbose messaging.
-v library_file
Searches for unresolved module references in file library_file
-y search_dir
Searches for unresolved module references in the directory
search_dir
+libext+ext
Uses the extension ext when searching library directories
-work logical_library
Specifies the VHDL logical library to place the Verilog modules
into. Any VHDL source that instances this Verilog code can
reference this VHDL library to find the module.
-resolve
By default, vlogan does not resolve instantiated VHDL design
units. This option tells vlogan to resolve VHDL design units as
well. If this option is not used, any VHDL design units are
resolved during compilation.
-sverilog
Enables the analysis of SystemVerilog source code
+vhdllib+libs
Search libraries for VHDL components in case they were
analyzed in library other than “WORK”.(use with -resolve)
+reflib+libs
Search libraries for Verilog components in case they were
analyzed in library other than “WORK”. (use with -resolve).
+librescan
Search from beginning of library list for all undefined Verilog
modules.
+notimingchecks
Specifies no timing simulation (used for parsing only)
+nospecify
Specifies no path delays (used for parsing only)
 
# vcs: 編譯設計並生成仿真可執行文件,默認叫做simv
    vcs <source_files> [libname.]design_unit  [options]
    Options are as follows: 
+v2k
Enables the use of new Verilog constricts in the 1364-2001
standard.
-full64
Compiles the design in 64 bit mode and creates a 64 bit
executable for simulating in 64 bit mode.
-cm_libs yv|celldefine
Specifies compiling for coverage source files in Verilog libraries
when you include the yv argument. Specifies compiling for
coverage module definitions that are under the ‘celldefine
compiler directive when you include the celldefine argument.
You can specify both arguments using the plus (+) delimiter.
+cli+[module_name=]1|2|3|4
Enable CLI debugging.
1 enables you to see the values of nets and registers and deposit
values 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 for
instances of the module.
-line
Enables stepping through the code and source line breakpoints in
DVE.
+vpi
    Enables the use of VPI PLI access routines.
-sverilog
    Enables the analysis of SystemVerilog source code
-ntb_opts keyword_argument
The keyword arguments are as follows:
check
Reports error, during compilation or simulation, when there is
an out-of-bound or illegal array access.
dep_check
Enables dependency analysis and incremental compilation.
Detects files with circular dependencies and issues an error
message when VCS cannot determine which file to compile
first.
no_file_by_file_pp
By default, VCS does file by file preprocessing on each input
file, feeding the concatenated result to the parser. This
argument disables this behavior.
print_deps[=filename]
Enter this argument with the dep_check argument. This
argument tells VCS to display the dependencies for the source
files on the screen or in the file that you specify.
tb_timescale=value
Specifies an overriding timescale for the testbench. The
timescale is in the Verilog format (for example,
10ns/10ns).
use_sigprop
Enables the signal property access functions. (for example,
vera_get_ifc_name()).
vera_portname
Specifies 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
+nospecify
    Specifies no path delays (used for parsing only)
-override_timescale=time_unit/time_precision
Overrides 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 all
module definitions that precede the first ‘timescale
compiler directive. Do not include spaces when specifying
the arguments to this option.
-assert keyword_argument
The keyword arguments are as follows:
dumpoff
Disables the dumping of SVA information in the VPD file
during simulation.
filter
Blocks reporting of trivial implication successes. These
happen when an implication construct registers a success only
because the precondition (antecedent) portion is false (and so
the consequence portion is not checked). With this option,
reporting only shows successes in which the whole expression
matched.
finish_maxfail=N
Terminates the simulation if the number of failures for any
assertion reaches Nmust be supplied, otherwise no limit is
set.
global_finish_maxfail=N
Stops the simulation when the total number of failures, from
all SystemVerilog assertions, reaches N.
maxcover=N
Disables the collection of coverage information for cover
statements after the cover statements are covered number of
times. Nmust be a positive integer, it can’t be 0.
+incdir+directory+
Specifies the directories that contain the files you specified with
the ‘include compiler directive. You can specify more that one
directory, separating each path name with the “+” character.
-y directory_pathname
Specifies a Verilog library directory to search for module
definitions.
+define+macro_name=value+
Defines a text macro. Test for this definition in your Verilog
source code using the ‘ifdef compiler directive.
-cm line|cond|fsm|tgl|path
Specifies compiling for the specified type or types of coverage.
The arguments specifies the types of coverage:
line
Compile for line or statement coverage.
cond
Compile for condition coverage.
fsm
Compile for FSM coverage.
tgl
Compile for toggle coverage.
path
Compile for path coverage.
-cm_noconst
Tells VCS not to monitor for conditions that can never be met or
lines that can never execute because a signal is permanently at a 1
0r 0 value.
-cm_cond arguments
Modifies condition coverage as specified by the argument or
arguments:
basic
Only logical conditions and no multiple conditions.
std
The default: only logical, multiple, sensitized conditions.
full
Logical and non-logical, multiple conditions, no sensitized
conditions.
allops
Logical and non-logical conditions.
event
Signals in event controls in the sensitivity list position are
conditions.
anywidth
Enables conditions that need more than 32 bits.
sop
Specifies condition SOP coverage. It also tells VCS that when
it reads conditional expressions that contain the ^ bitwise
XOR and ~^ bitwise XNOR operators, it reduces the
expression to negation and logical AND or OR.
for
Enables conditions in for loops.
tf
Enables conditions in user defined tasks and functions.
You can specify more than one argument. If you do use the + plus
delimiter between arguments, for example:
-cm_cond basic+allops
-cm_tgl mda 
Enables toggle coverage for Verilog 2001 multidimensional
arrays and SystemVerilog unpacked arrays. Not requires for
packed SystemVerilog arrays. 
-P pli.tab
    Specifies a PLI table file. 
+libext+extension
Specifies that VCS only search the source files in a Verilog
library directory with the specified extension. You can specify
more than one extension, separating each extension with the “+”
character. For example, +libext++.v specifies searches library 
files with no extension and library files with the .v extension.
Enter this option when you enter the -y option. 
-v filename
    Specifies a Verilog library file to search for module definitions.         
 
# simv: 啓動一個simulation session.
    simv [options]
    Options are as follows:
-cm line|cond|fsm|tgl|path|assert
Specifies monitoring for the specified type or types of coverage.
The arguments specifies the types of coverage:
line
Monitor for line or statement coverage.
cond
Monitor for condition coverage.
fsm
Monitor for FSM coverage.
tgl
Monitor for toggle coverage.
path
Monitor for path coverage.
branch
Monitor for branch coverage.
assert
Monitor 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, for
example:
-cm line+cond+fsm+tgl
-cm_name filename
    Specifies 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+ 
    -/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 \
    -/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+ \   
-
~/project/Berry/vmodel/common/rtl 
-~/project/Berry/vmodel/common/tb 
-~/project/Berry/vmodel/vdu/rtl 
-~/project/Berry/vmodel/vdu/tb 
-~/project/Berry_gen/vmodel/vdu/tb 
-~/project/Berry/vmodel/mbist/rtl \
-/home/tools_old/Misc/Xilinx/ISE_DS/ISE/verilog/src/unisims \
-/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=function
   check=function
   misc=function
   data=integer
   size=number
   args=
   nocelldefinepli
   persistent
 
     # ACC功能:
   acc=(+=)|-=|:=capibities:module_name[+]|%CELL|%TASK|*
    其中:
        acc              關鍵字
      =(+=)|-=|:=      add/remove/change
      capibilities     冒號分隔
   PLI函數可用的ACC功能:
       r/read
       rw/read_write
       cbk/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的屬性:
   noOpt
   noPortOpt
   Opt
   PortOpt
  
   two state simulation的屬性:
   2value
   4value
 

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   ...
 
發佈了15 篇原創文章 · 獲贊 22 · 訪問量 12萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章