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!

Reply

TCL suggestions... (removed blocking keywords in post title-Austin)

Highlighted
Observer
Posts: 21
Registered: ‎04-04-2013

TCL suggestions... (removed blocking keywords in post title-Austin)

[ Edited ]

so far I thought that in tcl

 

set var [f x]

 

means: evaluate f(x) and assign the returnvalue to var. Yet for some reason I get the following errormessage (see the bottom):

 

set buffer [get_sites BUFHCE_X1Y0]
BUFHCE_X1Y0
set pin [get_site_pins -of_objects $buffer -filter {DIRECTION==OUT}]
BUFHCE_X1Y0/O
set node [get_nodes -of_objects $pin]
CLK_HROW_BOT_R_X182Y26/CLK_HROW_CK_HCLK_OUT_R0
get_nets -of_objects $node
WARNING: [Vivado 12-1023] No nets matched for command 'get_nets -of_objects [get_nodes -of_objects [get_site_pins -of_objects [get_sites BUFHCE_X1Y0] -filter DIRECTION==OUT]]'.

 

How does `get_nets` know how these variables where defined? This looks like a fair amount of magic to me, where understanding it could help with unleashing the full potential of the tool.

Explorer
Posts: 197
Registered: ‎09-07-2011

Re: TCL suggestions... (removed blocking keywords in post title-Austin)

set var [f x] works like you expect.

 

The other stuff is probably Xilinx magic.    I don't think get_nets knows about your variables, but it seems to know the literal arguments passed to it.

 

Even though the get_*  commands return a  string to the console, it seems like behind the scenes Vivado maintains object meta data that we don't see.    

 

 

 

 

Xilinx Employee
Posts: 159
Registered: ‎04-24-2013

Re: TCL suggestions... (removed blocking keywords in post title-Austin)

Hi,

 

This forum post may be of interest to you.

 

https://forums.xilinx.com/t5/Vivado-TCL-Community/TCL-get-broken-in-combination-with-foreach/td-p/799063

 

Best Regards
Aidan

 

 

------------------------------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if this answered your question
Give Kudos to a post which you think is helpful and may help other users
------------------------------------------------------------------------------------------------------------------

Instructor
Posts: 3,873
Registered: ‎01-23-2009

Re: TCL suggestions... (removed blocking keywords in post title-Austin)

Yes, this is all "Xilinx Magic".

 

While XDC is, at its base SDC, which is Tcl, Xilinx has done a lot of under the hood magic to make it into something more.

 

Xilinx has implemented an entire "constraints management" system. It is this mechanism that allows a WHOLE BUNCH of capabilities in Vivado

  - using the constraints editor or constraints wizard - including modifying constraints

  - having constraints written as part of a dcp file

  - managing "out of context constraints"

  - but probably most importantly, making Tcl look like it can manage design "objects"

  - (and more)

 

When a Tcl command is executed, the command has an effect on the design immediately. In "normal" Tcl, that's all that happens. But in Xilinx, if the command has "something to do with constraints", then in order to "manage" those constraints, Xilinx also (apparently) stores the actual constraint commands somewhere.

 

This is necessary to mimic the idea that Tcl variables can store design objects. The output of a Tcl command is a string (or list of strings). A Tcl variable is a string or a list of strings. But in Vivado, we use both embedded commands as well as variables to pass objects or lists of objects from one command to another - this cannot be accomplished with strings. So, these mechanisms (embedding commands, holding outputs of commands in variables, an even passing arguments to functions) are modified in Vivado Tcl to not just work with the string output, but to "keep" the underlying Tcl command so that the lists of objects can be passed around (via their commands).

 

And Xilinx has done an astonishingly good job on it - this system really behaves as if we are passing around design database objects. The post that @amaccre mentioned is the first time I have seen someone manage to break it.

 

Your example is one of the ways we can "peek behind the curtains", and see that Xilinx is doing much more than just keeping strings of outputs around, but is actually keeping commands so that the concept of "passing objects" can be mimicked.

 

Avrum