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

时间:2015-07-24 19:56:29

标签: vhdl xilinx xilinx-ise

看起来比每次单独输入每个更方便。

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

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命令进入Simulation GUI的控制台窗口来运行这些命令(在Notepad ++中输入,并保存为项目文件夹中的.tcl文件)

1 个答案:

答案 0 :(得分:0)

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

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

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

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

要在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
    
  4. 下面是Simulation Process Property对话框,用于设置用户定义的TCL脚本(红色选项),如果需要,还可以设置用户定义的波形配置文件(* .wcfg)绿色选项。

    enter image description here