公司里用Questa Sim做仿真,其实跟ModelSim差不多,总结常用的命令如下。
1 启动
vsim -gui
2 编译 -- VCOM
vcom
[-2008 | -2002 | -93 | -87] Choose VHDL 2008, 2002, 1993, or 1987
[-explicit] Resolve ambiguous overloads
[-work <libname>] Specify work library
<filename(s)> VHDL file(s) to be compiled
3 仿真 -- VSIM
vsim
[-t [<mult>]<unit>] Time resolution
4 Example
# Clear former sim
quit -sim # Make library directory structure
if {[file exits work] == 0}
{
vlib work
vmap work work
} # Compile files
# Here set your own directory
set srcpath ../hdl
vcom -93 -explicit -work work $srcpath/spi_master.vhd # Simulation commands
vsim -t 1ps tb_spi add wave -noupdate -radix hex -group mut mut:*
configure wave -timelineunits ms
configure wave -namecolwidth 170
configure wave -valuecolwidth 75
configure wave -signalnamewidth 1 run 1 ms
wave zoom full
6 configure wave
-signalnamewidth [<value>]
(optional) Controls the number of hierarchical regions displayed as part of a signal name shown in the pathname pane.
Can also be set with the WaveSignalNameWidth variable in the modelsim.ini file.
<value> — Any non-negative integer where the default is 0 (display the full path).
1 displays only the leaf path element, 2 displays the last two path elements, and so on.