CN104535918B - A kind of cross clock domain lock unit internal constant test circuit and method - Google Patents

A kind of cross clock domain lock unit internal constant test circuit and method Download PDF

Info

Publication number
CN104535918B
CN104535918B CN201410811176.5A CN201410811176A CN104535918B CN 104535918 B CN104535918 B CN 104535918B CN 201410811176 A CN201410811176 A CN 201410811176A CN 104535918 B CN104535918 B CN 104535918B
Authority
CN
China
Prior art keywords
unit
clock
metastable state
time
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201410811176.5A
Other languages
Chinese (zh)
Other versions
CN104535918A (en
Inventor
王鹏
田毅
范毓洋
阎芳
薛茜男
赵长啸
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Civil Aviation University of China
Original Assignee
Civil Aviation University of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Civil Aviation University of China filed Critical Civil Aviation University of China
Priority to CN201410811176.5A priority Critical patent/CN104535918B/en
Publication of CN104535918A publication Critical patent/CN104535918A/en
Application granted granted Critical
Publication of CN104535918B publication Critical patent/CN104535918B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Tests Of Electronic Circuits (AREA)

Abstract

一种跨时钟域同步器内部常数测试电路和方法。测试电路包括:异步数据单元、待检测单元、第一亚稳态计数单元、第二亚稳态计数单元、模式选择单元和计时单元。本发明公开了一种进行跨时钟域同步器MTBF评估时使用的同步器内部常数的测试电路和方法。其包括对同步器内部常数测试电路的设计实现、测试操作及数据计算的内容。本发明解决了进行跨时钟域同步器MTBF评估时同步器内部常数难以准确获得的问题,可应用在由主从锁存器工艺参数不同的寄存器构成的同步器中,提高了同步器内部常数测试结果的可靠性。

A circuit and method for testing internal constants of a cross-clock domain synchronizer. The test circuit includes: an asynchronous data unit, a unit to be detected, a first metastable state counting unit, a second metastable state counting unit, a mode selection unit and a timing unit. The invention discloses a test circuit and method for the internal constant of the synchronizer used when evaluating the MTBF of the cross-clock domain synchronizer. It includes the design and implementation of the internal constant test circuit of the synchronizer, test operation and data calculation. The invention solves the problem that it is difficult to accurately obtain the internal constant of the synchronizer when evaluating the MTBF of the cross-clock domain synchronizer, and can be applied to a synchronizer composed of registers with different process parameters of the master-slave latch, and improves the test of the internal constant of the synchronizer reliability of the results.

Description

一种跨时钟域同步器内部常数测试电路和方法A circuit and method for testing internal constants of a cross-clock domain synchronizer

技术领域technical field

本发明属于电子技术领域,特别是涉及一种跨时钟域同步器内部常数测试电路和方法。The invention belongs to the field of electronic technology, in particular to a circuit and method for testing internal constants of a cross-clock domain synchronizer.

背景技术Background technique

随着电子硬件设计规模的增大和片上系统(SOC,System On Chip)的出现,现场可编程门阵列(FPGA,Field Programmable Gate Array)和专用集成电路(ASIC,ApplicationSpecific Integrated Circuit)设计中跨时钟域信号电路也相应增多,从而致使电路中由跨时钟域引起的亚稳态的概率也增多。因此由两个寄存器级联或者更多级寄存器的级联构成的同步电路被广泛使用,如图1所示,本文把该电路称为同步器。而FPGA、ASIC工艺的不断进步对亚稳态的解决造成不利影响,极大恶化了现有同步器的性能。同一设计中跨时钟域信号的增多和所用器件解决亚稳态效率的降低,会使FPGA电路整体的可靠性下降,增加了设计失败的风险。因此,评估FPGA中使用的同步器能否满足设计的可靠性需求显得尤为重要。With the increase of electronic hardware design scale and the appearance of System On Chip (SOC, System On Chip), cross-clock domain The number of signal circuits also increases accordingly, resulting in an increase in the probability of metastability caused by crossing clock domains in the circuit. Therefore, a synchronous circuit composed of two registers cascaded or more registers cascaded is widely used, as shown in Figure 1, this paper calls this circuit a synchronizer. However, the continuous progress of FPGA and ASIC technology has a negative impact on the solution of the metastable state, which greatly deteriorates the performance of the existing synchronizer. The increase of cross-clock domain signals in the same design and the reduction of the efficiency of the devices used to solve the metastable state will reduce the overall reliability of the FPGA circuit and increase the risk of design failure. Therefore, it is particularly important to evaluate whether the synchronizer used in the FPGA can meet the reliability requirements of the design.

目前主要利用公式进行同步器可靠性评估(其中Fd为输入同步器的数据转换频率,Fc为接收时钟域的时钟频率,T为接收时钟域的时钟周期,i+1为同步器中寄存器的个数,C1、C2为同步器内部常数:C1为窗口常数,C2为时间常数)。两级寄存器构成的同步器则使用进行评估(其中C2M为同步器中寄存器的主锁存器的时间常数,C2S为同步器中寄存器的从锁存器的时间常数,λ为目的时钟域时钟的占空比)。从上述公式中可知,为了对同步器进行平均无故障时间(MTBF)评估,除了从具体应用中可知的Fd,Fc,T,λ四个外部影响参量外,还必须测量出C1、C2两个跟器件相关的内部常数。目前可使用如图2所示的测试电路来得到内部常数C1,C2,其中CLK1为第一时钟域的时钟信号,CLK2为第二时钟域中的时钟信号,待测试的寄存器为待测寄存器B;待测寄存器B的输出被寄存器C和寄存器D分别在CLK2全周期后和半周期后采样。当两个寄存器采样值不同时,亚稳态就被检测出来。由于待测试单元B在半个CLK2时钟周期后被寄存器D采样,在时钟的高电平期间待测寄存器B只有主锁存器进行亚稳态的恢复工作,因此该电路仅能测出寄存器的主锁存器的时间常数C2M,并不能测出寄存器完整的时间常数C2。根据公式当寄存器中的C2M和C2s相等时,时间常数C2的值可以用测量出的C2M的值替代。若该寄存器的主锁存器和从锁存器工艺参数不同时,用C2M的值替代C2则会导致同步器内部常数测试结果不准确,从而影响同步器MTBF评估的准确度。Currently the main formula used Perform synchronizer reliability evaluation (where F d is the data conversion frequency of the input synchronizer, F c is the clock frequency of the receiving clock domain, T is the clock cycle of the receiving clock domain, i+1 is the number of registers in the synchronizer, C 1 and C 2 are internal constants of the synchronizer: C 1 is a window constant, and C 2 is a time constant). The synchronizer composed of two-level registers uses Evaluate (where C 2M is the time constant of the master latch of the register in the synchronizer, C 2S is the time constant of the slave latch of the register in the synchronizer, and λ is the duty cycle of the destination clock domain clock). It can be seen from the above formula that in order to evaluate the mean time between failure (MTBF) of the synchronizer, in addition to the four external influencing parameters known from the specific application, F d , F c , T, λ, it is also necessary to measure C 1 , C 2 Two internal constants related to the device. Currently, the test circuit shown in Figure 2 can be used to obtain internal constants C 1 and C 2 , where CLK1 is the clock signal in the first clock domain, CLK2 is the clock signal in the second clock domain, and the register to be tested is Register B; the output of register B to be tested is sampled by register C and register D after a full cycle and a half cycle of CLK2, respectively. Metastable states are detected when the sampled values of the two registers are different. Since unit B to be tested is sampled by register D after half a CLK2 clock period, only the main latch of register B to be tested performs metastable recovery during the high level of the clock, so this circuit can only measure the register The time constant C 2M of the master latch cannot measure the complete time constant C 2 of the register. According to the formula When C 2M and C 2s in the register are equal, the value of time constant C 2 can be replaced by the value of C 2M measured. If the process parameters of the master latch and the slave latch of this register are different, replacing C 2 with the value of C 2M will lead to inaccurate test results of the internal constant of the synchronizer, thereby affecting the accuracy of the synchronizer MTBF evaluation.

发明内容Contents of the invention

为了解决上述问题,本发明的目的在于提供一种跨时钟域同步器内部常数测试电路和方法。In order to solve the above problems, the object of the present invention is to provide a circuit and method for testing internal constants of a cross-clock domain synchronizer.

为了达到上述目的,本发明提供的跨时钟域同步器内部常数测试电路和方法包括:异步数据单元、待检测单元、第一亚稳态计数单元、第二亚稳态计数单元、模式选择单元和计时单元;其中:异步数据单元与待检测单元连接,待检测单元分别与第一亚稳态计数单元和第二亚稳态计数单元相连接,第一亚稳态计数单元与模式选择单元连接,第二亚稳态计数单元与模式选择单元连接,模式选择单元与计时单元相连接;异步数据单元与第一时钟输入信号CLK1相连接;模式选择单元分别与模式选择信号SEL以及第二时钟输入信号CLK2_M1和第三时钟输入信号CLK2_M2相连接。In order to achieve the above object, the cross-clock domain synchronizer internal constant test circuit and method provided by the present invention include: an asynchronous data unit, a unit to be detected, a first metastable counting unit, a second metastable counting unit, a mode selection unit and Timing unit; wherein: the asynchronous data unit is connected to the unit to be detected, the unit to be detected is respectively connected to the first metastable counting unit and the second metastable counting unit, the first metastable counting unit is connected to the mode selection unit, The second metastable counting unit is connected with the mode selection unit, and the mode selection unit is connected with the timing unit; the asynchronous data unit is connected with the first clock input signal CLK1; the mode selection unit is respectively connected with the mode selection signal SEL and the second clock input signal CLK2_M1 is connected to the third clock input signal CLK2_M2.

所述的第一时钟输入信号CLK1与第二时钟输入信号CLK2_M1为两个不同源的异步时钟,第一时钟输入信号CLK1与第三时钟输入信号CLK2_M2也为两个不同源的异步时钟,第二时钟输入信号CLK2_M1和第三时钟输入信号CLK2_M2不同时存在;第二时钟输入信号CLK2_M1为频率较慢时钟;第三时钟输入信号CLK2_M2为频率较快时钟,设置第三时钟输入信号CLK2_M2时钟周期为第二时钟输入信号CLK2_M1的一半。The first clock input signal CLK1 and the second clock input signal CLK2_M1 are asynchronous clocks from two different sources, and the first clock input signal CLK1 and the third clock input signal CLK2_M2 are also asynchronous clocks from two different sources. The clock input signal CLK2_M1 and the third clock input signal CLK2_M2 do not exist at the same time; the second clock input signal CLK2_M1 is a clock with a slower frequency; the third clock input signal CLK2_M2 is a clock with a faster frequency, and the clock period of the third clock input signal CLK2_M2 is set as the first Half of the second clock input signal CLK2_M1.

所述的异步数据单元1包括第一寄存器和第一反相器,第一寄存器的输出端口通过第一反相器返回到第一寄存器的输入端口。The asynchronous data unit 1 includes a first register and a first inverter, and the output port of the first register returns to the input port of the first register through the first inverter.

所述的模式选择单元主要包括第一多路选择器和第二多路选择器。The mode selection unit mainly includes a first multiplexer and a second multiplexer.

所述的第一亚稳态计数单元包括第二寄存器和第三寄存器、第一可配置相位延迟模块、第一异或门、第六寄存器和第一亚稳态计数器。The first metastable counting unit includes a second register and a third register, a first configurable phase delay module, a first exclusive OR gate, a sixth register and a first metastable counter.

所述的第二亚稳态计数单元包括第四寄存器、第五寄存器、第二可配置相位延迟模块、第二异或门、第七寄存器和第二亚稳态计数器。The second metastable counting unit includes a fourth register, a fifth register, a second configurable phase delay module, a second exclusive OR gate, a seventh register and a second metastable counter.

本发明提供的跨时钟域同步器内部常数测试方法包括按顺序执行的下列步骤:The method for testing internal constants of cross-clock domain synchronizers provided by the present invention includes the following steps executed in sequence:

步骤1)生成异步信号的S1阶段:由异步数据单元生成与第二时钟域异步的第一时钟域数字信号,即第一寄存器的输出端Q的输出信号;Step 1) S1 stage of generating an asynchronous signal: the asynchronous data unit generates a digital signal in the first clock domain that is asynchronous with the second clock domain, that is, the output signal of the output terminal Q of the first register;

