VCS仿真流程


去中興面試的時候被問到vcs 的使用方式,現在整理一下。

1. three-step flow

第一步:analysis——vlogan、vhdlan

  在analysis phase中VCS會檢查文件的語法錯誤,並將文件生成elaboration phase需要的中間文件,將這些中間文件保存在默認的library中(也可以用-work指定要保存的library)。

  1. analyzing VHDL files

% vhdlan [vhdlan_options] file1.vhd file2.vhd

  2. analyzing verilog files

% vlogan [vlogan_options] file1.v file2.v

  3. analyzing system verilog files

% vlogan -sverilog [vlogan_options] file1.sv file2.sv

  這個也可以仿真verilog 文件

  4. analyzing open vera files

% vlogan -ntb [vlogan_options] file1.vr file2.vr file3.v

  

-ntb   :     Enables the use of the OpenVera testbench language constructs described in the OpenVera Language Reference Manual: Native 
Testbench.

  如果是vera 文件,好像在vcs中加-vera選項也可以仿真,

  vlogan有一些常用的選項,比如-sverilog,-l,-f,-full64,-timescale,-y,+define+macro,+libext+extension等等選項。

 

第二步:elaboration

 
   In this phase, using the intermediate files generated during analysis, VCS MX builds the instance hierarchy and generates a binary executable simv. 
  
  可以用optimized mode或者debug mode來elaborate design(也就是compile)。debug mode也叫interactive mode,顧名思義可以調試排查設計中的問題,但是比較消耗時間。optimized mode也叫batch mode(批處理模式),帶來最優的編譯和運行時間,一般用來run regression。synopsys建議在設計完全正確之前用full_debug或者particial_debug,當設計沒問題了用optimized mode。
 
% vcs [elab_options] [libname.]design_unit

  libname:是analysis phase中-work選項指定的library,如果沒有指定就用默認的(定義在synopsys_sim.setup中)。

  design_unit:可以是verilog的top module(vhdl另論)。

  常用的elaboration option: -full64 ,-file filename,-gui,-R,-l,-f,-debug,-debug_all。

 

第三步:simulation

運行elaboration phase生成的二進制文件simv來運行仿真。
 
  Based on how you elaborate the design, you can run your simulation the following ways:
  • Interactive mode(用了debug或者debug_all選項)
  • Batch mode 
 
在interactive mode中, To debug using a GUI, you can use the Discovery Visualization Environment (DVE), and to debug through the command-line interface, you can use the Unified Command-line Interface (UCLI). 
仿真之后可以在dve中查看生成的波形文件(當然需要自己制定要生成波形$vcdpluson、+vcs+vcdpluson等方式)。
 
在batch mode中,不要加debug選項。
./simv #直接運行simv

  

2. two-step flow

兩步走的方法只在verilog和system verilog有用,也就是說VHDL文件一定要用three-step flow。

這是常用的方式,先vcs再simv。

 

3. one-step flow

這其實就是加了-R選項的two-step flow方式。

 


免責聲明!

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



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