去中興面試的時候被問到vcs 的使用方式,如今整理一下。面試
第一步: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
% 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
兩步走的方法只在verilog和system verilog有用,也就是說VHDL文件必定要用three-step flow。
這是經常使用的方式,先vcs再simv。
這其實就是加了-R選項的two-step flow方式。