set_false_path -from [get_ports I_Rst] -to [get_pins Rst_Next_reg/D]
set_false_path -from [get_ports I_Rst] -to [get_pins Rst_reg/D]
The asynchronous-assert of CLR on FF1 can (as you say) cause data to arrive at FF1 at the “wrong” time and cause metastability of FF2. Also, (as you say) Vivado does not warn us by throwing a timing violation. Finally, (as you say) many texts do not discuss this or indirectly tell us not to worry about it. I’m not sure I have the answer but here are some thoughts.
- ...
These are two major assumptions that could be wrong and (as far as I understand) the static timing analysis has no awareness of.Asynchronous reset is asserted at start-up and having relative long duration.
I don't understand which real world problem you are discussing here.
Not in any real design I ever saw. If the system involves a manual reset, you'll take care that the reset causes a safe state, e.g. all outputs off.These are two major assumptions that could be wrong
Pushing at any time is no problem, again only the reset release matters. You'll probably take measures to prevent a bouncing reset. Usually it's achieved by external hardware design, e.g. using a reset IC, but in case of doubt, the reset release may be delayed by a counter.That button could be pushed at any time, causing potential timing violations in the second flip-flop.
As I wrote in my first post, the problem is that this will cause metastability in the 2nd flip-flop.Pushing at any time is no problem, again only the reset release matters.
There are two answers:As I wrote in my first post, the problem is that this will cause metastability in the 2nd flip-flop.
Yes, sorry, I wasn't 100% sure if metastability is my only concern... but maybe it is best if we start by just discussing metastability."safe" is a rather general phrase.
I have attempted to draw a timing diagram:Could you draw a timing diagram showing your concern, so we can focus on the same problem as you do.
It is not safe, if Data Out has any impact on the design behaviour, in other words affect design ouput or internal states still persisting after reset release. Need to assure that design output and registers are also reset.What I don't understand is why this is safe when I connect the output of that flip-flop to any other flip-flop that isn't using that same reset.
Yes, but this would only be relevant if both flip-flops were in the same reset domain, which they are not. The second flip-flop is not reset, so can enter a metastable state (see my timing diagram above). If the first flip-flop had a synchronous reset, then this metastability would be impossible.Metastable state will surely end far before reset release.
Clearly our experience is a little different here. Certainly in ASIC designs I totally agree, but in FPGA designs I rarely see this.The usual solution is to reset all design FFs by the asynchronous reset, not only a few selected.
Dedicated partial resets must be synchronous, otherwise they are not safe. Timing analysis won't help you in this regard.
Unfortunately a global reset doesn't necessarily guarantee safe reset release. A direct external clock can be expected to run during reset release, potentially causing timing violations and undefined states. If we assume that "async reset" is a synchronized copy of the global reset input, we get safe behaviour for the discussed structure if all connected logic transitions to defined state during reset assertion.Isn´t there a global RST in your FPGA that sets/clears all FFs inside?
I agree.Unfortunately a global reset doesn't necessarily guarantee safe reset release.
Recent FPGA families have logic-array-b-wide asynchronous clear signals, it usually costs no extra logic or routing resources if you connect all FFs of a clock domain to the respective synchronized reset instead of only a few.
Yes, exactly.Hi,
I agree.
But in the given example, if all FFs are reset then also the 2nd FF is reset and one gets clean states without the metastability problem for the 2nd FF output.
Klaus
The asynchronous-assert of CLR on FF1 can (as you say) cause data to arrive at FF1 at the “wrong” time and cause metastability of FF2. Also, (as you say) Vivado does not warn us by throwing a timing violation. Finally, (as you say) many texts do not discuss this or indirectly tell us not to worry about it. I’m not sure I have the answer but here are some thoughts.
- It is simply not possible for Vivado STA to analyze the asynchronous-assert of a reset. -because, the reset is asserted without reference to any clock in the design. Further, we have placed timing exceptions (set_false_path) on the reset input to the FPGA, which prevents STA.
- …but the metastability of FF2 is a problem, right? Well, during a reset, the FPGA engineer should ensure that all important operations (eg. launching the missile) are placed on hold until the reset is de-asserted. So, if the metastability of FF2 can propagate downstream and cause problems then maybe other flip-flops that follow FF2 should be reset too.
- I’m still uncomfortable. Ok, me too. Maybe we just need to ensure that the reset is asserted long enough for metastability to settle out – and then de-assert the reset.
- You can avoid the problem altogether by using a reset that is synchronous assert and synchronous de-assert.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?