步骤2)选择第一模式的S2阶段:通过模式选择单元的模式选择信号SEL选择模式一,对待检测单元主锁存器进行主锁存器时间常数测试,此时第一亚稳态计数单元工作有效,并且选择第二时钟域时钟信号为时钟频率较慢的第二时钟输入信号CLK2_M1;Step 2) Select the S2 stage of the first mode: select mode one by the mode selection signal SEL of the mode selection unit, and carry out the main latch time constant test for the main latch of the unit to be detected, and now the first metastable counting unit works It is valid, and the second clock domain clock signal is selected as the second clock input signal CLK2_M1 with a slower clock frequency;

步骤3)配置第一延迟时间初始值的S3阶段:设定第一亚稳态计数单元中的第一可配置相位延迟模块的延迟时间的初始值,即为使用待检测单元主锁存器进行亚稳态处理的解决时间t的初始值;Step 3) Stage S3 of configuring the initial value of the first delay time: setting the initial value of the delay time of the first configurable phase delay module in the first metastable counting unit, that is, using the main latch of the unit to be detected initial value of the solution time t for metastable processing;

步骤4)第一亚稳态计数单元计数至预期采样数目N1的S4阶段:第一亚稳态计数单元对亚稳态进行统计,当第一亚稳态计数器达到预期采样数目N1时,第三计数器停止工作;Step 4) The first metastable counting unit counts to the S4 stage of the expected sampling number N1: the first metastable counting unit counts the metastable state, and when the first metastable counter reaches the expected sampling number N1, the third The counter stops working;

步骤5)记录当前延迟时间和计时单元中数值的S5阶段:记录第三计数器的数值及对应的第一可配置相位延迟模块(Y1)的延迟时间值;Step 5) record the current delay time and the S5 stage of the value in the timing unit: record the value of the third counter and the delay time value of the corresponding first configurable phase delay module (Y1);

步骤6)判断测试次数是否达到预期采样次数N2的S6阶段:判断主锁存器时间常数测试的次数是否到达预期采样次数N2次,即当前采样是否达到预期采样次数N2;如果判断结果为“是”,则进入下一步S8阶段,否则下一步进入S7阶段;Step 6) S6 stage of judging whether the number of tests reaches the expected number of samples N2: whether the times of judging the main latch time constant test reaches the expected number of samples N2 times, that is, whether the current sampling reaches the expected number of samples N2; if the judgment result is "Yes ", then enter the next step S8 stage, otherwise the next step enters the S7 stage;

步骤7)配置第一延迟时间的新值的S7阶段:重新设定第一亚稳态计数单元中第一可配置相位延迟模块的延迟时间值,下一步重新进入S4阶段,继续下一循环测试;Step 7) S7 stage of configuring the new value of the first delay time: reset the delay time value of the first configurable phase delay module in the first metastable counting unit, and then re-enter the S4 stage in the next step to continue the next cycle test ;

步骤8)处理测试数据,得到主锁存器的时间常数C2M的S8阶段:对测试数据进行处理,通过记录的预期采样次数N2个计时单元的值及对应的第一可配置相位延迟模块延迟时间,对待测试单元中的待测寄存器进行主锁存器的时间常数C2M的测量计算;Step 8) process the test data, obtain the time constant C of the master latch S8 stage: process the test data, pass the value of the expected sampling times N2 timing units of the record and the corresponding first configurable phase delay module delay Time, measure and calculate the time constant C 2M of the main latch for the register to be tested in the unit to be tested;

