Qsys生成simulator时产生的tcl脚本建立仿真

9 篇文章 1 订阅
4 篇文章 0 订阅

用Qsys生成simulator时产生的tcl脚本建立仿真的过程:

对QSYS的仿真采用其自己生成的sim文件夹中的tcl脚本,不用自己在do文件中加入IP文件列表了,可以比较快速的建立qsys的仿真工程。针对该qsys的testbench还是得自己建的。

过程如下:

  1. 针对qsys核建立测试工程
  2. 将msim_setup.tcl中的# # TOP-LEVEL TEMPLATE - BEGIN 到# # TOP-LEVEL TEMPLATE - END 复制到另外一个文件,保存为mentor.do
  3. 修改 mentor.do文件 中路径和需要的编译选项。(见后面附录)
  4. 在mentor.do目录下,cmd命令执行vsim -do mentor.do
    至此结束。

在mentor.do文件中包含了对库文件的编译,每一次都编译再仿真的话启动速度会很慢。因此在第一次编译后,可以对mentor.do文件进行修改,优化掉这一段。或者只在modelsim中执行下面一段。

vlog ../*.v

set TOP_LEVEL_NAME DMA_sys_TOP_tb

set USER_DEFINED_ELAB_OPTIONS -voptargs="+acc"

elab

# # Run the simulation.

log -r /*

do wave.do

run 5us

附修改后的mentor.do文件,红色是修改的地方

# ----------------------------------------

# # TOP-LEVEL TEMPLATE - BEGIN

# #

# # QSYS_SIMDIR is used in the Quartus-generated IP simulation script to

# # construct paths to the files required to simulate the IP in your Quartus

# # project. By default, the IP script assumes that you are launching the

# # simulator from the IP script location. If launching from another

# # location, set QSYS_SIMDIR to the output directory you specified when you

# # generated the IP script, relative to the directory from which you launch

# # the simulator.

# #

# set QSYS_SIMDIR <script generation output directory>

set QSYS_SIMDIR D:/Work/FPGA/DMA/selfdma_v3_addr_Sim_0425/dd4_sys/sim

# #

# # Source the generated IP simulation script.

source $QSYS_SIMDIR/mentor/msim_setup.tcl

# #

# # Set any compilation options you require (this is unusual).

# set USER_DEFINED_COMPILE_OPTIONS <compilation options>

# set USER_DEFINED_VHDL_COMPILE_OPTIONS <compilation options for VHDL>

# set USER_DEFINED_VERILOG_COMPILE_OPTIONS <compilation options for Verilog>

# #

# # Call command to compile the Quartus EDA simulation library.

dev_com

# #

# # Call command to compile the Quartus-generated IP simulation files.

com

# #

# # Add commands to compile all design files and testbench files, including

# # the top level. (These are all the files required for simulation other

# # than the files compiled by the Quartus-generated IP simulation script)

# #

# vlog <compilation options> <design and testbench files>

vlog ../*.v

 

# #

# # Set the top-level simulation or testbench module/entity name, which is

# # used by the elab command to elaborate the top level.

# #

# set TOP_LEVEL_NAME <simulation top>

set TOP_LEVEL_NAME DMA_sys_TOP_tb

# #

# # Set any elaboration options you require.

# set USER_DEFINED_ELAB_OPTIONS <elaboration options>

set USER_DEFINED_ELAB_OPTIONS -voptargs="+acc"

# #

# # Call command to elaborate your design and testbench.

elab

# #

# # Run the simulation.

# run -a

log -r /*

do wave.do

run 5us

# #

# # Report success to the shell.

# exit -code 0

# #

# # TOP-LEVEL TEMPLATE - END

# ----------------------------------------
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值