3246 views|5 replies

165

Posts

0

Resources
The OP
 

A brief discussion on synchronous reset and asynchronous reset [Copy link]

Hello everyone, when it comes to synchronous reset and asynchronous reset, we have to talk about the word reset. In the design of digital logic circuits, the circuit is started by reset, and reset is like the "pacemaker" of digital circuits. In the design, there are mainly three types of resets: one is no reset: born strong, start when powered on; the second is asynchronous reset: a kind person passes by and kicks it casually, pacing, which is completely unprepared and may be revived at any time; the third is synchronous reset: professional rescue team, hold the chest with your hand, and hold it without pacing. Don't leave until you hear the "bang bang" sound. It is very critical and you must hold it for a while. Let's talk about these three types in detail. 1. No reset I have never seen code written like this, without a reset. The teacher said that digital circuits cannot do without reset. Without a reset, how can the registers be initialized? Without a definite initial value, how can this circuit work? In fact, don't worry. After the FPGA is powered on, the initial value of the register defaults to "0". Of course, you can also assign an initial value manually. The following is an example of code without reset: reg [7:0] a; always @(posedge clk) begin a <= b; end If there is no reset signal, a lot of resources can be saved, and the compilation and wiring time can also be shortened a lot. If the scale is large, it is also helpful to improve the overall performance of the design. However, in digital circuit design, we seldom use reset circuits. Instead, we often use this feature of FPGA to generate internal reset circuits ourselves. 2. Asynchronous reset Asynchronous reset circuit description: Add the reset signal to the sensitive quantity list in the always statement to realize asynchronous reset. The following is an example of asynchronous reset code and circuit diagram: reg [7:0] a; always @(posedge clk,posedge rst_n)
                begin
                        if(rst_n)
                                begin
                                        a <= 8’h0;
                                end
                        else
                                begin
                                        a <= b;
                                end
                end

        

        异步复位的缺点:
        异步复位对复位信号要求很严格的,不然随便一个毛刺就会把电路给复位掉的。
        另外,异步复位信号依赖于FPGA内部的传导延时,因此,在微小的电压或温度差异下,设计都有可能输出错误,设计的可移植性也很差。上面不是说了嘛,这随便一脚提过来,有时候能感觉到,有时候感觉不到啊。冬天穿个大棉袄,就得使个大劲才能提醒。
        正因为对不同寄存器延迟是不同的,所以容易引发间断性设计问题。怎么理解呢?
        如图所示,2 bit的移位寄存器组成一个环,复位后,左边寄存器清零,右边寄存器置位,而且都在同一上升沿触发,所以,如果左边寄存器上升沿来的时候,复位信号已经释放掉了,但是右边寄存器还处于复位状态,这个时候数据就错误。

        异步复位的优点:
        异步复位不依赖于时钟。所以如果时钟是外部输入的,而且时钟有可能丢失,例如处于省电模式时,只能使用异步复位。
        另外一个优势是设计更快的物理实现。相对于同步复位,异步复位有更宽松的时序约束。从而布局布线工具使用更少的时间便可达到约束条件。

        三、同步复位
        同步复位就是非常专业,不留一点马虎,和他的名字一样,只在时钟的有效沿发生,所以一个有效的同步信号,至少要维持一个时钟周期(把你叫不醒,是不会停的)。由于仅仅在时钟的有效沿有效,所以可以滤除复位信号上的毛刺,电路可靠性好很多。下面为同步复位的代码举例:
        

        reg [7:0] a;
        
          always @(posedge clk)
                begin
                        if(rst_n)
                                begin
                                        a <= 8’h0;
                                end
                        else
                                begin
                                        a <= b;
                                end
        end
      
        
        所以,总结一下。其优点是“弥补了异步复位的所有缺点”,其缺点是“没有异步复位的优点“”。这个总结够简单吧。

        总结

        我们熟悉了3种复位方式,了解了他们的脾气,那就总结一下,在我们平时设计中如何使用他们。

       尽量用同步复位,如果你的规模不是特别大,虽然占有布线资源多一点,但是对系统可靠性还是有帮助的。

       规模很大的时候,可以考虑混和复位方式,在什么场合呢?比如说设计中有多个IP核和功能模块,要求有不同的复位方式,这个时候就要求混和复位方式,另外,还有电路延迟,大型电路中两个模块之间信号延迟可能超过10ns,如果时钟周期为3ns,需要3个时钟周期才能通过,所以,大型设计中完全同步是非常不容易的。如图所示为一个复杂的混和复位树。各种复位都用上了。
        
        
        各位,加油,共同进步!png[/img] Come on, everyone, let’s make progress together!png[/img] Come on, everyone, let’s make progress together!png[/img] Come on, everyone, let’s make progress together!png[/img] Come on, everyone, let’s make progress together!
This post is from FPGA/CPLD

Latest reply

Make progress together,  Details Published on 2018-2-3 12:23
Personal signature想学FGPA,至芯科技 昭哥带你学,联系方式:15201114008
 

1903

Posts

0

Resources
2
 
Learn
This post is from FPGA/CPLD

Comments

Learn and make progress together  Details Published on 2018-2-3 09:46
 
 

6366

Posts

4929

Resources
3
 
It's very detailed and accurate. I've read it.
This post is from FPGA/CPLD

Comments

Thanks,  Details Published on 2018-2-3 09:46
 
 
 

165

Posts

0

Resources
4
 
tiankai001 posted on 2018-2-1 15:44 This is very detailed and very accurate. I have read it.
Thank you,
This post is from FPGA/CPLD
Personal signature想学FGPA,至芯科技 昭哥带你学,联系方式:15201114008
 
 
 

165

Posts

0

Resources
5
 
Learn and make progress together
This post is from FPGA/CPLD
Personal signature想学FGPA,至芯科技 昭哥带你学,联系方式:15201114008
 
 
 

1903

Posts

0

Resources
6
 
Make progress together,
This post is from FPGA/CPLD
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list