VCS仿真流程

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

1. three-step flow

第一步:analysis——vlogan、vhdlanbash

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

  1. analyzing VHDL filesthis

% vhdlan [vhdlan_options] file1.vhd file2.vhd

  2. analyzing verilog filesspa

% vlogan [vlogan_options] file1.v file2.v

  3. analyzing system verilog filesdebug

% 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選項也能夠仿真,code

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

 

第二步: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方式。

相關文章
相關標籤/搜索