去中興面試的時候被問到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
% 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
./simv #直接運行simv
2. two-step flow
兩步走的方法只在verilog和system verilog有用,也就是說VHDL文件一定要用three-step flow。
這是常用的方式,先vcs再simv。
3. one-step flow
這其實就是加了-R選項的two-step flow方式。