cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
14,843 Views
Registered: ‎03-28-2014

XDC indexing generated cells

Jump to solution

I'm trying to area constrain a couple hundred FIFOs that are all generated instances as smaller groups of FIFOs. How can I add a range of instances to a pBlock other than manually duplicating the constraint and changing the index number?

 

For example I would like to replace this:

add_cells_to_pblock [get_pblocks pblock_0_11] [get_cells Code_inst/FIFO_GEN[0].fifo_inst]
add_cells_to_pblock [get_pblocks pblock_0_11] [get_cells Code_inst/FIFO_GEN[1].fifo_inst]
.
.
.
add_cells_to_pblock [get_pblocks pblock_0_11] [get_cells Code_inst/FIFO_GEN[11].fifo_inst]

With something more like this:

add_cells_to_pblock [get_pblocks pblock_0_11] [get_cells Code_inst/FIFO_GEN[0 to 11].fifo_inst]

Is this possible?

 

Thanks,

Dan

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Guide
Guide
28,089 Views
Registered: ‎01-23-2009

Loops in "XDC" files are not supported. They are supported in "Unmanaged constraint" files - in project mode you put the constraints in .tcl files (not .xdc files), and in non-project mode you source the .tcl file or in newer versions use "read_xdc -unmanaged"

 

However, this is not necessarily the best way to go. There are some complexities with unmanaged constraint files, and parsing the XDC file will be slower - in XDC you always want to minimize the operations that access the design database (since they take time).

 

While its not perfect, you can use the regular expression wildcarding format. All the "get_" commands (including get_cells) have the option -regexp. This changes how wildcarding in the name is interpreted. Without the -regexp, the wildcarding uses the simple "glob" style wildcards - these are probably too simplistic to represent numerical ranges.

 

However, with the -regexp option, the command uses the full "Regular Expression" syntax. Here you have more capability. Even with -regexp you can't directly represent a number range (regexp is string based, not numerical), but you can construct regular expressions that will do what you want. A quick search of the web turned up this web page that helps you construct number ranges using regular expressions. This should work in an XDC file...

 

Avrum

 

 

View solution in original post

Tags (2)
0 Kudos
6 Replies
Highlighted
Moderator
Moderator
14,836 Views
Registered: ‎01-16-2013

@dcwhitehead,

 

Not sure but can you try using for loop:

 

for {set i 0} {$i < 12} {incr i} {

add_cells_to_pblock [get_pblocks pblock_0_11] [get_cells Code_inst/FIFO_GEN[$i].fifo_inst]

}

 

Regards,

Syed

---------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.

Did you check our new quick reference timing closure guide (UG1292)?
---------------------------------------------------------------------------------------------
0 Kudos
Highlighted
Moderator
Moderator
14,835 Views
Registered: ‎01-16-2013

@dcwhitehead,

 

Seems like loops are not supported in XDC from the below link:

http://www.xilinx.com/support/answers/59134.html

 

however it also mentions a workaround of applying constraints in form of loops.

 

Regards,
Syed

---------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.

Did you check our new quick reference timing closure guide (UG1292)?
---------------------------------------------------------------------------------------------
0 Kudos
Highlighted
Guide
Guide
28,090 Views
Registered: ‎01-23-2009

Loops in "XDC" files are not supported. They are supported in "Unmanaged constraint" files - in project mode you put the constraints in .tcl files (not .xdc files), and in non-project mode you source the .tcl file or in newer versions use "read_xdc -unmanaged"

 

However, this is not necessarily the best way to go. There are some complexities with unmanaged constraint files, and parsing the XDC file will be slower - in XDC you always want to minimize the operations that access the design database (since they take time).

 

While its not perfect, you can use the regular expression wildcarding format. All the "get_" commands (including get_cells) have the option -regexp. This changes how wildcarding in the name is interpreted. Without the -regexp, the wildcarding uses the simple "glob" style wildcards - these are probably too simplistic to represent numerical ranges.

 

However, with the -regexp option, the command uses the full "Regular Expression" syntax. Here you have more capability. Even with -regexp you can't directly represent a number range (regexp is string based, not numerical), but you can construct regular expressions that will do what you want. A quick search of the web turned up this web page that helps you construct number ranges using regular expressions. This should work in an XDC file...

 

Avrum

 

 

View solution in original post

Tags (2)
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
14,826 Views
Registered: ‎04-16-2008

Wildcards are also suported.  You can use [*] to grab all geneated instances of the same name.

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
14,823 Views
Registered: ‎04-16-2008
Ah, sorry. I misread the initial question. I see why this does not work for you. Please ignore.
0 Kudos
Highlighted
Adventurer
Adventurer
14,812 Views
Registered: ‎03-28-2014

Avrum,

 

Thanks for the input! Regular expressions should work for me. The following example code does exactly what I need.

 

[get_cells -regexp {Code_inst/FIFO_GEN\[(1[0-1]|[0-9])\]\.fifo_inst}]

-Dan

Tags (2)
0 Kudos