UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer icel
Observer
12,736 Views
Registered: ‎11-19-2007

Xilinx ISE Tcl Script Error

Jump to solution

I'm running a program that invokes a tcl file. I'm trying to execute the xilinx tcl commands from that tcl script.

In the tcl script, i only have the following code.

 

source $env(XILINX)/bin/xilinx-init.tcl

 

 

But i received the following error when the script gets invoked:

error reading package index file C:/Xilinx/10.1/ISE/bin/pkgIndex.tcl: load: Cannot match with any static package. Try "load_unsupported" to load dynamic packages into statically wrapped applications. error reading package index file C:/Xilinx/10.1/ISE/bin/pkgIndex.tcl: load: Cannot match with any static package. Try "load_unsupported" to load dynamic packages into statically wrapped applications. can't find package xilinx while executing "package require xilinx" (file "C:\Xilinx\10.1\ISE/bin/xilinx-init.tcl" line 30) invoked from within "source $env(XILINX)/bin/xilinx-init.tcl"

............

.....

 

Any idea how to solve this? Please advise....

 

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
15,762 Views
Registered: ‎11-28-2007

Re: Xilinx ISE Tcl Script Error

Jump to solution

Close your VHDL editor.

Open a dos command window and type "xtclsh -h" to make sure xtclsh command works first (you should see the output like below)

 

C:\>xtclsh -h
Release 11.5 - xtclsh L.70 (nt)
Copyright (c) 1995-2009 Xilinx, Inc.  All rights reserved.
xtclsh                                - Invoke tclsh in a interactive mode.
xtclsh -h                             - Print out the usage and version info and
exit.
xtclsh <Tcl_script> [arg1] ... [argn] - Evaluate the Tcl script with the
optional arguments and exit.

 

Run your VHDL editor again, then calls x.tcl (this is the default tcl script run by ActivateState Tcl). Create a new tcl script (say x_ise.tcl) for Xilinx stuff. From x.tcl, you can run xtclsh as an external application via the "exec" command. e.g.

 

exec xtclsh x_ise.tcl your_options_here

 

I suggest you look up exec and catch command in tcl manual to make your script more robust and complete.

 

Cheers,
Jim
0 Kudos
10 Replies
Observer icel
Observer
12,724 Views
Registered: ‎11-19-2007

Re: Xilinx ISE Tcl Script Error

Jump to solution

Probably i'm asking the wrong question.....
I intend to run the xilinx tcl commands from project creation to bitstream creation automation. But the script is being invoked from an exe file.

When the script gets invoked, it's evaluated in a Tcl regular shell causing all the xilinx tcl commands to be undefined/no recognized.

How do i load/initialize the xilinx tcl libraries into that script so that i can use the xilinx tcl commands?

 

I tried using "source $env(XILINX)/bin/xilinx-init.tcl" which was taken from the Xilinx Development System Reference Guide document(Chapter 3, page 54) but i received the error above.

Please advise.

Message Edited by icel on 03-23-2010 08:09 PM
0 Kudos
Xilinx Employee
Xilinx Employee
12,720 Views
Registered: ‎11-28-2007

Re: Xilinx ISE Tcl Script Error

Jump to solution

You don't have to load/initialize xilinx tcl libraries if you use the xtclsh, which is installed with ISE.

 

 

Cheers,
Jim
Observer icel
Observer
12,718 Views
Registered: ‎11-19-2007

Re: Xilinx ISE Tcl Script Error

Jump to solution

 but how do i make an tcl script get evaluated in xtclsh when the script is being called by an app outside of xtclsh?

 

my program flow is like this:

[1] A.exe calls X.tcl and passes it a parameter which is the build folder path

[2] X.tcl will first check if Xilinx ISE is installed. If yes, continue. If no, abort.

[2] X.tcl will create an ISE project and generate a bitstream in that build folder using the Xilinx tcl commands.

 

But when X.tcl gets called, it is automatically evaluated in a regular tcl shell and it cant access the Xilinx tcl commands.

 

So how do i make X.tcl evaluated in a xtclsh when called from A.exe? or

What command so i include in X.tcl so that it'll search and load the Xilinx tcl libraries.

 

please advise..

0 Kudos
Xilinx Employee
Xilinx Employee
12,703 Views
Registered: ‎11-28-2007

Re: Xilinx ISE Tcl Script Error

Jump to solution

How do you call x.tcl from your A.exe right now? You could simply add xctlsh in front of x.tcl in your current calling procedure. For e.g.:

 

