Metastable avoidance synchronization circuit
The metastability avoidance synchronization circuit addresses the issue of mixed data output in two-stage flip-flop circuits by using a multiplied clock, shift register, and enable signal to ensure accurate data synchronization.
Patent Information
- Application Number
- JP2023032185
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-02
- Publication Date
- 2024-09-12
- Estimated Expiration
- 2043-03-02
AI Technical Summary
Existing two-stage flip-flop synchronization circuits output incorrect data when multiple-bit input signals experience metastability, leading to mixing of old and new data.
A metastability avoidance synchronization circuit with a phase synchronization unit generating a multiplied clock, a shift register for capturing data, an enable signal to detect invalid data, and a final stage flip-flop for synchronized data output, preventing mixed data output.
Prevents the output of invalid data by ensuring synchronization is completed in reduced time, reducing the risk of mixed old and new data being output.
Smart Images

Figure 2024124187000001
Abstract
Description
[Technical field]
[0001] The present invention relates to a metastable state avoidance type synchronization circuit, a metastable state avoidance type synchronization method, and a program. [Background technology]
[0002] In order to realize various functions, communication devices used in the fields of electrical and electronic communication may be divided into different logic circuit modules for each function and configured using different clocks. In such communication devices, a synchronization circuit is required to synchronize asynchronous signals in order to transfer asynchronous signals between logic circuit modules.
[0003] However, if the rising and falling edges of the signal input to the synchronization circuit and the clock are close to each other, a metastable state occurs in which the signal level remains at an intermediate voltage between the "L" and "H" thresholds, causing the output signal to become unstable. Therefore, for asynchronous inputs, measures are required to prevent the circuit operation from being affected even if a metastable state occurs.
[0004] As a metastable avoidance synchronization circuit with a synchronization function that avoids metastable states, a two-stage configuration of flip-flops (hereinafter referred to as FFs) that operate on the receiving clock has been proposed when asynchronous transfer is performed between clocks of different frequencies between logic circuit modules (for example, paragraph 0004 of Patent Document 1). [Prior art documents] [Patent documents]
[0005] [Patent Document 1] Patent No. 7031936 Summary of the Invention [Problem to be solved by the invention]
[0006] However, in the above-mentioned synchronization circuit with two stages of FFs, if the input signal is composed of multiple bits, a state will occur in which new and old data are mixed in the multiple bits after the metastable state has stabilized, and such incorrect output data may be output as the data after synchronization.
[0007] An object of the present invention is to provide a metastable avoidance synchronization circuit that solves the above-mentioned problem, that is, the problem that incorrect data in which new and old data are mixed in multiple bits may be output as synchronized data. [Means for solving the problem]
[0008] A metastable avoidance synchronization circuit according to one aspect of the present invention comprises: Clock 2 n Multiplied by (n: positive integer) 2 n a phase synchronization unit that generates a multiplied clock; Input data consisting of multiple bits is n A shift register that sequentially captures the data in synchronization with the multiplied clock; an invalid data removal EN generation circuit that detects the occurrence of invalid data in a process in which the input data captured in the shift register is sequentially shifted, and generates an enable signal that becomes active during a period other than a period during which the invalid data is output from the shift register; a final stage flip-flop that latches and outputs the multiple-bit data output from the shift register in synchronization with the clock on condition that the enable signal is active; The device is configured to include:
[0009] In addition, a metastable avoidance synchronization method according to another aspect of the present invention includes: Clock 2 n Multiplied by (n: positive integer) 2 n generating a multiplied clock; Input data consisting of multiple bits is n Shifting sequentially in synchronization with the multiplied clock; detecting generation of invalid data during the process of sequentially shifting the input data, and generating an enable signal that is active during a period other than the period during which the invalid data is output; latching and outputting a plurality of bits of data obtained by sequentially shifting the input data in synchronization with the clock on condition that the enable signal is active; The device is configured to include:
[0010] In addition, a program according to another aspect of the present invention includes: A computer with a metastable avoidance synchronization circuit, Clock 2 n Multiplied by (n: positive integer) 2 n generating a multiplied clock; Input data consisting of multiple bits is n Shifting sequentially in synchronization with the multiplied clock; detecting generation of invalid data during the process of sequentially shifting the input data, and generating an enable signal that is active during a period other than the period during which the invalid data is output; latching and outputting a plurality of bits of data obtained by sequentially shifting the input data in synchronization with the clock on condition that the enable signal is active; The device is configured to execute the following: Effect of the Invention
[0011] By having the above-mentioned configuration, the present invention can prevent incorrect data in which new and old data are mixed in a plurality of bits from being output as synchronized data. [Brief description of the drawings]
[0012] [Figure 1] 1 is a block diagram of a metastable avoidance synchronization circuit according to a first embodiment of the present invention; [Diagram 2]1 is a circuit diagram showing an example of an illegal data removal EN generation circuit in a metastable avoidance synchronization circuit according to a first embodiment of the present invention. FIG. [Diagram 3] FIG. 11 is a diagram showing an example of synchronization timing of multiple-bit data in a metastable avoidance synchronization circuit configured with two stages of FFs. [Figure 4] 3 is a diagram showing an example of synchronization timing of multiple-bit data in the metastable avoidance synchronization circuit according to the first embodiment of the present invention; FIG. [Diagram 5] FIG. 11 is a diagram showing another example of synchronization timing of multi-bit data in the metastable avoidance synchronization circuit according to the first embodiment of the present invention. [Figure 6] FIG. 11 is a diagram showing yet another example of synchronization timing of multi-bit data in the metastable avoidance synchronization circuit according to the first embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] [First embodiment] Next, a first embodiment of the present invention will be described in detail with reference to the drawings. In the first embodiment of the present invention, the synchronization of an input DATA_IN of multiple bits controlled by an input clock of a certain frequency with an output DATA_OUT controlled by an output clock of a higher frequency than the input clock is described. For convenience of explanation, a block diagram is shown as an n+1-bit signal, and a timing diagram is shown as a 2-bit signal of [1:0].
[0014] [Configuration Description] 1 is a block diagram showing an example of a metastable state avoidance synchronization circuit according to a first embodiment of the present invention. The metastable state avoidance synchronization circuit according to the present embodiment includes a PLL (Phase Locked Loop) 110, a shift register 120, an illegal data removal enable signal generation circuit (hereinafter, referred to as an illegal data removal EN generation circuit) 140, and a final stage FF 170.
[0015] Based on the clock CLK1, the PLL 110 generates a x1 clock 111 having the same frequency as the clock CLK1 and an 8-multiplied clock 112 having a frequency eight times that of the clock CLK1. The x1 clock 111 generated by the PLL 110 is output to the final stage FF 170. The 8-multiplied clock 112 generated by the PLL 110 is output to the shift register 120 and the illegal data removal EN generation circuit 140. The PLL 110 is also referred to as a phase synchronization unit.
[0016] The shift register 120 is a three-stage shift register that sequentially receives the DATA_IN[n:0] signal, which is a multi-bit input signal, in synchronization with the 8-multiplication clock 112. Among the signals inside the shift register 120, 121 denotes a signal passing through the first stage of the synchronized FFs of DATA_IN[0], 122 denotes a signal passing through the second stage of the synchronized FFs of DATA_IN[0], 123 denotes a signal passing through the third stage of the synchronized FFs of DATA_IN[0], 131 denotes a signal passing through the first stage of the synchronized FFs of DATA_IN[n], 132 denotes a signal passing through the second stage of the synchronized FFs of DATA_IN[n], and 133 denotes a signal passing through the third stage of the synchronized FFs of DATA_IN[n]. In FIG. 1, of the FFs in each stage that constitute the shift register 120, only the FFs corresponding to the least significant bit and the most significant bit of the DATA_IN[n:0] signal and their outputs are shown. Also, a second stage signal 162 of the shift register 120 is the synchronization FF second stage passing signals 122, . . . , 132 of DATA_IN[n:0], and is output to the illegal data elimination EN generation circuit 140. Also, a third stage (final stage) signal 163 of the shift register 120 is the synchronization FF second stage passing signals 123, . . . , 133 of DATA_IN[n:0], and is output to the illegal data elimination EN generation circuit 140 and the final stage FF 170.
[0017] The invalid data removal EN generation circuit 140 operates in synchronization with the 8x clock 112, and is configured to generate an enable signal 155 for removing invalid data caused by the presence or absence of metastable states on a bit-by-bit basis based on the second-stage signal 162 and the third-stage signal 163 of the shift register 120, and output the enable signal 155 to the final-stage FF 170.
[0018] The final stage FF 170 is a FF for transferring the DATA_IN[n:0] signal to a timing synchronized with the ultimately required clock CLK1. Each FF constituting the final stage FF 170 has a clock input terminal, an enable terminal (hereinafter referred to as an EN terminal), an input terminal, and an output terminal, with the x1 clock 111 being input to the clock input terminal, the enable signal 155 output from the illegal data removal EN generation circuit 155 being input to the EN terminal, and the output signal 163 of the shift register 120 being input to the input terminal. Also, a DATA_OUT[n:0] signal synchronized with the clock CLK1 is output from the output terminal of each FF constituting the final stage FF 170.
[0019] 2 is a block diagram showing an example of the improper data removal EN generation circuit 140. The improper data removal EN generation circuit 140 of this example includes a comparator 141 and an enable signal generation circuit (hereinafter, referred to as an EN generation circuit) 142.
[0020] The comparator 141 is configured to receive the second-stage signal 162 and the third-stage signal 163 from the shift register 120 and determine whether or not the value of any bit of the DATA_IN[n:0] signal has switched between the second and third stages of the shift register 120. The comparator 141 includes an EXOR circuit that takes the exclusive OR of the second-stage signal and the third-stage signal for each bit of the DATA_IN[n:0] signal, and an AND circuit that takes the logical AND of outputs 151, . . . , 152 of all the EXOR circuits, and outputs an output 153 of the AND circuit to the EN generation circuit 142 as the output of the comparator 141.
[0021] The EN generation circuit 142 receives the output 153 of the comparator 141, and generates and outputs a signal 155 for removing illegal data by detecting that multiple bits of the DATA_IN[n:0] signal have been switched at different timings. The EN generation circuit 142 includes a FF that generates a signal 154 by shifting the output 153 of the comparator 141 by one clock of the 8-multiplied clock 112, and an OR gate that takes the logical sum of this signal 154 and the output 153 of the comparator 141.
[0022] Next, before describing the operation of the metastable avoidance synchronization circuit according to this embodiment, the operation of the two-stage synchronization circuit mentioned in the background art will be described.
[0023] Figure 3 is a timing diagram of multi-bit data synchronization using a two-stage synchronization circuit. For convenience of explanation, the DATA_IN[n:0] signal is assumed to be a two-bit DATA_IN[1:0] signal. In addition, the example shows the case where the DATA_IN[1:0] signal switches from 00 (LL) to 11 (HH).
[0024] Referring to Figure 3, when the DATA_IN[1:0] signal is taken into the first-stage FF by clock CLK1 at T10, metastable state occurs due to asynchronous inter-clock signals, and bit [0] stabilizes to the "H" side and bit [1] stabilizes to the "L" side. As a result, the output of the second-stage FF latched at T20 has bit [0] stabilized to the new data side and bit [1] stabilized to the old data side, resulting in invalid data with a difference of one clock between the two. Referring to Figure 3, it is after timing T30 that the second-stage FF can obtain an accurate DATA_OUT signal after synchronization. The period from timing T20 to timing T30 is a period in which new and old data are mixed.
[0025] In this way, in a two-stage synchronization circuit, in order to prevent the capture of incorrect data, it is necessary to capture the DATA_OUT signal after a sufficient amount of time has elapsed, which increases the amount of delay.
[0026] Next, the operation of the metastable avoidance synchronization circuit according to the present embodiment will be described.
[0027] In FIG. 1, first, a PLL 110 generates a x1 clock 111 and an 8-times clock 112 based on a clock CLK1.
[0028] An input signal, DATA_IN signal, is sequentially taken into a three-stage shift register 120 in synchronization with an 8-multiplied clock 112 .
[0029] For example, in the case of bit [0], the shift register 120 sends a shift register second stage signal 122 and a third stage signal 123 to the illegal data elimination EN generation circuit 140. Also, in the case of bit [n], the shift register second stage signal 132 and a third stage signal 133 are sent to the illegal data elimination EN generation circuit 140. The same applies to the remaining bits.
[0030] The illegal data removal EN generation circuit 140 generates an illegal data removal EN signal 155 synchronized with the 8-multiplied clock 112. The operation at this time will be described later.
[0031] The final stage FF 170 transfers the data at a timing synchronized with the ultimately required clock CLK1. The data update condition of this final stage FF 170 is set to the illegal data removal EN signal 155="L", thereby preventing the leakage of illegal data to the subsequent stages. The final stage FF 170 is in a synchronous relationship with the illegal data removal EN signal 155, and is therefore a one-stage FF.
[0032] 2, the operation of the illegal data removal EN generation circuit 140 will be described. The second-stage signal 122 and the third-stage signal 123 of bit [0] of the shift register 120 are input to the corresponding EXOR gate of the comparator 141. Then, the output 151 of the EXOR gate becomes "L" only when the second-stage signal 122 is "H" and the third-stage signal 123 is "L", or the second-stage signal 122 is "L" and the third-stage signal 123 is "H". That is, the output 151 becomes "L" when the bit [0] changes from "L" to "H" or from "H" to "L", and becomes "H" when there is no such change.
[0033] Also, the second-stage signal 132 and the third-stage signal 133 of bit [n] of the shift register 120 are input to the corresponding EXOR gate of the comparator 141. Then, the output 152 of the EXOR gate becomes "L" only when the second-stage signal 132 is "H" and the third-stage signal 133 is "L", or the second-stage signal 132 is "L" and the third-stage signal 133 is "H". In other words, the output 152 becomes "L" when the bit [n] changes from "L" to "H" or from "H" to "L", and becomes "H" when there is no such change.
[0034] For the remaining bits of the shift register 120 other than bits [0] and [n], signals that go to "L" only when there is a change, similar to outputs 151 and 152, are generated by the corresponding EXOR gates.
[0035] The signals 151, ..., 152 generated for each bit and going to "L" when there is a change are input to the AND gate of the comparator 141, which generates a logical AND signal 153 of all bits. This logical AND signal 153 is a signal that goes to "L" when there is a change in any of the bits. Next, a logical OR gate takes the logical OR of this signal 153 and a signal 154 obtained by shifting this signal by 1T using the 8-times clock 112, thereby generating a signal 155 that goes to "L" when there is a change in any of the bits for 2T consecutively. This signal 155 is then used as the illegal data removal EN signal.
[0036] Multi-bit data when any bit changes for 2T consecutively indicates that the old value has switched to a mixture of old and new data (invalid data) for each bit due to the effects of metastable state, followed by a new value. The "invalid data removal EN signal" generated as described above is a signal that is "L" (inactive) only during this invalid data period. In other words, the "invalid data removal EN signal" is a signal that is "H" (active) during periods other than invalid data periods.
[0037] Fig. 4 is an example of a timing diagram of the metastable state avoidance synchronization circuit according to the present embodiment. As in Fig. 3, Fig. 4 shows an example in which the 2-bit data DATA_IN[1:0] switches from 00 to 11.
[0038] Referring to FIG. 4, when the DATA_IN[1:0] signal is captured by clock 112 at timing T10, metastability occurs due to the asynchronous inter-clock signal, and output 121 of the first stage of the shift register for bit [0] stabilizes at “H”, and output 131 of the first stage of the shift register for bit [1] stabilizes at “L”.
[0039] The signal 121, whose bit [0] has stabilized at “H”, becomes the signal 122 and the signal 123 through the subsequent two-stage shift register.
[0040] 2. Signal 151 is "L" between T11 and T12, when the values of signals 122 and 123 are different, according to the logic of comparator 141 in FIG.
[0041] Similarly, signal 131, whose bit [1] has stabilized at “L”, becomes signal 132 and signal 133 through the subsequent two-stage shift register.
[0042] 2, the signal 152 is "L" between T12 and T13 when the values of the signals 132 and 133 are different.
[0043] The signal 153 is an ANDed signal of the signals 151 and 152, and is a signal that is "L" between T11 and T13.
[0044] 2 performs an OR operation on the signal 153 and the signal 154 shifted by one clock to generate the signal 155. Therefore, the signal 155 is a signal that becomes “L” for 1T when different bits change at different timings.
[0045] 4, signal 161 is the signal of the first stage of the shift register of DATA_IN[1:0], signal 162 is the signal of the second stage of the shift register of DATA_IN[1:0], and signal 163 is the signal of the third stage of the shift register of DATA_IN[1:0]. During the T12-T13 period when the value of signal 163 is "01", the data becomes invalid with new and old data mixed, and at the same timing, signal 155 becomes "L".
[0046] 1, and is generated by latching the signal 163 under the condition that the signal 155="H" at the timing T20, which is the rising edge of the clock CLK1. As a result, the clock transfer from the DATA_IN signal to the DATA_OUT signal synchronized with the clock CLK1 is completed.
[0047] Figures 5 and 6 are different timing diagrams of the switching of DATA_IN[1:0]. Of these, Figure 5 is a timing diagram when the switching of DATA_IN[1:0] occurs at timing T15, which is 5T later on the clock 122 than timing T10 in Figure 4. If invalid data due to the influence of metastable state is detected at the timing shown in Figure 5, the invalid data will be at timing T20, so data updating will not be performed at timing T20, and new data will be updated at timing T30.
[0048] Fig. 6 is a timing diagram showing when a switch in DATA_IN[1:0] occurs at timing T14, which is 4T later on the clock 122 than timing T10 in Fig. 4. Even if invalid data due to the effects of metastable state is detected at the timing shown in Fig. 6, new data is confirmed at timing T20, so data is updated at timing T20.
[0049] That is, as explained with reference to FIG. 3, a synchronization circuit having two stages of flip-flops requires a time of 2T with a clock CLK1 of T10-T30 until synchronization is completed, whereas the synchronization circuit of this embodiment can complete synchronization in 0.5T with a clock CLK1 of T14-T20 at the shortest.
[0050] [Another embodiment of the invention] Although the present invention has been described above with reference to the embodiment of the present invention, the present invention is not limited to the above-mentioned embodiment. Various modifications that can be understood by those skilled in the art can be made to the configuration and details of the present invention within the scope of the present invention.
[0051] For example, in the above embodiment, the shift register 120 and the illegal data removal EN generation circuit 140 are operated in synchronization with a clock that is eight times the clock CLK1. However, the shift register 120 and the illegal data removal EN generation circuit 140 generally operate in synchronization with a clock that is eight times the clock CLK1. n It may be operated in synchronization with a multiplied clock (n is a positive integer). For example, by increasing the multiplication rate to a 16-multiplied clock (n=4) or other rate higher than the 8-multiplied clock (n=3), it is possible to shorten the time until synchronization is completed compared to the above embodiment.
[0052] Furthermore, the shift register 120 is not limited to a three-stage configuration, but may have four or more stages.
[0053] The metastable state avoidance synchronization circuit may have a computer system therein. The above-mentioned process may be stored in a computer-readable recording medium in the form of a program, and the above-mentioned process may be performed by the metastable state avoidance synchronization circuit by reading and executing the program by the computer. The computer may be composed of, for example, a CPU (Central Processing Unit), a main memory, a storage, and an interface, but is not limited thereto.
[0054] In addition, instead of the above-mentioned CPU, a GPU (Graphic Processing Unit), a DSP (Digital Signal Processor), an MPU (Micro Processing Unit), an FPU (Floating number Processing Unit), a PPU (Physics Processing Unit), a TPU (Tensor Processing Unit), a quantum processor, a microcontroller, or a combination of these may be used. [Industrial Applicability]
[0055] The present invention can be used in general synchronization circuits to avoid the effects of metastable states that can occur during asynchronous transfer between logic circuit modules that operate on clocks of different frequencies. [Explanation of symbols]
[0056] 110 PLL 111 Clock with the same frequency as clock CLK1 112 Clock CLK1 multiplied by 8 120 Shift Register 121 DATA_IN[0] synchronization signal after passing through the first FF 122 DATA_IN[0] signal after passing through the second stage of the synchronization FF 123 DATA_IN[0] synchronization signal after passing through the 3rd stage of FF 131 DATA_IN[n] signal after passing through the first stage of synchronization FF 132 DATA_IN[n] signal after passing through the second stage of the synchronization FF 133 DATA_IN[n] signal after passing through the 3rd stage of synchronization FF 140 False data removal EN generation circuit 155 Invalid data removal EN signal 170 Final stage FF
Claims
1. Clock 2 n Multiplied by (n: positive integer) 2 n a phase synchronization unit that generates a multiplied clock; Input data consisting of multiple bits is n A shift register that sequentially captures the data in synchronization with the multiplied clock; an invalid data removal EN generation circuit that detects the occurrence of invalid data in a process in which the input data captured in the shift register is sequentially shifted, and generates an enable signal that becomes active during a period other than a period in which the invalid data is output from the shift register; a final stage flip-flop that latches and outputs the multiple-bit data output from the shift register in synchronization with the clock on condition that the enable signal is active; A metastable avoidance synchronization circuit comprising:
2. The illegal data removal EN generation circuit includes: a comparator for detecting whether or not a value of any bit has changed between the second stage signal and the third stage signal of the shift register; The output of the comparator and the output of the comparator are n an EN generating circuit for generating, as the enable signal, a logical OR signal with a signal shifted by one clock by the multiplied clock; Equipped with 2. The metastable avoidance synchronization circuit according to claim 1.
3. The clock has a higher frequency than a clock that controls the input data.
3. The metastable avoidance synchronization circuit according to claim 2.
4. wherein n is 3; 4. A metastable avoidance type synchronization circuit according to claim 1.
5. Clock 2 n Multiplied by (n: positive integer) 2 n generating a multiplied clock; Input data consisting of multiple bits is n Shifting sequentially in synchronization with the multiplied clock; detecting generation of invalid data during the process of sequentially shifting the input data, and generating an enable signal that is active during a period other than the period during which the invalid data is output; latching and outputting a plurality of bits of data obtained by sequentially shifting the input data in synchronization with the clock on condition that the enable signal is active; A metastable avoidance synchronization method comprising:
6. A computer with a metastable avoidance synchronization circuit, Clock 2 n Multiplied by (n: positive integer) 2 n generating a multiplied clock; Input data consisting of multiple bits is n Shifting sequentially in synchronization with the multiplied clock; detecting generation of invalid data during the process of sequentially shifting the input data, and generating an enable signal that is active during a period other than the period during which the invalid data is output; latching and outputting a plurality of bits of data obtained by sequentially shifting the input data in synchronization with the clock on condition that the enable signal is active; A program that executes the following.
Citation Information
Patent Citations
Bit phase synchronization circuit
JP2003143118A
Metastability preventing synchronization circuit
JP2014140123A
Receiving circuit and semiconductor integrated circuit
JP2018201252A
Metastable avoidance type synchronization circuit and metastable avoidance method
JP2021184549A
Method and apparatus for processing multi-bit data across clock domains
JP2022539485A
