2

Seems a lot more convenient than typing each one individually every time.

This link was very unclear to me:

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

Sample Code:

#Sample Script:

restart
run 20 ns 
dump
run 20 ns
dump
quit

I'm just looking for the Tcl command to enter in the Console Window of the Simulation GUI to run these commands (entered in Notepad ++, and saved as a .tcl file in my project folder)

VKkaps
  • 159
  • 3
  • 21
  • Please include what you have tried doing so far. Your current question might be considered too broad by some people. Also, a [MVCE](http://stackoverflow.com/help/mcve), might help improve your question. – Richard Erickson Jul 24 '15 at 20:00
  • *edited. But there's really not too much to it. The internet and other Xilinx documentation inlcuding this link (http://www.xilinx.com/support/documentation/sw_manuals/xilinx12_1/ism_r_simulation_command_overview.htm) were not much help – VKkaps Jul 24 '15 at 20:06

1 Answers1

0

Just pass your tcl file as a parametet to your compiled/fused testbench via -tclbatch <filename>.

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

-gui opens the testbench in GUI mode with iSim connected to the testbench executable.

To see all supported options of a testbench, run the testbench executable with -h.

To show all supported TCL commands in iSim, use the help command. I'm currently not aware of any loadfile/source/do instruction for iSim.

Example fifo_cc_got_tb:

  1. All needed VHDL files are listed in a fifo_cc_got_tb.prj file:

    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"
    

    The ISE ProjectNavigator collects this information for you and saves it in a prj file.

  2. fuse.exe is executed to compile the testbench from given prj file:

    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
    

    This can also be found in the ProjectNavigator console 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\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. The simulation is launched with a TCL script

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

    Also this can be seen in the ProjectNavigators console 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
    

Here is the Simulation Process Property dialog to setup a user defined TCL script (red option) and if needed a user defined waveform configuration file (*.wcfg) green option.

enter image description here

Paebbels
  • 15,573
  • 13
  • 70
  • 139
  • This sounds right, but is there anyway you could break this down further for a beginner? Like what fuse is/does and what specifically? – VKkaps Jul 24 '15 at 21:17
  • The simulation compiler for ISE simulator (iSim) is called fuse.exe. It compiles all given vhdl and verilog files to an executable (e.g. fifo_tb.exe if you testbench's name is fifo_tb). The list of files which should be compiled is saved in a prj file (e.g. fifo_tb.prj). When you launch your simulation, the executable and iSim.exe (the simulator GUI) are started. Both processes communicate via TCP sessions. Filename is you tcl script. – Paebbels Jul 24 '15 at 21:32
  • You're awesome, thank you! Just to be clear though, if my testbench is "adder_tb.vhd" and my tcl file is "testrun.tcl". I would enter _.\adder_tb.exe -tclbatch testrun.tcl -g_ into the [Command Window shown here](https://i.imgur.com/pOHrKew.jpg) to run my .tcl command file? – VKkaps Jul 24 '15 at 22:42
  • No, console means Windows console either cmd.exe or powershell. Alternativly, you can configure an user defined tcl script in iSim process properties in the ISE project navigator. – Paebbels Jul 25 '15 at 07:49
  • ...lost again.. So how do you know to use either cmd.exe or powershell? How do I get to these in Windows7? – VKkaps Jul 25 '15 at 14:24
  • ?? Have you never used the windows command prompt a.k.a console or cmd.exe? Powershell (PS or PoSh) is the successor of cmd. I prefer powershell because of it's power and featues. – Paebbels Jul 25 '15 at 14:34
  • ahh okay so you enter " .\fifo_tb.exe -tclbatch fifo_tb.tcl -g" into the command prompt and it will pull up Xilinx and Isim (specifically the 2 files above) – VKkaps Jul 25 '15 at 17:58
  • Exacly :) If you start iSim from ISE navigator, you'll see the executed commands in the log window. The first command is fuse.exe to compile all files (something like fuse.exe -prj fifo_tb.prj -mt 2 ....) the second should call fifo_tb.exe. – Paebbels Jul 25 '15 at 20:24
  • I'm getting this error (http://i.imgur.com/TjlXXhr.jpg ) every time I try and run my testbench and tcl file in the command prompt. Any ideas!?! – VKkaps Jul 27 '15 at 12:31
  • Sorry I made a mistake. Option `-g` is `-gui`. I extended my answer with an fifo_cc_got exampe and snippets from the project navigator log. I also added a screenshot from the simulation process property dialog, where you can setup these command line options for the usage in ISE. – Paebbels Jul 27 '15 at 13:03