如何在文本文件中创建 Tcl 命令列表,然后在 ISim 中创建 运行?

How to create a list of Tcl commands in a text file and then run it in ISim?

好像比每次都一个一个打字方便多了。

这个 link 对我来说很不清楚:

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 的控制台 Window 中输入 运行 这些命令(在记事本 ++ 中输入,并保存为 .tcl 文件在我的项目文件夹中)

只需将您的 tcl 文件作为参数通过 -tclbatch <filename> 传递给您的 compiled/fused 测试台。

.\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.7\ISE_DS\ISE\vhdl\src\unisims\primitive\MUXCY.vhd"
    vhdl unisim "C:\Xilinx.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.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 控制台中找到 window:

    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.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 控制台中看到 window:

    ....
    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
    

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