步骤9)选择模式二的S9阶段:通过模式选择单元的模式选择信号SEL选择模式二,进行待检测单元从锁存器时间常数及同步器窗口常数测试,此时第二亚稳态计数单元工作有效,并且选择第二时钟域时钟信号为时钟频率较快的第三时钟输入信号CLK2_M2;Step 9) select the S9 stage of mode two: select mode two by the mode selection signal SEL of mode selection unit, carry out to-be-detected unit from latch time constant and synchronizer window constant test, now the second metastable counting unit work It is valid, and the second clock domain clock signal is selected as the third clock input signal CLK2_M2 with a faster clock frequency;

步骤10)配置第二延迟时间初始值的S10阶段:设定第二亚稳态计数单元中的第二可配置相位延迟模块的延迟时间的初始值,即为使用待检测单元从锁存器进行亚稳态处理的解决时间t的初始值;Step 10) S10 stage of configuring the second delay time initial value: setting the initial value of the delay time of the second configurable phase delay module in the second metastable state counting unit, that is, using the unit to be detected to carry out from the latch initial value of the solution time t for metastable processing;

步骤11)第二亚稳态计数单元计数至预期采样数目N1的S11阶段:第二亚稳态计数单元对亚稳态进行统计,当第二亚稳态计数器达到预期采样数目N1时,使第三计数器停止工作;Step 11) The second metastable counting unit counts to the S11 stage of the expected sampling number N1: the second metastable counting unit counts the metastable state, and when the second metastable counter reaches the expected sampling number N1, the first Three counters stop working;

步骤12)记录当前延迟时间和计时单元中数值的S12阶段:记录第三计数器的数值及对应的第二可配置相位延迟模块的延迟时间值;Step 12) S12 stage of recording the current delay time and the value in the timing unit: record the value of the third counter and the delay time value of the corresponding second configurable phase delay module;

步骤13)判断测试次数是否达到预期采样次数N2的S13阶段:判断从锁存器时间常数测试的次数是否到达预期采样次数N2次,如果判断结果为“是”,则进入下一步S15阶段,否则下一步进入S14阶段;Step 13) S13 stage of judging whether the number of tests reaches the expected number of sampling times N2: judging whether the number of times of the slave latch time constant test reaches the expected number of sampling times N2 times, if the judgment result is "yes", then enter the next step S15 stage, otherwise The next step is to enter the S14 stage;

步骤14)配置第二延迟时间的新值的S14阶段:重新设定第二亚稳态计数单元中第二可配置相位延迟模块的延迟时间值,下一步重新进入S11阶段,继续下一循环测试;Step 14) Stage S14 of configuring the new value of the second delay time: reset the delay time value of the second configurable phase delay module in the second metastable counting unit, and then re-enter the S11 stage in the next step to continue the next cycle test ;

步骤15)处理测试数据,得到同步器内部常数C1,C2的S15阶段:对测试数据进行处理,通过记录的预期采样次数N2个计时单元的值及对应的第二可配置相位延迟模块延迟时间对同步器中的待测寄存器进行内部常数C2及C1测量计算;本流程至此结束。Step 15) process the test data, obtain the synchronizer internal constant C 1 , the S15 stage of C 2 : process the test data, pass the value of the expected sampling times N2 timing units recorded and the corresponding second configurable phase delay module delay The internal constants C 2 and C 1 are measured and calculated for the register to be tested in the synchronizer; this process ends here.

在S8阶段中,所述的主锁存器的时间常数C2M的计算方法如下:根据公式其中t为主锁存器解决时间,即第一可配置相位延迟模块Y1的值,对上述公式两边同时取自然对数,则可得到此时的MTBF可通过第三计数器的值乘以第二时钟输入信号CLK2_M1时钟周期除以第一亚稳态计数器的预期采样数目N1值计算得出;以第一可配置相位延迟模块的延迟时间t为横轴,ln(MTBF)为纵轴,在坐标轴上确定出N2个点;以N2个采样点绘制直线,得到的斜率k1的倒数即为C2MIn the S8 stage, the calculation method of the time constant C 2M of the master latch is as follows: According to the formula Among them, t is the solution time of the main latch, that is, the value of the first configurable phase delay module Y1, taking the natural logarithm on both sides of the above formula at the same time, then it can be obtained The MTBF at this time can be calculated by multiplying the value of the third counter by the clock period of the second clock input signal CLK2_M1 divided by the expected sampling number N1 value of the first metastable counter; the delay time of the first configurable phase delay module t is the horizontal axis, ln(MTBF) is the vertical axis, and N2 points are determined on the coordinate axis; a straight line is drawn with N2 sampling points, and the reciprocal of the slope k1 obtained is C 2M .

在S15阶段中,所述的同步器内部常数C1、C2的计算方法如下:根据其中t为从锁存器解决时间,即第二可配置相位延迟模块的值,λT为目的时钟域时钟第三时钟输入信号CLK2_M2高电平时间,对上述公式两边同时取自然对数,则可得到其中C2M可由步骤8)计算得出,因此lnFd,lnFc为已知;此时的MTBF可通过第三计数器的值乘以第三时钟输入信号CLK2_M2时钟周期除以第二亚稳态计数器的预期采样数目N1值计算得出;以第二可配置相位延迟模块延迟时间t为横轴,ln(MTBF)为纵轴,确定出N2个点,以N2个采样点绘制直线,得到的斜率的倒数k2即为从锁存器的时间常数C2S;并且可得到绘制直线与y轴的交点值Yc,则窗口常数C1可由算出,时间常数C2可由算出。In the S15 stage, the calculation method of the internal constants C 1 and C 2 of the synchronizer is as follows: according to Where t is the resolution time from the latch, that is, the value of the second configurable phase delay module, and λT is the high-level time of the third clock input signal CLK2_M2 of the destination clock domain clock. Taking the natural logarithm on both sides of the above formula at the same time, it can be get where C 2M can be calculated by step 8), so lnF d and lnF c are known; the MTBF at this time can be calculated by multiplying the value of the third counter by the clock period of the third clock input signal CLK2_M2 divided by the expected sampling number N1 value of the second metastable counter; 2. The delay time t of the configurable phase delay module is the horizontal axis, ln(MTBF) is the vertical axis, determine N2 points, draw a straight line with N2 sampling points, and the reciprocal k2 of the obtained slope is the time constant of the slave latch C 2S ; and the intersection point value Yc of the drawn line and the y-axis can be obtained, then the window constant C 1 can be obtained by Calculated, the time constant C2 can be given by figured out.

本发明公开了一种进行跨时钟域同步器MTBF评估时使用的同步器内部常数的测试电路和方法。其包括对同步器内部常数测试电路的设计实现、测试操作及数据计算的内容。本发明解决了进行跨时钟域同步器MTBF评估时同步器内部常数难以准确获得的问题,可应用在由主从锁存器工艺参数不同的寄存器构成的同步器中,提高了同步器内部常数测试结果的准确性和适用范围。The invention discloses a test circuit and method for the internal constant of the synchronizer used when evaluating the MTBF of the cross-clock domain synchronizer. It includes the design and implementation of the internal constant test circuit of the synchronizer, test operation and data calculation. The invention solves the problem that it is difficult to accurately obtain the internal constant of the synchronizer when evaluating the MTBF of the cross-clock domain synchronizer, and can be applied to a synchronizer composed of registers with different process parameters of the master-slave latch, and improves the test of the internal constant of the synchronizer The accuracy and applicability of the results.

附图说明Description of drawings

图1为已有技术中的跨时钟域同步器电路原理图。FIG. 1 is a circuit schematic diagram of a cross-clock domain synchronizer in the prior art.

图2为已有技术中的跨时钟域同步器内部常数测试电路原理图。FIG. 2 is a schematic diagram of an internal constant test circuit of a cross-clock domain synchronizer in the prior art.

图3为本发明提供的跨时钟域同步器内部常数测试电路组成框图。FIG. 3 is a block diagram of an internal constant test circuit of a cross-clock domain synchronizer provided by the present invention.

图4为本发明提供的跨时钟域同步器内部常数测试电路原理图。FIG. 4 is a schematic diagram of an internal constant test circuit of a cross-clock domain synchronizer provided by the present invention.

