Need for reset synchronizer: The way most of the designs have been modelled needs asynchronous reset assertion and synchronous de-assertion. The requirement of most of the designs these days is:
- When reset is asserted, it propagates to all designs; brings them to reset state whether or not clock is toggling; i.e. assertion should be asynchronous
- When reset is deasserted, wait for a clock edge, and then, move the system to next state as per the FSM (Finite State Machine); i.e. deassertion should be synchronous
Definition of reset synchronizer: A reset synchronizer synchronizes the deassertion of reset with respect to the clock domain. In other words, a reset synchronizer manipulates the asynchronous reset to have synchronous deassetion.
Figure 1 below shows the schematic representation of how a reset synchronizer is built. It consists of two registers connected in series, the input of first register tied to VDD. The asynchronous reset signal is connected to the Rbar pin of both the register. The output of this circuit has synchronized de-assertion. This synchronised reset fans out to the design.
Figure 1: Reset synchronizer |
How reset synchronizer works: When the reset is asserted, it first propagates to reset synchronizer flops. It resets both the flops of reset synchronizer asynchronously (without waiting for clock edge) thereby generating reset assertion for fanout registers. Figure 2 below shows the scenario of reset assertion, and also the timing waveforms associated with assertion of reset.
Figure 2: Reset assertion |
Similarly, the de-assertion of reset first reaches the two flops of reset synchronizer. Now, the first flop in chain propagates 1 to intermediate output upon arrival of a clock edge. Upon next clock edge, this signal propagates to the output thereby reaching the fanout registers. The reset de-assertion timing (recovery and removal checks timing) should be met from second stage of reset synchronizer to all the domain registers' reset pins as the deassertion is synchronous.
Some facts about reset synchronizer:
- The reset synchronizer manipulates the originally asynchronous reset to have synchronous deassertion.
- The reset synchronizer must fanout to all the registers that need to be "OUT OF RESET" in a single cycle. And there must be a single synchronizer for all such flops, otherwise, some flops will be out of reset 2 cycles later, some 3 cycles later; thus, defeating the purpose of reset synchronization.
- There can, of course, be multiple reset synchronizers in the design, with the number equal to number of functional clock domains. Each reset synchronizer fans out to all the resettable flops of its own clock domain.
- The timing constraints related to a reset synchronizer are discussed here.
Also read:
In Figure 2, how reset assertion combinationally causes the output of the second flop in reset synchronizer to go to zero?
ReplyDeleteThis is the basic property of a flip-flop with asynchronous reset. When reset is asserted, the flop's output goes zero. This is what is happening here. :-)
Deleteif reset is asserted (=1) you say the flops output goes to 0. Then in figure 3 is wrong, because the reset = 1 , then is asserted and then flops output goes to 0 right?. In figure 3 the reset shouldn't be 0 all the time ?
DeleteReset assertion means (reset = 0) deassertion is (reset = 1). He is showing an example of active low reset, that is the circuit is driven low when the input is driven low.
DeleteThe reset signal described in this article is active low, meaning, when reset is asserted, it has a value of 0 and when reset is deasserted, it has a value of 1. So Figure 3 is correct.
DeleteDo we need to use inverter at the input of each reset pin of functional domain FF
ReplyDeleteIt depends upon your design architecture actually. Let us suppose the flip-flops we are using are the ones with active low asynchronous reset. If the reset signal coming is also active low, we dont need to. In case the reset signal is active high, then, we need to use inverters. But that inverter will be common for all registers of that domain.
DeleteAlso it saves ton of energy. Imagine, in a system where reset assertion means giving 1 on reset pin, to put system in reset you have to keep giving 1 in the system. That means even when system is under reset it uses a lot of power. Compared to this, when reset is active low, you just power off the domain and you can have 0 on the reset pin. POWER SAVED!
Deletewhy do we need two stages here? When reset is de-asserted, we can propagate the reset to the fanouts with 1 clk cycle delay right? May be I am missing something. Can you please clarify?
ReplyDeleteHi
DeleteGood question. The reason we use two flops is because the reset is asynchronous to the fanout flops. Thus, one stage is needed to absorb the metastability itself.
In Figure 3, for synchronizer flops, reset deassertion should be asynchronous right ? So why does the output change only when clock edge arrives ?
ReplyDeleteHi
DeleteA reset synchronizer synchronizes the deassertion of reset. That is why, deassertion is shown with respect to clock edge and is now synchronous.
The synchronizer flop outputs change only at clock edges because that is the basic property of a flip-flop. Since reset is deasserted, the regular operation of a flip-flop occurs, which is to capture the value at its input pin on a clock edge (in this case, rising), and have it appear at the output pin.
ReplyDeleteHi, what about the reset synchronisers if they are scan-flops, will it impact ATPG during shift?
ReplyDeleteNo, shift is not concerned about the functionality of the flop. A reset synchroniser is simply two flops put together with "d" input of first flop getting a constant value. During shift, they should be treat the same way as normal 2-bit flops.
DeleteHi! during asynchronous deassertion of reset, when the first flop goes into metastability, shouldn't the second flop also go into metastability? as there is a violation of recovery + removal check for both the flops. Or am I missing something?
ReplyDeleteHi Anunhav
DeleteFor the second flop, both input and output are the same value. Hence, it doesn't try to change its state and doesn't go into metastability. I hope that explains. :-)