Invention content
The defects of to solve conventional clock dynamic switching circuit, this application provides a kind of multi-clock dynamic switching circuits.
The technical solution adopted by the present invention is:A kind of multi-clock dynamic switching circuit, input end of clock include Slow Clock,
Reference clock, middling speed clock, low-speed clock and high-frequency clock;Output terminal of clock includes the first output clock, the second output clock
Clock is exported with third, is included between input end of clock and output terminal of clock:
Slow Clock synthesizes the Slow Clock after gate through Slow Clock switching sub-circuit;Reference clock through at a slow speed when
Clock switching sub-circuit synthesizes the reference clock after gate;Low-speed clock is through Slow Clock switching sub-circuit synthesis by gate
Low-speed clock afterwards;Middling speed clock synthesizes the middling speed clock after gate through Slow Clock switching sub-circuit;High-frequency clock passes through
Slow Clock switching sub-circuit synthesizes the high-frequency clock after gate;
Slow Clock after gate, the reference clock after gate and the low-speed clock after gate, three
It carries out or operation obtains the first output clock;
Slow Clock after gate, the reference clock after gate and the middling speed clock after gate, three
It carries out or operation obtains the second output clock;
Slow Clock after gate, the reference clock after gate and the high-frequency clock after gate, three
It carries out or operation obtains third output clock.
Slow Clock synthesizes the Slow Clock after gate through Slow Clock switching sub-circuit, specially:
First input control signal, the gate enable signal of reference clock, the gate enable signal of low-speed clock, three do
Obtain the gate enable signal of Slow Clock after NAND operation, the non-and Slow Clock of the gate enable signal of Slow Clock do with
Operation synthesizes the Slow Clock after gate.
Reference clock synthesizes the reference clock after gate through Slow Clock switching sub-circuit, specially:
Second input control signal, the gate enable signal of Slow Clock, the gate enable signal of low-speed clock, three do
It is being obtained after NAND operation as a result, being synchronized using reference clock two-stage d type flip flop after obtain the gate of reference clock and enable letter
Number;The non-and reference clock of the gate enable signal of reference clock, which is done, synthesizes the reference clock after gate with operation.
Low-speed clock synthesizes the low-speed clock after gate through Slow Clock switching sub-circuit, specially:
Third input control signal, the gate enable signal of reference clock, the gate enable signal of Slow Clock, three do
It is being obtained after NAND operation as a result, being synchronized using low-speed clock two-stage d type flip flop after obtain first M signal, using one
Grade d type flip flop obtains second M signal after synchronizing;Then by the synchronization of middling speed clock level-one d type flip flop, high-frequency clock level-one D
Trigger obtains the gate enable signal of low-speed clock after synchronizing, second M signal, the gate enable signal of low-speed clock,
Low-speed clock operation synthesizes the low-speed clock after gate.
Middling speed clock synthesizes the middling speed clock after gate through Slow Clock switching sub-circuit, specially:
First M signal obtains third M signal after middling speed clock level-one d type flip flop synchronizes, using middling speed
Clock level-one d type flip flop obtains the gate enable signal of middling speed clock after synchronizing;When the gate enable signal of low-speed clock, middling speed
The gate enable signal of clock and middling speed clock operation synthesize the middling speed clock after gate.
High-frequency clock synthesizes the high-frequency clock after gate through Slow Clock switching sub-circuit, specially:
Third M signal obtains the gate enable signal of high-frequency clock after high-frequency clock two-stage d type flip flop synchronizes;
The gate enable signal of low-speed clock, the gate enable signal of high-frequency clock and high-frequency clock three's operation are synthesized by gate
High-frequency clock afterwards.
First M signal is obtained after low-speed clock two-stage d type flip flop synchronizes, specially:
Two-stage d type flip flop includes the first synchronizer and the second synchronizer;
Third input control signal, the gate enable signal of Slow Clock, the gate enable signal of reference clock, San Zheyu
Result after inverse connect the input terminal of the first synchronizer with low-speed clock, and output signal connects the input of the second synchronizer
End exports first M signal.
When the process middling speed clock level-one d type flip flop is synchronous, high-frequency clock level-one d type flip flop obtains low speed after synchronizing
The gate enable signal of clock, specially:
Second M signal connect the input terminal of the first d type flip flop with middling speed clock, and signal and the high-frequency clock of output connect
The input terminal of the second d type flip flop is connect, exports the gate enable signal of low-speed clock.
The gate enable signal of reference clock obtains first state output signal, telltable clock switching electricity after negating operation
The current state on road.
Second M signal obtains the second state output signal, the current state of telltable clock switching circuit after negating.
Second state output signal and the first output clock after NAND gate by the failing edge of the second output clock by being adopted
Sample obtains the output signal of the clock phase relationship of the second output clock of instruction and the first output clock.
Second state output signal by the failing edge of third output clock after NAND gate by being sampled to obtain instruction third
Export the output signal of the clock phase relationship of clock and two output clocks.
The advantageous effect that the present invention obtains is:Technical solution using the present invention being capable of impulse- free robustness switching at runtime SoC chip
Required high-frequency clock, low-speed clock, reference clock and Slow Clock simultaneously generate synchronous clock domains clock phase indication signal
And state, meet clock switching needs of the SoC chip between high-performance scene and multiple low-power consumption scenes.It is simple simultaneously skilful
Wonderful circuit structure avoids the generation of burr, and saves circuit resource.
Specific embodiment
With reference to the attached drawing in the embodiment of the present application, the technical solution in the embodiment of the present application is carried out clear, complete
Ground describes, it is clear that described embodiment is some embodiments of the present application, instead of all the embodiments.Based on the application
In embodiment, those skilled in the art's all other embodiments obtained without making creative work, all
Belong to the range of the application protection.
A kind of multi-clock dynamic switching circuit proposed by the present invention, hardware circuit is as shown in Figure 1, input end of clock
Including Slow Clock, reference clock, middling speed clock, low-speed clock and high-frequency clock;Output terminal of clock include first output clock,
Second output clock and third output clock, include between input end of clock and output terminal of clock:
Slow Clock synthesizes the Slow Clock after gate through Slow Clock switching sub-circuit;Reference clock through at a slow speed when
Clock switching sub-circuit synthesizes the reference clock after gate;Low-speed clock is through Slow Clock switching sub-circuit synthesis by gate
Low-speed clock afterwards;Middling speed clock synthesizes the middling speed clock after gate through Slow Clock switching sub-circuit;High-frequency clock passes through
Slow Clock switching sub-circuit synthesizes the high-frequency clock after gate;
Slow Clock after gate, the reference clock after gate and the low-speed clock after gate, three
It carries out or operation obtains the first output clock;
Slow Clock after gate, the reference clock after gate and the middling speed clock after gate, three
It carries out or operation obtains the second output clock;
Slow Clock after gate, the reference clock after gate and the high-frequency clock after gate, three
It carries out or operation obtains third output clock.
Slow Clock switches sub-circuit, specially:The gate enable signal, low of first input control signal, reference clock
The gate enable signal of fast clock, three obtain the gate enable signal of Slow Clock, the door of Slow Clock after doing NAND operation
The non-and Slow Clock of control enable signal, which is done, synthesizes the Slow Clock after gate with operation.
Reference clock switches sub-circuit, specially:The gate enable signal, low of second input control signal, Slow Clock
The gate enable signal of fast clock, three do obtaining after NAND operation as a result, being synchronized using reference clock two-stage d type flip flop
The gate enable signal of reference clock is obtained afterwards;Non- done with reference clock of the gate enable signal of reference clock synthesizes with operation
Reference clock after gate.
Low-speed clock switches sub-circuit, specially:The gate enable signal, slow of third input control signal, reference clock
The gate enable signal of fast clock, three do obtaining after NAND operation as a result, being synchronized using low-speed clock two-stage d type flip flop
After obtain first M signal, obtain second M signal after being synchronized using level-one d type flip flop;Then pass through middling speed clock one
Grade d type flip flop is synchronous, high-frequency clock level-one d type flip flop obtains the gate enable signal of low-speed clock after synchronizing, among second
Signal, the gate enable signal of low-speed clock, low-speed clock operation synthesize the low-speed clock after gate.
Middling speed clock switches sub-circuit, specially:First M signal obtains after middling speed clock level-one d type flip flop synchronizes
To third M signal, the gate enable signal of middling speed clock is obtained after being synchronized using middling speed clock level-one d type flip flop;Low speed
The gate enable signal of clock, the gate enable signal of middling speed clock and middling speed clock operation synthesize the middling speed after gate
Clock.
High-frequency clock switches sub-circuit, specially:Third M signal obtains after high-frequency clock two-stage d type flip flop synchronizes
To the gate enable signal of high-frequency clock;The gate enable signal of low-speed clock, the gate enable signal of high-frequency clock and high speed
Clock three's operation synthesizes the high-frequency clock after gate.
In low-speed clock switching sub-circuit, low-speed clock obtains first M signal after two-stage d type flip flop synchronizes, specifically
For:Two-stage d type flip flop includes the first synchronizer and the second synchronizer;Third input control signal, Slow Clock gate enable
The gate enable signal of signal, reference clock, the result after three's NAND operation connect the defeated of the first synchronizer with low-speed clock
Enter end, output signal connects the input terminal of the second synchronizer, exports first M signal.
Fig. 2 is integrated circuit structure chart, including:
The input of the circuit includes Slow Clock (clkslow_in), reference clock (clkref_in), input control signal
(sel[2:0]), high-frequency clock (pll_x4), middling speed clock (pll_x2) and low-speed clock (pll_x1);It is defeated that output includes first
Go out clock clk_x1, the second output clock clk_x2 and third output clock clk_x4.
The circuit first branch:First input control signal (sel [0]) is synchronous with by reference clock (clkref_in)
Reference clock gate enable signal (ref_ff2) and by middling speed clock (pll_x2), low-speed clock (pll_x1), it is high/
First gate enable signal x4_ff3 of low-speed clock, the gate enable signal after NAND operation as Slow Clock
gatedEnable_slow;Then the non-and Slow Clock of the gate enable signal gatedEnable_slow of Slow Clock
(clkslow_in) mutually with result be Slow Clock after gate.
Circuit the second branch:Gate enable signal gatedEnable_slow, the second input control signal of Slow Clock
First gate enable signal x4_ff3 of (sel [1]) and high/low speed clock, the result after three's NAND operation is passed through
Reference clock (clkref_in) two-stage d type flip flop is synchronized later as the gate enable signal ref_ff2 with reference to clock;It will ginseng
The non-progress of the second gate enable signal ref_ff2 of clock (clkref_in) and reference clock is examined with the result after operation i.e.
For the reference clock after gate;
Second gate enable signal ref_ff2 of reference clock obtains output signal clock_state [0] after negating, and refers to
Show the current state of clock switch circuit.
Circuit third branch:
Input control signal (sel [2]), the second output signal ref_ff2, Slow Clock gate enable signal
GatedEnable_slow synchronizes the result after three's NAND operation by low-speed clock (pll_x1) two-stage d type flip flop
Signal x1_ff1 is obtained later;It samples to obtain signal x1_ff2 using low-speed clock level-one d type flip flop;Then by level-one
After the sampling of fast clock (pll_x2) d type flip flop, the sampling of level-one high-frequency clock high-frequency clock (pll_x4) d type flip flop, as it is high/
First gate enable signal x4_ff3 of low-speed clock.Non-, x4_ff3 non-, low-speed clock (pll_x1) three's phase of x1_ff2
With result as the low-speed clock after gate;
X1_ff2 obtains output signal clock_state [1], the current state of telltable clock switching circuit after negating.
The 4th branch of circuit:
X1_ff1 obtains signal x2_ff1 after the sampling of level-one middling speed clock (pll_x2) d type flip flop, using level-one
The second gate enable signal x2_ff2 of high/low speed clock is obtained after the sampling of middling speed clock (pll_x2) d type flip flop;High/low speed
Non-, the second gate enable signal x2_ff2 non-sum middling speed clock (pll_x2) of first gate enable signal x1_ff4 of clock
Three's phase and result as the middling speed clock after gate.
The 5th branch of circuit:
X2_ff1 obtains signal x4_ff1 after the sampling of level-one high-frequency clock (pll_x4) d type flip flop, using level-one
The third gate enable signal x4_ff2 of high/low speed clock is obtained after the sampling of high-frequency clock (pll_x4) d type flip flop;High/low speed
The non-sum of non-, high/low speed clock the first gate enable signal x1_ff4 of the third gate enable signal x4_ff2 of clock is high
Fast clock (pll_x4) three phase and result as the high-frequency clock after gate.
Slow Clock after gate, the reference clock after gate and low-speed clock three's phase after gate
Or output clock clk_x1 is generated later;
Slow Clock after gate, the reference clock after gate and middling speed clock three's phase by gate
Or output clock clk_x2 is generated later;
Slow Clock after gate, the reference clock after gate and high-frequency clock three's phase by gate
Or output clock clk_x4 is generated later.
Clock_state [1] and clk_x1 obtains instruction clk_ by being sampled after NAND gate by the failing edge of clk_x2
The output signal clkx2_phase of the clock phase relationship of x2 and clk_x1;
Clock_state [1] and clk_x2 obtains instruction clk_ by being sampled after NAND gate by the failing edge of clk_x4
The output signal clkx4_phase of the clock phase relationship of x4 and clk_x2.
Circuit sequence relationship when illustrating circuit switching, Fig. 3 show sel [2:0] 3 ' b100 are switched to by 3 ' b010
Circuit sequence relation schematic diagram;
In clock selecting control signal sel [2:0] after becoming 3 ' b100 from 3 ' b010, after reference clock synchronizes,
Ref_ff2 from 0 saltus step be 1;The failing edge of next pll_x1 clocks, x1_ff0 become 0 from 1, next one pll_x1 clock
Failing edge, x1_ff1 becomes 0 from 1, and the failing edge of next one pll_x1 clock, x1_ff2 becomes 0 from 1;Then next
The failing edge of a pll_x2, x2_ff3 become 0 from 1;Then the failing edge of next pll_x4, x4_ff3 become 0 from 1;It arrives
This, the gate enable signal of middling speed clock/2 and high-frequency clock is effective, and clk_x1/clk_x2/clk_x4 is switched to middling speed respectively
Clock, low-speed clock, high-frequency clock clock rate, while clkx2_phase/clkx4_phase starts to indicate new clock
Phase relation.
Fig. 4 shows sel [2:0] the circuit sequence relation schematic diagram of 3 ' b001 is switched to by 3 ' b100;
In clock selecting control signal sel [2:0] after becoming 3 ' b001 from 3 ' b100, the decline of next pll_x1 clocks
Edge, x1_ff0 become 1 from 0, and the failing edge of next one pll_x1 clock, x1_ff1 becomes 1 from 0, during next one pll_x1
The failing edge of clock, x1_ff2 become 1 from 0;The failing edge that x2_ff1 becomes next pll_x2 after 1 in x1_ff1 becomes from 0
1, the x2_ff2 failing edge for becoming next pll_x2 after 1 in x2_ff1 becomes 1 from 0;X4_ff1 is after x2_ff1 becomes 1
The failing edge of next pll_x4 from 0 becomes 1, x4_ff2 and becomes the failing edge of next pll_x4 after 1 in x4_ff1 becoming from 0
It is 1;This is arrived, the gate enable signal of middling speed clock/2 and high-frequency clock becomes invalid, clk_x1/clk_x2/clk_x4 successively
Failure of oscillation and it is switched to the clock rate of Slow Clock respectively.
Although the preferred embodiment of the application has been described, those skilled in the art once know basic creation
Property concept, then additional changes and modifications may be made to these embodiments.So appended claims be intended to be construed to include it is excellent
It selects embodiment and falls into all change and modification of the application range.Obviously, those skilled in the art can be to the application
Various modification and variations are carried out without departing from spirit and scope.If in this way, these modifications and variations of the application
Belong within the scope of the application claim and its equivalent technologies, then the application is also intended to exist comprising these modification and variations
It is interior.