图5为本发明提供的跨时钟域同步器内部常数测试方法流程图。FIG. 5 is a flowchart of a method for testing internal constants of a cross-clock domain synchronizer provided by the present invention.

具体实施方式detailed description

下面结合附图和具体实施例对本发明提供的跨时钟域同步器内部常数测试电路和方法进行详细说明。The circuit and method for testing the internal constant of a cross-clock domain synchronizer provided by the present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments.

如图3所示,本发明提供的跨时钟域同步器内部常数测试电路包括:异步数据单元1、待检测单元2、第一亚稳态计数单元3、第二亚稳态计数单元4、模式选择单元5和计时单元6;其中:异步数据单元1与待检测单元2连接,待检测单元2分别与第一亚稳态计数单元3和第二亚稳态计数单元4相连接,第一亚稳态计数单元3与模式选择单元5连接,第二亚稳态计数单元4与模式选择单元5连接,模式选择单元5与计时单元6相连接;异步数据单元1与第一时钟输入信号CLK1相连接;模式选择单元5分别与模式选择信号SEL以及第二时钟输入信号CLK2_M1和第三时钟输入信号CLK2_M2相连接。As shown in Figure 3, the internal constant test circuit of the cross-clock domain synchronizer provided by the present invention includes: an asynchronous data unit 1, a unit to be detected 2, a first metastable counting unit 3, a second metastable counting unit 4, a mode Selection unit 5 and timing unit 6; wherein: the asynchronous data unit 1 is connected with the unit 2 to be detected, and the unit 2 to be detected is connected with the first metastable counting unit 3 and the second metastable counting unit 4 respectively, and the first substable The stable counting unit 3 is connected with the mode selection unit 5, the second metastable counting unit 4 is connected with the mode selection unit 5, and the mode selection unit 5 is connected with the timing unit 6; the asynchronous data unit 1 is connected with the first clock input signal CLK1 Connection; the mode selection unit 5 is connected to the mode selection signal SEL and the second clock input signal CLK2_M1 and the third clock input signal CLK2_M2 respectively.

异步数据单元1属于第一时钟域;模式选择单元5为组合逻辑,不需要时钟驱动;待检测单元2、第一亚稳态计数单元3、第二亚稳态计数单元4和计时单元6属于第二时钟域;模式选择单元5为第二时钟域的单元选择时钟装置,并且选择第一亚稳态计数单元3的输出或第二亚稳态计数单元4的输出与计时单元6相连。The asynchronous data unit 1 belongs to the first clock domain; the mode selection unit 5 is a combinational logic and does not need to be driven by a clock; the unit to be detected 2, the first metastable counting unit 3, the second metastable counting unit 4 and the timing unit 6 belong to The second clock domain; the mode selection unit 5 selects a clock device for units in the second clock domain, and selects the output of the first metastable counting unit 3 or the output of the second metastable counting unit 4 to be connected to the timing unit 6 .

如图4所示,第一时钟输入信号CLK1与第二时钟输入信号CLK2_M1为两个不同源的异步时钟,第一时钟输入信号CLK1与第三时钟输入信号CLK2_M2也为两个不同源的异步时钟,第二时钟输入信号CLK2_M1和第三时钟输入信号CLK2_M2不同时存在;在模式一测试主锁存器的情况下,选择时钟频率较慢的第二时钟输入信号CLK2_M1作为输入时钟;为提高亚稳态产生频率,在模式二测试从锁存器的情况下,选择时钟频率较快的第三时钟输入信号CLK2_M2作为输入时钟,可设置第三时钟输入信号CLK2_M2时钟周期为第二时钟输入信号CLK2_M1的一半。As shown in Figure 4, the first clock input signal CLK1 and the second clock input signal CLK2_M1 are asynchronous clocks from two different sources, and the first clock input signal CLK1 and the third clock input signal CLK2_M2 are also asynchronous clocks from two different sources. , the second clock input signal CLK2_M1 and the third clock input signal CLK2_M2 do not exist at the same time; in the case of testing the master latch in mode one, the second clock input signal CLK2_M1 with a slower clock frequency is selected as the input clock; in order to improve metastability In the case of testing the slave latch in mode 2, the third clock input signal CLK2_M2 with a faster clock frequency is selected as the input clock, and the clock period of the third clock input signal CLK2_M2 can be set to be that of the second clock input signal CLK2_M1 half.

所述的异步数据单元1包括第一寄存器A1和第一反相器M1,第一寄存器A1的输出端口通过第一反相器M1返回到第一寄存器A1的输入端口;用于生成第一时钟域的数据信号,即第一寄存器A1的输出端Q的输出信号。The asynchronous data unit 1 includes a first register A1 and a first inverter M1, the output port of the first register A1 returns to the input port of the first register A1 through the first inverter M1; it is used to generate the first clock The data signal of the field, that is, the output signal of the output terminal Q of the first register A1.

所述的模式选择单元5主要包括第一多路选择器X1和第二多路选择器X2,用于根据模式选择信号SEL确定主锁存器测试模式和从锁存器测试模式间的选择;第一多路选择器X1选择第二时钟输入信号CLK2_M1或第三时钟输入信号CLK2_M2作为第二时钟域的输入时钟CLK2;第二多路选择器X2选择第一亚稳态计数器J1或者第二亚稳态计数器J2在到达预期采样数目N1时的输出信号作为第三计数器J3停止计数的使能信号。The mode selection unit 5 mainly includes a first multiplexer X1 and a second multiplexer X2, which are used to determine the selection between the master latch test mode and the slave latch test mode according to the mode selection signal SEL; The first multiplexer X1 selects the second clock input signal CLK2_M1 or the third clock input signal CLK2_M2 as the input clock CLK2 of the second clock domain; the second multiplexer X2 selects the first metastable counter J1 or the second substable counter J1 The output signal of the steady-state counter J2 when it reaches the expected sampling number N1 serves as an enabling signal for the third counter J3 to stop counting.

所述的待检测单元2是待测寄存器B。The unit 2 to be tested is the register B to be tested.

所述的第一亚稳态计数单元3包括第二寄存器A2和第三寄存器A3、第一可配置相位延迟模块Y1、第一异或门M3、第六寄存器A6和第一亚稳态计数器J1;该单元在模式一工作有效,对使用待测寄存器B主锁存器进行第一可配置相位延迟模块Y1延迟时间恢复后的亚稳态数目进行统计;待检测单元2的输出信号在第二时钟域的原时钟的反相时钟和第二时钟域的原时钟延迟第一可配置相位延迟模块Y1时钟的上升沿分别通过第三寄存器A3和第二寄存器A2进行采样,把输出结果经过第一异或门M3异或逻辑后,输入到由第二时钟域的原时钟延迟第一可配置相位延迟模块Y1时钟的上升沿触发的第六寄存器A6后,由第一亚稳态计数器J1进行亚稳态计数。The first metastable counting unit 3 includes a second register A2 and a third register A3, a first configurable phase delay module Y1, a first XOR gate M3, a sixth register A6 and a first metastable counter J1 ; This unit works effectively in mode 1, and uses the main latch of the register B to be tested to carry out statistics on the number of metastable states after the delay time recovery of the first configurable phase delay module Y1; the output signal of the unit 2 to be detected is in the second The inverse clock of the original clock in the clock domain and the original clock delay in the second clock domain The rising edge of the first configurable phase delay module Y1 clock is sampled through the third register A3 and the second register A2 respectively, and the output result is passed through the first After the exclusive OR logic of the exclusive OR gate M3, it is input to the sixth register A6 triggered by the rising edge of the first configurable phase delay module Y1 clock delayed by the original clock of the second clock domain, and then the first metastable counter J1 performs substable steady state count.

