ncsim仿真VHDL
ncsim仿真VHDL
1、文件列表
ctrl.vhd
design_io.vhd
tb.vhd
compile.nc
simulate.nc
./shm/shmtb.tcl
2、 Compile你的VHDL设计文件[compile.nc]
1 #!/bin/csh -f 2 #---------------------------------------------------------------------- 3 4 # ------------------------------------------------------------------- # 5 # Directories location 6 # ------------------------------------------------------------------- # 7 8 setenv src_dir ../src 9 setenv tb_dir ./ 10 setenv work_dir ./lib 11 12 # ------------------------------------------------------------------- # 13 # Library creation 14 # ------------------------------------------------------------------- # 15 16 setenv CDS_VHDL /user/EDA_Tools/Cadence/IUS_11.10_lnx86/tools.lnx86/inca 17 18 echo "softinclude $CDS_VHDL/files/cds.lib" > cds.lib 19 echo "define work ./lib" >> cds.lib 20 echo " " > hdl.var 21 mkdir -p $work_dir 22 23 # Compile Key Expander 24 # 25 ncvhdl -v93 -work work $src_dir/ctrl.vhd 26 27 # 28 # Compile Testbench 29 # 30 ncvhdl -v93 -work work $tb_dir/design_io.vhd 31 ncvhdl -v93 -work work $tb_dir/tb.vhd
3、simulate生成波形[simulate.nc]
1 #!/bin/csh -f 2 #---------------------------------------------------------------------- 3 # ------------------------------------------------------------------- # 4 # Elaborating the Design 5 # ------------------------------------------------------------------- # 6 7 ncelab -work work work.tb:beh -access wrc 8 9 # ******************************************************************* # 10 # ------------------------------------------------------------------- # 11 # Simulating the Design 12 # ------------------------------------------------------------------- # 13 14 ncsim tb +acssce+rwc -MESSAGES -input ./shm/shmtb.tcl
4、Tcl脚本文件控制生成波形[./shm/shmtb.tcl]
1 #生成VCD文件 2 database -open ./waves/tbvcdwaves -vcd -default 3 probe -create beh -depth all -all -vcd -database ./waves/tbvcdwaves 4 5 #生成shm文件 6 database -open ./waves/tbwaves -shm -default 7 probe -create beh -depth all -all -shm -database ./waves/tbwaves 8 run 9 exit
5、 运行脚本run[run]
注意将相关文件权限更新为可执行
1 ./compile.nc 2 ./simulate.nc
6、使用simvison查看波形
simvision ./waves/tbwaves.shm/tbwaves.trn &
形而上者谓之道 形而下者谓之器。