cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
2,576 Views
Registered: ‎05-14-2015

more readable XDC file

Hello,

There are always very long path name if we want to get a clock or a pin in our design. 

In order to make my .xdc scripts more readable, I made a XDC script as below. 

First, I use an variable "rxoutclk_out_0_1" and "rxoutclk_out_0_2" to replace their long path name.

Then, I can call this variable in the following scripts. In this way, my XDC file is more readable. 

 

set rxoutclk_out_0_1 {-of_objects [get_pins {i_uhdsdi_10gbe_top/i_uhdsdi_10gbe_wrapper/i_uhdsdi_10gbe_ctrl_ch2/g_ch2.i_gth_sdi_x1y13/inst/gen_gtwizard_gthe4_top.gth_sdi_x1y13_gtwizard_gthe4_inst/gen_gtwizard_gthe4.gen_channel_container[27].gen_enabled_channel.gthe4_channel_wrapper_inst/channel_inst/gthe4_channel_gen.gen_gthe4_channel_inst[0].GTHE4_CHANNEL_PRIM_INST/RXOUTCLK}]}
set rxoutclk_out_0_2 {-of_objects [get_pins {i_uhdsdi_10gbe_top/i_uhdsdi_10gbe_wrapper/i_uhdsdi_10gbe_ctrl_support/i_uhdsdi_10gbe_ctrl/g_ch1.i_gth_sdi_x1y12/inst/gen_gtwizard_gthe4_top.gth_sdi_x1y12_gtwizard_gthe4_inst/gen_gtwizard_gthe4.gen_channel_container[27].gen_enabled_channel.gthe4_channel_wrapper_inst/channel_inst/gthe4_channel_gen.gen_gthe4_channel_inst[0].GTHE4_CHANNEL_PRIM_INST/RXOUTCLK}]}

set_clock_groups -asynchronous -group [get_clocks $rxoutclk_out_0_1] \
                               -group [get_clocks $rxoutclk_out_0_2]

 

But, during synthesizing, 2 critical warnings popped out as below:

I checked and can't find why its an "unknown option"?

[Common 17-170] Unknown option '-of_objects [get_pins {i_uhdsdi_10gbe_top/i_uhdsdi_10gbe_wrapper/i_uhdsdi_10gbe_ctrl_support/i_uhdsdi_10gbe_ctrl/g_ch1.i_gth_sdi_x1y12/inst/gen_gtwizard_gthe4_top.gth_sdi_x1y12_gtwizard_gthe4_inst/gen_gtwizard_gthe4.gen_channel_container[27].gen_enabled_channel.gthe4_channel_wrapper_inst/channel_inst/gthe4_channel_gen.gen_gthe4_channel_inst[0].GTHE4_CHANNEL_PRIM_INST/RXOUTCLK}]', please type 'get_clocks -help' for usage info. ["C:/work/bsp/timings.xdc":18]
[Common 17-170] Unknown option '-of_objects [get_pins {i_uhdsdi_10gbe_top/i_uhdsdi_10gbe_wrapper/i_uhdsdi_10gbe_ctrl_ch2/g_ch2.i_gth_sdi_x1y13/inst/gen_gtwizard_gthe4_top.gth_sdi_x1y13_gtwizard_gthe4_inst/gen_gtwizard_gthe4.gen_channel_container[27].gen_enabled_channel.gthe4_channel_wrapper_inst/channel_inst/gthe4_channel_gen.gen_gthe4_channel_inst[0].GTHE4_CHANNEL_PRIM_INST/RXOUTCLK}]', please type 'get_clocks -help' for usage info. ["C:/work/bsp/timings.xdc":24]

 

 

0 Kudos
9 Replies
Highlighted
Scholar
Scholar
2,566 Views
Registered: ‎06-20-2017

You could try something like this:

 

set GROUP0 [get_clocks -of_objects [get_ports iCLK0] -include_generated_clocks]]
set GROUP1 [get_clocks -of_objects [get_ports iCLK1] -include_generated_clocks]]
set GROUP2 [get_clocks -of_objects [get_cells {design_1_i/util_ds_buf/U0}] -include_generated_clocks]
set_clock_groups -asynchronous\
-group $GROUP0\
-group $GROUP1\
-group $GROUP2
0 Kudos
Highlighted
Guide
Guide
2,524 Views
Registered: ‎01-23-2009

Tcl commands are a set of strings - the first string is the command, the second string the first option (or sub-command), the third string the next option, etc...

 

In your first command, you set the rxoutclk_out_0_1 to a single string which contains the whole "-of_objects [get_pins..." This is one string. So the get_clocks command sees a single option which is this massive string (with spaces, etc...). This one string is not a valid option.

 

While the first part of the string may be a valid option, you have instructed Tcl to take the whole string as the first option (which is why it fails).

 