所述的第二亚稳态计数单元4包括第四寄存器A4、第五寄存器A5、第二可配置相位延迟模块Y2、第二异或门M4、第七寄存器A7和第二亚稳态计数器J2;该单元在模式二工作有效,对使用待测寄存器B主锁存器进行半个第三时钟输入信号CLK2_M2时钟周期解决时间恢复和其从锁存器进行第二可配置相位延迟模块Y2延迟时间恢复后亚稳态数目进行统计;待检测单元2的输出信号在第二时钟域的原时钟和第二时钟域的原时钟的反向时钟延迟第二可配置相位延迟模块Y2时钟的上升沿分别通过第五寄存器A5和第四寄存器A4进行采样,把输出结果经过异或逻辑后,输入到由第二时钟域的原时钟的反向时钟延迟第二可配置相位延迟模块Y2时钟上升沿触发的第七寄存器A7后,由第二亚稳态计数器J2进行亚稳态计数。The second metastable counting unit 4 includes a fourth register A4, a fifth register A5, a second configurable phase delay module Y2, a second XOR gate M4, a seventh register A7 and a second metastable counter J2 ; This unit works effectively in mode 2, and uses half of the third clock input signal CLK2_M2 clock cycle to solve the time recovery of the master latch of the register B to be tested and its second configurable phase delay module Y2 delay time from the latch After recovery, the number of metastable states is counted; the output signal of the unit 2 to be detected is delayed by the original clock of the second clock domain and the reverse clock of the original clock of the second clock domain. The rising edge of the second configurable phase delay module Y2 clock respectively Sampling is carried out through the fifth register A5 and the fourth register A4, and the output result is input to the clock rising edge triggered by the reverse clock delay of the original clock of the second clock domain and the second configurable phase delay module Y2 after passing through the exclusive OR logic After the seventh register A7, the metastable counting is performed by the second metastable counter J2.

计时单元6包括第三计数器J3,其分别在模式一和模式二下对采样到预期采样数目N1个亚稳态所需的时间进行计时;测试工作时每隔一个第二时钟域的时钟周期对第三计数器J3进行加一操作,当对应模式下的亚稳态计数单元中的亚稳态计数器的值达到预期采样数目N1时,产生的停止计数的使能信号使第三计数器J3停止计数,并保留原值不变直到进行下次测试。Timing unit 6 includes a third counter J3, which clocks the time required for sampling to the expected sampling number N1 metastable states in mode one and mode two respectively; The third counter J3 performs an addition operation, and when the value of the metastable counter in the metastable counting unit in the corresponding mode reaches the expected sampling number N1, the generated enable signal to stop counting causes the third counter J3 to stop counting, And keep the original value unchanged until the next test.

所述的第一亚稳态计数单元3中第一亚稳态计数器J1对模式一下的亚稳态产生数进行统计,当亚稳态达到预期采样数目N1时,第一亚稳态计数器J1停止工作,产生的停止计数的使能信号通过模式选择单元5使第三计数器J3停止工作。In the first metastable state counting unit 3, the first metastable state counter J1 counts the number of metastable states generated in the first mode, and when the metastable state reaches the expected sampling number N1, the first metastable state counter J1 stops work, the generated enable signal to stop counting will make the third counter J3 stop working through the mode selection unit 5 .

所述的第二亚稳态计数单元4中第二亚稳态计数器J2对模式二下的亚稳态产生数进行统计,当亚稳态达到预期采样数目N1时,第二亚稳态计数器J2停止工作,产生的停止计数的使能信号通过模式选择单元5使第三计数器J3停止工作。In the second metastable state counting unit 4, the second metastable state counter J2 counts the number of metastable states generated under the mode two, and when the metastable state reaches the expected sampling number N1, the second metastable state counter J2 To stop working, the generated enabling signal for stopping counting will cause the third counter J3 to stop working through the mode selection unit 5 .

如图5所示,本发明提供的利用上述跨时钟域同步器内部常数测试电路进行跨时钟域同步器内部常数测试的方法包括按顺序执行的下列步骤:As shown in Figure 5, the method for testing the internal constants of the cross-clock domain synchronizer provided by the present invention using the above-mentioned internal constant test circuit of the cross-clock domain synchronizer includes the following steps executed in order:

步骤1)生成异步信号的S1阶段:由异步数据单元1生成与第二时钟域异步的第一时钟域数字信号,即第一寄存器A1的输出端Q的输出信号;Step 1) S1 stage of generating asynchronous signal: the asynchronous data unit 1 generates a digital signal in the first clock domain asynchronous to the second clock domain, that is, the output signal of the output terminal Q of the first register A1;

步骤2)选择第一模式的S2阶段:通过模式选择单元5的模式选择信号SEL选择模式一,对待检测单元2主锁存器进行主锁存器时间常数测试,此时第一亚稳态计数单元3工作有效,并且选择第二时钟域时钟信号为时钟频率较慢的第二时钟输入信号CLK2_M1;Step 2) select the S2 stage of the first mode: select mode one by the mode selection signal SEL of the mode selection unit 5, and carry out the main latch time constant test for the main latch of the detection unit 2, and now the first metastable state counts Unit 3 works effectively, and selects the second clock domain clock signal as the second clock input signal CLK2_M1 with a slower clock frequency;

步骤3)配置第一延迟时间初始值的S3阶段:设定第一亚稳态计数单元3中的第一可配置相位延迟模块Y1的延迟时间的初始值,即为使用待检测单元2主锁存器进行亚稳态处理的解决时间t的初始值;Step 3) Stage S3 of configuring the initial value of the first delay time: set the initial value of the delay time of the first configurable phase delay module Y1 in the first metastable counting unit 3, which is to use the main lock of the unit 2 to be detected The initial value of the resolution time t of the metastable state processing of the memory;

步骤4)第一亚稳态计数单元计数至预期采样数目N1的S4阶段:第一亚稳态计数单元3对亚稳态进行统计,当第一亚稳态计数器J1达到预期采样数目N1时,第三计数器J3停止工作;Step 4) The first metastable state counting unit counts to the S4 stage of the expected sampling number N1: the first metastable state counting unit 3 counts the metastable state, and when the first metastable state counter J1 reaches the expected sampling number N1, The third counter J3 stops working;

步骤5)记录当前延迟时间和计时单元中数值的S5阶段:记录第三计数器J3的数值及对应的第一可配置相位延迟模块Y1的延迟时间值;Step 5) S5 stage of recording the current delay time and the value in the timing unit: record the value of the third counter J3 and the corresponding delay time value of the first configurable phase delay module Y1;

步骤6)判断测试次数是否达到预期采样次数N2的S6阶段:判断主锁存器时间常数测试的次数是否到达预期采样次数N2次,即当前采样是否达到预期采样次数N2;如果判断结果为“是”,则进入下一步S8阶段,否则下一步进入S7阶段;Step 6) S6 stage of judging whether the number of tests reaches the expected number of samples N2: whether the times of judging the main latch time constant test reaches the expected number of samples N2 times, that is, whether the current sampling reaches the expected number of samples N2; if the judgment result is "Yes ", then enter the next step S8 stage, otherwise the next step enters the S7 stage;

步骤7)配置第一延迟时间的新值的S7阶段:重新设定第一亚稳态计数单元3中第一可配置相位延迟模块Y1的延迟时间值,下一步重新进入S4阶段,继续下一循环测试;Step 7) The S7 stage of configuring the new value of the first delay time: reset the delay time value of the first configurable phase delay module Y1 in the first metastable state counting unit 3, the next step re-enters the S4 stage, and continues to the next step cycle test;

步骤8)处理测试数据,得到主锁存器的时间常数C2M的S8阶段:对测试数据进行处理,通过记录的预期采样次数N2个计时单元6的值及对应的第一可配置相位延迟模块Y1延迟时间,对待测试单元2中的待测寄存器B进行主锁存器的时间常数C2M的测量计算;Step 8) process the test data, obtain the time constant C of the master latch S8 stage: process the test data, pass the value of the expected sampling times N2 timing units 6 of the record and the corresponding first configurable phase delay module Y1 delay time, the measurement and calculation of the time constant C 2M of the main latch is carried out for the register B to be tested in the unit 2 to be tested;

