cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
348 Views
Registered: ‎11-21-2019

Automatic selection between multiple constraint files

Jump to solution

Hello all,

I have a project which supports several different FPGA Mezzanine Cards and I select which one is used through a constant in a package file. I also have some constraint files, which are always used, plus one constraint file for each FMC.
Up to now, for each implementation I was enabling in Vivado the correct .xdc file and I was disabling the rest of the .xdc files which had signals related to the other (unused) FMCs. Is there a way in project mode to somehow (add a tcl script to the constraint sources?) set a process in order to automatically use the correct constraint files depending on the constant I set in the package file or through a generic?

Thank you.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Moderator
Moderator
290 Views
Registered: ‎01-16-2013

@cocopa 

 

Check this link

https://forums.xilinx.com/t5/Vivado-TCL-Community/Conditional-inclusion-of-xdc-files-or-constraints/td-p/697128 

 

--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)?
---------------------------------------------------------------------------------------------

View solution in original post

2 Replies
Highlighted
Moderator
Moderator
291 Views
Registered: ‎01-16-2013

@cocopa 

 

Check this link

https://forums.xilinx.com/t5/Vivado-TCL-Community/Conditional-inclusion-of-xdc-files-or-constraints/td-p/697128 

 

--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)?
---------------------------------------------------------------------------------------------

View solution in original post

Highlighted
Visitor
Visitor
205 Views
Registered: ‎11-21-2019

Hi, I'm coming back to this thread because I'm facing some troubles.
I added an unmanaged tcl script to my constraints set, in which I enable/disable specific .xdc files with something like this:

if {$condition == "cond1" } {
    set_property is_enabled true [get_files -regexp -filter {NAME =~ ".*constraints1.xdc"}]
}

if {$condition == "cond2" } {
    set_property is_enabled true [get_files -regexp -filter {NAME =~ ".*constraints2.xdc"}]
}

If I open the elaborated design, everything is as expected and only the correct .xdc files have been enabled.
However, that is not the case with the implemented design, it seems that all the xdc files are read and the design fails.
I used the "write_xdc" command to print the constraints that are actually loaded and it seems that the tcl script is read but all the commands in it seem to be ignored and not read at all -as if it was empty. I removed the conditional statements but the commands were still ignored.
Do you have any idea what the problem could be? Perhaps the "is_enabled" property is not the ideal way to set the correct constraints files? And if not, what could be the alternative?

0 Kudos