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!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
584 Views
Registered: ‎03-29-2008

Register Retiming , will it cross CDC boundaries?

I am wondering if the optimization will cross clock domains as part of its optimization or will it only optimizes in one clock domain?  I would hope that it would not cross a boundary but I cannot find any statement that Register Re-timing is clock domain aware.

 

Can anyone say for sure?

 

Thank You

Nick

0 Kudos
5 Replies
Historian
Historian
546 Views
Registered: ‎01-23-2009

Re: Register Retiming , will it cross CDC boundaries?

While I haven't seen any documentation that discusses this, I would have to assume that the tool will not cross clock boundaries. This would be illegal...

 

Furthermore, all the metastability resolution chains in your design (the back to back flip-flops on the destination domain) should all have the ASYNC_REG property set on them either in your RTL code or in the constraint file (the designer is required to do this). One of the functions of the ASYNC_REG property is to declare the cells as DONT_TOUCH - cells that have the DONT_TOUCH on them cannot be modified as part of register retiming or replication.

 

Avrum

0 Kudos
Visitor robdrw
Visitor
536 Views
Registered: ‎07-14-2016

Re: Register Retiming , will it cross CDC boundaries?

Thanks @avrumw@nickh initiated this topic based on a question I asked him. I think the original question was slightly misunderstood, so I feel like I should add a bit of detail to the original post to assist the experts like yourself when answering.

 

Imagine we have a circuit in clk domain CLKA. The circuit in CLKA has two register stages that we are concerned with. The first stage contains multiple bits. The second stage contains a single bit, where stage_2 = f(stage_1). The single bit in stage 2 is then fed into a synchronization chain to help it cross into clk domain CLKB.

 

My question does not relate to retiming over crossing between CLKA and CLKB. Instead, I am curious if the tools will recognize that stage 2 in CLKA is feeding a synchronization chain in CLKB and, as a result, protect CLKA stage 2 from getting somehow retimed somewhere into the cone of logic between CLKA stage 1 and CLKA stage 2. You can assume that ASYNC_REG property is set on the synchro chain in CLKB and that a false path is set between CLKA and CLKB.

0 Kudos
Historian
Historian
531 Views
Registered: ‎01-23-2009

Re: Register Retiming , will it cross CDC boundaries?

@robdrw,

 

That is a good question.

 

Again, my assumption is that the tools understand this and will not push logic from before the stage_2 flip-flop to after, but I can't prove it. I have certainly never seen the tool do this (but I never use register retiming, so that isn't surprising), nor have I ever heard of the tools doing this.

 

The good news is that even if Vivado did do something like this, it would then be able to tell you that the resulting synchronizer is illegal. The report_cdc command analyzes all clock crossings, and determines if the structure around the clock crossing is "legal". The resulting structure (with combinatorial logic driving the first flip-flop on a different domain) will fail this check.

 

Finally, if you wanted to be certain that this couldn't happen, you could always put the DONT_TOUCH attribute on the stage_2 flip-flop - this would prevent the tool from doing any retiming that involves this flip-flop. But, again, I don't think this is necessary - I highly suspect that the tool will not touch this flip-flop.

 

(Or, alternatively, don't enable register retiming!)

 

Avrum

0 Kudos
Visitor robdrw
Visitor
527 Views
Registered: ‎07-14-2016

Re: Register Retiming , will it cross CDC boundaries?

Thanks @avrumw. I suspect the same - it seems sensible.t It would be nice if someone from the factory could provide a definitive response.

0 Kudos
Historian
Historian
521 Views
Registered: ‎01-23-2009

Re: Register Retiming , will it cross CDC boundaries?

From UG901 (v2018.2 p. 56):

 

Note: Cells with DONT_TOUCH/MARK_DEBUG attributes, cells with timing exceptions (false_path,
multicycle_path), and user-instantiated cells will block this attribute.

 

So, I am pretty sure that if you have a set_false_path or set_max_delay between the last FF on CLKA and the first FF on CLKB it will fall under the case of "cells with timing exceptions".

 

While this describes the "RETIMING_FORWARD" and "RETIMING_BACKWARD" properties, I suspect that it applies to global retiming as well.

 

Avrum

0 Kudos