步骤9)选择模式二的S9阶段:通过模式选择单元5的模式选择信号SEL选择模式二,进行待检测单元2从锁存器时间常数及同步器窗口常数测试,此时第二亚稳态计数单元4工作有效,并且选择第二时钟域时钟信号为时钟频率较快的第三时钟输入信号CLK2_M2;Step 9) select the S9 stage of mode two: select mode two by the mode selection signal SEL of mode selection unit 5, carry out to-be-detected unit 2 from latch time constant and synchronizer window constant test, now the second metastable count Unit 4 works effectively, and selects the second clock domain clock signal as the third clock input signal CLK2_M2 with a faster clock frequency;

步骤10)配置第二延迟时间初始值的S10阶段:设定第二亚稳态计数单元4中的第二可配置相位延迟模块Y2的延迟时间的初始值,即为使用待检测单元2从锁存器进行亚稳态处理的解决时间t的初始值;Step 10) S10 stage of configuring the second delay time initial value: setting the initial value of the delay time of the second configurable phase delay module Y2 in the second metastable state counting unit 4, which is to use the unit to be detected 2 from the lock The initial value of the resolution time t of the metastable state processing of the memory;

步骤11)第二亚稳态计数单元计数至预期采样数目N1的S11阶段:第二亚稳态计数单元4对亚稳态进行统计,当第二亚稳态计数器J2达到预期采样数目N1时,使第三计数器J3停止工作;Step 11) The second metastable state counting unit counts to the S11 stage of the expected sampling number N1: the second metastable state counting unit 4 counts the metastable state, and when the second metastable state counter J2 reaches the expected sampling number N1, Make the third counter J3 stop working;

步骤12)记录当前延迟时间和计时单元中数值的S12阶段:记录第三计数器J3的数值及对应的第二可配置相位延迟模块Y2的延迟时间值;Step 12) S12 stage of recording the current delay time and the value in the timing unit: record the value of the third counter J3 and the delay time value of the corresponding second configurable phase delay module Y2;

步骤13)判断测试次数是否达到预期采样次数N2的S13阶段:判断从锁存器时间常数测试的次数是否到达预期采样次数N2次,如果判断结果为“是”,则进入下一步S15阶段,否则下一步进入S14阶段;Step 13) S13 stage of judging whether the number of tests reaches the expected number of sampling times N2: judging whether the number of times of the slave latch time constant test reaches the expected number of sampling times N2 times, if the judgment result is "yes", then enter the next step S15 stage, otherwise The next step is to enter the S14 stage;

步骤14)配置第二延迟时间的新值的S14阶段:重新设定第二亚稳态计数单元4中第二可配置相位延迟模块Y2的延迟时间值,下一步重新进入S11阶段,继续下一循环测试;Step 14) S14 stage of configuring the new value of the second delay time: reset the delay time value of the second configurable phase delay module Y2 in the second metastable state counting unit 4, the next step re-enters the S11 stage, and continues to the next step cycle test;

步骤15)处理测试数据,得到同步器内部常数C1,C2的S15阶段:对测试数据进行处理,通过记录的预期采样次数N2个计时单元6的值及对应的第二可配置相位延迟模块Y2延迟时间对同步器中的待测寄存器B进行内部常数C2及C1测量计算;本流程至此结束。Step 15) process the test data to obtain the internal constant C1 of the synchronizer, the S15 stage of C2 : process the test data, pass the value of the expected sampling times N2 timing units 6 recorded and the corresponding second configurable phase delay module The Y2 delay time is used to measure and calculate the internal constants C 2 and C 1 of the register B to be tested in the synchronizer; this process ends here.

在S7阶段和S14阶段中,所述的重新设定延迟时间值的具体方法是按逐次递增的原则,其最终延迟时间不应该超过第二时钟域时钟的半个周期。In the S7 stage and the S14 stage, the specific method of resetting the delay time value is based on the principle of increasing successively, and the final delay time should not exceed half a cycle of the second clock domain clock.

所述的第一亚稳态计数单元3中第一可配置相位延迟模块Y1用于对第二时钟域的时钟信号进行可配置的不同延迟的实现,第二亚稳态计数单元4中的第二可配置相位延迟模块Y2用于对第二时钟域相位反向的时钟信号进行可配置的不同延迟的实现;实际测试中,采用循环测试的方法;在每次测试中,延迟时间逐渐递增,但最终延迟时间不应该超过第二时钟域时钟的半个周期。The first configurable phase delay module Y1 in the first metastable counting unit 3 is used to implement configurable different delays for the clock signal in the second clock domain, and the first metastable phase delay module in the second metastable counting unit 4 The second configurable phase delay module Y2 is used to implement configurable different delays for the clock signal with the reverse phase of the second clock domain; in the actual test, the loop test method is adopted; in each test, the delay time is gradually increased, But the final delay time should not exceed half cycle of the second clock domain clock.

在S8阶段中,所述的主锁存器的时间常数C2M的计算方法如下:根据公式(t为主锁存器解决时间,即第一可配置相位延迟模块Y1的值),对上述公式两边同时取自然对数,则可得到此时的MTBF可通过第三计数器J3的值乘以第二时钟输入信号CLK2_M1时钟周期除以第一亚稳态计数器J1的预期采样数目N1值计算得出;以第一可配置相位延迟模块Y1的延迟时间t为横轴,ln(MTBF)为纵轴,在坐标轴上确定出N2个点;以N2个采样点绘制直线,得到的斜率k1的倒数即为C2MIn the S8 stage, the calculation method of the time constant C 2M of the master latch is as follows: According to the formula (t is the solution time of the master latch, that is, the value of the first configurable phase delay module Y1), taking the natural logarithm on both sides of the above formula at the same time, it can be obtained The MTBF at this time can be calculated by multiplying the value of the third counter J3 by the clock period of the second clock input signal CLK2_M1 divided by the expected sampling number N1 value of the first metastable counter J1; the first configurable phase delay module Y1 The delay time t is the horizontal axis, ln(MTBF) is the vertical axis, and N2 points are determined on the coordinate axis; a straight line is drawn with N2 sampling points, and the reciprocal of the slope k1 obtained is C 2M .

在S15阶段中,所述的同步器内部常数C1、C2的计算方法如下:根据(t为从锁存器解决时间,即第二可配置相位延迟模块Y2的值,λT为目的时钟域时钟第三时钟输入信号CLK2_M2高电平时间),对上述公式两边同时取自然对数,则可得到其中C2M可由步骤8)计算得出,因此lnFd,lnFc为已知;此时的MTBF可通过第三计数器J3的值乘以第三时钟输入信号CLK2_M2时钟周期除以第二亚稳态计数器J2的预期采样数目N1值计算得出;以第二可配置相位延迟模块Y2延迟时间t为横轴,ln(MTBF)为纵轴,确定出N2个点,以N2个采样点绘制直线,得到的斜率的倒数k2即为从锁存器的时间常数C2S;并且可得到绘制直线与y轴的交点值Yc,则窗口常数C1可由算出,时间常数C2可由算出;In the S15 stage, the calculation method of the internal constants C 1 and C 2 of the synchronizer is as follows: according to (t is the resolution time of the slave latch, that is, the value of the second configurable phase delay module Y2, and λT is the high-level time of the third clock input signal CLK2_M2 of the destination clock domain clock), taking the natural logarithm on both sides of the above formula at the same time, then you can get where C 2M can be calculated by step 8), so lnF d and lnF c are known; the MTBF at this time can be calculated by multiplying the value of the third counter J3 by the clock period of the third clock input signal CLK2_M2 divided by the expected sampling number N1 value of the second metastable counter J2; Take the delay time t of the second configurable phase delay module Y2 as the horizontal axis, ln(MTBF) as the vertical axis, determine N2 points, draw a straight line with N2 sampling points, and the reciprocal k2 of the obtained slope is the slave latch The time constant C 2S of ; and the intersection point value Yc of the drawn line and the y-axis can be obtained, then the window constant C 1 can be obtained by Calculated, the time constant C2 can be given by calculate;

为保证测试数据的准确有效性,可在同一器件的不同位置进行测试,取不同测试位置的同步器内部常数C1、C2的平均值进行MTBF计算。In order to ensure the accuracy and validity of the test data, the test can be carried out at different positions of the same device, and the average value of the internal constants C 1 and C 2 of the synchronizer at different test positions can be used for MTBF calculation.

本发明提供的跨时钟域同步器内部常数测试电路和方法解决了同步器中寄存器的主锁存器和从锁存器工艺参数不同时进行MTBF计算所需同步器内部常数难以全面准确测量的问题;提供了一种通用的同步器内部常数测试电路及测试方法,可对同步器内部常数进行准确测量计算。The internal constant test circuit and method of the cross-clock domain synchronizer provided by the present invention solve the problem that the internal constant of the synchronizer required for MTBF calculation is difficult to be fully and accurately measured when the process parameters of the master latch and the slave latch of the register in the synchronizer are different. ; Provide a general synchronizer internal constant test circuit and test method, which can accurately measure and calculate the synchronizer internal constant.

Claims (9)

1. a kind of cross clock domain lock unit internal constant test circuit, it is characterised in that:Which includes:Asynchronous data unit (1), treat Detector unit (2), the first metastable state counting unit (3), the second metastable state counting unit (4), mode selecting unit (5) and timing Unit (6);Wherein:Asynchronous data unit (1) is connected with unit to be detected (2), unit (2) to be detected respectively with the first metastable state Counting unit (3) is connected with the second metastable state counting unit (4), the first metastable state counting unit (3) and mode selecting unit (5) connect, the second metastable state counting unit (4) is connected with mode selecting unit (5), mode selecting unit (5) and timing unit (6) it is connected;Asynchronous data unit (1) is connected with the first clock input signal CLK1;Mode selecting unit (5) respectively with mould Formula selection signal SEL and second clock input signal CLK2_M1 and the 3rd clock input signal CLK2_M2 are connected.
2. cross clock domain lock unit internal constant test circuit according to claim 1, it is characterised in that:Described first Clock input signal CLK1 and second clock input signal CLK2_M1 are two not homologous asynchronous clocks, and the first clock is input into Signal CLK1 and the 3rd clock input signal CLK2_M2 are also two not homologous asynchronous clocks, second clock input signal Exist when CLK2_M1 and the 3rd clock input signal CLK2_M2 is different;Second clock input signal CLK2_M1 is that frequency is slower Clock;3rd clock input signal CLK2_M2 is the very fast clock of frequency, arranges the 3rd clock input signal CLK2_M2 clocks week Half of the phase for second clock input signal CLK2_M1.
3. cross clock domain lock unit internal constant test circuit according to claim 1, it is characterised in that:Described is asynchronous Data cell (1) includes the first depositor (A1) and the first phase inverter (M1), and the output port of the first depositor (A1) passes through the One phase inverter (M1) returns to the input port of the first depositor (A1).
4. cross clock domain lock unit internal constant test circuit according to claim 1, it is characterised in that:Described pattern Select unit (5) mainly includes the first MUX (X1) and the second MUX (X2).
5. cross clock domain lock unit internal constant test circuit according to claim 1, it is characterised in that:Described first Metastable state counting unit (3) includes the second depositor (A2) and the 3rd depositor (A3), the first configurable phase delay module (Y1), the first XOR gate (M3), the 6th depositor (A6) and the first metastable state enumerator (J1).
6. cross clock domain lock unit internal constant test circuit according to claim 1, it is characterised in that:Described second Metastable state counting unit (4) includes the 4th depositor (A4), the 5th depositor (A5), the second configurable phase delay module (Y2), the second XOR gate (M4), the 7th depositor (A7) and the second metastable state enumerator (J2).
7. the cross clock domain synchronization that the cross clock domain lock unit internal constant test circuit described in a kind of utilization claim 1 is carried out Device internal constant method of testing, it is characterised in that:Described method includes the following steps for executing in order:
Step 1) generate asynchronous signal the S1 stages:When generating first asynchronous with second clock domain by asynchronous data unit (1) Clock domain digital signal, the i.e. output signal of the outfan Q of the first depositor (A1);
Step 2) select first mode the S2 stages:Pattern is selected by the mode select signal SEL of mode selecting unit (5) One, treating detector unit (2) main latch carries out main latch time constant test, now the first metastable state counting unit (3) Work effectively, and selects second clock domain clock signal for slower second clock input signal CLK2_M1 of clock frequency;
Step 3) configuration first time delay initial value the S3 stages:First set in the first metastable state counting unit (3) can The initial value of the time delay of configuration phase Postponement module (Y1), is as carried out using unit to be detected (2) main latch metastable The initial value of the solution time t of state process;
Step 4) the first metastable state counting unit counts to expected number of samples N1 the S4 stages:First metastable state counting unit (3) metastable state is counted, when the first metastable state enumerator J1 reaches expected number of samples N1, the 3rd enumerator (J3) stops Only work;
Step 5) record current delay times and timing unit in numerical value the S5 stages:Record the 3rd enumerator (J3) numerical value and The delay time value of the corresponding first configurable phase delay module (Y1);
Step 6) judge whether testing time reaches the S6 stages of expected sampling number N2:Judge that main latch time constant is tested Number of times whether reach expected sampling number N2 time, i.e. whether present sample reaches expected sampling number N2;If it is judged that For "Yes", then the next step S8 stage is entered, otherwise next step enters the S7 stages;
Step 7) configuration the first time delay new value the S7 stages:Reset first in the first metastable state counting unit (3) The delay time value of configurable phase delay module (Y1), next step reenter the S4 stages, continue subsequent cycle test;
Step 8) process test data, obtain time constant C of main latch2MThe S8 stages:Test data is processed, is led to The value of N2 timing unit of the expected sampling number (6) of overwriting and corresponding first configurable phase delay module (Y1) postpone Time, treating the depositor to be measured (B) in test cell (2) carries out time constant C of main latch2MSurvey calculation;
Step 9) select pattern two the S9 stages:Pattern two is selected by the mode select signal SEL of mode selecting unit (5), Carry out unit to be detected (2) to test from latch time constant and lock unit window constant, now the second metastable state counting unit (4) work effectively, and second clock domain clock signal is selected for clock frequency the 3rd clock input signal CLK2_ faster M2;
Step 10) configuration second time delay initial value the S10 stages:Set second in the second metastable state counting unit (4) The initial value of the time delay of configurable phase delay module (Y2), as carries out Asia using unit to be detected (2) from latch The initial value of the solution time t of steady state process;
Step 11) the second metastable state counting unit counts to expected number of samples N1 the S11 stages:Second metastable state counting unit (4) metastable state is counted, when the second metastable state enumerator (J2) reaches expected number of samples N1, makes the 3rd enumerator (J3) quit work;
Step 12) record current delay times and timing unit in numerical value the S12 stages:Record the numerical value of the 3rd enumerator (J3) And corresponding second configurable phase delay module (Y2) delay time value;
Step 13) judge whether testing time reaches the S13 stages of expected sampling number N2:Judge to survey from latch time constant Whether the number of times of examination reaches expected sampling number N2 time, if it is judged that being "Yes", then enters the next step S15 stage, otherwise Next step enters the S14 stages;
Step 14) configuration the second time delay new value the S14 stages:Reset in the second metastable state counting unit (4) The delay time value of two configurable phase delay modules (Y2), next step reenter the S11 stages, continue subsequent cycle test;
Step 15) process test data, obtain lock unit internal constant C1, C2The S15 stages:Test data is processed, is led to The value of N2 timing unit of the expected sampling number (6) of overwriting and corresponding second configurable phase delay module (Y2) postpone Time to lock unit in depositor to be measured (B) carry out internal constant C2And C1Survey calculation;This flow process so far terminates.
8. cross clock domain lock unit internal constant method of testing according to claim 7, it is characterised in that:In the S8 stages In, time constant C of described main latch2MComputational methods as follows:According to formula Wherein t is the value that main latch solves the configurable phase delay module Y1 of time, i.e., first, and above-mentioned formula both sides are taken from simultaneously So logarithm, then be obtainedMTBF now can pass through the 3rd enumerator (J3) Value is multiplied by expected number of samples N1 value of the second clock input signal CLK2_M1 clock cycle divided by the first metastable state enumerator J1 Calculate;With the first configurable phase delay module (Y1) time delay t as transverse axis, ln (MTBF) is the longitudinal axis, in coordinate N2 point is determined on axle;With N2 sampling point-rendering straight line, the inverse of the slope k 1 for obtaining is C2M.
9. cross clock domain lock unit internal constant method of testing according to claim 7, it is characterised in that:In the S15 stages In, described lock unit internal constant C1, C2Computational methods as follows:According to Wherein t is to solve the value that time, i.e., second can configure phase delay module (Y2), λ from latchTFor purpose clock zone clock Above-mentioned formula both sides are taken natural logrithm, are then obtained by three clock input signal CLK2_M2 high level times simultaneouslyWherein C2MCan be by step 8) calculate, thereforelnFd, lnFcFor known;MTBF now can be multiplied by the 3rd clock input signal by the value of the 3rd enumerator (J3) The CLK2_M2 clock cycle is calculated divided by the expected number of samples N1 value of the second metastable state enumerator (J2);Can match somebody with somebody with second Phase delay module (Y2) t time delay is put for transverse axis, ln (MTBF) is the longitudinal axis, determines N2 point, paints with N2 sampled point Straight line processed, the k2 reciprocal of the slope for obtaining are time constant C from latch2S;And the friendship that can obtain drawing straight line and y-axis Point value Yc, then window constant C1Can be byCalculate, time constant C2Can ByCalculate.
CN201410811176.5A 2014-12-22 2014-12-22 A kind of cross clock domain lock unit internal constant test circuit and method Expired - Fee Related CN104535918B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410811176.5A CN104535918B (en) 2014-12-22 2014-12-22 A kind of cross clock domain lock unit internal constant test circuit and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410811176.5A CN104535918B (en) 2014-12-22 2014-12-22 A kind of cross clock domain lock unit internal constant test circuit and method