This can be fixed with ugly use of the "eval" command (which forces the parser to re-parse the string after the first parsing/substitution phase), but that is not recommended.

 

As others have recommended, what you want is to have the rxoutclk_out_0_1 variable hold the clock object, not a string that you are trying to use as an option to the command

 

set rxoutclk_out_0_1 [get_clocks -of_objects [get_pins {i_uhdsdi_10gbe_top/i_uhdsdi_10gbe_wrapper/i_uhdsdi_10gbe_ctrl_ch2/g_ch2.i_gth_sdi_x1y13/inst/gen_gtwizard_gthe4_top.gth_sdi_x1y13_gtwizard_gthe4_inst/gen_gtwizard_gthe4.gen_channel_container[27].gen_enabled_channel.gthe4_channel_wrapper_inst/channel_inst/gthe4_channel_gen.gen_gthe4_channel_inst[0].GTHE4_CHANNEL_PRIM_INST/RXOUTCLK]

 

Now the variable will have the clock, and you can

 

set_clocks -asynchronous -group $rxcoutclk_out_0_1 -group $rxoutclk_out_0_2

 

Avrum

 

Tags (2)
0 Kudos
Highlighted
Scholar
Scholar
2,497 Views
Registered: ‎06-20-2017

0 Kudos
Highlighted
Explorer
Explorer
2,489 Views
Registered: ‎05-14-2015

@maps-mpls,I tried, but failed with a new type of error. My .xdc is like this. 

set PLL_CLKOUT0 [get_clocks -of_objects [get_pins i_systempll/inst/mmcme4_adv_inst/CLKOUT0]]
set PLL_CLKOUT1 [get_clocks -of_objects [get_pins i_systempll/inst/mmcme4_adv_inst/CLKOUT1]]
set PLL_CLKOUT2 [get_clocks -of_objects [get_pins i_systempll/inst/mmcme4_adv_inst/CLKOUT2]]
			   
set_clock_groups -asynchronous -group $PLL_CLKOUT0 \
                               -group $PLL_CLKOUT1 \ 
							   -group $PLL_CLKOUT2 

The error is:

[Common 17-1550] Command failed: can't read "PLL_CLKOUT0": no such variable
 ["C:/work/timings.xdc":94]
0 Kudos
Highlighted
Explorer
Explorer
2,414 Views
Registered: ‎05-14-2015

@maps-mpls@avrumw,

Do you have some other ideas to try? It's quite strange why Vivado can't handle variable of Tcl very well!

0 Kudos
Highlighted
Guide
Guide
2,366 Views
Registered: ‎01-23-2009

Command failed: can't read "PLL_CLKOUT0": no such variable

 

I have no idea why you are getting this error. The commands you are using look valid, and I have used similar structures many many times.

 

So there is nothing inherently wrong with this. The problem must have something to do with something subtle - either where the constraints exist in files (if they are not in the same file, and there is a constraint file ordering issue) or there is some subtle typo like a hidden character difference (a zero that is the letter O or something like that).

 

Again, it is legal and it works to put clock objects in variables for use throughout the rest of your XDC file.

 

Avrum

0 Kudos
Highlighted
Explorer
Explorer
2,352 Views
Registered: ‎05-14-2015

@avrumw, You're right. This is legal.  

But, I feel this is something Vivado should improve to suppress this confusing "no such variable" warning in the next version. 

 

I tried the xdc like below:

 

set PLL_CLKOUT0 [get_clocks -of_objects [get_pins i_systempll/inst/mmcme4_adv_inst/CLKOUT0]]
set PLL_CLKOUT1 [get_clocks -of_objects [get_pins i_systempll/inst/mmcme4_adv_inst/CLKOUT1]]		
set_clock_groups -asynchronous -group $PLL_CLKOUT0 \
                               -group $PLL_CLKOUT1

 

 

Then, Vivado will give a critical warning "no such variable" like below. But, this warning is only for Synthesis. 

Once I opened synthesized design, this warning is gone. 

XDC.png

 

Then, I checked Timing Constraints inside Synthesized Design. The constraint is already there: (see picture below). So, I feel Vivado should not pop out this warning. 

XDC.png

0 Kudos
Highlighted
Guide
Guide
2,344 Views
Registered: ‎01-23-2009

This is not a "bug" nor something that needs to be suppressed. If the command is failing in synthesis, there is a reason. Most likely the clock doesn't exist during the synthesis pass. Take a look at this posting which describes a condition where clocks don't (yet) exist during synthesis.

 

Avrum

0 Kudos
Highlighted
Explorer
Explorer
2,323 Views
Registered: ‎05-14-2015

@avrumw,

I feel this is different case. If the clock does not exist during the synthesis pass, the warning is like below in the green circle:

clock.png

0 Kudos