ADJUSTED-FREQUENCY SYNCHRONIZER FOR CLOCK DOMAIN CROSSING
20260126827 ยท 2026-05-07
Assignee
Inventors
Cpc classification
G06F1/08
PHYSICS
International classification
G06F1/12
PHYSICS
G06F1/08
PHYSICS
Abstract
A synchronizer with flip-flops has a reduced number of flip-flops coupled in series, receiving as an input data of a first clock domain and supplying as an output data in the second clock domain. The second clock signal is at a variable frequency adjusted to a target frequency, by a division factor. The flip-flops are timed by a clock signal subsampling the second clock signal by a factor k1. The subsampled clock signal is generated by a frequency divider propagating a pulse of the signal every k1 clock pulses, while keeping the edges aligned.
Claims
1. A device, comprising: a set of first flip-flops coupled in series, receiving first data in a first clock domain based on a first clock signal; and a clock adjustment circuit including: an input configured to receive a second clock signal asynchronous with the first clock signal; adjustment circuitry configured to generate an adjusted clock signal having a period larger than a period of the second clock signal; and an output coupled to a clock input of each of the flip-flops and configured to provide the adjusted clock signal to the clock input of each of the first flip-flops, wherein the set of first flip-flops is configured to output the first data in a second clock domain asynchronous with the first clock domain and based on the second clock signal.
2. The device according to claim 1, wherein the adjustment circuitry includes a subsampler configured to subsample the second clock signal by a subsampling factor, an integer greater than or equal to 2, the subsampler receiving, as input signal, the second clock signal and outputting the adjusted clock signal.
3. The circuit according to claim 2, wherein the adjustment circuit includes a clock divider upstream from the subsampler and configured to adjust the second clock signal by a division factor corresponding to an integer greater than or equal to 2.
4. The device according to claim 3, wherein the subsampler includes a module for adapting the subsampling factor to an adjustment of a frequency of the second clock signal by the division factor.
5. The device according to claim 2, wherein the subsampler comprises a counter configured to count pulses of the second clock signal and a clock gating cell coupled to the counter.
6. The device according to claim 1, wherein the set of flip-flops includes only two flip-flops in series.
7. The device according to claim 1, wherein, when a mean time between failures formula links a theoretical number N.sub.sync of flip-flops to a first frequency of the first clock signal and a second frequency of the second clock signal, a subsampling factor k is fixed at a factor k2 selected from the factors of N.sub.sync1.
8. The device according to claim 1, wherein the adjustment circuit includes a clock divider configured to generate the adjusted clock signal by dividing the second clock signal by a division factor corresponding to an integer greater than or equal to 2.
9. The device according to claim 1, comprising a set of second flip-flops coupled in series and receiving second data in a third clock domain based on a third clock signal and each having a clock input coupled to receive the adjusted clock signal from the clock adjustment circuit, wherein the clock adjustment causes the second flip-flops to output the second data in the second clock domain, the third clock domain being asynchronous with the second clock domain.
10. A method for synchronization between a first clock domain timed by a first clock signal and a second clock domain asynchronous with the first clock domain and timed by a second clock signal, the method comprising: obtaining at least one clock-division factor or clock-subsampling factor; adjusting, based on the clock-division factor, a variable frequency of the second clock signal at a target frequency to supply an adjusted clock signal timing the flip-flops; and controlling, with the adjusted clock signal, flip-flops put in series in a synchronization unit that receives as an input data of the first clock domain and supplies as an output data in the second clock domain.
11. The method of claim 10, wherein adjusting the variable frequency includes generating the adjusted clock signal by dividing the second clock signal with a frequency divider.
12. The method of claim 10, wherein adjusting the variable frequency includes generating the adjusted clock signal by subsampling the second clock signal with a subsampler.
13. The method of claim 10, wherein adjusting the variable frequency includes generating the adjusted clock signal by dividing a frequency of the second clock signal with a frequency divider and subsampling the output of the frequency divider with a subsampler.
14. A method, comprising receiving, with a set of first flip-flops coupled in series, first input data in a first clock domain based on a first clock signal; receiving, with a clock adjustment circuit, a second clock signal asynchronous with the first clock signal; generating, with the clock adjustment circuit, an adjusted clock signal having a period larger than a period of the second clock signal; and providing the adjusted clock signal to a clock input of each of the first flip-flops; and outputting the first input data from the set of first flip-flops in a second clock domain based on the second clock signal.
15. The method of claim 14, wherein generating the adjusted clock signal includes dividing the second clock signal with a frequency divider of the frequency adjustment circuit.
16. The method of claim 14, wherein generating variable frequency includes subsampling the second clock signal with a subsampler of the clock adjustment circuit.
17. The method of claim 16, wherein the subsampler includes a counter configured to count pulses of the second clock signal and a clock gating cell coupled to the counter.
18. The method of claim 14, wherein the set of first flip-flops includes only two first flip-flops in series.
19. The method of claim 14, wherein generating the variable frequency includes generating a divided clock signal by dividing the frequency of the second clock signal with a frequency divider and subsampling the output of the frequency divider with a subsampler.
20. The method of claim 11, further comprising: receiving, with a set of second flip-flops coupled in series, second data in a third clock domain based on a third clock signal; providing the adjusted clock signal to a clock input of each of the second flip-flops; and outputting the second data from the set of second flip-flops in the second clock domain, the second clock domain being asynchronous with the first clock domain.
Description
BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS
[0050] Other advantages and features of the disclosure will become apparent upon examining the detailed description of in no way limiting embodiments and implementations, and from the accompanying drawings, wherein:
[0051]
[0052]
[0053]
[0054]
[0055]
[0056]
[0057]
[0058]
[0059]
DETAILED DESCRIPTION
[0060] In a context of clock-domain crossing, a synchronizer with flip-flops has a reduced number of flip-flops put in series, receiving as an input data of a first clock domain and supplying as an output data in the second clock domain. The second clock signal is at a variable frequency adjusted to a target frequency, by a division factor k0. The flip-flops are timed by a clock signal subsampling the second clock signal by a factor k1. The subsampled clock signal is generated by a frequency divider propagating a pulse of the signal every k1 clock pulses, while keeping the edges aligned. Theoretically additional flip-flops are avoided.
[0061] Electronic systems such as automobile systems can be implemented in the form of a system on chip (SoC), which is an integrated circuit including all the components of the system, often including, for example, components associated with different and asynchronous clock domains.
[0062] Clock domain crossing occurs when data are transferred from a flip-flop (a source flip-flop) controlled or timed by a first clock CLOCK_A to a flip-flop (a destination or target flip-flop) controlled by a second clock CLOCK_B.
[0063] Depending on the relationship between the clocks, problems may occur during the transfer of data between the source flip-flop and the target flip-flop. By way of example, if a transition at the output of the source flip-flop occurs very close to the active edge (rising or falling) of the second clock, a configuration or maintenance violation at the target flip-flop may occur. This may cause an oscillation of the output of the second flip-flop, which can become unstable and not stabilize at a stable value before the next active edge of the second clock. This condition is called metastability.
[0064] To reduce the uncertainty relating to the metastability of the target flip-flop, it is conventional to put several target flip-flops in series, making it possible to extend the sampling time for the data to several clock cycles, where the risks of metastability are almost zero.
[0065] The number N.sub.sync of target flip-flops is generally obtained by the mean time between failures MTBF formula already mentioned above.
[0066] This number N.sub.sync of flip-flops necessary for synchronizing the data in the second time domain increases rapidly with the frequency f.sub.B of the second clock domain-condition sought to improve its performances-, but also with the use of lower-grade flip-flops-condition useful for reducing costs and having a simpler and less expensive design with the use of standard identical flip-flops.
[0067] A high number N.sub.sync of flip-flops is prejudicial to the compactness of the synchronizer 100, as well as to the electrical consumption thereof.
[0068] Since electronic systems can include a large number of synchronization units between asynchronous clock domains, any additional flip-flop in these units leads to the same prejudice in terms of compactness and electrical consumption.
[0069] Adjusting a variable frequency of the second clock signal to a target frequency to supply a clock signal timing the flip-flops and/or using flip-flops controlled or timed by a clock signal subsampling the second target clock signal CLOCK_B makes it possible to reduce the number of flip-flops while keeping a constant sampling time for the input data, to keep the MTBF and therefore the risks of metastability unchanged. Thus, creating a virtual clock generating this adjusted and/or subsampled clock signal makes it possible to overcome the drawbacks of the known art.
[0070]
[0071] Solely for purposes of illustration, the two intermediate flip-flops 111, 112henceforth superfluousare shown in broken lines to illustrate how this synchronization unit improves the one in
[0072] The synchronizer with flip-flops 300 of
[0073] The flip-flops are typically D flip-flops (standing for Data), i.e., including a single data input: d, the value of which is copied onto the output q at each clock edge (here rising edge, but in a variant this can be to the falling edge). The D flip-flop makes it possible to ensure a stable output state between two clock edges.
[0074] The set of flip-flops B includes two flip-flops B1 110 and B4 113 in series, timed by a clock CLK_k.
[0075] The clock CLK_k can be the second clock CLK_B adjusted to a target frequency, for example adapted to the number of flip-flops used. The target clock signal CLK_B can be generated by any known clock generatorand therefore not detailed heresuch as an electronic oscillator (typically an RLC circuit). It is known that a variable-frequency clock source is provided with a clock divider 301 (dividing by an integer clock factor k0) making it possible to adjust downwards the clock frequency at the source output, with respect to a maximum operational frequency f.sub.Bmax.
[0076] The clock CLK_k can be a virtual clock CLK_k that subsamples the target clock CLK_B, optionally previously adjusted by a clock factor k0. The virtual clock is implemented by the clock subsampling unit 301, which receives as an input the clock signal CLK_B (optionally adjusted by k0) and the subsampling parameter k1, an integer greater than or equal to 2. In the example in the figure, k=3, making it possible to divide by k=3 the clock frequency (e.g., rising edges) between the clock signal CLK_B (frequency: f.sub.B) and the subsampled clock signal CLK_k (frequency: f.sub.k=f.sub.B/k1).
[0077] The parameter or parameters k0 and k1 can be pre-fixed in a register or a memory of the synchronizer 300. In a variant, they can be adjusted by a user through a user interface (not illustrated). In another variant, they can be dynamically adapted (by an adaptation module not shown on
[0078]
[0079] The subsampling unit makes it possible to generate the subsampled clock unit CLK_k by eliminating certain pulses of the clock signal CLK_B (or by copying the other pulses into a new signal). Thus the signals CLK_k and CLK_B remain in phase (their pulse edges are aligned, for the common pulses), as illustrated in
[0080] The subsampling unit 400 shown includes a clock gating cell 410 coupled to a pulse counter 420 in the input signal, here CLK_B.
[0081] The pulse counter 420 is shown here highly schematically since there are numerous possible implementations, accessible to a person skilled in the art. The pulse counter 420 is configured to count the pulses of the input signal CLK_B, typically at each rising edge (or in a variant falling edge) and, according to the parameter k1, to generate a high or strong state of an activation signal ACTIV intended for the clock gating cell 410 whenever k1 pulses have been counted in the input signal CLK_B.
[0082] The clock gating cell 410 essentially stops the propagation of the clock signal CLK_B through it when an activation signal ACTIV at a low or weak level is applied to it. Only the pulses of the clock signal CLK_B during a high activation signal ACTIV are propagated to CLK_k.
[0083] For example, when k1=3, only one pulse out of three is propagated to the output CLK_k.
[0084] The clock gating cell 410 is of the latch-AND type, including a latch 411 and an AND gate 412. The latch 411 is controlled by the activation signal ACTIV to activate the AND gate 412 during a clock period, every k1 periods. The AND gate 412 therefore allows the clock signal CLK_B to propagate during one clock period every k periods, therefore allowing one pulse out of k1 to pass.
[0085]
[0086] Since the subsampler unit 400 allows one pulse out of three of the signal CLK_B to pass, the subsampled clock signal consists of one clock pulse every three clock cycles B, and therefore at a frequency f.sub.B/3. The pulses of the signal CLK_k 507 are perfectly aligned in phase (in edges) with those of the initial signal CLK_B 207.
[0087] Since the flip-flops B are controlled by the signal CLK_k, the first flip-flop B1 takes the value of the data A_q at one pulse of the signal CLK_k, and the second flip-flop b4 in series takes the value of the data B1_q at the following pulse of the signal CLK_k. The second flip-flop B4 therefore does not operate at the clock cycle B following that of the first flip-flop B1, but at a following virtual clock cycle, and therefore after k1=3 clock cycles B. This guarantees keeping the sampling time unchanged: the flip-flop B4 of the synchronization unit 400 operates at the same instants as the flip-flop B4 of the synchronization unit 100 (
[0088] Although the example in
[0089] Likewise, although the above example of
[0090] The above mean time between failures (MTBF) formula links the theoretical number N.sub.sync of flip-flops to the frequency f.sub.A and the frequency f.sub.B, but also to the required MTBF and to the characteristics of the flip-flops used. This number N.sub.sync can be 3, 4, 5, 6, or even more. Though the known techniques impose hardware implementations providing for this exact number (or more) of flip-flops, the approach described above makes it possible to reduce the number thereof.
[0091] It makes it possible in particular to use lower-grade flip-flops (for example conventional flip-flops) without increasing (or even by reducing) the number of flip-flops actually used. The approach described above therefore offers broadened access to the catalogue of flip-flops available without impact on the performance of the synchronization unit.
[0092] It also makes it possible to improve the performances of the target clock domain Bvia increasing its operational frequency f.sub.Bwithout increasing (or even by reducing) the number of flip-flops actually use.
[0093] Typically, the number N.sub.sync1 obtained according to the constraints involved (required MTBF, f.sub.A, f.sub.B, characteristics of the flip-flops used) has two or more factors, in the sense of multiplication, namely at least 1 and N.sub.sync1, and optionally any integer divider of N.sub.sync1. Any factor k2 among these two or more factors can be selected as subsampling factor k1.
[0094] For example, for N.sub.sync=5, the following factors are available: 1, 2, 4; for N.sub.sync=6:1, and 5; for N.sub.sync=7:1, 2, 3, 6; etc.
[0095] The choice of the factor k2 can depend on the number of flip-flops to be used, and/or possibilities offered by the subsampling unit 301, 400.
[0096] The number N.sub.B of flip-flops B is in fact related to the factor k2 selected by the following formula, to keep a constant sampling time for the input data: N.sub.B=(N.sub.sync1)/k2+1.
[0097] Thus, if k2=N.sub.sync1, then only two flip-flops B are necessary instead of N.sub.sync. This is the case in
[0098] By way of illustration, if N.sub.sync=5 and k2=2, then three flip-flops B can be used instead of five; if N.sub.sync=7 and k2=2, then four flip-flops are necessary whereas with k2=3 three flip-flops B can be used instead of seven.
[0099] Although it is envisaged above remaining at equal sampling times for the input data, it is however possible to use the above teachings to reduce the number of flip-flops, even while extending the time for sampling the input data.
[0100] For example, if a subsampling unit 301, 400 is already available with a subsampling factor k1 that is not compatible with the theoretical number N.sub.sync of flip-flops B (k1 does not divide N.sub.sync1), then it is possible to use a higher theoretical N.sub.sync that satisfies the condition: k1 divides N.sub.sync1. The extension of the sampling time is then equal to (N.sub.syncN.sub.sync)/f.sub.B.
[0101] By way of illustration, if N.sub.sync5 and the subsampling unit divides f.sub.B by 3, then N.sub.sync can be fixed at 7. Three flip-flops B will then be used instead of the 5 (N.sub.sync). On the other hand, the sampling time will change from 5/f.sub.B to 7/f.sub.B.
[0102] Finally, there are scenarios where the frequency f.sub.B is adjusted (e.g., by a user) by a division factor k0 to slow down (or accelerate) the clock over time, whereas the synchronization unit 301, 400 is in operation (and therefore the number of flip-flops B is fixed as above). In this case, the subsampling unit 301, 400 can be provided with a module for dynamic (and therefore automatic) adaptation of the subsampling factor k1 to the variations in f.sub.B by the division factor k0.
[0103] As indicated above, the unit 301 of
[0104] Thus, in embodiments, the subsampling unit 400 of
[0105]
[0106] Adjusting the frequency f.sub.B of the clock CLK_B by k0-3 makes it possible to multiply the clock period by k0. The pulses of the signal CLK_Badj 517 are perfectly aligned in phase (in edges) with those of the initial signal CLK_Bmax 207 corresponding to the maximum clock frequency of the domain B, f.sub.Bmax.
[0107] Since the flip-flops B are controlled by the adjusted signal CLK_Badj, the first flip-flop B1 takes the value of the data A_q at one pulse of the signal CLK_Badj, and the second flip-flop b4 in series takes the value of the data B1_q at the following pulse of the signal CLK_Badj, i.e., at the end of a period corresponding to three periods of the maximum frequency f.sub.Bmax of CLK_Bmax.
[0108] A person skilled in the art thus understands that it is possible to combine the mechanisms for adjusting the frequency f.sub.B of the clock signal CLK_B by k0 and of subsampling the clock frequency CLK_B by k1 in order to obtain a period T between two edges of CLK_k best adjusted: T=(k0.Math.k1)/f.sub.Bmax.
[0109]
[0110] Typically, k0 and k1 can be selected so that k0.Math.k1 is a factor of (N.sub.sync1)/(N.sub.B1), N.sub.sync being determined using the maximum frequency f.sub.Bmax.
[0111] In a variant, if a user fixes k0, the adjusted frequency f.sub.B is f.sub.Bmax/k0. k1 can then be selected so that k1 is a factor of (N.sub.sync1)/(N.sub.B1), N.sub.sync being determined using the adjusted frequency f.sub.B.
[0112]
[0113] Data of the clock domains A 107 and C 607 are transmitted to the clock domain B asynchronous with A and C, requiring respective clock-domain crossings: A to B and C to B.
[0114] If the synchronization unit 601 between the domains A and B is, for the example, identical to that of
[0115] The flip-flops in broken lines in the synchronization unit 602 are not used. They illustrate, for any useful purpose, the flip-flops theoretically necessary when N.sub.sync=7 for the crossing of the clock domain C to B.
[0116] The flip-flops of the synchronization unit 602 can be identical (of the same nature) to those of the synchronization unit 601, or be different.
[0117] The flip-flops of the synchronization unit 601 and those of the synchronization unit 602 are all controlled by the same subsampled signal CLK_k coming from the clock subsampling unit 301. The latter is therefore shared between several clock-domain crossings to one and the same target clock domain (here B), and therefore shared between several source clock domains (here A and C).
[0118] The costs (integrated-circuit surface, electrical consumption) of the subsampler unit 301 are thus more reduced by the synchronization unit, the more clock-domain crossings there are to be implemented to the same clock domain.
[0119]
[0120] The operations 700 begin at the step 710 with the recovery of the clock-subsampling factor k.
[0121] In one embodiment, k0 and/or k1 are stored in memory or in a register internal to the electronic system.
[0122] In another embodiment, k0 and/or k1 are entered by a user when the electronic system is initiated.
[0123] In yet another embodiment, k0 and/or K1 are determined by the electronic system from a synchronization-unit configuration 300, 601, 602. Typically, on the one hand, first information such as the frequencies f.sub.A, f.sub.B, fc (for the domain C), the mean time between failures MTBF and the characteristics of the flip-flops Be used are known and, on the other hand, second information such as the number N.sub.B of flip-flops B available in the synchronization unit 300, 601, 602 (for example 2) are known. The electronic system can therefore determine the division factor or factors k0 and clock-subsampling factor or factors k1, by calculating first of all N.sub.sync with the first information and then determining k2=(N.sub.sync1)/(N.sub.B1). If k2 is an integer, k0=k2 or k1=k2 or k0.Math.k1=k2. Otherwise a higher integer can be selected for k0 and/or k1, preferably the integer immediately higher: k0 or k1 or k0.Math.k1=higher integer part (k2).
[0124] At the step 720, the clock divider or the clock-subsampling unit 301, 400 is started with the clock factor k0 or clock-subsampling factor k1 respectively, as determined at the step 710.
[0125] For example, in the case of subsampling, the subsampling unit 301, 400 propagates one clock pulse of the signal CLK_B over k1 pulses. This forms the subsampled clock signal CLK_k. Thus a clock signal CLK_k subsampling the clock signal CLK_B is generated.
[0126] At the step 730, the subsampled clock signal CLK_k is supplied to the flip-flops B of the synchronization unit 300, 601, 602 in order to control them at a frequency f.sub.B/k1.
[0127] This control makes it possible to transfer the data from the source clock domain or domains to the target clock domain B, in a synchronized manner, while maintaining a required mean time between failures.
[0128] Of course, the present disclosure is not limited to the embodiments described above by way of example; it extends to other variants. Other embodiments are possible.
[0129] In one embodiment, a unit (300, 601, 602) for synchronizing between a first clock domain (107, 607) timed by a first clock signal (CLK_A, CLK_C) and a second clock domain (114) asynchronous with the first clock domain and timed by a second clock signal (CLK_B), the synchronization unit including: a set of flip-flops (110, 113, 610, 611, 612) put in series, receiving as an input data (A_q) of the first clock domain and supplying as an output (120, 620) data in the second clock domain, wherein the second clock signal (CLK_B) is at a variable frequency adjusted to a target frequency (f.sub.B) to supply a clock signal timing the flip-flops (110, 113, 610, 611, 612) and/or the flip-flops (110, 113, 610, 611, 612) are timed by a clock signal (CLK_k) subsampling the second clock signal (CLK_B).
[0130] In one embodiment, the synchronization unit (300, 601, 602) including a subsampler (301, 400) configured to subsample an input signal by a subsampling factor (k1), an integer greater than or equal to 2, the subsampler receiving, as input signal, the second clock signal (CLK_B).
[0131] In one embodiment, a source of the second clock signal includes a clock divider (301, 400) configured to adjust the second clock signal by a division factor (k0), an integer greater than or equal to 2.
[0132] In one embodiment, the subsampler (301, 400) includes a module for adapting the subsampling factor (k1) to an adjustment of a frequency (f.sub.B) of the second clock signal (CLK_B) by the division factor (k0).
[0133] In one embodiment, the subsampler (301, 400) includes a clock gating cell (410) coupled to a counter (420) of pulses in the input signal.
[0134] In one embodiment, the set of flip-flops includes only two flip-flops in series (110, 113).
[0135] In one embodiment, when a required mean time between failures (MTBF) formula links a theoretical number N.sub.sync of flip-flops to a first frequency (f.sub.A) of the first clock signal (CLK_A) and a second frequency (f.sub.B) of the second clock signal (CLK_B), a subsampling factor k is fixed at a factor k2 selected from the factors of N.sub.sync1.
[0136] In one embodiment, a system (600) includes a first synchronization unit (601) between a first clock domain (107) timed by a first clock signal (CLK_A, CLK_C) and a second clock domain (114) asynchronous with the first clock domain and timed by a second clock signal (CLK_B), a second synchronization unit (602) between a third clock domain (607) timed by a third clock signal (CLK_C) distinct from the first clock signal (CLK_A) and the second clock domain (114) asynchronous with the third clock domain (607), wherein a shared subsampler (301, 400) supplies the same clock signal (CLK_k) subsampling the second clock signal (CLK_B), to the flip-flops (110, 113, 610, 611, 612) of the first and second synchronization units (601, 602).
[0137] In one embodiment, one embodiment for synchronization between a first clock domain (107, 607) timed by a first clock signal (CLK_A, CLK_C) and a second clock domain (114) asynchronous with the first clock domain and timed by a second clock signal (CLK_B), the method including the following steps: obtaining (710) at least one clock-division factor (k0) or clock-subsampling factor (k1), adjusting, by the clock-division factor, a variable frequency of the second clock signal at a target frequency to supply a clock signal timing the flip-flops and/or generating (720), by the clock-subsampling factor obtained, a clock signal (CLK_k) subsampling the second clock signal (CLK_B), and controlling (730), with the adjusted and/or generated clock signal (CLK_k), flip-flops (110, 113, 610, 611, 612) put in series in a synchronization unit (300, 601, 602) that receives as an input data (A_q) of the first clock domain and supplies as an output (120, 620) data in the second clock domain.
[0138] In one embodiment, a system includes a synchronization unit (300, 601, 602).
[0139] These and other changes can be made to the embodiments in light of the above-detailed description. In general, in the following claims, the terms used should not be construed to limit the claims to the specific embodiments disclosed in the specification and the claims, but should be construed to include all possible embodiments along with the full scope of equivalents to which such claims are entitled. Accordingly, the claims are not limited by the disclosure.