Publications (2)

Publication Number Publication Date
CN104535918A CN104535918A (en) 2015-04-22
CN104535918B true CN104535918B (en) 2017-03-15

Family

ID=52851480

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410811176.5A Expired - Fee Related CN104535918B (en) 2014-12-22 2014-12-22 A kind of cross clock domain lock unit internal constant test circuit and method

Country Status (1)

Country Link
CN (1) CN104535918B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108958701A (en) * 2017-05-22 2018-12-07 深圳市中兴微电子技术有限公司 A kind of data transfer control method, device and storage medium
CN110311659B (en) * 2018-03-27 2021-02-12 华为技术有限公司 Trigger and integrated circuit
WO2020133537A1 (en) * 2018-12-29 2020-07-02 华为技术有限公司 Clock domain crossing processing circuit
CN111262562B (en) * 2020-03-02 2021-08-27 上海交通大学 Metastable state detection circuit
CN112036103B (en) * 2020-09-01 2024-03-08 深圳市傲立电子有限公司 Device and method for processing multi-bit data from fast clock domain to slow clock domain
CN112416054B (en) * 2020-10-30 2022-11-08 山东浪潮科学研究院有限公司 Method for testing cross-clock-domain signal synchronization of FPGA design
CN112953475B (en) * 2021-02-04 2022-08-02 中国电子科技集团公司第五十八研究所 Multi-bit data clock domain crossing synchronization circuit
CN115225043B (en) * 2022-07-27 2024-11-15 中国民航大学 Electromagnetic protection circuit for low-noise amplifier of Beidou receiver
CN118566703B (en) * 2024-08-05 2024-10-15 湖南进芯电子科技有限公司 System and method for monitoring metastable state in real time and dynamically correcting metastable state

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6781418B1 (en) * 2001-09-21 2004-08-24 Cypress Semiconductor Corp. Arbiter/pulse discriminator circuits with improved metastable failure rate by delayed balance point adjustment
CN1717643A (en) * 2002-11-28 2006-01-04 印芬龙科技股份有限公司 clock synchronization circuit
CN102790605A (en) * 2011-05-20 2012-11-21 上海华虹集成电路有限责任公司 Asynchronous signal synchronizer
CN104049672A (en) * 2013-03-14 2014-09-17 辉达公司 Data Synchronization Across Asynchronous Boundaries Using Selectable Synchronizers To Minimize Latency

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6781418B1 (en) * 2001-09-21 2004-08-24 Cypress Semiconductor Corp. Arbiter/pulse discriminator circuits with improved metastable failure rate by delayed balance point adjustment
CN1717643A (en) * 2002-11-28 2006-01-04 印芬龙科技股份有限公司 clock synchronization circuit
CN102790605A (en) * 2011-05-20 2012-11-21 上海华虹集成电路有限责任公司 Asynchronous signal synchronizer
CN104049672A (en) * 2013-03-14 2014-09-17 辉达公司 Data Synchronization Across Asynchronous Boundaries Using Selectable Synchronizers To Minimize Latency

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
FPGA设计中的亚稳态及其缓解措施;汪路元;《电子技术应用》;20121231;第38卷(第8期);第13-19页 *
Metastability Considerations;XILINX;《http://userwweb.eng.gla.ac.uk/scott.roy/DCD3/technotes.pdf》;19970131;第2-55至2-57,13-47至13-49页 *
Metastability Testing at FPGA Circuit Design using Propagation Time Characterization;Branka Medved Rogina,et al.;《Electrical/Electronics Insulation Conference, 1979 EIC 14th》;19791011;第1-6页 *
可编程逻辑器件设计中的亚稳态问题及解决方案;李立等;《湘潭大学自然科学学报》;20090331;第31卷(第1期);第125-129页 *

Also Published As

Publication number Publication date
CN104535918A (en) 2015-04-22

Similar Documents

Publication Publication Date Title
CN104535918B (en) A kind of cross clock domain lock unit internal constant test circuit and method
JP6326200B2 (en) Circuit and method for measuring
CN108170018B (en) A gated loop time-to-digital converter and time-to-digital conversion method
CN102621383B (en) Method and system for measuring nanosecond ultra-narrow pulse
CN105445645B (en) A kind of numeric type observation circuit for being used to monitor integrated circuit NBTI aging effects
CN103513173B (en) Based on BTI proving installation and the method for testing thereof of voltage controlled oscillator
CN101174833A (en) Method and measuring circuit for accurate time measurement
CN101183244A (en) Accurate trigger signal generation method and generation circuit
CN105068405B (en) Single channel signal pulsewidth high-precision measuring method and device that FPGA is realized
CN102565673A (en) Highly-reliable pulse counting test system based on FPGA (Field Programmable Gate Array)
CN103176059B (en) A kind of measure the method for pulse width, device and cymometer
CN103645379B (en) TTL signal frequency saltus step monitoring system and method
CN107422193B (en) A circuit and method for measuring single particle flip transient pulse length
CN102809725B (en) Sensitive element device for bypass signal of sensing circuit and detection method of sensitive element device
CN103105534B (en) Phase difference measurement circuit and measurement method based on field programmable gata array (FPGA) identical periodic signals
CN102466779B (en) Built-in test method and circuit for flip-flop delay
CN111538227A (en) High-precision time testing method, system and storage medium
CN103219970B (en) Single event transient pulse width method for widening and circuit
CN103675383B (en) A kind of circuit measuring waveform
CN203929885U (en) Based on FPGA etc. precision frequency testing system
CN109856525A (en) A kind of circuit aging detection sensor based on look-up table
CN206223867U (en) A phase detection device
CN107247183B (en) A phase measurement system and method
CN113125944B (en) Circuit delay detector and detection method for FPGA supporting full path
CN102571041B (en) Method for detecting time delay and time sequence of circuit and method for correcting time delay by using such method

Legal Events

Date Code Title Description
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20170315

CF01 Termination of patent right due to non-payment of annual fee