Search code examples
vhdlfpgaxilinx

Conditional UCF statements or conditional UCF file inclusion


Is there a way/workaround to use statements in a UCF file conditionally, or, can UCF files be included into other UCF files conditionally?

The problem I'm facing is that I have a top module with a set of generics which conditionally instantiate or remove certain submodules from the top module via generate statements.
However, most of these submodules have timing constraints defined in the projects UCF file. Somewhere during map or par the build process is aborted stating that an instance the UCF file is refering to does not exist (which is correct since the instance was never created due to the choice of generics in the top module).

Whats the best possible way to achieve some sort of "conditional constraint", which can avoid this problem? (beside the obvious preprocessor/script which fingers around in my UCF file)

PS: I'm using the Xilinx ISE 14.4 / Vivado 2012.4 command line tools.


Solution

  • This question has been asked several times:

    http://forums.xilinx.com/t5/Design-Entry/include-and-ifdef-for-ucf-files/td-p/77822

    http://forums.xilinx.com/t5/Design-Entry/Conditional-inclusion-of-ucf-files/td-p/195684

    Short answer is no, not possible unfortunately.

    Your best bet is to create 2 separate UCF files and either create a script to point to one or the other or to manually replace it each time you turn on/off your generic switch.