Monday, August 26, 2013

How To Execute TCL script in Xilinx-ISIM CLI


Xilinx-ISim apply stimulus from tcl script :


Xilinx-ISim allows us to run tcl script from its CLI.The input stimulus to be generated and output signals to be checked (ie.,show value <signal>) can given in tcl script.

File name : <file-name>.tcl
                Example : stimulus.tcl 

How to Run tcl script from Isim Cli :-

source  <path>/<file-name>.tcl
Example : source  stimulus.tcl 

In this example the script file is located in project base directory.
Below are some sample tcl scripts ,use and modify according to your needs.

Example 1.  
 This script will restart the simulation from time 0 ,adds input signals and runs the simulation .Open a file in text editor and save it with tcl extension (ie., stimulus.tcl) and then copy paste the below code.
  # This is a TCL script #  
  # File Name : stimulus.tcl #  
  # How To run : source stimulus.tcl #  
  #       execute this command in Isim CLI#  
  #       and path to stimulus.tcl should be given#  
  #       if its in different directory #   
  puts "..restarting simulation.."  
  restart  
  puts "..inserting input stimulus.."  
  isim force add s 0 -value 1 -time 50 ns -repeat 100 ns  
  isim force add r 1 -value 0 -time 100 ns -repeat 200 ns  
  isim force add clock 0 -value 1 -time 20 ns -repeat 40 ns  
  puts "..running simulation.."  
  run  

Example 2.
  see this Link

No comments:

Post a Comment