Synopsys VCS 學習筆記(一)


1、VCS常用編譯命令:
  vcs source_files [source_or_object_files] options
e.g vcs top.v toil.v -RI +v2k

Details of Options:

-I:Compiles for interactive use

+v2k:Enables new language features in the proposed IEEE 1364-2001 standard. See “Implemented IEEE Std 1364-2001 Language Constructs” on page 2-23.

-R after compilation, run simulation executable

-RI after compilation, run simulation under xvcs

-sverilog
Enables the use of the Verilog language extensions in the Accellera
SystemVerilog specification.

-debug
Enables the use of UCLI commands and DVE.

-debug_all
Enables the use of UCLI and DVE. Also enables line stepping.

-doc

Starts browser to display the HTML files for the VCS/VCSi documentation.

-vcd <filename>
Sets the output VCD file name to the specified file.
The default filename is verilog.dump.
A $dumpfile system task in the Verilog source code will override
this option.

+vcdfile+<filename>
Specifies the VCD file you want to use for post-processing.

-fsdb
To dump an fsdb file

-Xman=4:combines all source files into a single file “tokens.v”
e.g:vcs add4.v top.v -Xman=4

-l filename:Specifies a file where VCS records compilation messages. If you
also enter the -R option, VCSrecords messages from both
compilation and simulation in the same file.

2、fsdbDumpfile and fsdbDumpvars to dump an fsdb file.
fsdbDumpfile - 指定FSDB文件名
-語法:$fsdbDumpfile("FSDB name")
-功能:將dump下來的資料存成指定的檔案

fsdbDumpvars - Dump指定的變量
-語法:$fsdbDumpvars;$fsdbDumpvars(leval,module/var);
-功能:將所要觀察的變量dump下來,存儲到FSDB file.

$fsdbDumpon,$fsdbDumpfileoff
-功能:Turn on/off dump 變量的功能

$fsdbDumpMem,$fsdbDumpMenNow
-語法:$fsdbDumpMem,$fsdbDumpMemNow
-功能:將記憶體的值儲存到FSDB file,當呼叫$fsdbDumpMemNow時記憶體的值會立即被dump出來,而呼叫$fsdbDumpMem則必須等到時機間隔結束才會dump出來。

example 1:

1 initial begin
2   $vcdpluson;
3   $fsdbDumpfile("test.fsdb");
4   $fsdbDumpvars(0,router_test_io);
5 end

 

example 2:

1 initial begin
2     $vcdpluson;
3     $fsdbDumpfile("test.fsdb");
4     $fsdbDumpvars(0,test);
5 end

 

注:example 1和example 2將router_test_io和test兩個模塊中的信號波形全部存在test.sfdb文件中。


3、執行simv(VCS生成仿真使用的二進制測試文件)文件
命令:./simv [run_time_options]

run_time_options

-s: stops simulation at time 0

e.g:./simv -s

4、Interactive mode(交互模式)
允許實時的控制仿真的進行,允許在模擬的過程中改變寄存器的值或者設置,這些改變會實時地影響到模擬的結果

5、Post-processing mode(后台處理方式)
先輸出用戶指定選擇的信號及其變化過程到一個文件中,然后可以用 VirSim來分析這個文件。該文件是 VCD+類型的,VCD+文件是一種二進制的格式,里面記錄了 VCS模擬的結果,和信號的變化歷史等信息。

6、VCS編譯注意問題:
使用VCS編譯時,必須先將含有`timescale或者宏定義的文檔放在前面,不然會報錯誤
Error-[ITSFM] Illegal `timescale for module
router_test_top.sv, 7
Module "router_test_top" has `timescale but previous module(s)/package(s) do
not.
Please refer LRM 1364-2001 section 19.8.

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM