Xilinx 8.2i Life Jacket User Manual


 
Development System Reference Guide www.xilinx.com 97
Example Tcl Scripts
R
Example Tcl Scripts
This section provides two example Tcl scripts. The first example is a “Sample Tcl Script for
General Usage”. The second example is a “Sample Tcl Script for Advanced Scripting”.
You can run these example Tcl scripts the following ways:
Enter each statement interactively at the xtclsh prompt (%).
You can access the xtclsh prompt (%) from the command line by typing xtclsh, or
from the Tcl Console tab in Project Navigator.
Save the statements in a script file with a .tcl extension. To run the Tcl script, type the
following from the xtclsh prompt (%):
% source <script_name>.tcl
Sample Tcl Script for General Usage
# open the project and set project-level properties
project new watchvhd.ise
project set family Virtex2P
project set device xc2vp2
project set package fg256
project set speed -7
# add all the source HDLs and ucf
xfile add stopwatch.vhd statmatch.vhd cnt60.vhd dcm1.vhd decode.vhd
xfile add tenths.vhd hex2led
xfile add watchvhd.ucf
# define all partitions
partition new /stopwatch/MACHINE
partition new /stopwatch/Inst_dcm1
partition new /stopwatch/XCOUNTER
partition new /stopwatch/decoder
partition new /stopwatch/sixty
partition new /stopwatch/lsbled
partition new /stopwatch/msbled
# get partition properties
set props [partition properties]
puts "Partition Properties : $props"
# get top
set top [project get top]