觉得这篇文章很好,因而在这里翻译一下——或许也可以说是按我的了解加中文注释。
MulTIple, independent clocks are ubiquitous in system-on-chip (SoC) design. Most SoC devices have mulTIple interfaces, some following standards that use very different clock frequencies.
在一个SOC规划中,存在多个、独立的时钟,这现已是一件很往常的作业了。大大都的SOC器材都具有很多个接口,各个接口标准都或许会运用彻底不同的时钟频率。
Many modern serial interfaces are inherently asynchronous from the rest of the chip; some actually derive their clocks directly from the incoming data streams. There is also a trend toward designing major sub-blocks of SoCs to run on independent clocks to ease the problem of clock skew across large chips.
例如关于现代的串行通讯接口而言,它们自然而然地就与芯片的其余部分是不同步的,因为它们的时钟有时分就是直接从数据流中康复出来的。并且,现在还有一个趋势,就是有时分为了在防止大芯片中令人头痛的所谓clocl skew问题,干脆让各个子模块都具有独立的时钟。
For all of these reasons, designers working on SoC projects are virtually certain to encounter mulTIple clocks and to be faced with the design of logic interconnecTIng two portions of the chip running on independent clocks. Each such portion is known as a clock domain. The interface between logic on different clocks is called a clock domain crossing or clock domain boundary. The proper handing of signals across clock domain boundaries is critical for successful SoC design.
因为以上原因,进行SOC规划时,常常要考虑作业在不一起钟下的两个部分逻辑之间的互连问题,而每个部分,都可称之为“时钟域”,衔接它们之间的那部分数字逻辑可称为“时钟鸿沟”或所谓“跨时钟域”。合理地处理跨时钟的问题,关于一个成功的SOC规划来说十分要害。
Problem #1: Meta-stability
The first multi-clock problem that designers must consider is that of meta-stability as signals pass from one clock domain to another. Most designers understand that meta-stability is a real problem in real circuits; the modern abstractions of RTL design and static timing analysis cant entirely shield designers from having to worry about the underlying physics.
1) 亚稳态
多时钟域规划的榜首个问题,就是信号从一个时钟域传输到另一个时钟域的时分,或许会呈现亚稳态。 许多规划者都知道,在实在的电路中确实会存在所谓亚稳态的问题。可是,在现代的FPGA规划中,即便规划者面临的是RTL级笼统和静态时序剖析,却依然不能彻底将这个问题拒之门外,因为笼统的掩盖之下,咱们依然防止不了实在的物理规则。
Whenever a signal enters a clocked circuit element, such as a flip-flop, too close to the clock, there is the potential for meta-stability. When this happens, the flip-flop may not immediately settle to a known value. It is critical that the output signal from the flip-flop not be used until it has settled.
任何时分,一个信号输入到一个时钟触发的电路——例如一个D触发器,当信号(跳变)过于接近时钟前沿,便会存在所谓亚稳态问题。这个时分,DFF的输出端不会立刻发生一个可预知的值,也就是说,在这段时间内,输出信号是无效的。
On a truly asynchronous clock boundary, the receiving domains clock is used to capture each signal from the driving domain in a flip-flop. Because there is no defined temporal relationship between the clock and the signal, it is entirely possible that they could transition at the same time. Whenever this happens, there is a possibility of meta-stability in the receiving clock domain.
在规划中,常常会用一个触发器接纳来自于另一个时钟域的输出信号(即用本地时钟的前沿来锁存另一个时钟域的信号)。因为触发器的时钟和数据输入信号不存在确认的相位联系,因而彻底有或许呈现数据和时钟一起跳变的状况。这样,就在接纳端地点的时钟域中形成了亚稳态。
This is not just a theoretical potential. GHz-rate chips with clocking design errors can exhibit the effects of meta-stability quite quickly when running in real systems. These effects typically include loss of critical handshake signals between clocks domains, and corruption of multi-bit dataserious problems that are highly likely to require a chip re-spin.
亚稳态的危险,并不仅仅是理论上的。关于GHz数据率的芯片,假如时钟规划考虑不妥,一旦把它放到实践体系中运转,亚稳态的作用所形成的损害很快就会表现出来。最典型的比如说,跨时钟域的要害握手信号丢掉,以及并行数据犯错。然后这个芯片的规划很或许就落空,所以你不得不推倒重来。(所谓 re-spin,按我的了解,是重新开始的意思)
Most designers also know that the textbook solution to meta-stability is using two levels of flip-flops on each signal crossing a clock domain boundary. Even if the first flip-flop does become meta-stable, there is an extremely high likelihood that the signal will settle by the time that it passes through the second level. The double-level flip-flop structure is often called a synchronizer, and designers commonly speak of synchronizing signals across clock domains.
大都规划者都现已知道,关于亚稳态,教科书上经典的解决办法,就是在凡时钟鸿沟的当地,都用两级(D)触发器对信号进行同步。这样的话,哪怕榜首级D触发器进入了亚稳态,后一级也极有或许把它克服掉。这种两级触发器结构,一般称为“synchronizer”,这个进程也称为跨时钟域信号同步。
Problem #2: Reset synchronization 复位的同步问题
Improper synchronization of reset signals is a related problem in multi-clock designs. Designers sometimes forget that reset signals are subject to meta-stability and must be protected by synchronizers. Generally, the entire SoC can be reset by a single signal, which therefore must propagate to all clocked elements in all clock domains.
复位信号的不同步,也是一个与多时钟规划相关的问题。规划者有时分会忘了一个现实,那就是复位信号也或许引起亚稳态问题,并且必须用synchronizers来对它进行同步。一般来说,每个SOC都会有一个reset信号,这个信号被送到各个时钟域的各个同步逻辑单元,来对整个芯片/体系进行复位。
There is no need for synchronization on the activation edge of reset, since by definition all state elements are reset to initial values, and the reset signal will generally be held active for enough cycles to allow any meta-stability to settle out.