xtclsh x.tcl parameters_here

 

 

Cheers,
Jim
0 Kudos
Observer icel
Observer
12,701 Views
Registered: ‎11-19-2007

Re: Xilinx ISE Tcl Script Error

Jump to solution

I forgot to mention that i've also installed ActiveState ActiveTcl.

 

I can't change how A.exe calls x.tcl because its part of another software.

However i did try to call a second tcl script x2.tcl from x.tcl by including the command "xtclsh x2.tcl" in x.tcl

but i received the following error:

invalid command name xtclsh

 

Is it possible to copy the xilinx tcl libraries into my ActiveState tcl  library folder and include the command "package require xilinx" inside x.tcl

If it is, which file do i copy?

 

please advise... i'm really lost here...

0 Kudos
Xilinx Employee
Xilinx Employee
12,696 Views
Registered: ‎11-28-2007

Re: Xilinx ISE Tcl Script Error

Jump to solution

I wonder why you need this A.exe in the first place?

 

Any way, as a minimum, before you run a.exe, set up XILINX environment variable to point to your ISE installation (for me it's c:\Xilinx\11.2\ISE) and add %XILINX%\bin\nt to your PATH environment variable. For you don't know how to set up environment variable, take a look at this AR: http://www.xilinx.com/support/answers/11630.htm

 

 

 

 

Cheers,
Jim
0 Kudos
Observer icel
Observer
12,694 Views
Registered: ‎11-19-2007

Re: Xilinx ISE Tcl Script Error

Jump to solution

Hi jimwu,

 

Actually I'm running a VHDL editor software. There is a function(reffered as A.exe here) on the software that calls a tcl script which copies all the VHDL files to a folder.

I'm trying to expand that tcl script to automate all the xilinx processes to generate a bitstream.

I cant change anything related to A.exe or how it calls x.tcl. I only modify the tcl script (x.tcl)

 

I've  add %XILINX%\bin\nt to my  path environment variable. I'm running on WinXp.

 

How do i proceed from here?

Please advise.

Message Edited by icel on 03-24-2010 10:14 AM
0 Kudos
Xilinx Employee
Xilinx Employee
15,763 Views
Registered: ‎11-28-2007

Re: Xilinx ISE Tcl Script Error

Jump to solution

Close your VHDL editor.

Open a dos command window and type "xtclsh -h" to make sure xtclsh command works first (you should see the output like below)

 

C:\>xtclsh -h
Release 11.5 - xtclsh L.70 (nt)
Copyright (c) 1995-2009 Xilinx, Inc.  All rights reserved.
xtclsh                                - Invoke tclsh in a interactive mode.
xtclsh -h                             - Print out the usage and version info and
exit.
xtclsh <Tcl_script> [arg1] ... [argn] - Evaluate the Tcl script with the
optional arguments and exit.

 

Run your VHDL editor again, then calls x.tcl (this is the default tcl script run by ActivateState Tcl). Create a new tcl script (say x_ise.tcl) for Xilinx stuff. From x.tcl, you can run xtclsh as an external application via the "exec" command. e.g.

 

exec xtclsh x_ise.tcl your_options_here

 

I suggest you look up exec and catch command in tcl manual to make your script more robust and complete.

 

Cheers,
Jim
0 Kudos
Observer icel
Observer
12,684 Views
Registered: ‎11-19-2007

Re: Xilinx ISE Tcl Script Error

Jump to solution

Hi jimwu,

 

I just tried the solution you suggested. I tried a simple command(project new "test.ise") in the second script. It worked like a charm.

I'll explore the other commands and also lookup the tcl manual on 'exec' and 'catch' like you suggested.

 

Thanks so much for your help. I really appreaciate it

0 Kudos
Xilinx Employee
Xilinx Employee
3,511 Views
Registered: ‎03-24-2008

Re: Xilinx ISE Tcl Script Error

Jump to solution

One final parting thought for anyone else who might stumble upon this thread.

 

The mechanism you originally posted from the Development System Reference Guide  was never really supported, and has been pulled from the Tcl documentation. 

 

Jim's suggestion is the appropriate one, we can only really support the Xilinx libraries throught xtclsh which can be called as a separate forked process from another interpreter either through exec, or through pipes.

 

http://www.xilinx.com/support/documentation/sw_manuals/xilinx11/devref.pdf

 

'Greg

Greg Daughtry
Vivado Product Marketing Director, Xilinx, Inc.
0 Kudos