已阅读5页,还剩12页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Version 1 0Page 1 of 17Q4 08 Implementation and Timing of Reset Circuits in Altera FPGAs ABSTRACT Most circuit designs employing FPGAs and ASICs are synchronous systems using a large number of flip flops or registers It is usually important that these synchronous elements are capable of starting or being returned to a known state logic 1 or 0 This function is normally handled by a reset There are usually one or more reset signals that are brought into the device and used alone or in conjunction with additional circuitry to perform this function This Tech Note examines the various types of resets synchronous asynchronous and synchronized asynchronous with respect to their advantages and disadvantages various techniques of implementation in FPGAs and their proper timing analysis in Altera s TimeQuest timing analysis engine Synchronous circuits are typically reset with one of two types of resets synchronous or asynchronous resets Synchronous resets are frequency synchronous with the clock domain of the registers they reset Asynchronous resets by nature will arrive at the registers they are affecting with a non deterministic timing relationship to the clock domain of the registers Because of this it is difficult to time these types of resets A third category or resets is discussed here which for the lack of a better name will be referred to as synchronized asynchronous resets These resets have some of the benefits of synchronous resets without some of their disadvantages and they also avoid some of the pitfalls that can be associated with purely asynchronous resets As shall be shown for most situations synchronized asynchronous resets are the preferred method when designing FPGA circuits Synchronous Resets Synchronous resets are based on the premise that the reset signal will only affect the state of a register on the active edge of the clock signal to that register Synchronous resets have the advantage that they generally insure that the circuit is 100 synchronous They also have the advantage that they can be easily timed with static timing analysis tools such as the Altera Quartus II TimeQuest timing engine Since the reset signal is launched and latched by clocks that are synchronous to each other the Data Arrival and Data Required times can be easily determined for proper slack analysis Another advantage of synchronous resets is that they can be much easier to work with when using cycle based simulators These resets do have their disadvantages however For example they may require pulse stretchers to guarantee a reset pulse width wide enough to ensure reset is present during an active edge of the clock Perhaps even more importantly these resets require a clock in order to reset a circuit If something is causing the launch clock to fail the resulting circuit will not get the reset In Altera FPGAs there are two methods by which a reset can reach a register either by being gated in with the data input see Figure 1 or by using a LAB wide control signal synclr see Figure 2 The first method has the potential disadvantage that an additional gate delay may have to be added to the circuit to accommodate the reset signal causing increased Data Arrival times In that event it would have a negative impact on setup slack The second method relies on dedicated routing in the Logic Array Block LAB to each register but is also slower than an asynchronous reset would be to the same register Figure 3 shows that the path for synchronous clear traverses an AND gate whereas the asynchronous clear path goes directly to the register 1 In addition there is only one synchronous synclr control signal per LAB but there 1 In fact this path is slightly slower than the path through the LC The potential advantage of the LAB wide synclr is to save on LCs Version 1 0Page 2 of 17Q4 08 are two asynchronous labclr control signals per LAB Using a large number of synchronous resets in a design can cause the fitter to run out of LABs due to this However without the use of these LAB wide synchronous clear signals the logic cell LC utilization could increase These are the tradeoffs that must be made when using synchronous resets in FPGAs Fortunately Quartus II does offer some control over which of these two methods will be used This can be controlled on a global level or on a module entity level but not on an individual register level 2 There are two settings that can be assigned in the Assignment Editor ALLOW SYNCH CLEAR USAGE and FORCE SYNCH CLEAR The first setting will allow the synthesis engine to use the LAB wide synchronous clear signal when needed and the second one forces the tool to always use it Either way synchronous resets will be slower than asynchronous resets and are not the preferred method in FPGAs Figure 1 Synchronous Reset Using Logic Cell Figure 2 LAB Wide Control Signals Stratix III FPGAs 2 One could control this on an individual register basis by controlling the source code and by using a synthesis directive to force the tool not to optimize out the gate in front of the register Version 1 0Page 3 of 17Q4 08 Figure 3 Adaptive Logic Module ALM Details Stratix III FPGAs When examining the timing analysis of synchronous resets there are two types that need to be addressed externally synchronized and internally synchronized Externally synchronized resets are synchronized to the clock domain outside the FPGA These are not very common Figure 4 Schematic for Externally Synchronized Reset Version 1 0Page 4 of 17Q4 08 An example of an externally synchronized reset is shown in Figure 4 A power on asynchronous reset por n is dual rank synchronized externally to the system clock and then brought into the FPGA Inside the FPGA this reset is gated with the data input to the registers to implement a synchronous reset Figure 5 shows the Verilog equivalent of the schematic The important thing to note here is that when using synchronous resets the reset signal is not put in the sensitivity list as it would be for an asynchronous reset Figure 5 Verilog Code for Externally Synchronized Reset The constraints for this design are shown in Figure 6 Since the external reset is synchronous one only needs to constrain the reset n signal as a normal input signal with a set input delay statement Figure 6 SDC Constraints for Externally Synchronized Reset Version 1 0Page 5 of 17Q4 08 More often resets coming into the device are asynchronous In this case the resets must be synchronized internally before being sent to the registers As shown in Figure 7 the synchronization registers are now inside the FPGA Figure 7 Schematic for Internally Synchronized Reset The equivalent Verilog code is shown in Figure 8 Again note that only the clock edge is in the sensitivity list for a synchronous reset Figure 8 Verilog Code for Internally Generated Reset Version 1 0Page 6 of 17Q4 08 The SDC constraints are similar to the external case except that now the input reset cannot be constrained since it is asynchronous and should be cut with a set false path statement as shown in Figure 9 to avoid these being considered unconstrained paths Figure 9 SDC Constraints for Internally Synchronized Reset Another issue with synchronous resets is their behavior with respect to short pulses less than a period on the asynchronous input to the synchronizer flip flops On the one hand this could be viewed as a disadvantage in that there is a requirement on the asynchronous reset that it be at least one period wide in order to guarantee that it will be captured by the first flip flop On the other hand this could be viewed as an advantage in that this circuit increases noise immunity Spurious pulses on the asynchronous input would have a lower chance of being captured by the first flip flop so they would not trigger a synchronous reset In some cases one might want to increase noise immunity further and reject any asynchronous input reset that is less than n periods wide This would also be useful for debouncing an asynchronous input reset In order to do this the following modification Figure 10 should be made to the internally synchronized reset Figure 10 Schematic for Internally Synchronized Reset with Pulse Extender Many designs have more than one clock signal In these cases a separate reset synchronization circuit should be used for each clock domain in the design When PLLs are involved extra caution should be used When creating synchronizers for the PLL output clocks these clock domains will not be reset until the PLL has locked and the PLL output clocks are stable Also worth noting if the reset to the PLL is used this reset does not have to be synchronous to the input clock to the PLL An asynchronous reset can be used for this Again using a reset to the PLL will further delay the assertion of a synchronous reset to the PLL Version 1 0Page 7 of 17Q4 08 output clock domains when using internally synchronized resets As will be demonstrated in a later section of this document synchronized asynchronous resets solve this problem rather nicely Asynchronous Resets Asynchronous resets have been the most common form of resets used in circuit design for a very long time It has been very popular to have one asynchronous reset come into the device and then put on a global buffer and connect to the asynchronous reset pin of every or almost every register in the device This approach has its advantages under certain circumstances but it is not without pitfalls It is not always the case that every register in a design requires a reset This approach is not without its costs in terms of routing resources and use of LAB wide control signals It is good practice to only reset those registers that require it One of the biggest advantages of asynchronous resets is that they are not inserted in the data path as synchronous resets are Hence they do not negatively impact the data arrival times between registers Another advantage is that they take effect essentially immediately As soon as the registers get the reset pulse regardless of the timing relationship relative to the clock the registers are reset It is not dependent on a clock as synchronous resets are There isn t any problem with going into reset asynchronously Problems can arise however when the reset is released also referred to as reset removal When reset is removed it must meet the asynchronous tSU time This is checked in TimeQuest with a Recovery time check Also when reset is removed it must meet the asynchronous tH time This is checked in TimeQuest with a Removal time check Together these checks are referred to as Recovery Removal Analysis 3 clock 0 tSU tH Recovery Time Check Relative Distance of Reset Deassertion from Clock Edge tCO reset n Increased Settling Time Additional Delay Removal Time Check Metastability Zone Figure 11 Metastability Curve When the reset signal is deasserted and does not pass the recovery or removal time check the edge is said to have fallen in the metastability zone as shown in Figure 11 above The consequence of this is that the time it takes for the output of the register to settle to the correct state based on the data input to the 3 For further information on this topic refer to Tech Note Understanding Recovery Removal Analysis in TimeQuest Version 1 0Page 8 of 17Q4 08 register is increased This additional delay can lead to setup time failures to registers downstream leading to system failure Obviously this situation should be avoided at all costs One method of avoiding this is to add a couple of follower registers after the register with the asynchronous reset and use the output of these registers in the design The follower registers act to synchronize the data to the clock in a manner to remove the metastability issues The closer these registers can be placed to each other in the device the better to keep the routing delays to a minimum which decreases data arrival times and increases MTBF Note that it is important that these follower registers themselves are not reset but rather will be initialized over a period of several clock cycles by flushing out their current or initial state Figure 12 below shows a schematic example of this circuit Figure 12 Schematic of Asynchronous Reset with Follower Registers In general for pipelined designs like this without feedback circuits where there is no sequence dependence on initialization and when the design can wait several cycles after coming out of reset before beginning operation this type of reset is acceptable The equivalent Verilog code is shown in Figure 13 below Note how this differs from the synchronous reset code The active edge of the reset is now in the sensitivity list for the procedural block It is also important that the follower registers are not in the else part of the first procedural block as this would infer a clock enable on the follower registers with the inverse of the reset signal tied to the clock enable The follower registers should be in a separate procedural block as shown using non blocking assignments Version 1 0Page 9 of 17Q4 08 Figure 13 Verilog Code of Asynchronous Reset with Follower Registers Constraining an asynchronous reset is simple By definition asynchronous resets have a non deterministic relationship to the clock domains of the registers they are resetting Therefore static timing analysis of these resets is not possible they are usually cut with a set false path statement as shown at the bottom of Figure 14 Because the relationship of the reset to the clock at the register is not known recovery and removal analysis cannot be run in TimeQuest for this path Attempting to do so will yield no paths reported Even without the false path statement cutting this path no paths would be reported for recovery and removal Figure 14 SDC Constraints for Asynchronous Reset Besides the potential metastability issues with asynchronous resets another issue is their susceptibility to noise A noisy asynchronous reset could cause a spurious reset For this reason it is important that the asynchronous reset is debounced and filtered As mentioned previously synchronous resets are less susceptible to this problem although not immune because they are registered by the clock In the next section on Synchronized Asynchronous Resets methods are discussed for avoiding this problem altogether Perhaps the biggest problem with asynchronous resets is again related to reset removal Besides the potential for metastability issues there is no guarantee that every register connected to the reset will have the same timing relationship to the clock due to register placement and routing within the device The effect of this is that within a given clock period some registers would come out of reset while others won t until the following clock period This has the potential for disastrous effects with feedback circuits where the next output of a register is dependent on the current output of other registers A common example of this is with state machines One hot state machines are particularly problematic since only one state bit is set at a time If more than one state bit is high due to some state bits coming out of reset and not others then the state machine could enter an illegal state 4 With binary encoded state machines it is possible to create transitions for unused states back to the reset state this making it a deterministic state machine This would allow for graceful recovery from an illegal or unused state 4 Fortunately one of the Synthesis settings available now is called Safe State Machines that will gracefully recover from an illegal state However this setting is OFF by default and would have to be turned ON to take effect Version 1 0Page 10 of 17Q4 08 Despite the potential for recovery from these cases they should be avoided whenever possible One method for avoiding them all together is to use a different reset scheme referred to as Synchronized Asynchronous Resets which are discussed in detail in the next section Synchronized Asynchronous Resets In order to avoid some of the problems associated with purely synchronous resets and purely asynchronous reset a third class of reset called Synchronized Asynchronous Resets can be used These resets combine the advantages of asynchronous resets no involvement of the data path for speed and taking effect almost instantaneously with the advantages of synchronous resets 100 synchronous for timing analysis and resistance to noise These resets are asynchronously asserted and synchronously deasserted to achieve these goals As discussed previously going into reset asynchronously is fine but coming out of reset asynchronously leads to potential problems with metastability and hazards of unwanted situations with synchronous circuits involving feedback Some of the methods of implementing these resets are discussed below The circuit shown in Figure 15 uses synchronizer registers in a similar manner to synchronous resets but the asynchronous reset is gated with the output of the registers to assert the resulting reset asynchronously This circuit will assert the reset asynchronously and deassert it asynchronously however it has the disadvantage that there will be a gate delay in the resulting reset path Figure 15 Schematic of Synchronized Asynchronous Reset with Gated Reset A better way to implement this is shown in Figure 16 This takes the gate delay out of the path of the resulting reset The asynchronous reset input is connected directly to the CLRN pin of the synchronizer registers asserting the resulting reset immediately When the reset is deasserted a logic 1 is clocked though the synchronizers to deassert the resulting reset synchronously Version 1 0Page 11 of 17Q4 08 Figure 16 Schematic of Synchronized Asynchronous Reset without Gate Delay The equivalent Verilog code is shown below in Figure 17 The first procedural block creates the synchronized reset rst n which then becomes the asynchronous reset for the second procedural block In both of these blocks the active edge of the reset is us
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2023年煤矿特种作业井下电钳工作业理论考试练习题含答案
- 《医疗废物分类目录》(2025版)试题(附答案)
- 《体育教学论》课程试题库
- (完整版)外科护理学考试试题和答案解析
- 2024年一级建造师考试市政工程真题及答案「完整版」
- 2025《医院感染诊断标准》试题+答案
- 11月证券从业考试《金融市场基础知识》真题及答案
- 20261029-230749-苏教版七年级生物下册寒假作业(含答案)
- 2026年煤矿安全监察员题库及参考答案
- 2026年辽源市西安区教育局公开招聘乒乓球教练员考试题库及参考答案
- 2026 陕煤集团榆林化学有限责任公司招聘笔试题库(模拟练习·含答案解析)
- 2025年学校校医招聘试题及答案
- 医药购销不正之风治理课件
- 塔吊司索工考试题库及答案2026
- 2026 年秋季开学初三正视模考得失主题班会
- 广东省广州市增城区2025-2026学年七年级上学期期中生物学试题(含答案)
- (2026版)传染病防治自查报告
- 2026年四川省广元市辅警人员招聘考试真题解析含答案
- 广东省江门市2026年重点中学小升初语文考试真题试卷(+答案)
- 2025年兵团新职工考试题及答案
- 2026年中国铁路广州局铁路局校园招聘真题
评论
0/150
提交评论