【问题标题】:How to create a list of Tcl commands in a text file and then run it in ISim?如何在文本文件中创建 Tcl 命令列表,然后在 ISim 中运行它?
【发布时间】:2015-07-24 19:56:29
【问题描述】:

似乎比每次都单独输入要方便得多。

这个链接对我来说很不清楚:

http://sagekingthegreat.blogspot.com/2013/08/how-to-execute-tcl-script-in-xilinx.html

示例代码:

#Sample Script:

restart
run 20 ns 
dump
run 20 ns
dump
quit

我只是在寻找 Tcl 命令进入模拟 GUI 的控制台窗口以运行这些命令(在记事本 ++ 中输入,并在我的项目文件夹中保存为 .tcl 文件)

【问题讨论】:

  • 请附上您到目前为止所做的尝试。某些人可能认为您当前的问题过于宽泛。此外,MVCE 可能有助于改善您的问题。
  • *已编辑。但真的没有太多。包含此链接 (xilinx.com/support/documentation/sw_manuals/xilinx12_1/…) 的 Internet 和其他赛灵思文档没有太大帮助

标签: vhdl xilinx xilinx-ise


【解决方案1】:

只需通过-tclbatch <filename> 将您的 tcl 文件作为参数传递给您的编译/融合测试平台。

.\fifo_tb.exe -tclbatch fifo_tb.tcl -gui

-gui 以 GUI 模式打开测试平台,iSim 连接到测试平台可执行文件。

要查看测试平台的所有支持选项,请使用-h 运行测试平台可执行文件。

要在 iSim 中显示所有支持的 TCL 命令,请使用 help 命令。我目前不知道 iSim 有任何 loadfile/source/do 指令。

fifo_cc_got_tb 示例:

  1. 所有需要的 VHDL 文件都列在 fifo_cc_got_tb.prj 文件中:

    vhdl poc "D:\git\PoC\tb\common\my_config_ML505.vhdl"
    vhdl poc "D:\git\PoC\tb\common\my_project.vhdl"
    vhdl unisim "C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\unisims\primitive\MUXCY.vhd"
    vhdl unisim "C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\unisims\primitive\XORCY.vhd"
    vhdl poc "D:\git\PoC\src\common\utils.vhdl"
    vhdl poc "D:\git\PoC\src\common\strings.vhdl"
    vhdl poc "D:\git\PoC\src\common\vectors.vhdl"
    vhdl poc "D:\git\PoC\src\common\board.vhdl"
    vhdl poc "D:\git\PoC\src\common\config.vhdl"
    vhdl poc "D:\git\PoC\src\common\physical.vhdl"
    vhdl poc "D:\git\PoC\tb\common\simulation.v93.vhdl"
    vhdl poc "D:\git\PoC\tb\common\simulation.v93.vhdl"
    vhdl poc "D:\git\PoC\src\mem\ocram\ocram.pkg.vhdl"
    vhdl poc "D:\git\PoC\src\mem\ocram\ocram_sdp.vhdl"
    vhdl poc "D:\git\PoC\src\fifo\fifo_cc_got.vhdl"
    vhdl test "D:\git\PoC\tb\fifo\fifo_cc_got_tb.vhdl"
    

    ISE ProjectNavigator 会为您收集此信息并将其保存在 prj 文件中。

  2. fuse.exe 被执行以从给定的 prj 文件编译测试台:

    cd D:\git\PoC\temp\isim\
    C:\Xilinx\14.7\ISE_DS\ISE\bin\nt64\fuse.exe test.fifo_cc_got_tb --prj fifo_cc_got_tb.prj -o fifo_cc_got_tb.exe
    

    这也可以在 ProjectNavigator 控制台窗口中找到:

    Started : "Simulate Behavioral Model".
    
    Determining files marked for global include in the design...
    Running fuse...
    Command Line: fuse -intstyle ise -incremental -lib secureip -o D:/git/GitHub/PicoBlaze-Examples/Projects/SoFPGA_Atlys_ISE/ise/sync_Strobe_isim_beh.exe -prj D:/git/GitHub/PicoBlaze-Examples/Projects/SoFPGA_Atlys_ISE/ise/sync_Strobe_beh.prj PoC.sync_Strobe {}
    Running: C:\Xilinx\14.7\ISE_DS\ISE\bin\nt64\unwrapped\fuse.exe -intstyle ise -incremental -lib secureip -o D:/git/GitHub/PicoBlaze-Examples/Projects/SoFPGA_Atlys_ISE/ise/sync_Strobe_isim_beh.exe -prj D:/git/GitHub/PicoBlaze-Examples/Projects/SoFPGA_Atlys_ISE/ise/sync_Strobe_beh.prj PoC.sync_Strobe 
    
  3. 使用 TCL 脚本启动模拟

    .\fifo_cc_got_tb.exe -tclbatch ..\..\sim\iSim.gui.tcl -gui
    

    这也可以在 ProjectNavigators 控制台窗口中看到:

    ....
    Compiled 21 VHDL Units
    Built simulation executable D:/git/GitHub/PicoBlaze-Examples/Projects/SoFPGA_Atlys_ISE/ise/sync_Strobe_isim_beh.exe
    Fuse Memory Usage: 50240 KB
    Fuse CPU Usage: 529 ms
    Launching ISim simulation engine GUI...
    "D:/git/GitHub/PicoBlaze-Examples/Projects/SoFPGA_Atlys_ISE/ise/sync_Strobe_isim_beh.exe" -intstyle ise -gui -tclbatch isim.cmd  -wdb "D:/git/GitHub/PicoBlaze-Examples/Projects/SoFPGA_Atlys_ISE/ise/sync_Strobe_isim_beh.wdb"
    ISim simulation engine GUI launched successfully
    

这里是 Simulation Process Property 对话框,用于设置用户定义的 TCL 脚本(红色选项),如果需要,还可以设置用户定义的波形配置文件 (*.wcfg) 绿色选项。

【讨论】:

  • 这听起来不错,但是对于初学者来说,无论如何你可以进一步分解它吗?比如什么 fuse 是/做什么以及 具体是什么?
  • ISE 模拟器 (iSim) 的模拟编译器名为 fuse.exe。它将所有给定的 vhdl 和 verilog 文件编译为可执行文件(例如,如果您的测试平台名称为 fifo_tb,则为 fifo_tb.exe)。应编译的文件列表保存在 prj 文件中(例如 fifo_tb.prj)。当您启动仿真时,可执行文件和 iSim.exe(仿真器 GUI)将启动。两个进程都通过 TCP 会话进行通信。文件名是你的 tcl 脚本。
  • 你太棒了,谢谢!不过要清楚一点,如果我的测试台是“adder_tb.vhd”而我的 tcl 文件是“testrun.tcl”。我会在Command Window shown here 中输入 .\adder_tb.exe -tclbatch testrun.tcl -g 来运行我的 .tcl 命令文件吗?
  • 不,控制台意味着 Windows 控制台 cmd.exe 或 powershell。或者,您可以在 ISE 项目导航器的 iSim 过程属性中配置用户定义的 tcl 脚本。
  • ...又输了..那么你怎么知道使用 cmd.exe 还是 powershell 呢?在 Windows7 中如何访问这些内容?
猜你喜欢
  • 2013-04-28
  • 2013-09-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多