WO2021129050A1 - Glitch-free clock switching circuit - Google Patents

Glitch-free clock switching circuit Download PDF

Info

Publication number
WO2021129050A1
WO2021129050A1 PCT/CN2020/120445 CN2020120445W WO2021129050A1 WO 2021129050 A1 WO2021129050 A1 WO 2021129050A1 CN 2020120445 W CN2020120445 W CN 2020120445W WO 2021129050 A1 WO2021129050 A1 WO 2021129050A1
Authority
WO
WIPO (PCT)
Prior art keywords
clock
signal
flip
flop
signals
Prior art date
Application number
PCT/CN2020/120445
Other languages
French (fr)
Chinese (zh)
Inventor
张涤非
梁远军
Original Assignee
深圳市紫光同创电子有限公司
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 深圳市紫光同创电子有限公司 filed Critical 深圳市紫光同创电子有限公司
Priority to KR1020227013018A priority Critical patent/KR102654395B1/en
Publication of WO2021129050A1 publication Critical patent/WO2021129050A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K5/00Manipulating of pulses not covered by one of the other main groups of this subclass
    • H03K5/125Discriminating pulses
    • H03K5/1252Suppression or limitation of noise or interference
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • G06F1/08Clock generators with changeable or programmable clock frequency
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K5/00Manipulating of pulses not covered by one of the other main groups of this subclass
    • H03K5/156Arrangements in which a continuous pulse train is transformed into a train having a desired pattern
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • This application relates to the technical field of clock circuits, and in particular to a glitch-free clock switching circuit.
  • MUX multiplexer
  • the waveform diagram can refer to Figure 1, where clk[0] ⁇ clk[3] are four-way input clocks, sel[0] ⁇ sel[3] are the four-way clock selection corresponding to clk[0] ⁇ clk[3] Signal, at a certain moment, only one of sel[0] ⁇ sel[3] is high level, and clk_out is the output clock.
  • the multiplexer When sel[0] is high, the multiplexer outputs clk[0], when sel[1] is high, the multiplexer outputs clk[1], when sel[2] is high, multiplexes are selected When the output of clk[2] and sel[3] are high, the multiplexer outputs clk[3]. In this clock switching mode, if the timing is not properly controlled, the clock switching will cause glitches in the output clock. These burrs may trigger certain functions by mistake, so it is necessary to find a way to remove these burrs.
  • the present application provides a glitch-free clock switching circuit, which can realize that when multiple clock signals are switched, the output clock does not produce glitches.
  • the present application provides a glitch-free clock switching circuit, including: a clock selection signal generation circuit, a synchronization circuit, and a multiplexer.
  • the clock selection signal generation circuit is used to generate multiple clock selection signals.
  • the number of clock selection signals is the same as the number of multiple clock signals for switching, and the multiple clock signals for switching are a set of clock signals that are sequentially delayed in time sequence, and the clock selection signal is the same as the number of clock signals for switching.
  • the multiple clock signals that are switched have a one-to-one correspondence, and at any time, only one clock selection signal is valid.
  • the synchronization circuit is configured to perform synchronization processing on the multiple clock selection signals generated by the clock selection signal generating circuit according to multiple clock signals for switching, and each clock selection signal after synchronization processing satisfies the following characteristics: any adjacent Of the two clock selection signals, the falling edge of the previous clock selection signal is aligned with the rising edge of the next clock selection signal, and the rising edge of each clock selection signal is aligned with the rising edge of the corresponding clock signal. Each clock selection The falling edge of the signal is aligned with the rising edge of the next clock signal of the corresponding clock signal.
  • the input terminal of the multiplexer inputs multiple clock signals for switching, and the control terminal of the multiplexer inputs a control signal, and the control signal is multiple clock selection signals processed by the synchronization circuit synchronously
  • the output terminal of the multiplexer outputs a clock output signal, and the clock output signal is a clock signal corresponding to a valid clock selection signal after synchronization processing.
  • the synchronization circuit includes: a type I synchronization processing unit and a plurality of type II synchronization processing units, the sum of the number of the type I synchronization processing unit and the type II synchronization processing unit and the clock selection
  • the number of clock selection signals generated by the signal generating circuit is the same, wherein the type I synchronization processing unit is used for synchronizing the clock selection signal corresponding to the first clock signal in time sequence; each type II synchronization processing unit is used for The clock selection signals corresponding to all the clock signals after the first clock signal in the sequence are synchronized in a one-to-one correspondence.
  • the I-type synchronization processing unit includes: a first D flip-flop, a second D flip-flop, and a third D flip-flop connected in series, and a two-input AND gate, wherein the first D flip-flop
  • the input signal of the input terminal is the clock selection signal corresponding to the first clock signal in the timing sequence
  • the clock terminal of the first D flip-flop inputs a first clock signal
  • the first clock signal is the plurality of clocks for switching
  • the output terminal of the first D flip-flop is connected to the input terminal of the second D flip-flop
  • the clock terminal of the second D flip-flop inputs a second clock signal
  • the second clock signal Is the next adjacent clock signal after the clock signal with the highest timing sequence
  • the output terminal of the second D flip-flop is connected to the input terminal of the third D flip-flop, while the output terminal of the second D flip-flop is connected To the first input terminal of the two-input AND gate
  • the clock terminal of the third D flip-flop inputs a third clock signal
  • the type II synchronization processing unit includes: a fourth D flip-flop, a fifth D flip-flop, and a sixth D flip-flop connected in series, and a two-input OR gate, wherein the fourth D flip-flop
  • the input signal of the input terminal is any one of the clock selection signals corresponding to all the clock signals after the most advanced clock signal in the timing sequence.
  • the clock terminal of the fourth D flip-flop inputs a fourth clock signal, the fourth clock signal To be the same clock signal as the first clock signal, the output terminal of the fourth D flip-flop is connected to the input terminal of the fifth D flip-flop; the clock terminal of the fifth D flip-flop inputs a fifth clock Signal, the fifth clock signal is the clock signal corresponding to the clock selection signal input by the fourth D flip-flop, the output terminal of the fifth D flip-flop is connected to the input terminal of the sixth D flip-flop, and at the same time
  • the output terminal of the fifth D flip-flop is connected to the first input terminal of the two-input OR gate; the clock terminal of the sixth D flip-flop inputs a sixth clock signal, and the sixth clock signal is the first An adjacent clock signal after five clock signals, the output terminal of the sixth D flip-flop is connected to the second input terminal of the two-input OR gate, and the output terminal of the two-input OR gate outputs the synchronized clock Select the signal.
  • a synchronous clock is input to the clock terminal of the first D flip-flop, and the synchronous clock is any one of a plurality of clock signals for switching.
  • the synchronous clock is the clock signal with the most advanced timing sequence.
  • n clock selection signals there are n clock selection signals, n-1 type II synchronization processing units, and n is an integer.
  • each type II synchronization processing unit has the same structure.
  • the clock selection signal input by each type II synchronization processing unit is different.
  • the input clock of the first D flip-flop of each type II synchronization processing unit is the most advanced clock signal in time sequence.
  • the input clock of the D flip-flop in the middle of each type II synchronization processing unit is the clock signal corresponding to the clock selection signal input by the first D flip-flop.
  • the clock signal input by the last D flip-flop of each type II synchronization processing unit is an adjacent clock signal after the clock signal input by the D flip-flop in the middle position.
  • a clock signal generating circuit configured to generate the multiple clock signals for switching.
  • the clock signal generating circuit includes a plurality of D flip-flops, and the plurality of D flip-flops are used to delay generating a plurality of clock signals for switching.
  • the clock signal generating circuit is connected to the synchronization circuit and the multiplexer respectively.
  • the clock selection signal generating circuit includes an internal counter, which utilizes the internal counter to cyclically generate a binary control code, and then converts the binary control code into a code of 1 out of N, where N is the number of clock selection signals.
  • the clock selection signal generating circuit is connected to the synchronization circuit.
  • the synchronization circuit is connected to the multiplexer.
  • the present application also provides a glitch-free clock switching method, which is applied to the glitch-free clock switching circuit of the first aspect.
  • the method includes: a clock selection signal generating circuit generates a plurality of clock selection signals, and selects the plurality of clocks The signal is sent to the synchronization circuit; the synchronization circuit performs synchronization processing on the multiple clock selection signals generated by the clock selection signal generation circuit according to the multiple clock signals for switching to obtain the processed multiple clock selection signals; the multiplexer receives for switching And output a clock output signal, and the clock output signal is a clock signal corresponding to the effective clock selection signal after synchronization processing.
  • the synchronization circuit performs synchronization processing on multiple clock selection signals generated by the clock selection signal generation circuit according to multiple clock signals for switching, including: using an I-type synchronization processing unit to select the clock corresponding to the most advanced clock signal in time sequence The signal is synchronized; a plurality of type II synchronization processing units are used to synchronize the clock selection signals corresponding to all the clock signals after the first clock signal in the sequence.
  • the glitch-free clock switching circuit provided in this application adds a synchronization circuit, which uses multiple clocks to synchronize the control signals of the multiplexer, and adjusts the pulse width of the control signals, which can avoid outputting clocks during the switching of multiple clocks.
  • the signal generates burrs, and the realization method is simple, and it is not limited by the process.
  • FIG. 1 is a timing diagram of the existing clock switching
  • FIG. 2 is a schematic structural diagram of a glitch-free clock switching circuit according to an embodiment of the application.
  • Fig. 3 is a schematic diagram of an implementation circuit of the synchronization circuit in Fig. 2;
  • FIG. 4 is a schematic structural diagram of a glitch-free clock switching circuit according to another embodiment of the application.
  • FIG. 5 is a timing diagram of the glitch-free clock switching circuit when switching clocks according to an embodiment of the application
  • FIG. 6 is a method flowchart of a glitch-free clock switching method according to an embodiment of the application.
  • the embodiment of the present application provides a glitch-free clock switching circuit, as shown in FIG. 2, comprising: a clock selection signal generation circuit 21, a synchronization circuit 22, and a multiplexer 23.
  • the clock selection signal generation circuit 21 is used to generate A plurality of clock selection signals, the number of the clock selection signals is the same as the number of the plurality of clock signals for switching, and the plurality of clock signals for switching are a set of clock signals that are sequentially delayed in time sequence, and
  • the clock selection signal has a one-to-one correspondence with multiple clock signals for switching. At any time, only one clock selection signal is valid.
  • n there are n multiple clock signals for switching, which are respectively denoted as clk[0] ⁇ clk[n-1], n is an integer greater than or equal to 2, and the multiple clock signals for switching clk[0] ⁇ clk[n-1] are a set of clock signals delayed in sequence.
  • Multiple clock selection signals are denoted as sel_0[0] ⁇ sel_0[n-1], which can be abbreviated as sel_0[n- 1:0], sel_0[0] corresponds to clk[0], sel_0[1] corresponds to clk[1], and so on, sel_0[n-1] corresponds to clk[n-1].
  • the synchronization circuit 22 is used for synchronizing the multiple clock selection signals sel_0[n-1:0] generated by the clock selection signal generating circuit according to multiple clock signals clk[0] to clk[n-1] for switching Processing, among the multiple clock selection signals sel[n-1:0] after synchronization processing, each clock selection signal after synchronization processing satisfies the following characteristics: In any two adjacent clock selection signals, the previous clock selection signal The falling edge of the clock selection signal is aligned with the rising edge of the next clock selection signal, the rising edge of each clock selection signal is aligned with the rising edge of the corresponding clock signal, and the falling edge of each clock selection signal is aligned with the next item of the clock signal The rising edge of the clock signal is aligned.
  • the input terminal of the multiplexer 23 inputs multiple clock signals clk[0] ⁇ clk[n-1] for switching, the control terminal of the multiplexer 23 inputs a control signal, and the control signal is synchronized by the synchronization circuit 22
  • the output terminal of the multiplexer 23 outputs a clock output signal clk_out under the control of the control signal, and the clock output signal clk_out is a slave
  • the clock selection signal generation circuit 21 uses an internal counter to cyclically generate a binary control code, and then converts the binary control code into a code of 1 out of N, where N is the number of clock selection signals, which are output to the synchronization circuit 22 for processing Synchronous processing.
  • the synchronization circuit 22 includes a type I synchronization processing unit and a plurality of type II synchronization processing units.
  • the sum of the number of the type I synchronization processing unit and the type II synchronization processing unit is equal to the sum of the number of the type I synchronization processing unit and the type II synchronization processing unit.
  • the number of clock selection signals generated by the clock selection signal generating circuit is the same. In this embodiment, there are n clock selection signals.
  • n-1 type II synchronization processing units there are n-1 type II synchronization processing units, and the type I synchronization processing unit It is used for synchronizing the clock selection signal sel_0[0] corresponding to the clock signal clk[0] at the top of the time sequence; each of the type II synchronization processing units is used for one-to-one correspondence to the clock signals after the clock signal at the top of the time sequence.
  • the clock selection signal sel_0[n-1:1] corresponding to all the clock signals clk[n-1:1] is synchronized.
  • the I-type synchronization processing unit includes three D flip-flops connected in series and a two-input AND gate AND04.
  • the three D flip-flops are a first D flip-flop DFF01 and a second D flip-flop.
  • the clock terminal of the first D flip-flop DFF01 inputs a synchronization clock
  • the synchronization clock is any one of the multiple clock signals for switching, in this embodiment, the synchronization clock selects clk[0], the first D flip-flop DFF01
  • the output terminal of is connected to the input terminal of the second D flip-flop DFF02.
  • the clock signal input from the clock terminal of the second D flip-flop DFF02 is an adjacent clock signal clk[1] after the first clock signal clk[0] in the timing sequence, and the output of the second D flip-flop DFF02
  • the terminal is connected to the input terminal of the third D flip-flop DFF03, and the output terminal of the second D flip-flop DFF02 is connected to the first input terminal of the two-input AND gate AND04.
  • the clock signal input from the clock terminal of the third D flip-flop DFF03 is the clock signal clk[0] with the highest timing sequence.
  • the output terminal of the third D flip-flop DFF03 is connected to the second input terminal of the two-input AND gate AND04, and the two inputs are connected to the second input terminal of the two-input AND gate AND04.
  • the output terminal of the gate AND04 outputs the clock selection signal sel[0] after synchronization processing.
  • each type II synchronization processing unit has the same structure.
  • a type II synchronization processing unit for processing the clock selection signal sel_0[1] is taken as an example.
  • the type II synchronization processing unit includes : Three D flip-flops connected in series and a two-input OR gate OR14.
  • the three D flip-flops are the fourth D flip-flop DFF11, the fifth D flip-flop DFF12 and the sixth D flip-flop DFF13, respectively.
  • the input signal of the input terminal of the four D flip-flop DFF11 is the unsynchronized clock selection signal sel_0[1] corresponding to the next clock signal clk[0] after the first clock signal clk[0] in the timing sequence, and the fourth D trigger
  • the clock signal input by the clock terminal of the DFF11 is the same as the synchronous clock input by the DFF01, which is also clk[0], and the output terminal of the fourth D flip-flop DFF11 is connected to the input terminal of the fifth D flip-flop DFF12.
  • the clock signal input from the clock terminal of the fifth D flip-flop DFF12 is an adjacent clock signal clk[1] after the first clock signal clk[0] in the timing sequence, and the output terminal of the fifth D flip-flop DFF12 is connected To the input terminal of the sixth D flip-flop DFF13, while the output terminal of the fifth D flip-flop DFF12 is connected to the first input terminal of the two-input OR gate OR14.
  • the clock signal input from the clock terminal of the sixth D flip-flop DFF13 is an adjacent clock signal clk[2] after the input clock signal of the fifth D flip-flop DFF12, and the output terminal of the sixth D flip-flop DFF13 is connected to the second input
  • the second input terminal of the OR gate OR14 and the output terminal of the two-input OR gate OR14 output the synchronized clock selection signal sel[1].
  • the input clock of the first D flip-flop is clk[0], and the D in the middle position
  • the input clock of the flip-flop is the clock signal corresponding to the clock selection signal input by the first D flip-flop
  • the clock signal input by the last D flip-flop is an adjacent clock signal after the clock signal input by the D flip-flop in the middle position.
  • the clock selection signals sel_0[0] ⁇ sel_0[n-1] generated by the clock selection signal generation circuit 21 are first synchronized by the same clock clk[0], so that all clock selection signals are synchronized and the clock is eliminated
  • the delay between the selection signals is synchronized for the first time with multiple clocks respectively, and the rising and falling edges of different clock selection signals are aligned with the rising edges of the corresponding clock signals, and then multiple clocks are used for the second time Synchronization, so that the rising and falling edges of different clock selection signals are aligned with the rising edge of the next clock of the corresponding clock signal, and the results of the last two multiple clock synchronizations are logically operated, on the one hand, the synchronized processing In any two adjacent clock selection signals, the falling edge of the previous clock selection signal is aligned with the rising edge of the next clock selection signal to achieve seamless switching of the clock selection signal; The rising edge of each clock selection signal is aligned with the rising edge of the corresponding clock signal
  • the state of the previous clock selected for output is the same as the state of the next clock selected for output to avoid glitches.
  • the rising edge of the previous clock selection signal is aligned with the falling edge of the next clock selection signal, and the state of the previous clock at the time of clock transition The state is the same as the latter clock, so the output clock will not produce glitches.
  • the glitch-free clock switching circuit provided by another embodiment of the present application further includes: a clock signal generating circuit 24.
  • the clock signal generating circuit 24 includes a plurality of D flip-flops, using a plurality of D flip-flops. Delay generation of multiple clock signals clk[0] ⁇ clk[n-1] for switching. These multiple clock signals are used as multiple clock inputs of the multiplexer on the one hand, and output to the synchronization circuit on the other hand for synchronizing the clock selection signal.
  • Figure 5 shows the timing diagram of the glitch-free clock switching circuit provided by the embodiment of the present application when switching clocks, where clk[0] ⁇ clk[n-1] are multiple clock signals for switching, sel_1[0] ⁇ sel_1 [n-1] is the clock selection signal after using the same clock synchronization, sel_2[0] ⁇ sel_2[n-1] is the clock selection signal after using multiple clocks for the first synchronization, sel_3[0] ⁇ sel_3[ n-1] is the clock selection signal after the second synchronization using multiple clocks, sel[0] ⁇ sel[n-1] is the clock selection signal output after synchronization, clk_out is the clock output signal output by the multiplexer .
  • the rising edge of [0] is aligned, the rising edge of sel_2[n-2] is aligned with the rising edge of clk[n-2], the falling edge of sel_2[n-2] is aligned with the rising edge of clk[n-2], sel_3[ The rising edge of n-2] is aligned with the rising edge of clk[n-1], the falling edge of sel_3[n-2] is aligned with the rising edge of clk[n-1], and the rising edge of sel[n-2] is aligned with clk[ The rising edge of n-2] is aligned, the falling edge of sel[n-2] is aligned with the rising edge of clk[n-1], and the rest of the signals are deduced by analogy. Finally, clk_out will not generate glitches during clock switching.
  • an embodiment of the present application provides a glitch-free clock switching method, which is applied to the glitch-free clock switching circuit described above.
  • the method may include steps S301 to S303.
  • Step S301 The clock selection signal generating circuit generates a plurality of clock selection signals, and sends the plurality of clock selection signals to the synchronization circuit.
  • Step S302 the synchronization circuit performs synchronization processing on the multiple clock selection signals generated by the clock selection signal generating circuit according to the multiple clock signals for switching, to obtain processed multiple clock selection signals.
  • the present application can use the type I synchronization processing unit to synchronize the clock selection signal corresponding to the most advanced clock signal in the timing sequence, and use multiple type II synchronization processing units to perform the synchronization processing on all clocks after the most advanced clock signal in timing sequence.
  • the clock selection signal corresponding to the signal is synchronized.
  • the sum of the number of type I synchronization processing units and type II synchronization processing units is the same as the number of clock selection signals generated by the clock selection signal generating circuit.
  • Step S303 The multiplexer receives multiple clock signals for switching and processed multiple clock selection signals, and outputs a clock output signal, the clock output signal is a clock signal corresponding to the effective clock selection signal after synchronization processing .

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Nonlinear Science (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Electronic Switches (AREA)

Abstract

Provided in the present application is a glitch-free clock switching circuit, comprising: a clock selection signal generating circuit, a synchronization circuit, and a multipath selector. The clock selection signal generating circuit is used for generating multiple clock selection signals. The synchronization circuit is used for synchronizing the multiple clock selection signals on the basis of multiple clock signals for switching. The synchronized clock selection signals satisfy the following characteristics: in any two adjacent clock selection signals, the falling edge of the preceding clock selection signal is aligned with the rising edge of the subsequent clock selection signal, the rising edge of each clock selection signal is aligned with the rising edge of the clock signal corresponding thereto, and the falling edge of each clock selection signal is aligned with the rising edge of the clock signal subsequent to the clock signal corresponding to the clock selection signal. The multipath selector selects one from multiple inputted clock signals for output on the basis of the multiple synchronized clock selection signals. The present application prevents glitches from being generated by the clock signal outputted during a multipath switching process.

Description

无毛刺时钟切换电路Glitch-free clock switching circuit
相关申请的交叉引用Cross references to related applications
本申请要求于2019年12月26日提交中国专利局的申请号为CN201911370944.7、名称为“无毛刺时钟切换电路”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number CN201911370944.7 and the name "Glitch-Free Clock Switching Circuit" filed with the Chinese Patent Office on December 26, 2019, the entire content of which is incorporated into this application by reference.
技术领域Technical field
本申请涉及时钟电路技术领域,尤其涉及一种无毛刺时钟切换电路。This application relates to the technical field of clock circuits, and in particular to a glitch-free clock switching circuit.
背景技术Background technique
随着高速接口电路的发展,用到的时钟频率越来越多,很多场合需要在工作过程中对工作时钟进行切换,满足不同的功能需求。简单的使用多路选择器(Multiplexer,MUX)即可实现时钟的切换,多路选择器的控制端输入一组时钟选择信号,通过时钟选择信号控制多路选择器将多路时钟逐一输出。其波形示意图可以参考图1,其中clk[0]~clk[3]是四路输入时钟,sel[0]~sel[3]是和clk[0]~clk[3]对应的四路时钟选择信号,在某一个时刻,sel[0]~sel[3]中只有一个是高电平,clk_out为输出时钟。sel[0]为高电平时,多路选择器输出clk[0],sel[1]为高电平时,多路选择器输出clk[1],sel[2]为高电平时,多路选择器输出clk[2],sel[3]为高电平时,多路选择器输出clk[3]。在这种时钟切换模式下,如果时序控制不当,时钟切换会引起输出时钟产生毛刺。这些毛刺可能错误的触发某些功能,因此必须要想办法去除这些毛刺。With the development of high-speed interface circuits, more and more clock frequencies are used. In many cases, it is necessary to switch the working clock during the working process to meet different functional requirements. Simply use a multiplexer (MUX) to switch clocks. The control end of the multiplexer inputs a set of clock selection signals, and the multiplexer is controlled by the clock selection signals to output multiple clocks one by one. The waveform diagram can refer to Figure 1, where clk[0]~clk[3] are four-way input clocks, sel[0]~sel[3] are the four-way clock selection corresponding to clk[0]~clk[3] Signal, at a certain moment, only one of sel[0]~sel[3] is high level, and clk_out is the output clock. When sel[0] is high, the multiplexer outputs clk[0], when sel[1] is high, the multiplexer outputs clk[1], when sel[2] is high, multiplexes are selected When the output of clk[2] and sel[3] are high, the multiplexer outputs clk[3]. In this clock switching mode, if the timing is not properly controlled, the clock switching will cause glitches in the output clock. These burrs may trigger certain functions by mistake, so it is necessary to find a way to remove these burrs.
发明内容Summary of the invention
为解决上述问题,本申请提供一种无毛刺时钟切换电路,能够实现多路时钟信号进行切换时,输出时钟不会产生毛刺。In order to solve the above-mentioned problems, the present application provides a glitch-free clock switching circuit, which can realize that when multiple clock signals are switched, the output clock does not produce glitches.
第一方面,本申请提供一种无毛刺时钟切换电路,包括:时钟选择信号产生电路、同步电路和多路选择器,所述时钟选择信号产生电路,用于生成多个时钟选择信号,所述时钟选择信号的个数与供切换的多个时钟信号的个数相同,所述供切换的多个时钟信号为一组在时序上依次延迟的时钟信号,且所述时钟选择信号与所述供切换的多个时钟信号是一一对应的,在任意时刻,有且只有一个时钟选择信号是有效的。所述同步电路,用于根据供切换的多个时钟信号对所述时钟选择信号产生电路生成的多个时钟选择信号进行同步处理,同步处理后的各时钟选择信号满足以下特性:任意相邻的两个时钟选择信号中,前一项时钟选择信号的下降沿与后一项时钟选择信号的上升沿对齐,每个时钟选择信号的上升沿与其对应的时钟信号的上升沿对齐,每个时钟选择信号的下降沿与其对应的时钟信号的后一项时钟信号的上升沿对齐。所述多路选择器的输入端输入供切换的多个时钟信号,所述多路选择器的控制端输入一控制信号,所述控制信号为所述同步电路同步处理后的多个时钟选择信号,所述多路选择器的输出端输出一时钟输出信号,所述时钟输出信号为与同步处理后的有效的时钟选择信号对应的时钟信号。In a first aspect, the present application provides a glitch-free clock switching circuit, including: a clock selection signal generation circuit, a synchronization circuit, and a multiplexer. The clock selection signal generation circuit is used to generate multiple clock selection signals. The number of clock selection signals is the same as the number of multiple clock signals for switching, and the multiple clock signals for switching are a set of clock signals that are sequentially delayed in time sequence, and the clock selection signal is the same as the number of clock signals for switching. The multiple clock signals that are switched have a one-to-one correspondence, and at any time, only one clock selection signal is valid. The synchronization circuit is configured to perform synchronization processing on the multiple clock selection signals generated by the clock selection signal generating circuit according to multiple clock signals for switching, and each clock selection signal after synchronization processing satisfies the following characteristics: any adjacent Of the two clock selection signals, the falling edge of the previous clock selection signal is aligned with the rising edge of the next clock selection signal, and the rising edge of each clock selection signal is aligned with the rising edge of the corresponding clock signal. Each clock selection The falling edge of the signal is aligned with the rising edge of the next clock signal of the corresponding clock signal. The input terminal of the multiplexer inputs multiple clock signals for switching, and the control terminal of the multiplexer inputs a control signal, and the control signal is multiple clock selection signals processed by the synchronization circuit synchronously The output terminal of the multiplexer outputs a clock output signal, and the clock output signal is a clock signal corresponding to a valid clock selection signal after synchronization processing.
可选地,所述同步电路包括:一个I型同步处理单元和多个II型同步处理单元,所述I型同步处理单元和所述II型同步处理单元的个数之和与所述时钟选择信号产生电路生成的时钟选择信号的个数相同,其中,所述I型同步处理单元用于对时序最靠前时钟信号对应的时钟选择信号进行同步处理;各所述II型同步处理单元用于一一对应地分别对所述时序最靠前时钟信号之后的所有时钟信号对应的时钟选择信号进行同步处理。Optionally, the synchronization circuit includes: a type I synchronization processing unit and a plurality of type II synchronization processing units, the sum of the number of the type I synchronization processing unit and the type II synchronization processing unit and the clock selection The number of clock selection signals generated by the signal generating circuit is the same, wherein the type I synchronization processing unit is used for synchronizing the clock selection signal corresponding to the first clock signal in time sequence; each type II synchronization processing unit is used for The clock selection signals corresponding to all the clock signals after the first clock signal in the sequence are synchronized in a one-to-one correspondence.
可选地,所述I型同步处理单元包括:串联连接的第一D触发器、第二D触发器和第三D触发器,以及一个二输入与门,其中,所述第一D触发器的输入端输入信号为时序最靠前时钟信号所对应的时钟选择信号,所 述第一D触发器的时钟端输入第一时钟信号,所述第一时钟信号为所述供切换的多个时钟信号的任意一个,所述第一D触发器的输出端连接至所述第二D触发器的输入端;所述第二D触发器的时钟端输入第二时钟信号,所述第二时钟信号为时序最靠前时钟信号的后一个相邻时钟信号,所述第二D触发器的输出端连接至所述第三D触发器的输入端,同时所述第二D触发器的输出端连接至所述二输入与门的第一输入端;所述第三D触发器的时钟端输入第三时钟信号,所述第三时钟信号为时序最靠前时钟信号,所述第三D触发器的输出端连接至所述二输入与门的第二输入端,所述二输入与门的输出端输出同步处理后的时钟选择信号。Optionally, the I-type synchronization processing unit includes: a first D flip-flop, a second D flip-flop, and a third D flip-flop connected in series, and a two-input AND gate, wherein the first D flip-flop The input signal of the input terminal is the clock selection signal corresponding to the first clock signal in the timing sequence, the clock terminal of the first D flip-flop inputs a first clock signal, and the first clock signal is the plurality of clocks for switching For any one of the signals, the output terminal of the first D flip-flop is connected to the input terminal of the second D flip-flop; the clock terminal of the second D flip-flop inputs a second clock signal, the second clock signal Is the next adjacent clock signal after the clock signal with the highest timing sequence, the output terminal of the second D flip-flop is connected to the input terminal of the third D flip-flop, while the output terminal of the second D flip-flop is connected To the first input terminal of the two-input AND gate; the clock terminal of the third D flip-flop inputs a third clock signal, the third clock signal is the clock signal with the highest timing, the third D flip-flop The output terminal of is connected to the second input terminal of the two-input AND gate, and the output terminal of the two-input AND gate outputs a clock selection signal after synchronization processing.
可选地,所述II型同步处理单元包括:串联连接的第四D触发器、第五D触发器和第六D触发器,以及一个二输入或门,其中,所述第四D触发器的输入端输入信号为时序最靠前时钟信号之后的所有时钟信号所对应的时钟选择信号的其中任意一个,所述第四D触发器的时钟端输入第四时钟信号,所述第四时钟信号为与所述第一时钟信号相同的时钟信号,所述第四D触发器的输出端连接至所述第五D触发器的输入端;所述第五D触发器的时钟端输入第五时钟信号,所述第五时钟信号为所述第四D触发器输入的时钟选择信号对应的时钟信号,所述第五D触发器的输出端连接至所述第六D触发器的输入端,同时所述第五D触发器的输出端连接至所述二输入或门的第一输入端;所述第六D触发器的时钟端输入第六时钟信号,所述第六时钟信号为所述第五时钟信号之后的一个相邻时钟信号,所述第六D触发器的输出端连接至所述二输入或门的第二输入端,所述二输入或门的输出端输出同步处理后的时钟选择信号。Optionally, the type II synchronization processing unit includes: a fourth D flip-flop, a fifth D flip-flop, and a sixth D flip-flop connected in series, and a two-input OR gate, wherein the fourth D flip-flop The input signal of the input terminal is any one of the clock selection signals corresponding to all the clock signals after the most advanced clock signal in the timing sequence. The clock terminal of the fourth D flip-flop inputs a fourth clock signal, the fourth clock signal To be the same clock signal as the first clock signal, the output terminal of the fourth D flip-flop is connected to the input terminal of the fifth D flip-flop; the clock terminal of the fifth D flip-flop inputs a fifth clock Signal, the fifth clock signal is the clock signal corresponding to the clock selection signal input by the fourth D flip-flop, the output terminal of the fifth D flip-flop is connected to the input terminal of the sixth D flip-flop, and at the same time The output terminal of the fifth D flip-flop is connected to the first input terminal of the two-input OR gate; the clock terminal of the sixth D flip-flop inputs a sixth clock signal, and the sixth clock signal is the first An adjacent clock signal after five clock signals, the output terminal of the sixth D flip-flop is connected to the second input terminal of the two-input OR gate, and the output terminal of the two-input OR gate outputs the synchronized clock Select the signal.
可选地,第一D触发器的时钟端输入一个同步时钟,该同步时钟为供切换的多个时钟信号的任意一个。Optionally, a synchronous clock is input to the clock terminal of the first D flip-flop, and the synchronous clock is any one of a plurality of clock signals for switching.
可选地,同步时钟为时序最靠前时钟信号。Optionally, the synchronous clock is the clock signal with the most advanced timing sequence.
可选地,时钟选择信号为n个,II型同步处理单元为n-1个,n为整数。Optionally, there are n clock selection signals, n-1 type II synchronization processing units, and n is an integer.
可选地,每个II型同步处理单元的结构相同。Optionally, each type II synchronization processing unit has the same structure.
可选地,每个II型同步处理单元输入的时钟选择信号不同。Optionally, the clock selection signal input by each type II synchronization processing unit is different.
可选地,每个II型同步处理单元最前一个D触发器的输入时钟均是时序最靠前时钟信号。Optionally, the input clock of the first D flip-flop of each type II synchronization processing unit is the most advanced clock signal in time sequence.
可选地,每个II型同步处理单元中间位置的D触发器的输入时钟是最前一个D触发器输入的时钟选择信号对应的时钟信号。Optionally, the input clock of the D flip-flop in the middle of each type II synchronization processing unit is the clock signal corresponding to the clock selection signal input by the first D flip-flop.
可选地,每个II型同步处理单元最后一个D触发器输入的时钟信号为中间位置的D触发器输入的时钟信号之后的一个相邻时钟信号。Optionally, the clock signal input by the last D flip-flop of each type II synchronization processing unit is an adjacent clock signal after the clock signal input by the D flip-flop in the middle position.
可选地,还包括:时钟信号产生电路,用于生成所述供切换的多个时钟信号。Optionally, it further includes: a clock signal generating circuit, configured to generate the multiple clock signals for switching.
可选地,所述时钟信号产生电路包括多个D触发器,利用多个D触发器延迟生成供切换的多个时钟信号。Optionally, the clock signal generating circuit includes a plurality of D flip-flops, and the plurality of D flip-flops are used to delay generating a plurality of clock signals for switching.
可选地,时钟信号产生电路分别与同步电路和多路选择器连接。Optionally, the clock signal generating circuit is connected to the synchronization circuit and the multiplexer respectively.
可选地,所述时钟选择信号产生电路包括内部计数器,利用内部计数器循环产生二进制控制码,然后将二进制控制码转换为N中取1码,其中N为时钟选择信号的个数。Optionally, the clock selection signal generating circuit includes an internal counter, which utilizes the internal counter to cyclically generate a binary control code, and then converts the binary control code into a code of 1 out of N, where N is the number of clock selection signals.
可选地,时钟选择信号产生电路与同步电路连接。Optionally, the clock selection signal generating circuit is connected to the synchronization circuit.
可选地,同步电路与多路选择器连接。Optionally, the synchronization circuit is connected to the multiplexer.
第二方面,本申请还提供了无毛刺时钟切换方法,其应用于第一方面的无毛刺时钟切换电路,该方法包括:时钟选择信号产生电路生成多个时钟选择信号,并将多个时钟选择信号发送至同步电路;同步电路根据供切换的多个时钟信号对时钟选择信号产生电路生成的多个时钟选择信号进行同步处理,得到处理后的多个时钟选择信号;多路选择器接收供切换的多个时钟信号和处理后的多个时钟选择信号,并输出一时钟输出信号,时钟输出信号为与同步处理后的有效的时钟选择信号对应的时钟信号。In the second aspect, the present application also provides a glitch-free clock switching method, which is applied to the glitch-free clock switching circuit of the first aspect. The method includes: a clock selection signal generating circuit generates a plurality of clock selection signals, and selects the plurality of clocks The signal is sent to the synchronization circuit; the synchronization circuit performs synchronization processing on the multiple clock selection signals generated by the clock selection signal generation circuit according to the multiple clock signals for switching to obtain the processed multiple clock selection signals; the multiplexer receives for switching And output a clock output signal, and the clock output signal is a clock signal corresponding to the effective clock selection signal after synchronization processing.
可选地,同步电路根据供切换的多个时钟信号对时钟选择信号产生电路生成的多个时钟选择信号进行同步处理,包括:利用I型同步处理单元对 时序最靠前时钟信号对应的时钟选择信号进行同步处理;利用多个II型同步处理单元分别对时序最靠前时钟信号之后的所有时钟信号对应的时钟选择信号进行同步处理。Optionally, the synchronization circuit performs synchronization processing on multiple clock selection signals generated by the clock selection signal generation circuit according to multiple clock signals for switching, including: using an I-type synchronization processing unit to select the clock corresponding to the most advanced clock signal in time sequence The signal is synchronized; a plurality of type II synchronization processing units are used to synchronize the clock selection signals corresponding to all the clock signals after the first clock signal in the sequence.
本申请提供的无毛刺时钟切换电路,增加一个同步电路,通过采用多项时钟对多路选择器的控制信号进行同步处理,并且调整控制信号的脉冲宽度,能够避免多路时钟切换过程中输出时钟信号产生毛刺,而且实现方式简单,不受工艺限制。The glitch-free clock switching circuit provided in this application adds a synchronization circuit, which uses multiple clocks to synchronize the control signals of the multiplexer, and adjusts the pulse width of the control signals, which can avoid outputting clocks during the switching of multiple clocks. The signal generates burrs, and the realization method is simple, and it is not limited by the process.
附图说明Description of the drawings
图1为现有的时钟切换时序图;FIG. 1 is a timing diagram of the existing clock switching;
图2为本申请一实施例的无毛刺时钟切换电路的结构示意图;2 is a schematic structural diagram of a glitch-free clock switching circuit according to an embodiment of the application;
图3为图2中同步电路的一种实现电路示意图;Fig. 3 is a schematic diagram of an implementation circuit of the synchronization circuit in Fig. 2;
图4为本申请另一实施例的无毛刺时钟切换电路的结构示意图;4 is a schematic structural diagram of a glitch-free clock switching circuit according to another embodiment of the application;
图5为本申请一实施例的无毛刺时钟切换电路在切换时钟时的时序图;FIG. 5 is a timing diagram of the glitch-free clock switching circuit when switching clocks according to an embodiment of the application;
图6为本申请一实施例的无毛刺时钟切换方法的方法流程图。FIG. 6 is a method flowchart of a glitch-free clock switching method according to an embodiment of the application.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments It is only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
本申请实施例提供一种无毛刺时钟切换电路,如图2所示,包括:时钟选择信号产生电路21、同步电路22和多路选择器23,其中,时钟选择信号产生电路21,用于生成多个时钟选择信号,所述时钟选择信号的个数 与供切换的多个时钟信号的个数相同,所述供切换的多个时钟信号为一组在时序上依次延迟的时钟信号,且所述时钟选择信号与供切换的多个时钟信号是一一对应的,在任意时刻,有且只有一个时钟选择信号是有效的。本实施例中,所述供切换的多个时钟信号为n个,分别记为clk[0]~clk[n-1],n为大于等于2的整数,所述供切换的多个时钟信号clk[0]~clk[n-1]为一组在时序上依次延迟的时钟信号,多个时钟选择信号记为sel_0[0]~sel_0[n-1],可以简记为sel_0[n-1:0],sel_0[0]对应选择clk[0],sel_0[1]对应选择clk[1],依次类推,sel_0[n-1]对应选择clk[n-1]。The embodiment of the present application provides a glitch-free clock switching circuit, as shown in FIG. 2, comprising: a clock selection signal generation circuit 21, a synchronization circuit 22, and a multiplexer 23. The clock selection signal generation circuit 21 is used to generate A plurality of clock selection signals, the number of the clock selection signals is the same as the number of the plurality of clock signals for switching, and the plurality of clock signals for switching are a set of clock signals that are sequentially delayed in time sequence, and The clock selection signal has a one-to-one correspondence with multiple clock signals for switching. At any time, only one clock selection signal is valid. In this embodiment, there are n multiple clock signals for switching, which are respectively denoted as clk[0]~clk[n-1], n is an integer greater than or equal to 2, and the multiple clock signals for switching clk[0]~clk[n-1] are a set of clock signals delayed in sequence. Multiple clock selection signals are denoted as sel_0[0]~sel_0[n-1], which can be abbreviated as sel_0[n- 1:0], sel_0[0] corresponds to clk[0], sel_0[1] corresponds to clk[1], and so on, sel_0[n-1] corresponds to clk[n-1].
同步电路22,用于根据供切换的多个时钟信号clk[0]~clk[n-1]对所述时钟选择信号产生电路生成的多个时钟选择信号sel_0[n-1:0]进行同步处理,同步处理后的多个时钟选择信号sel[n-1:0]中,同步处理后的各时钟选择信号满足以下特性:任意相邻的两个时钟选择信号中,前一项时钟选择信号的下降沿与后一项时钟选择信号的上升沿对齐,每个时钟选择信号的上升沿与其对应的时钟信号的上升沿对齐,每个时钟选择信号的下降沿与其对应的时钟信号的后一项时钟信号的上升沿对齐。The synchronization circuit 22 is used for synchronizing the multiple clock selection signals sel_0[n-1:0] generated by the clock selection signal generating circuit according to multiple clock signals clk[0] to clk[n-1] for switching Processing, among the multiple clock selection signals sel[n-1:0] after synchronization processing, each clock selection signal after synchronization processing satisfies the following characteristics: In any two adjacent clock selection signals, the previous clock selection signal The falling edge of the clock selection signal is aligned with the rising edge of the next clock selection signal, the rising edge of each clock selection signal is aligned with the rising edge of the corresponding clock signal, and the falling edge of each clock selection signal is aligned with the next item of the clock signal The rising edge of the clock signal is aligned.
多路选择器23的输入端输入供切换的多个时钟信号clk[0]~clk[n-1],所述多路选择器23的控制端输入一控制信号,控制信号为同步电路22同步处理后的多个时钟选择信号sel[n-1:0],所述多路选择器23的输出端在所述控制信号的控制下输出一时钟输出信号clk_out,所述时钟输出信号clk_out为从所述供切换的多个时钟信号clk[0]~clk[n-1]中选出的一个时钟信号,该时钟信号为与同步处理后的有效的时钟选择信号对应的时钟信号。The input terminal of the multiplexer 23 inputs multiple clock signals clk[0]~clk[n-1] for switching, the control terminal of the multiplexer 23 inputs a control signal, and the control signal is synchronized by the synchronization circuit 22 After processing the multiple clock selection signals sel[n-1:0], the output terminal of the multiplexer 23 outputs a clock output signal clk_out under the control of the control signal, and the clock output signal clk_out is a slave A clock signal selected from the plurality of clock signals clk[0] to clk[n-1] for switching, and the clock signal is a clock signal corresponding to an effective clock selection signal after synchronization processing.
进一步地,所述时钟选择信号产生电路21,利用内部计数器循环产生二进制控制码,然后将二进制控制码转换为N中取1码,其中N为时钟选择信号的个数,输出给同步电路22进行同步处理。Further, the clock selection signal generation circuit 21 uses an internal counter to cyclically generate a binary control code, and then converts the binary control code into a code of 1 out of N, where N is the number of clock selection signals, which are output to the synchronization circuit 22 for processing Synchronous processing.
所述同步电路22,如图3所示,包括一个I型同步处理单元和多个II型同步处理单元,所述I型同步处理单元和所述II型同步处理单元的个数之和与所述时钟选择信号产生电路生成的时钟选择信号的个数相同,本实 施例中,时钟选择信号为n个,因此,II型同步处理单元为n-1个,其中,所述I型同步处理单元用于对时序最靠前时钟信号clk[0]对应的时钟选择信号sel_0[0]进行同步处理;各所述II型同步处理单元用于一一对应地分别对时序最靠前时钟信号之后的所有时钟信号clk[n-1:1]对应的时钟选择信号sel_0[n-1:1]进行同步处理。The synchronization circuit 22, as shown in FIG. 3, includes a type I synchronization processing unit and a plurality of type II synchronization processing units. The sum of the number of the type I synchronization processing unit and the type II synchronization processing unit is equal to the sum of the number of the type I synchronization processing unit and the type II synchronization processing unit. The number of clock selection signals generated by the clock selection signal generating circuit is the same. In this embodiment, there are n clock selection signals. Therefore, there are n-1 type II synchronization processing units, and the type I synchronization processing unit It is used for synchronizing the clock selection signal sel_0[0] corresponding to the clock signal clk[0] at the top of the time sequence; each of the type II synchronization processing units is used for one-to-one correspondence to the clock signals after the clock signal at the top of the time sequence. The clock selection signal sel_0[n-1:1] corresponding to all the clock signals clk[n-1:1] is synchronized.
具体地,如图3所示,I型同步处理单元包括:串联连接的三个D触发器和一个二输入与门AND04,所述三个D触发器分别是第一D触发器DFF01、第二D触发器DFF02和第三D触发器DFF03,其中,第一D触发器DFF01的输入端输入信号为时序最靠前时钟信号clk[0]所对应的未同步处理的时钟选择信号sel_0[0],第一D触发器DFF01的时钟端输入一个同步时钟,该同步时钟为供切换的多个时钟信号的任意一个,本实施例中,该同步时钟选择clk[0],第一D触发器DFF01的输出端连接至第二D触发器DFF02的输入端。Specifically, as shown in FIG. 3, the I-type synchronization processing unit includes three D flip-flops connected in series and a two-input AND gate AND04. The three D flip-flops are a first D flip-flop DFF01 and a second D flip-flop. The D flip-flop DFF02 and the third D flip-flop DFF03, wherein the input signal of the input terminal of the first D flip-flop DFF01 is the unsynchronized clock selection signal sel_0[0] corresponding to the clock signal clk[0] with the highest timing sequence. , The clock terminal of the first D flip-flop DFF01 inputs a synchronization clock, the synchronization clock is any one of the multiple clock signals for switching, in this embodiment, the synchronization clock selects clk[0], the first D flip-flop DFF01 The output terminal of is connected to the input terminal of the second D flip-flop DFF02.
本申请实施例中,第二D触发器DFF02的时钟端输入的时钟信号为时序最靠前时钟信号clk[0]的之后一个相邻时钟信号clk[1],第二D触发器DFF02的输出端连接至第三D触发器DFF03的输入端,同时第二D触发器DFF02的输出端连接至二输入与门AND04的第一输入端。第三D触发器DFF03的时钟端输入的时钟信号为时序最靠前时钟信号clk[0],第三D触发器DFF03的输出端连接至二输入与门AND04的第二输入端,二输入与门AND04的输出端输出同步处理后的时钟选择信号sel[0]。In the embodiment of the present application, the clock signal input from the clock terminal of the second D flip-flop DFF02 is an adjacent clock signal clk[1] after the first clock signal clk[0] in the timing sequence, and the output of the second D flip-flop DFF02 The terminal is connected to the input terminal of the third D flip-flop DFF03, and the output terminal of the second D flip-flop DFF02 is connected to the first input terminal of the two-input AND gate AND04. The clock signal input from the clock terminal of the third D flip-flop DFF03 is the clock signal clk[0] with the highest timing sequence. The output terminal of the third D flip-flop DFF03 is connected to the second input terminal of the two-input AND gate AND04, and the two inputs are connected to the second input terminal of the two-input AND gate AND04. The output terminal of the gate AND04 outputs the clock selection signal sel[0] after synchronization processing.
进一步地,本实施例中,每一个II型同步处理单元的结构相同,为描述方便,以用于处理时钟选择信号sel_0[1]的II型同步处理单元为例,该II型同步处理单元包括:三个串联连接的D触发器以及一个二输入或门OR14,所述三个D触发器分别是第四D触发器DFF11、第五D触发器DFF12和第六D触发器DFF13,其中,第四D触发器DFF11的输入端输入信号为时序最靠前时钟信号clk[0]之后一个相邻时钟信号clk[1]所对应的未同步处理的时钟选择信号sel_0[1],第四D触发器DFF11的时钟端输入的时钟信 号与DFF01输入的同步时钟相同,也为clk[0],第四D触发器DFF11的输出端连接至第五D触发器DFF12的输入端。Further, in this embodiment, each type II synchronization processing unit has the same structure. For ease of description, a type II synchronization processing unit for processing the clock selection signal sel_0[1] is taken as an example. The type II synchronization processing unit includes : Three D flip-flops connected in series and a two-input OR gate OR14. The three D flip-flops are the fourth D flip-flop DFF11, the fifth D flip-flop DFF12 and the sixth D flip-flop DFF13, respectively. The input signal of the input terminal of the four D flip-flop DFF11 is the unsynchronized clock selection signal sel_0[1] corresponding to the next clock signal clk[0] after the first clock signal clk[0] in the timing sequence, and the fourth D trigger The clock signal input by the clock terminal of the DFF11 is the same as the synchronous clock input by the DFF01, which is also clk[0], and the output terminal of the fourth D flip-flop DFF11 is connected to the input terminal of the fifth D flip-flop DFF12.
作为一种方式,第五D触发器DFF12的时钟端输入的时钟信号为时序最靠前时钟信号clk[0]之后一个相邻时钟信号clk[1],第五D触发器DFF12的输出端连接至第六D触发器DFF13的输入端,同时第五D触发器DFF12的输出端连接至二输入或门OR14的第一输入端。另外,第六D触发器DFF13的时钟端输入的时钟信号为第五D触发器DFF12输入时钟信号之后的一个相邻时钟信号clk[2],第六D触发器DFF13的输出端连接至二输入或门OR14的第二输入端,二输入或门OR14的输出端输出同步处理后的时钟选择信号sel[1]。As a way, the clock signal input from the clock terminal of the fifth D flip-flop DFF12 is an adjacent clock signal clk[1] after the first clock signal clk[0] in the timing sequence, and the output terminal of the fifth D flip-flop DFF12 is connected To the input terminal of the sixth D flip-flop DFF13, while the output terminal of the fifth D flip-flop DFF12 is connected to the first input terminal of the two-input OR gate OR14. In addition, the clock signal input from the clock terminal of the sixth D flip-flop DFF13 is an adjacent clock signal clk[2] after the input clock signal of the fifth D flip-flop DFF12, and the output terminal of the sixth D flip-flop DFF13 is connected to the second input The second input terminal of the OR gate OR14 and the output terminal of the two-input OR gate OR14 output the synchronized clock selection signal sel[1].
类似地,参考图3,用于处理其余时钟选择信号sel_0[2]~sel_0[n-1]的II型同步处理单元与用于处理时钟选择信号sel_0[1]的II型同步处理单元的结构相同,区别在于,输入的时钟选择信号不同,此时需要对应调整串联的三个D触发器输入的时钟信号,其中,最前一个D触发器的输入时钟都是clk[0],中间位置的D触发器的输入时钟为最前一个D触发器输入的时钟选择信号对应的时钟信号,最后一个D触发器输入的时钟信号为中间位置的D触发器输入的时钟信号之后的一个相邻时钟信号。特别地,将clk[0]作为clk[n-1]之后的一个相邻时钟信号。Similarly, referring to FIG. 3, the structure of a type II synchronization processing unit for processing the remaining clock selection signals sel_0[2] to sel_0[n-1] and a type II synchronization processing unit for processing the clock selection signal sel_0[1] The same, the difference is that the input clock selection signals are different. At this time, the clock signals input by the three D flip-flops in series need to be adjusted accordingly. Among them, the input clock of the first D flip-flop is clk[0], and the D in the middle position The input clock of the flip-flop is the clock signal corresponding to the clock selection signal input by the first D flip-flop, and the clock signal input by the last D flip-flop is an adjacent clock signal after the clock signal input by the D flip-flop in the middle position. In particular, take clk[0] as an adjacent clock signal after clk[n-1].
经过同步电路22的处理,时钟选择信号产生电路21生成的时钟选择信号sel_0[0]~sel_0[n-1]先被同一项时钟clk[0]同步,使得所有的时钟选择信号同步,消除时钟选择信号之间的延迟,再分别用多项时钟第一次同步,将不同的时钟选择信号的上升沿与下降沿分别与其对应的时钟信号的上升沿对齐,再分别用多项时钟第二次同步,使得不同的时钟选择信号的上升沿与下降沿分别与其对应的时钟信号的后一项时钟的上升沿对齐,最后两次多项时钟同步的结果做逻辑运算,一方面使得同步处理后的任意相邻的两个时钟选择信号中,前一项时钟选择信号的下降沿与后一项时钟选择信号的上升沿对齐,实现时钟选择信号的无缝切换;另一方面使得同步处理 后的每个时钟选择信号的上升沿与其对应的时钟信号的上升沿对齐,同步处理后的每个时钟选择信号的下降沿与其对应的时钟信号的后一项时钟信号的上升沿对齐,实现在时钟切换的时刻,被选择输出的前一项时钟与被选择输出的后一项时钟状态相同,避免毛刺的产生。综上所述,由于同步处理后相邻的时钟选择信号中,前一项时钟选择信号的上升沿与后一项时钟选择信号的下降沿对齐,且在时钟转换的时刻前一项时钟的状态和后一项时钟的状态相同,因此输出时钟不会产生毛刺。After processing by the synchronization circuit 22, the clock selection signals sel_0[0]~sel_0[n-1] generated by the clock selection signal generation circuit 21 are first synchronized by the same clock clk[0], so that all clock selection signals are synchronized and the clock is eliminated The delay between the selection signals is synchronized for the first time with multiple clocks respectively, and the rising and falling edges of different clock selection signals are aligned with the rising edges of the corresponding clock signals, and then multiple clocks are used for the second time Synchronization, so that the rising and falling edges of different clock selection signals are aligned with the rising edge of the next clock of the corresponding clock signal, and the results of the last two multiple clock synchronizations are logically operated, on the one hand, the synchronized processing In any two adjacent clock selection signals, the falling edge of the previous clock selection signal is aligned with the rising edge of the next clock selection signal to achieve seamless switching of the clock selection signal; The rising edge of each clock selection signal is aligned with the rising edge of the corresponding clock signal, and the falling edge of each clock selection signal after synchronization processing is aligned with the rising edge of the next clock signal of the corresponding clock signal, so as to realize the clock switching. At time, the state of the previous clock selected for output is the same as the state of the next clock selected for output to avoid glitches. In summary, because of the adjacent clock selection signals after synchronization, the rising edge of the previous clock selection signal is aligned with the falling edge of the next clock selection signal, and the state of the previous clock at the time of clock transition The state is the same as the latter clock, so the output clock will not produce glitches.
可选地,如图4所示,本申请另一实施例提供的无毛刺时钟切换电路还包括:时钟信号产生电24,时钟信号产生电路24包括多个D触发器,利用多个D触发器延迟生成供切换的多个时钟信号clk[0]~clk[n-1]。这多个时钟信号一方面作为多路选择器的多项时钟输入,另一方面输出给同步电路,用于对时钟选择信号作同步处理。Optionally, as shown in FIG. 4, the glitch-free clock switching circuit provided by another embodiment of the present application further includes: a clock signal generating circuit 24. The clock signal generating circuit 24 includes a plurality of D flip-flops, using a plurality of D flip-flops. Delay generation of multiple clock signals clk[0]~clk[n-1] for switching. These multiple clock signals are used as multiple clock inputs of the multiplexer on the one hand, and output to the synchronization circuit on the other hand for synchronizing the clock selection signal.
图5展示了本申请实施例提供的无毛刺时钟切换电路在切换时钟时的时序图,其中clk[0]~clk[n-1]为供切换的多路时钟信号,sel_1[0]~sel_1[n-1]为使用同一项时钟同步后的时钟选择信号,sel_2[0]~sel_2[n-1]为使用多项时钟第一次同步后的时钟选择信号,sel_3[0]~sel_3[n-1]为使用多项时钟第二次同步后的时钟选择信号,sel[0]~sel[n-1]为同步后输出的时钟选择信号,clk_out为多路选择器输出的时钟输出信号。图5中,以时钟选择信号sel[n-2]这一路信号为例,sel_1[n-2]的上升沿与clk[0]的上升沿对齐,sel_1[n-2]的下降沿与clk[0]的上升沿对齐,sel_2[n-2]的上升沿与clk[n-2]上升沿对齐,sel_2[n-2]的下降沿与clk[n-2]上升沿对齐,sel_3[n-2]的上升沿与clk[n-1]上升沿对齐,sel_3[n-2]的下降沿与clk[n-1]上升沿对齐,sel[n-2]的上升沿与clk[n-2]的上升沿对齐,sel[n-2]的下降沿与clk[n-1]的上升沿对齐,其余各路信号以此类推,最终,clk_out在时钟切换时不会产生毛刺。Figure 5 shows the timing diagram of the glitch-free clock switching circuit provided by the embodiment of the present application when switching clocks, where clk[0]~clk[n-1] are multiple clock signals for switching, sel_1[0]~sel_1 [n-1] is the clock selection signal after using the same clock synchronization, sel_2[0]~sel_2[n-1] is the clock selection signal after using multiple clocks for the first synchronization, sel_3[0]~sel_3[ n-1] is the clock selection signal after the second synchronization using multiple clocks, sel[0]~sel[n-1] is the clock selection signal output after synchronization, clk_out is the clock output signal output by the multiplexer . In Figure 5, taking the clock selection signal sel[n-2] as an example, the rising edge of sel_1[n-2] is aligned with the rising edge of clk[0], and the falling edge of sel_1[n-2] is aligned with clk. The rising edge of [0] is aligned, the rising edge of sel_2[n-2] is aligned with the rising edge of clk[n-2], the falling edge of sel_2[n-2] is aligned with the rising edge of clk[n-2], sel_3[ The rising edge of n-2] is aligned with the rising edge of clk[n-1], the falling edge of sel_3[n-2] is aligned with the rising edge of clk[n-1], and the rising edge of sel[n-2] is aligned with clk[ The rising edge of n-2] is aligned, the falling edge of sel[n-2] is aligned with the rising edge of clk[n-1], and the rest of the signals are deduced by analogy. Finally, clk_out will not generate glitches during clock switching.
请参阅图6,本申请实施例提供了一种无毛刺时钟切换方法,其应用于上面描述的无毛刺时钟切换电路,该方法可以包括步骤S301至步骤S303。Referring to FIG. 6, an embodiment of the present application provides a glitch-free clock switching method, which is applied to the glitch-free clock switching circuit described above. The method may include steps S301 to S303.
步骤S301:时钟选择信号产生电路生成多个时钟选择信号,并将多个时 钟选择信号发送至同步电路。Step S301: The clock selection signal generating circuit generates a plurality of clock selection signals, and sends the plurality of clock selection signals to the synchronization circuit.
步骤S302:同步电路根据供切换的多个时钟信号对时钟选择信号产生电路生成的多个时钟选择信号进行同步处理,得到处理后的多个时钟选择信号。Step S302: the synchronization circuit performs synchronization processing on the multiple clock selection signals generated by the clock selection signal generating circuit according to the multiple clock signals for switching, to obtain processed multiple clock selection signals.
作为一种方式,本申请可以利用I型同步处理单元对时序最靠前时钟信号对应的时钟选择信号进行同步处理,利用多个II型同步处理单元分别对时序最靠前时钟信号之后的所有时钟信号对应的时钟选择信号进行同步处理。其中,I型同步处理单元和II型同步处理单元的个数之和与时钟选择信号产生电路生成的时钟选择信号的个数相同。As a way, the present application can use the type I synchronization processing unit to synchronize the clock selection signal corresponding to the most advanced clock signal in the timing sequence, and use multiple type II synchronization processing units to perform the synchronization processing on all clocks after the most advanced clock signal in timing sequence. The clock selection signal corresponding to the signal is synchronized. Wherein, the sum of the number of type I synchronization processing units and type II synchronization processing units is the same as the number of clock selection signals generated by the clock selection signal generating circuit.
步骤S303:多路选择器接收供切换的多个时钟信号和处理后的多个时钟选择信号,并输出一时钟输出信号,时钟输出信号为与同步处理后的有效的时钟选择信号对应的时钟信号。Step S303: The multiplexer receives multiple clock signals for switching and processed multiple clock selection signals, and outputs a clock output signal, the clock output signal is a clock signal corresponding to the effective clock selection signal after synchronization processing .
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求的保护范围为准。The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited to this. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. All should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims (20)

  1. 一种无毛刺时钟切换电路,其特征在于,包括:时钟选择信号产生电路、同步电路和多路选择器,A glitch-free clock switching circuit, which is characterized by comprising: a clock selection signal generating circuit, a synchronization circuit and a multiplexer,
    所述时钟选择信号产生电路,用于生成多个时钟选择信号,所述时钟选择信号的个数与供切换的多个时钟信号的个数相同,所述供切换的多个时钟信号为一组在时序上依次延迟的时钟信号,且所述时钟选择信号与所述供切换的多个时钟信号是一一对应的,在任意时刻,有且只有一个时钟选择信号是有效的;The clock selection signal generating circuit is used to generate a plurality of clock selection signals, the number of the clock selection signals is the same as the number of the plurality of clock signals for switching, and the plurality of clock signals for switching is a group Clock signals that are sequentially delayed in time sequence, and the clock selection signal has a one-to-one correspondence with the multiple clock signals for switching. At any time, only one clock selection signal is valid;
    所述同步电路,用于根据供切换的多个时钟信号对所述时钟选择信号产生电路生成的多个时钟选择信号进行同步处理,同步处理后的各时钟选择信号满足以下特性:任意相邻的两个时钟选择信号中,前一项时钟选择信号的下降沿与后一项时钟选择信号的上升沿对齐,每个时钟选择信号的上升沿与其对应的时钟信号的上升沿对齐,每个时钟选择信号的下降沿与其对应的时钟信号的后一项时钟信号的上升沿对齐;The synchronization circuit is configured to perform synchronization processing on the multiple clock selection signals generated by the clock selection signal generating circuit according to multiple clock signals for switching, and each clock selection signal after synchronization processing satisfies the following characteristics: any adjacent Of the two clock selection signals, the falling edge of the previous clock selection signal is aligned with the rising edge of the next clock selection signal, and the rising edge of each clock selection signal is aligned with the rising edge of the corresponding clock signal. Each clock selection The falling edge of the signal is aligned with the rising edge of the next clock signal of the corresponding clock signal;
    所述多路选择器的输入端输入供切换的多个时钟信号,所述多路选择器的控制端输入一控制信号,所述控制信号为所述同步电路同步处理后的多个时钟选择信号,所述多路选择器的输出端输出一时钟输出信号,所述时钟输出信号为与同步处理后的有效的时钟选择信号对应的时钟信号。The input terminal of the multiplexer inputs multiple clock signals for switching, and the control terminal of the multiplexer inputs a control signal, and the control signal is multiple clock selection signals processed by the synchronization circuit synchronously The output terminal of the multiplexer outputs a clock output signal, and the clock output signal is a clock signal corresponding to a valid clock selection signal after synchronization processing.
  2. 根据权利要求1所述的无毛刺时钟切换电路,其特征在于,所述同步电路包括:一个I型同步处理单元和多个II型同步处理单元,所述I型同步处理单元和所述II型同步处理单元的个数之和与所述时钟选择信号产生电路生成的时钟选择信号的个数相同,其中,The glitch-free clock switching circuit according to claim 1, wherein the synchronization circuit comprises: a type I synchronization processing unit and a plurality of type II synchronization processing units, the type I synchronization processing unit and the type II synchronization processing unit The sum of the number of synchronization processing units is the same as the number of clock selection signals generated by the clock selection signal generating circuit, wherein,
    所述I型同步处理单元用于对时序最靠前时钟信号对应的时钟选择信号进行同步处理;The I-type synchronization processing unit is used to perform synchronization processing on the clock selection signal corresponding to the first clock signal in time sequence;
    各所述II型同步处理单元用于一一对应地分别对所述时序最靠前时钟 信号之后的所有时钟信号对应的时钟选择信号进行同步处理。Each of the type II synchronization processing units is used to perform synchronization processing on the clock selection signals corresponding to all the clock signals after the most advanced clock signal in a one-to-one correspondence.
  3. 根据权利要求2所述的无毛刺时钟切换电路,其特征在于,所述I型同步处理单元包括:The glitch-free clock switching circuit according to claim 2, wherein the I-type synchronization processing unit comprises:
    串联连接的第一D触发器、第二D触发器和第三D触发器,以及一个二输入与门,其中,The first D flip-flop, the second D flip-flop and the third D flip-flop connected in series, and a two-input AND gate, where,
    所述第一D触发器的输入端输入信号为时序最靠前时钟信号所对应的时钟选择信号,所述第一D触发器的时钟端输入第一时钟信号,所述第一时钟信号为所述供切换的多个时钟信号的任意一个,所述第一D触发器的输出端连接至所述第二D触发器的输入端;The input signal at the input terminal of the first D flip-flop is the clock selection signal corresponding to the first clock signal in timing, the clock terminal of the first D flip-flop inputs a first clock signal, and the first clock signal is For any one of the plurality of clock signals for switching, the output terminal of the first D flip-flop is connected to the input terminal of the second D flip-flop;
    所述第二D触发器的时钟端输入第二时钟信号,所述第二时钟信号为时序最靠前时钟信号的后一个相邻时钟信号,所述第二D触发器的输出端连接至所述第三D触发器的输入端,同时所述第二D触发器的输出端连接至所述二输入与门的第一输入端;The clock terminal of the second D flip-flop is input with a second clock signal, the second clock signal is the next adjacent clock signal of the frontmost clock signal in time sequence, and the output terminal of the second D flip-flop is connected to all The input terminal of the third D flip-flop, and the output terminal of the second D flip-flop is connected to the first input terminal of the two-input AND gate;
    所述第三D触发器的时钟端输入第三时钟信号,所述第三时钟信号为时序最靠前时钟信号,所述第三D触发器的输出端连接至所述二输入与门的第二输入端,所述二输入与门的输出端输出同步处理后的时钟选择信号。The clock terminal of the third D flip-flop inputs a third clock signal, the third clock signal is the most advanced clock signal in timing, and the output terminal of the third D flip-flop is connected to the second input of the two-input AND gate. Two input terminals, the output terminal of the two-input AND gate outputs a clock selection signal after synchronization processing.
  4. 根据权利要求3所述的无毛刺时钟切换电路,其特征在于,所述II型同步处理单元包括:The glitch-free clock switching circuit according to claim 3, wherein the type II synchronization processing unit comprises:
    串联连接的第四D触发器、第五D触发器和第六D触发器,以及一个二输入或门,其中,The fourth D flip-flop, the fifth D flip-flop and the sixth D flip-flop connected in series, and a two-input OR gate, where,
    所述第四D触发器的输入端输入信号为时序最靠前时钟信号之后的所有时钟信号所对应的时钟选择信号的其中任意一个,所述第四D触发器的时钟端输入第四时钟信号,所述第四时钟信号为与所述第一时钟信号相同的时钟信号,所述第四D触发器的输出端连接至所述第五D触发器的输入端;The input signal at the input terminal of the fourth D flip-flop is any one of the clock selection signals corresponding to all the clock signals after the clock signal at the top of the timing sequence, and the clock terminal of the fourth D flip-flop inputs a fourth clock signal , The fourth clock signal is the same clock signal as the first clock signal, and the output terminal of the fourth D flip-flop is connected to the input terminal of the fifth D flip-flop;
    所述第五D触发器的时钟端输入第五时钟信号,所述第五时钟信号为 所述第四D触发器输入的时钟选择信号对应的时钟信号,所述第五D触发器的输出端连接至所述第六D触发器的输入端,同时所述第五D触发器的输出端连接至所述二输入或门的第一输入端;The clock terminal of the fifth D flip-flop inputs a fifth clock signal, the fifth clock signal is a clock signal corresponding to the clock selection signal input by the fourth D flip-flop, and the output terminal of the fifth D flip-flop Connected to the input terminal of the sixth D flip-flop, while the output terminal of the fifth D flip-flop is connected to the first input terminal of the two-input OR gate;
    所述第六D触发器的时钟端输入第六时钟信号,所述第六时钟信号为所述第五时钟信号之后的一个相邻时钟信号,所述第六D触发器的输出端连接至所述二输入或门的第二输入端,所述二输入或门的输出端输出同步处理后的时钟选择信号。The clock terminal of the sixth D flip-flop inputs a sixth clock signal, the sixth clock signal is an adjacent clock signal after the fifth clock signal, and the output terminal of the sixth D flip-flop is connected to all The second input terminal of the two-input OR gate, and the output terminal of the two-input OR gate outputs a clock selection signal after synchronization processing.
  5. 根据权利要求3所述的无毛刺时钟切换电路,其特征在于,所述第一D触发器的时钟端输入一个同步时钟,该同步时钟为供切换的多个时钟信号的任意一个。The glitch-free clock switching circuit according to claim 3, wherein the clock terminal of the first D flip-flop inputs a synchronous clock, and the synchronous clock is any one of a plurality of clock signals for switching.
  6. 根据权利要求5所述的无毛刺时钟切换电路,其特征在于,所述同步时钟为时序最靠前时钟信号。5. The glitch-free clock switching circuit according to claim 5, wherein the synchronous clock is a clock signal with the highest timing sequence.
  7. 根据权利要求2至6任一所述的无毛刺时钟切换电路,其特征在于,所述时钟选择信号为n个,所述II型同步处理单元为n-1个,n为整数。The glitch-free clock switching circuit according to any one of claims 2 to 6, wherein there are n clock selection signals, n-1 type II synchronization processing units, and n is an integer.
  8. 根据权利要求2至6任一所述的无毛刺时钟切换电路,其特征在于,每个所述II型同步处理单元的结构相同。The glitch-free clock switching circuit according to any one of claims 2 to 6, wherein each of the type II synchronization processing units has the same structure.
  9. 根据权利要求2至6任一所述的无毛刺时钟切换电路,其特征在于,每个所述II型同步处理单元输入的时钟选择信号不同。The glitch-free clock switching circuit according to any one of claims 2 to 6, wherein the clock selection signal input by each type II synchronization processing unit is different.
  10. 根据权利要求2至6任一所述的无毛刺时钟切换电路,其特征在于,每个所述II型同步处理单元最前一个D触发器的输入时钟均是时序最靠前时钟信号。The glitch-free clock switching circuit according to any one of claims 2 to 6, wherein the input clock of the first D flip-flop of each type II synchronization processing unit is the most advanced clock signal in timing.
  11. 根据权利要求2至6任一所述的无毛刺时钟切换电路,其特征在于,每个所述II型同步处理单元中间位置的D触发器的输入时钟是最前一个D触发器输入的时钟选择信号对应的时钟信号。The glitch-free clock switching circuit according to any one of claims 2 to 6, wherein the input clock of the D flip-flop in the middle position of each of the type II synchronization processing units is the clock selection signal input by the first D flip-flop Corresponding clock signal.
  12. 根据权利要求2至6任一所述的无毛刺时钟切换电路,其特征在于, 每个所述II型同步处理单元最后一个D触发器输入的时钟信号为中间位置的D触发器输入的时钟信号之后的一个相邻时钟信号。The glitch-free clock switching circuit according to any one of claims 2 to 6, wherein the clock signal input by the last D flip-flop of each type II synchronization processing unit is the clock signal input by the D flip-flop in the middle position The next adjacent clock signal.
  13. 根据权利要求1至6任一所述的无毛刺时钟切换电路,其特征在于,还包括:时钟信号产生电路,用于生成所述供切换的多个时钟信号。The glitch-free clock switching circuit according to any one of claims 1 to 6, further comprising: a clock signal generating circuit for generating the multiple clock signals for switching.
  14. 根据权利要求13所述的无毛刺时钟切换电路,其特征在于,所述时钟信号产生电路包括多个D触发器,利用所述多个D触发器延迟生成供切换的多个时钟信号。The glitch-free clock switching circuit according to claim 13, wherein the clock signal generating circuit comprises a plurality of D flip-flops, and the plurality of D flip-flops are used to delay generating a plurality of clock signals for switching.
  15. 根据权利要求13所述的无毛刺时钟切换电路,其特征在于,所述时钟信号产生电路分别与所述同步电路和所述多路选择器连接。The glitch-free clock switching circuit according to claim 13, wherein the clock signal generating circuit is respectively connected to the synchronization circuit and the multiplexer.
  16. 根据权利要求1至6任一所述的无毛刺时钟切换电路,其特征在于,所述时钟选择信号产生电路包括内部计数器,利用所述内部计数器循环产生二进制控制码,然后将所述二进制控制码转换为N中取1码,其中N为时钟选择信号的个数。The glitch-free clock switching circuit according to any one of claims 1 to 6, wherein the clock selection signal generation circuit includes an internal counter, and the internal counter is used to generate a binary control code cyclically, and then the binary control code Convert to 1 code from N, where N is the number of clock selection signals.
  17. 根据权利要求1至6任一所述的无毛刺时钟切换电路,其特征在于,所述时钟选择信号产生电路与所述同步电路连接。The glitch-free clock switching circuit according to any one of claims 1 to 6, wherein the clock selection signal generating circuit is connected to the synchronization circuit.
  18. 根据权利要求1至6任一所述的无毛刺时钟切换电路,其特征在于,所述同步电路与所述多路选择器连接。The glitch-free clock switching circuit according to any one of claims 1 to 6, wherein the synchronization circuit is connected to the multiplexer.
  19. 一种无毛刺时钟切换方法,其特征在于,应用于如权利要求1-17任一项所述的无毛刺时钟切换电路,该方法包括:A glitch-free clock switching method, characterized by being applied to the glitch-free clock switching circuit according to any one of claims 1-17, the method comprising:
    时钟选择信号产生电路生成多个时钟选择信号,并将所述多个时钟选择信号发送至同步电路;The clock selection signal generating circuit generates a plurality of clock selection signals, and sends the plurality of clock selection signals to the synchronization circuit;
    同步电路根据供切换的多个时钟信号对所述多个时钟选择信号进行同步处理,得到处理后的多个时钟选择信号;The synchronization circuit performs synchronization processing on the multiple clock selection signals according to the multiple clock signals for switching to obtain the processed multiple clock selection signals;
    多路选择器接收所述供切换的多个时钟信号和所述处理后的多个时钟选择信号,并输出一时钟输出信号,所述时钟输出信号为与同步处理后的有效的时钟选择信号对应的时钟信号。The multiplexer receives the multiple clock signals for switching and the processed multiple clock selection signals, and outputs a clock output signal corresponding to the effective clock selection signal after synchronization processing Clock signal.
  20. 根据权利要求19所述的方法,其特征在于,所述同步电路根据供切换的多个时钟信号对所述时钟选择信号产生电路生成的多个时钟选择信号进行同步处理,包括:18. The method of claim 19, wherein the synchronization circuit performs synchronization processing on the multiple clock selection signals generated by the clock selection signal generating circuit according to multiple clock signals for switching, comprising:
    利用I型同步处理单元对时序最靠前时钟信号对应的时钟选择信号进行同步处理;Use the I-type synchronization processing unit to perform synchronization processing on the clock selection signal corresponding to the first clock signal in the sequence;
    利用多个II型同步处理单元分别对所述时序最靠前时钟信号之后的所有时钟信号对应的时钟选择信号进行同步处理。A plurality of type II synchronization processing units are used to perform synchronization processing on the clock selection signals corresponding to all the clock signals after the first clock signal in the sequence.
PCT/CN2020/120445 2019-12-26 2020-10-12 Glitch-free clock switching circuit WO2021129050A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020227013018A KR102654395B1 (en) 2019-12-26 2020-10-12 Glitch-free clock switching circuit

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911370944.7 2019-12-26
CN201911370944.7A CN111147053B (en) 2019-12-26 2019-12-26 Glitch-free clock switching circuit

Publications (1)

Publication Number Publication Date
WO2021129050A1 true WO2021129050A1 (en) 2021-07-01

Family

ID=70520668

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/120445 WO2021129050A1 (en) 2019-12-26 2020-10-12 Glitch-free clock switching circuit

Country Status (3)

Country Link
KR (1) KR102654395B1 (en)
CN (1) CN111147053B (en)
WO (1) WO2021129050A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114003086A (en) * 2021-10-29 2022-02-01 北京中科昊芯科技有限公司 Clock switching circuit, clock system, chip and electronic equipment

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111147053B (en) * 2019-12-26 2023-03-14 深圳市紫光同创电子有限公司 Glitch-free clock switching circuit
CN111913038B (en) * 2020-06-03 2023-12-19 大唐微电子技术有限公司 Device and method for detecting frequency of multipath clock signals

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101135921A (en) * 2007-10-10 2008-03-05 威盛电子股份有限公司 Multiple clock switching mechanism and switch method thereof
CN204613809U (en) * 2015-05-22 2015-09-02 中国航天科技集团公司第九研究院第七七一研究所 A kind of carrot-free clock switch circuit
CN105138069A (en) * 2015-10-23 2015-12-09 上海华力创通半导体有限公司 Digital domain clock selection device and implementation method
CN105680830A (en) * 2016-01-07 2016-06-15 中国航天科技集团公司第九研究院第七七一研究所 Burr-free switching circuit for supporting multi-way clock
CN105743464A (en) * 2016-01-21 2016-07-06 深圳市同创国芯电子有限公司 Clock conversion method, clock conversion device, clock conversion circuit and integrated circuit
US20160269034A1 (en) * 2015-03-13 2016-09-15 Qualcomm Incorporated Apparatuses, methods, and systems for glitch-free clock switching
CN111147053A (en) * 2019-12-26 2020-05-12 深圳市紫光同创电子有限公司 Glitch-free clock switching circuit

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5357146A (en) * 1992-12-31 1994-10-18 At&T Bell Laboratories Glitch-free clock multiplexer
US6292044B1 (en) * 1999-03-26 2001-09-18 Lucent Technologies Inc. Low power glitch-free clock switch
US6239626B1 (en) * 2000-01-07 2001-05-29 Cisco Technology, Inc. Glitch-free clock selector
KR100871205B1 (en) * 2002-07-23 2008-12-01 엘지노텔 주식회사 System for Concluding Phase of Multi-Clock
US6927604B2 (en) * 2003-08-21 2005-08-09 International Business Machines Corporation Clock signal selector circuit with reduced probability of erroneous output due to metastability
US7720113B2 (en) * 2004-04-23 2010-05-18 Panasonic Corporation Receiving apparatus, receiving system using same, and receiving method thereof
KR100674910B1 (en) * 2004-07-06 2007-01-26 삼성전자주식회사 Glitch-free clock switching circuit
CN101078944B (en) * 2007-05-11 2010-05-26 东南大学 Clock switching circuit
CN104779935A (en) * 2015-04-28 2015-07-15 杭州中天微系统有限公司 Clock burr-free dynamic switching circuit
KR101887757B1 (en) * 2016-09-19 2018-09-10 주식회사 아이닉스 Glitch-free clock multiplexer and selecting method of clock signal using the multiplexer

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101135921A (en) * 2007-10-10 2008-03-05 威盛电子股份有限公司 Multiple clock switching mechanism and switch method thereof
US20160269034A1 (en) * 2015-03-13 2016-09-15 Qualcomm Incorporated Apparatuses, methods, and systems for glitch-free clock switching
CN204613809U (en) * 2015-05-22 2015-09-02 中国航天科技集团公司第九研究院第七七一研究所 A kind of carrot-free clock switch circuit
CN105138069A (en) * 2015-10-23 2015-12-09 上海华力创通半导体有限公司 Digital domain clock selection device and implementation method
CN105680830A (en) * 2016-01-07 2016-06-15 中国航天科技集团公司第九研究院第七七一研究所 Burr-free switching circuit for supporting multi-way clock
CN105743464A (en) * 2016-01-21 2016-07-06 深圳市同创国芯电子有限公司 Clock conversion method, clock conversion device, clock conversion circuit and integrated circuit
CN111147053A (en) * 2019-12-26 2020-05-12 深圳市紫光同创电子有限公司 Glitch-free clock switching circuit

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114003086A (en) * 2021-10-29 2022-02-01 北京中科昊芯科技有限公司 Clock switching circuit, clock system, chip and electronic equipment

Also Published As

Publication number Publication date
CN111147053B (en) 2023-03-14
KR102654395B1 (en) 2024-04-02
KR20220062642A (en) 2022-05-17
CN111147053A (en) 2020-05-12

Similar Documents

Publication Publication Date Title
WO2021129050A1 (en) Glitch-free clock switching circuit
WO2021184623A1 (en) Clock signal generation circuit, driving method, and electronic device
US6563349B2 (en) Multiplexor generating a glitch free output when selecting from multiple clock signals
EP3197054A1 (en) Dynamic clock switching method and apparatus as well as computer readable medium
US6943595B2 (en) Synchronization circuit
US6653867B1 (en) Apparatus and method for providing a smooth transition between two clock signals
JPH0715302A (en) Variable delay buffer circuit
US6323715B1 (en) Method and apparatus for selecting a clock signal without producing a glitch
US8253449B2 (en) Clock switch circuit and clock switch method of the same
US10389515B1 (en) Integrated circuit, multi-channel transmission apparatus and signal transmission method thereof
US6960942B2 (en) High speed phase selector
CN118041345A (en) Arbitrary integer frequency divider with dynamically configurable frequency dividing coefficient
WO2008008297A2 (en) Glitch-free clock switcher
CN113708756A (en) Frequency divider with arbitrary integer and frequency dividing method thereof
TWI685200B (en) Synchronous mirror delay circuit and operation method for synchronous mirror delay
US11262786B1 (en) Data delay compensator circuit
JP2008300915A (en) High-speed serial communication utilizing duty ratio of clock
JP2013115529A (en) Clock frequency dividing apparatus
CN212305302U (en) Frequency divider with arbitrary integer
JP5742456B2 (en) DPLL circuit for serial data communication device
CN117411465A (en) Clock switching circuit, chip and electronic equipment
JP2000013196A (en) Clock selection circuit
CN117833909A (en) Half-integer frequency dividing system and frequency divider
JPH1168726A (en) Clock changeover circuit
JP2009130822A (en) Demultiplexer circuit

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20905757

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 20227013018

Country of ref document: KR

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1200 DATED 29.11.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20905757

Country of ref document: EP

Kind code of ref document: A1