WO2023179261A1 - Phase-frequency detector, phase-locked loop, and electronic device - Google Patents

Phase-frequency detector, phase-locked loop, and electronic device Download PDF

Info

Publication number
WO2023179261A1
WO2023179261A1 PCT/CN2023/076786 CN2023076786W WO2023179261A1 WO 2023179261 A1 WO2023179261 A1 WO 2023179261A1 CN 2023076786 W CN2023076786 W CN 2023076786W WO 2023179261 A1 WO2023179261 A1 WO 2023179261A1
Authority
WO
WIPO (PCT)
Prior art keywords
clock signal
phase
flop
flip
reference clock
Prior art date
Application number
PCT/CN2023/076786
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 华为技术有限公司
Publication of WO2023179261A1 publication Critical patent/WO2023179261A1/en

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03LAUTOMATIC CONTROL, STARTING, SYNCHRONISATION OR STABILISATION OF GENERATORS OF ELECTRONIC OSCILLATIONS OR PULSES
    • H03L7/00Automatic control of frequency or phase; Synchronisation
    • H03L7/06Automatic control of frequency or phase; Synchronisation using a reference signal applied to a frequency- or phase-locked loop
    • H03L7/08Details of the phase-locked loop
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03LAUTOMATIC CONTROL, STARTING, SYNCHRONISATION OR STABILISATION OF GENERATORS OF ELECTRONIC OSCILLATIONS OR PULSES
    • H03L7/00Automatic control of frequency or phase; Synchronisation
    • H03L7/06Automatic control of frequency or phase; Synchronisation using a reference signal applied to a frequency- or phase-locked loop
    • H03L7/08Details of the phase-locked loop
    • H03L7/085Details of the phase-locked loop concerning mainly the frequency- or phase-detection arrangement including the filtering or amplification of its output signal
    • H03L7/087Details of the phase-locked loop concerning mainly the frequency- or phase-detection arrangement including the filtering or amplification of its output signal using at least two phase detectors or a frequency and phase detector in the loop
    • 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

  • the present application relates to the field of integrated circuit technology, and in particular to a frequency and phase detector, a phase-locked loop and electronic equipment.
  • DVFS dynamic voltage and frequency scaling
  • Voltage regulation and frequency regulation technology can dynamically adjust the system voltage and the frequency of the local clock signal when the system is running according to the needs of different applications running the system, thereby reducing system energy consumption.
  • PFD phase frequency detector
  • the frequency identification accuracy of the existing frequency and phase detector is 1, which means that the existing frequency and phase detector can determine that the frequency difference between the target clock signal and the local clock signal is at least 1, so that the frequency and phase detector When the device performs frequency and phase identification processing, it takes a long time.
  • Embodiments of the present application provide a frequency and phase detector, a phase-locked loop and electronic equipment.
  • the frequency and phase detector performs frequency and phase detection processing, it consumes at least one order of magnitude faster time and is more accurate than the traditional solution. high.
  • embodiments of the present application provide a frequency and phase detector, including: a two-phase synchronous logic circuit, a counter, a time-to-digital converter, and a frequency and phase detector; a two-phase synchronous logic circuit for receiving local The clock signal and the reference clock signal, the period length of the reference clock signal is greater than the period length of the local clock signal; after the rising edge of the reference clock signal, the first clock signal is generated according to the first rising edge of the local clock signal, where the first The rising edge of the clock signal is not earlier than the first rising edge of the local clock signal; after the rising edge of the reference clock signal, the second clock signal is generated according to the second rising edge of the local clock signal, where the second clock signal The rising edge is not earlier than the second rising edge of the local clock signal; after the rising edge of the reference clock signal, the third clock signal is generated according to the third rising edge of the local clock signal, where the rising edge of the third clock signal is not Earlier than the third rising edge of the local clock signal; counter, used to determine the first
  • the two-phase synchronization logic circuit receives the reference clock signal and the local clock signal, and generates the first clock signal according to the first rising edge of the local clock signal after the rising edge of the reference clock signal; After the rising edge of the reference clock signal, the second clock signal is generated based on the second rising edge of the local clock signal. After the rising edge of the reference clock signal, the third clock signal is generated based on the third rising edge of the local clock signal.
  • the counter can determine the first number of complete cycles of the local clock signal within n cycles of the reference clock signal
  • the time-to-digital converter can determine the unit steps of the incomplete cycles of the local clock signal within n cycles of the reference clock signal.
  • the second longer number, and the time-to-digital converter can also determine a coefficient.
  • This coefficient is the ratio of the unit step size of the time-to-digital converter to the length of one cycle of the local clock signal. Then, when the frequency identification and phase identification logic circuit receives After reaching the first number, the second number, and the coefficient, the first phase difference between the reference clock signal and the local clock signal within n cycles of the reference clock signal Fref can be determined based on the first number, the second number, and the coefficient.
  • the accuracy of the frequency and phase identification is improved to the ratio of the unit step of the time-to-digital converter to the length of one cycle of the local clock signal, and the time-to-digital conversion
  • the unit step size of the detector is usually on the order of picoseconds (ps). Therefore, when the current frequency and phase detector performs frequency and phase identification processing, it consumes at least one order of magnitude faster time and has higher accuracy than the traditional solution.
  • the frequency and phase identification logic circuit is specifically used to determine the third number of complete cycles of the local clock signal corresponding to the second number according to the second number and the coefficient; add the first number to the third number to obtain Within n cycles of the reference clock signal, the fourth number of complete cycles of the local clock signal; based on the reference clock signal and the fourth number, determine the first number of complete cycles of the reference clock signal and the local clock signal within n cycles of the reference clock signal. phase difference.
  • the frequency and phase identification logic circuit is also used to determine the second phase difference based on the fourth number within n cycles and the fourth number within the next n cycles; determine the local clock based on the second phase difference.
  • the frequency of the signal is also used to determine the second phase difference based on the fourth number within n cycles and the fourth number within the next n cycles; determine the local clock based on the second phase difference.
  • the frequency of the signal is also used to determine the second phase difference based on the fourth number within n cycles and the fourth number within the next n cycles; determine the local clock based on the second phase difference.
  • the frequency of the signal according to the relationship between phase and frequency, the frequency and phase detector obtains the fourth number based on two adjacent n cycles, which can obtain the frequency of the local clock signal, so that the frequency and phase detector simultaneously It has frequency identification and phase identification functions.
  • the two-phase synchronous logic circuit generates a fourth clock signal based on the fourth rising edge of the local clock signal after the rising edge of the reference clock signal, wherein the rising edge of the fourth clock signal is no earlier than the local clock signal.
  • the fourth rising edge of the two-phase synchronous logic circuit is also used for the control signal generated by the frequency and phase detection logic circuit received at the control end of the two-phase synchronous logic circuit.
  • the reference clock When the control signal is at the first level, the reference clock The signal is transmitted to the data input terminal of the time-to-digital converter, the first clock signal is transmitted to the clock input terminal of the time-to-digital converter, and the third clock signal is transmitted to the sampling input terminal of the time-to-digital converter; when the control signal is the second level, the second clock signal is transmitted to the data input terminal of the time-to-digital converter, the third clock signal is transmitted to the clock input terminal of the time-to-digital converter, and the fourth clock signal is transmitted to the sampling input terminal of the time-to-digital converter.
  • Two-phase synchronous logic circuit including: a first D flip-flop, a second D flip-flop, a third D flip-flop, a fourth D flip-flop, a fifth D flip-flop, a delay, and an OR gate; two-phase synchronous logic
  • the first input end of the circuit is connected to the clock input end of the first D flip-flop, the set end of the first D flip-flop, the set end of the second D flip-flop, the set end of the third D flip-flop, and the fourth D flip-flop.
  • the set end of the D flip-flop, the set end of the fifth D flip-flop and the input end of the delay; two-phase synchronous logic circuit The second input terminal is connected to the first input terminal of the OR gate; the output terminal of the delay device is connected to the first output terminal of the two-phase synchronous logic circuit; the data input terminal of the first D flip-flop is connected to the third level terminal, The inverse output terminal of the first D flip-flop is connected to the second input terminal of the OR gate, wherein the third level terminal provides the third level; the output terminal of the OR gate is connected to the clock input terminal of the second D flip-flop, the third The clock input terminal of the D flip-flop, the clock input terminal of the fourth D flip-flop and the clock input terminal of the fifth D flip-flop; the data input terminal of the second D flip-flop is connected to the third level terminal, and the data input terminal of the second D flip-flop is connected to the third level terminal.
  • the positive output terminal is connected to the data input terminal of the third D flip-flop and the second output terminal of the two-phase synchronous logic circuit; the positive output terminal of the third D flip-flop is connected to the data input terminal of the fourth D flip-flop and the two The first output terminal of the two-phase synchronous logic circuit; the forward output terminal of the fourth D flip-flop is connected to the data input terminal of the fifth D flip-flop, the second output terminal of the two-phase synchronous logic circuit, and the third output terminal of the two-phase synchronous logic circuit.
  • the positive output terminal of the fifth D flip-flop is connected to the third input terminal of the OR gate and the third output terminal of the two-phase synchronous logic circuit; the two-phase synchronous logic circuit is used to obtain the output terminal from the two-phase synchronous logic circuit.
  • the first input terminal receives the reference clock signal and receives the local clock signal from the second input terminal of the two-phase synchronous logic circuit; the first D flip-flop is used to receive the reference clock signal at the setting terminal of the first D flip-flop and the clock input terminal. Under the control of the clock signal, an enable signal is generated according to the third level received by the data input terminal of the first D flip-flop; the OR gate is used to compare the received enable signal, the local clock signal and the positive signal of the fifth D flip-flop.
  • the fourth clock signal output to the output terminal is OR logically processed to generate a control clock signal; the second D flip-flop is used for the reference clock signal received at the set end of the second D flip-flop, and the second D flip-flop. Under the control of the control clock signal received by the clock input terminal, the first clock signal is generated according to the third level received by the data input terminal of the second D flip-flop; the third D flip-flop is used to set the third D flip-flop.
  • a second clock signal is generated according to the first clock signal received by the data input terminal of the third D flip-flop;
  • a four-D flip-flop used for controlling the reference clock signal received by the setting terminal of the fourth D flip-flop and the control clock signal received by the clock input terminal of the fourth D flip-flop, according to the data of the fourth D flip-flop.
  • the second clock signal received at the input terminal generates a third clock signal;
  • the fifth D flip-flop is used for the reference clock signal received at the set terminal of the fifth D flip-flop, and the clock input terminal of the fifth D flip-flop receives Under the control of the control clock signal, a fourth clock signal is generated according to the third clock signal received by the data input terminal of the fifth D flip-flop;
  • the delayer is used to delay the reference clock signal and generate a delayed reference clock signal ;
  • the time-to-digital converter is specifically used to determine the second number of unit steps in the incomplete cycles of the local clock signal within n cycles of the reference clock signal based on the delayed reference clock signal and the first clock signal.
  • the two-phase synchronous logic circuit also includes a first selector, a second selector and a third selector; the control end of the two-phase synchronous logic circuit is connected to the control end of the first selector and the second selector.
  • the output terminal of the second selector is connected to the first output terminal of the two-phase synchronous logic circuit; the first input terminal of the second selector is connected to the positive output terminal of the second D flip-flop, and the second terminal of the second selector The input terminal is connected to the positive output terminal of the fourth D flip-flop, the output terminal of the second selector is connected to the second output terminal of the two-phase synchronous logic circuit; the first input terminal of the third selector is connected to the fourth D flip-flop.
  • the forward output end of the third selector is connected to the forward output end of the fifth D flip-flop, and the output end of the third selector is connected to the third output end of the two-phase synchronous logic circuit;
  • the two The one-phase synchronous logic circuit receives the control signal generated by the frequency and phase detection logic circuit from the control end of the two-phase synchronous logic circuit;
  • the first selector passes the delayed reference signal through the two-phase synchronous logic circuit when the control signal is at the first level.
  • the second output end of the circuit is transmitted to the clock input end of the time-to-digital converter; the third selector transmits the third clock signal to the time digital through the third output end of the two-phase synchronous logic circuit when the control signal is the first level.
  • the sampling input terminal of the converter; when the control signal is at the second level, the fourth clock signal is transmitted to the sampling input terminal of the time-to-digital converter through the third output terminal of the two-phase synchronous logic
  • the counter is also used to sample the first number according to the third clock signal when the control signal generated by the frequency and phase detection logic circuit is at the first level, and store the first number in the counter.
  • the time-to-digital converter is also used to sample the second quantity according to the third clock signal when the control signal generated by the frequency and phase detection logic circuit is at the first level, and store the second quantity in the time-to-digital conversion in the vessel.
  • the time-to-digital converter is also configured to sample the coefficients according to the fourth clock signal when the control signal is the second level, and store the coefficients in the time-to-digital converter.
  • the frequency and phase detection logic circuit is also used to receive a reference clock signal and generate a control signal according to the reference clock signal.
  • the control signal is the second level in the first cycle of the reference clock signal; the control signal is at the second level in the first cycle of the reference clock signal.
  • the first level is from the 2nd cycle to the nth cycle of the signal.
  • a phase-locked loop in a second aspect, includes a filter, an oscillation circuit and a frequency and phase detector as described in any one of the above-mentioned first aspects; the frequency and phase detector is connected to the oscillator through the filter. circuit, the oscillation circuit is also connected to the frequency and phase detector; the frequency and phase detector receives the reference clock signal, the local clock signal generated by the oscillation circuit, and the target clock signal, and determines based on the reference clock signal, the local clock signal, and the target clock signal.
  • the third phase difference between the target clock signal and the local clock signal within n cycles of the reference clock signal generates a voltage control signal based on the third phase difference;
  • the filter receives the voltage control signal and generates the control voltage of the oscillation circuit based on the voltage control signal ;
  • the oscillation circuit receives the control voltage and adjusts the frequency of the local clock signal generated by the oscillation circuit under the control of the control voltage.
  • an electronic device in a third aspect, includes a printed circuit board, and further includes: a phase-locked loop as described in the second aspect provided on the printed circuit board, or a phase-locked loop as described in the second aspect provided on the printed circuit board.
  • the frequency and phase detector described in the first aspect is provided.
  • the fourth aspect provides a frequency and phase identification method, which includes: receiving a local clock signal and a reference clock signal; the period length of the reference clock signal is greater than the period length of the local clock signal; after the rising edge of the reference clock signal, according to the local The first rising edge of the clock signal generates the first clock signal, wherein the rising edge of the first clock signal is not earlier than the first rising edge of the local clock signal; after the rising edge of the reference clock signal, according to the The second rising edge generates a second clock signal, wherein the rising edge of the second clock signal is no earlier than the second rising edge of the local clock signal; after the rising edge of the reference clock signal, according to the third rising edge of the local clock signal The rising edge generates a third clock signal, wherein the rising edge of the third clock signal is no earlier than the third rising edge of the local clock signal; determining the first number of complete cycles of the local clock signal within n cycles of the reference clock signal , n is a positive integer greater than or equal to 2; the coefficient is determined based on the second clock
  • determining the first phase difference between the reference clock signal and the local clock signal within n cycles of the reference clock signal according to the first number, the second number, and the coefficient includes: according to the second number and the coefficient, Determine the third number of complete cycles of the local clock signal corresponding to the second number; add the first number to the third number to obtain the fourth number of complete cycles of the local clock signal within n cycles of the reference clock signal; according to The reference clock signal and the fourth quantity determine the first phase difference between the reference clock signal and the local clock signal within n cycles of the reference clock signal.
  • the method further includes: after the rising edge of the reference clock signal, generating a fourth clock signal according to the fourth rising edge of the local clock signal, wherein the rising edge of the fourth clock signal edge no earlier than the fourth rising edge of the local clock signal.
  • the method includes: generating an enable signal according to the third level under the control of the reference clock signal; and performing the processing on the received enable signal, the local clock signal and the fourth clock signal. or logical processing to generate a control clock signal; under the control of the reference clock signal and the control clock signal, generate the first clock signal according to the third level; under the control of the reference clock signal and the control clock signal, according to the first clock signal
  • the signal generates a second clock signal; under the control of the reference clock signal and the control clock signal, a third clock signal is generated according to the second clock signal; under the control of the reference clock signal and the control clock signal, a third clock signal is generated
  • the fourth clock signal perform delay processing on the reference clock signal to generate a delayed reference clock signal; then, according to the reference clock signal and the first clock signal, determine within n cycles of the reference clock signal, among the incomplete cycles of the local clock signal
  • the second number of unit steps specifically includes: determining the second number of unit steps in the incomplete cycles of the local clock
  • the method further includes: when the control signal is at the first level, sampling the first number according to the third clock signal, and storing the first number.
  • the method further includes: when the control signal is at the first level, sampling the second quantity according to the third clock signal, and storing the second quantity.
  • the method further includes: when the control signal is at the second level, sampling the coefficient according to the fourth clock signal and storing the coefficient.
  • the method further includes: receiving a reference clock signal, and generating a control signal according to the reference clock signal.
  • the control signal is at the second level during the first cycle of the reference clock signal; the control signal is at the second level during the second cycle of the reference clock signal. It is the first level in the nth cycle.
  • a computer-readable storage medium which includes computer instructions.
  • the electronic device causes the electronic device to perform the frequency and phase identification method as described in any one of the fourth aspects.
  • a computer program product is provided.
  • the computer program product When the computer program product is run on an electronic device, it causes the electronic device to execute the frequency and phase identification method described in any one of the fourth aspects.
  • Figure 1 is a schematic structural diagram of a D flip-flop according to Embodiment 1 of the present application.
  • Figure 2 is a schematic structural diagram of a phase-locked loop according to Embodiment 1 of the present application.
  • FIG. 3 is a timing diagram of an automatic frequency control loop provided by Embodiment 1 of the present application.
  • Figure 4 is a schematic structural diagram of a frequency and phase detector provided in Embodiment 2 of the present application.
  • Figure 5 is a timing diagram of the frequency and phase detector provided in Embodiment 2 of the present application.
  • Figure 6 is a timing diagram of a control signal provided by Embodiment 2 of the present application.
  • Figure 7 is a schematic structural diagram of a two-phase synchronous logic circuit provided in Embodiment 3 of the present application.
  • Figure 8 is a timing diagram of a two-phase synchronous logic circuit provided in Embodiment 3 of the present application.
  • Figure 9 is another structural schematic diagram of a two-phase synchronous logic circuit provided in Embodiment 3 of the present application.
  • Figure 10 is a schematic structural diagram of a phase-locked loop provided in Embodiment 4 of the present application.
  • FIG 11 is a schematic structural diagram of an oscillator provided in Embodiment 4 of the present application.
  • At least one of the following or similar expressions thereof refers to any combination of these items, including any combination of a single item (items) or a plurality of items (items).
  • at least one of a, b or c can mean: a, b, c, a and b, a and c, b and c or a, b and c, where a, b and c can It can be single or multiple.
  • words such as “first” and “second” do not limit the number and order.
  • a D flip-flop is an information storage device with a memory function and two stable states.
  • an embodiment of the present application provides a schematic structural diagram of a D flip-flop.
  • the D flip-flop has three input terminals and two output terminals.
  • the three input terminals are the data input terminal D terminal, the clock input terminal clk terminal, and the set terminal rstn terminal.
  • the two output terminals are the forward output terminal Q terminal and the Reverse output terminal, and the level output by the forward output terminal Q terminal is the same as the reverse output terminal The level of the terminal output is always opposite.
  • the level output by the positive output terminal Q terminal of the D flip-flop is the same as the input level input by the data input terminal D terminal; when the set terminal rstn terminal inputs a high level (also called HIGH), and When the clock input terminal clk inputs a low level, the level output by the forward output terminal Q of the D flip-flop remains consistent with the level output by the forward output terminal Q at the previous moment.
  • DVFS dynamic voltage and frequency scaling
  • Voltage regulation and frequency regulation technology can dynamically adjust the system voltage and the frequency of the local clock signal when the system is running according to the needs of different applications running the system, thereby reducing system energy consumption.
  • the basic process of dynamic voltage and frequency modulation technology includes: collecting signals related to system load, calculating the system load in the current time period; predicting the performance required by the system in the next time period based on the system load in the current time period; predicting The obtained performance is converted into the frequency of the local clock signal required when the system is running; the system voltage when the system is running is calculated based on the required frequency of the local clock signal, and the power management module in the system is notified to provide the system voltage to the system.
  • phase locked loop PLL
  • frequency locked loop FLL
  • the phase-locked loop 20 includes a frequency detector 201, a loop filter (loop filter). , LF) 202, voltage control oscillator (VCO) 203, the first input end of the frequency and phase detector 201 receives the reference clock signal Fref, and the output end of the frequency and phase detector 201 passes through the loop filter 202 Connected to the voltage controlled oscillator 203 , the voltage controlled oscillator 203 is connected to the second input end of the frequency and phase detector 201 .
  • LF loop filter
  • VCO voltage control oscillator
  • the voltage controlled oscillator 203 is used to generate the local clock signal Fckv, and transmit the local clock signal Fckv to the second input end of the frequency and phase detector 201.
  • the frequency and phase detector 201 compares the local clock signal Fckv and the reference clock signal Fref.
  • the phase difference of The signal Ud is filtered to generate the control voltage Uc of the voltage-controlled oscillator 203, and the control voltage Uc is transmitted to the voltage-controlled oscillator 203, so that the voltage-controlled oscillator 203 adjusts the frequency and phase of the local clock signal Fckv to realize the local clock signal.
  • the frequency and phase of Fckv are locked to the frequency and phase of the reference clock signal Fref.
  • the phase-locked loop of the digital architecture may also be called a frequency-locked loop of the digital architecture.
  • phase-locked loop of a digital architecture there is usually a target clock signal, in which both the target clock signal and the reference clock signal are determined, and the target clock signal and the reference clock signal have a fixed ratio relationship.
  • the phase-locked loop is usually frequency-locked first and then phase-locked, that is, first aligning the frequency of the local clock signal with the target clock signal, and then aligning the phase of the local clock signal with the target clock signal. alignment.
  • AFC automatic frequency control
  • the automatic frequency control loop requires frequency identification, that is, to determine the frequency difference between the target clock signal and the local clock signal.
  • the automatic frequency control loop often uses a reference
  • the clock signal Fref constructs a counting time window, and within this counting time window, the target clock signal is counted to generate the target quantity.
  • the local clock signal is also counted within this counting time window to generate the local quantity, and then the target quantity and the local quantity are calculated. The difference between them is the equivalent frequency difference between the target clock signal and the local clock signal.
  • the automatic frequency control loop in order to increase the counting time, the automatic frequency control loop often divides the reference clock signal Fref by N. Since the frequency of the local clock signal is usually in the GHz level, it is often difficult to achieve the GHz level in digital architecture. Therefore, it is also necessary to divide the local clock signal to the 100MHz level to meet the frequency requirements in the current digital structure.
  • FIG 3 a timing diagram of an automatic frequency control loop provided by an embodiment of the present application is shown.
  • Figure 3 includes the timing of the reference clock signal Fref, the timing of N-dividing the reference clock signal Fref, and the target clock signal Fckv1
  • the timing of the target clock signal Fckv1 is divided by M.
  • the automatic frequency control loop in the digital phase-locked loop determines the equivalent frequency difference between the target clock signal Fckv1 and the local clock signal Fckv according to the following formula 1:
  • the period of the reference clock signal Fref is Tref. Since the constructed counting time window divides the reference clock signal Fref by N, the counting time window can be expressed as N*Tref.
  • the period of the target clock signal Fckv1 is Tckv1, and the target clock signal Fckv1 is divided by M, so one period after the target clock signal Fckv1 is divided is M*Tckv1; the period of the local clock signal Fckv is Tckv, and the counter The signal Fckv is divided by M, so one cycle after the local clock signal Fckv is divided is M*Tckv.
  • the first term in formula 1 Indicates the target number obtained by counting the target clock signal Fckv1 within a counting time window of the reference clock signal Fref
  • the second term in Formula 1 Indicates the local number obtained by counting the local clock signal Fckv within a counting time window of the reference clock signal Fref. Then the first term minus the second term can determine the target clock within a counting period of the reference clock signal Fref. The equivalent frequency difference between the signal Fckv1 and the local clock signal Fckv.
  • the existing automatic frequency control loop can determine that the equivalent frequency difference between the target clock signal and the local clock signal is at least 1. Then it can be determined that the absolute value of the above formula 1 is at least 2, and the following formula 2 is obtained.
  • the required counting time window N*Tref ⁇ 1us that is to say, it takes 1us for the automatic frequency control loop to perform one frequency identification, then use the current digital phase-locked loop to achieve the frequency and phase of the local clock signal Fckv to the target It takes at least about 10us to lock the frequency and phase of the clock signal Fckv1.
  • phase-locked loop 201 is non-linear, and the bandwidth of the analog phase-locked loop is usually on the order of 100 kilohertz (kHz), so that the locking time of the analog phase-locked loop 20 is usually Around 50 microseconds (us).
  • the embodiment of the present application provides a frequency and phase detector 400.
  • the frequency and phase detector 400 can be applied to the phase-locked loop 20 shown in Figure 2.
  • the frequency and phase detector 400 can be used in the phase-locked loop 20 shown in Figure 2.
  • the phase detector 400 is used to generate the voltage control signal Uvco in Figure 2, and when the frequency and phase detector 400 performs frequency and phase identification processing, it consumes at least one order of magnitude faster time and has higher accuracy than the traditional solution.
  • the frequency and phase detector 400 includes: a two-phase synchronous logic circuit 401, a counter 402, a time-to-digital converter 403, and a frequency and phase detector logic circuit 404.
  • the two-phase synchronization logic circuit 401 receives the local clock signal Fckv and the reference clock signal Fref.
  • the period length of the reference clock signal Fref is is greater than the period length of the local clock signal Fckv.
  • the first clock signal Fckv_a is generated according to the first rising edge of the local clock signal Fckv, wherein the rising edge of the first clock signal Fckv_a is not earlier than the first rising edge of the local clock signal Fckv As shown in Figure 5, after the rising edge of the reference clock signal Fref arrives, the first rising edge of the local clock signal Fckv is aligned with the first rising edge of the first clock signal Fckv_a.
  • the second clock signal Fckv_b is generated according to the second rising edge of the local clock signal Fckv, wherein the rising edge of the second clock signal Fckv_b is not earlier than the second rising edge of the local clock signal Fckv edge, as shown in Figure 5, after the rising edge of the reference clock signal Fref arrives, the second rising edge of the local clock signal Fckv is aligned with the first rising edge of the second clock signal Fckv_b; after the rising edge of the reference clock signal Fref After the edge, the third clock signal Fckv_c is generated according to the third rising edge of the local clock signal Fckv, where the rising edge of the third clock signal Fckv_c is not earlier than the third rising edge of the local clock signal Fckv, as shown in Figure 5 , after the rising edge of the reference clock signal Fref arrives, the third rising edge of the local clock signal Fckv is aligned with the first rising edge of the third clock signal Fckv_c.
  • the two-phase synchronous logic circuit 401 will also generate the fourth clock signal Fckv_d according to the fourth rising edge of the local clock signal Fckv after the rising edge of the reference clock signal Fref, where the rising edge of the fourth clock signal Fckv_d The edge is not earlier than the fourth rising edge of the local clock signal Fckv.
  • the fourth rising edge of the local clock signal Fckv is consistent with the fourth rising edge of the fourth clock signal Fckv_d.
  • a rising edge aligns.
  • the counter 402 is used to determine the first number of complete cycles of the local clock signal Fckv within n cycles of the reference clock signal Fref, where n is a positive integer greater than or equal to 2. Specifically, the counter 402 determines how many integer periods of the local clock signal Fckv are included in n periods of the reference clock signal Fref based on the reference clock signal Fref and the local clock signal Fckv. The integer period of the local clock signal Fckv is the local clock signal. complete cycle.
  • the time-to-digital converter 403 is used to determine a coefficient based on the second clock signal and the third clock signal.
  • the coefficient is the ratio of the unit step size of the time-to-digital converter to the length of one cycle of the local clock signal; it is also used to determine a coefficient based on the reference clock signal. and the first clock signal, determining a second number of unit steps in incomplete cycles of the local clock signal within n cycles of the reference clock signal.
  • the time-to-digital converter 403 quantizes the second clock signal Fckv_b according to the third clock signal Fckv_c in the first cycle of n cycles of the reference clock signal Fref, thereby determining the third clock signal Fckv_c and The phase difference between the second clock signal Fckv_b, and since the rising edge of the second clock signal Fckv_b is aligned with the second rising edge of the local clock signal Fckv after the arrival of the rising edge of the reference clock signal Fref, the third clock signal Fckv_c The rising edge is aligned with the third rising edge of the local clock signal Fckv after the arrival of the rising edge of the reference clock signal Fref.
  • the second clock signal The phase difference between Fckv_b and the third clock signal Fckv_c can exactly reflect the length of one cycle of the local clock signal Fckv.
  • its measurement unit is a unit step of the current time-to-digital converter 403, that is, the time-to-digital converter 403 determines the length of the local clock signal Fckv.
  • the length of one cycle of is equal to the unit step size of x is the coefficient determined by the time-to-digital converter.
  • the time-to-digital converter 403 can quantize the reference clock signal Fref according to the first clock signal Fckv_a within n cycles of the reference clock signal Fref, thereby determining the phase between the reference clock signal Fref and the first clock signal Fckv_a. difference, and since the rising edge of the first clock signal is aligned with the first rising edge of the local clock signal Fckv after the rising edge of the reference clock signal Fref arrives, the phase between the reference clock signal Fref and the first clock signal Fckv_a The difference can exactly reflect the number of incomplete cycles of the local clock signal Fckv within n cycles of the reference clock signal Fref.
  • the measurement unit of the number of incomplete cycles of the local clock signal Fckv determined by the time-to-digital converter 403 is a unit step of the current time-to-digital converter 403 , that is, the local clock signal Fckv determined by the time-to-digital converter 403
  • the number of incomplete cycles is equal to y unit steps of the time-to-digital converter 403, where y represents the number of incomplete cycles of the local clock signal within n cycles of the reference clock signal Fref determined by the time-to-digital converter 403. The second number of unit steps.
  • the frequency and phase detection logic circuit 404 is used to determine the first phase difference between the reference clock signal Fref and the local clock signal Fckv within n cycles of the reference clock signal Fref based on the first quantity, the second quantity, and the coefficient. Specifically, the frequency and phase identification logic circuit 404 determines the third number of complete cycles of the local clock signal corresponding to the second number based on the second number and the coefficient. As mentioned above, the time-to-digital converter 403 determines that within n cycles of the reference clock signal Fref, the number of incomplete cycles of the local clock signal Fckv is equal to y unit steps of the time-to-digital converter, and y represents the incomplete cycles of the local clock signal. The second number of unit steps in a complete cycle.
  • the time-to-digital converter 403 also determines that the length of one cycle of the local clock signal Fckv is equal to x unit steps of the time-to-digital converter. 1/x is the coefficient, that is, the unit step of the time-to-digital converter 403 is equal to the unit step of the local clock. The ratio of the length of one cycle of the signal Fckv. It is equal to then that after the frequency and phase detection logic circuit 404 first obtains x and then y, it will calculate the value of y*(1/x), that is, the value of y ⁇ x, and the local clock corresponding to the second number can be determined. The third number of complete cycles of the signal.
  • the frequency and phase detection logic circuit 404 can also obtain the first number of complete cycles of the local clock signal Fckv within n cycles of the reference clock signal Fref determined by the counter 402. Then, the frequency and phase detection logic circuit 404 will The first quantity is added to the third quantity to obtain the fourth quantity of complete cycles of the local clock signal within n cycles of the reference clock signal Fref. Then, the frequency and phase detection logic circuit 404 determines the first phase difference between the reference clock signal and the local clock signal within n cycles of the reference clock signal based on the reference clock signal and the fourth quantity.
  • the measurement unit of the reference clock signal Fref is one complete cycle of the local clock signal Fckv
  • the frequency and phase detection logic circuit 404 can also obtain n cycles of the reference clock signal Fref according to the reference clock signal Fref.
  • the number of complete cycles of the local clock signal Fckv corresponding to the clock signal Fref, then the number of complete cycles of the local clock signal Fckv corresponding to the reference clock signal Fref minus the fourth number, can be determined in n cycles of the reference clock signal Within, the first phase difference between the reference clock signal and the local clock signal.
  • the two-phase synchronization logic circuit receives the reference clock signal and the local clock signal, and generates the first clock signal according to the first rising edge of the local clock signal after the rising edge of the reference clock signal; After the rising edge of the reference clock signal, the second clock signal is generated according to the second rising edge of the local clock signal. After the rising edge of the reference clock signal, the third clock signal is generated according to the third rising edge of the local clock signal.
  • the counter can determine the first number of complete cycles of the local clock signal within n cycles of the reference clock signal
  • the time-to-digital converter can determine the unit steps of the incomplete cycles of the local clock signal within n cycles of the reference clock signal.
  • the second longer number, and the time-to-digital converter can also determine a coefficient.
  • This coefficient is the ratio of the unit step size of the time-to-digital converter to the length of one cycle of the local clock signal. Then, when the frequency identification and phase identification logic circuit receives After reaching the first number, the second number, and the coefficient, the first phase difference between the reference clock signal and the local clock signal within n cycles of the reference clock signal Fref can be determined based on the first number, the second number, and the coefficient.
  • the accuracy of the frequency and phase identification is improved to the ratio of the unit step of the time-to-digital converter to the length of one cycle of the local clock signal, and the time-to-digital conversion
  • the unit step size of the detector is usually on the order of picoseconds (ps). Therefore, when the current frequency and phase detector performs frequency and phase identification processing, it consumes at least one order of magnitude faster time and has higher accuracy than the traditional solution.
  • the frequency and phase detection logic circuit 404 after acquiring the fourth number of the local clock signal Fckv within n cycles of the reference clock signal Fref, will also acquire the fourth number of the local clock signal Fckv within n cycles of the next reference clock signal Fref.
  • the fourth number of the local clock signal Fckv then the difference between the fourth numbers in two adjacent n cycles is obtained, and then the difference is divided by 2 to obtain the frequency of the local clock signal Fckv, then
  • the frequency difference between the local clock signal Fckv and the reference clock signal Fref can be obtained by subtracting the frequency of the local clock signal Fckv from the frequency of the reference clock signal Fref. That is to say, by applying the phase frequency detector 400 provided by the embodiment of the present application in a phase-locked loop, there is no need to set up an additional automatic frequency control loop, and the purpose of frequency identification can be achieved.
  • the target clock signal since the target clock signal is determined and the reference clock signal is also determined, the target clock signal There is a fixed ratio relationship with the reference clock signal. Then, after the phase frequency detector determines the phase difference or frequency difference between the reference clock signal and the local clock signal, based on the fixed ratio relationship between the target clock signal and the reference clock signal, Determine the phase difference and/or frequency difference between the target clock signal and the local clock signal.
  • the frequency and phase detection logic circuit 404 is also used to receive the reference clock signal Fref, generate the control signal Fctl according to the reference clock signal Fref, and transmit the control signal Fctl to the two-phase synchronous logic circuit 401.
  • Control terminal Referring to Figure 6, for example, when the frequency and phase detector determines the first phase difference between the reference clock signal Fref and the local clock signal Fckv within 2 cycles of the reference clock signal Fref, the control signal Fctl It is the second level during the first period of the two periods of the reference clock signal Fref, and the control signal Fctl is the first level during the second period of the two periods of the reference clock signal Fref.
  • the control signal Fctl is at the first of n cycles of the reference clock signal Fref.
  • the control signal Fctl is at the second level within n cycles, and the control signal Fctl is at the first level within the second to nth cycles of the n cycles of the reference clock signal Fref.
  • the first level may be low level and the second level may be high level, or the first level may be high level and the second level may be low level.
  • the embodiment of the present application does not limit the control signal Fctl.
  • the two-phase synchronous logic circuit 401 generates the first clock signal Fckv_a, the second clock signal Fckv_b, the third clock signal Fckv_c, and the fourth clock signal Fckv_d.
  • control signal Fctl generated by the frequency and phase detection logic circuit 404 is the second level in the first cycle of the two cycles of the reference clock signal Fref, It is the first level within 2 cycles.
  • the two-phase synchronous logic circuit 401 transmits the second clock signal Fckv_b to the time-to-digital converter 403 in the first cycle of the two cycles of the reference clock signal Fref, that is, when the control signal Fctl is at the second level.
  • the data input terminal tdc_in terminal, the third clock signal Fckv_c is transmitted to the clock input terminal tdc_clk terminal of the time-to-digital converter 403, and the fourth clock signal Fckv_d is transmitted to the data input terminal tdc_smp terminal of the time-to-digital converter 403, so that the time
  • the digitizer 403 quantizes the second clock signal Fckv_b according to the third clock signal Fckv_c to determine the coefficient, then samples the coefficient according to the third clock signal Fckv_c, stores the coefficient in the time-to-digital converter 403, and then stores the coefficient
  • the coefficients are transmitted to the frequency and phase detection logic circuit 404.
  • the two-phase synchronous logic circuit 401 transmits the reference clock signal Fref to the time-to-digital converter 403 in the second cycle of the two cycles of the reference clock signal Fref, that is, when the control signal Fctl is at the first level.
  • the data input terminal tdc_in transmits the first clock signal Fckv_a to the clock input terminal tdc_clk of the time-to-digital converter 403, and transmits the third clock signal Fckv_c to the data input terminal tdc_smp of the time-to-digital converter 403; so that the time digital
  • the converter 403 quantizes the reference clock signal Fref according to the first clock signal Fckv_a, determines the second number of unit steps in the incomplete cycle of the local clock signal within 2 cycles of the reference clock signal, and then quantizes the unit step size according to the third clock signal Fckv_c samples the second quantity, stores the second quantity in the time-to-digital converter 403 , and then transmits the stored second quantity to the frequency and phase detection logic circuit 404 .
  • the counter 402 in the first cycle of the two cycles of the reference clock signal Fref, that is, when the control signal Fctl is at the second level, samples the first number according to the fourth clock signal Fckv_d, and stores the first number in In the counter 402, the stored first number is then transmitted to the frequency and phase detection logic circuit 404. However, the frequency and phase detection logic circuit 404 does not use the signal received in the first cycle of the two cycles of the reference clock signal Fref. The first quantity arrived.
  • the first number is sampled according to the third clock signal Fckv_c, and the first number is stored in the counter 402 , and then transmit the stored first quantity to the frequency and phase detection logic circuit 404.
  • the frequency and phase detection logic circuit 404 will use the first quantity received in the second cycle of the two cycles of the reference clock signal Fref. Then, since the third clock signal Fckv_c must have a rising edge only after the arrival of a rising edge of the reference clock signal Fref, sampling the first quantity through the third clock signal Fckv_c also makes the frequency and phase detector There is no sampling error in 400.
  • the counter 402 may not receive the reference clock signal Fref, because the counter will receive the third cycle in the second cycle of the two cycles of the reference clock signal Fref, that is, when the control signal Fctl is at the first level.
  • Clock signal Fckv_c The third clock signal Fckv_c changes periodically according to the reference clock signal Fref. Therefore, when the counter 402 does not receive the reference clock signal Fref, the first quantity is sampled according to the third clock signal Fckv_c.
  • the first quantity That is, it represents the first number of complete cycles of the local clock signal Fckv within 2 cycles of the reference clock signal Fref.
  • the frequency and phase detection logic circuit 404 receives coefficients within the first cycle of the two cycles of the reference clock signal Fref, that is, when the control signal Fctl is at the second level, within the two cycles of the reference clock signal Fref. In the second cycle of , that is, when the control signal Fctl is at the second level, the first quantity and the second quantity are received, so that the frequency and phase detection logic circuit 404 determines based on the first quantity, the second quantity, and the coefficient. in reference clock Within n cycles of the signal Fref, the first phase difference between the reference clock signal Fref and the local clock signal Fckv.
  • the embodiment of the present application provides a schematic structural diagram of a two-phase synchronous logic circuit.
  • the two-phase synchronous logic circuit 401 includes: D flip-flop 4010, D flip-flop 4011, D flip-flop 4012. D flip-flop 4013, D flip-flop 4014, delay 4015 and OR gate 4016.
  • the first input terminal of the two-phase synchronous logic circuit 401 is connected to the clock input terminal clk terminal of the D flip-flop 4010, the set terminal rstn terminal of the D flip-flop 4010, the set terminal rstn terminal of the D flip-flop 4011, and the D flip-flop 4011.
  • the second input terminal of the two-phase synchronous logic circuit 401 is connected to the first input terminal of the OR gate 4016 .
  • the output terminal of the delay device 4015 is connected to the first output terminal of the two-phase synchronous logic circuit 401 .
  • the data input terminal D of the D flip-flop 4010 is connected to the third level terminal V3, which provides the third level, and the third level is high level; the reverse output terminal of the D flip-flop 4010 terminal is connected to the second input terminal of the OR gate 4016.
  • the output terminal of the OR gate 4016 is connected to the clock input terminal clk terminal of the D flip-flop 4011, the clock input terminal clk terminal of the D flip-flop 4012, the clock input terminal clk terminal of the D flip-flop 4013 and the clock input terminal clk of the D flip-flop 4014. end.
  • the data input terminal D of the D flip-flop 4011 is connected to the third level terminal V3.
  • the forward output terminal Q of the D flip-flop 4011 is connected to the data input terminal D of the D flip-flop 4012 and the third level terminal of the two-phase synchronous logic circuit 401.
  • the positive output terminal Q terminal of the D selector 4012 is connected to the data input terminal D terminal of the D flip-flop 4013 and the first output terminal of the two-phase synchronous logic circuit 401 .
  • the forward output terminal Q terminal of the D flip-flop 4013 is connected to the data input terminal D terminal of the D flip-flop 4014, the second output terminal of the two-phase synchronous logic circuit 401, and the third output terminal of the two-phase synchronous logic circuit 401.
  • the positive output Q terminal of the D flip-flop 4014 is connected to the third input terminal of the OR gate 4016 and the third output terminal of the two-phase synchronous logic circuit 401 .
  • the two-phase synchronous logic circuit 401 is configured to receive the reference clock signal Fref from the first input terminal of the two-phase synchronous logic circuit 401 and receive the local clock signal Fckv from the second input terminal of the two-phase synchronous logic circuit 401 .
  • an embodiment of the present application provides a timing diagram of a two-phase synchronous logic circuit 401 .
  • the D flip-flop 4010 is used for controlling the reference clock signal Fref received by the setting terminal rstn terminal of the D flip-flop 4010 and the clock input terminal clk terminal, and according to the third voltage received by the data input terminal D terminal of the D flip-flop 4010.
  • the level generates the enable signal Fenb.
  • the data input terminal D terminal of the D flip-flop 4010 is connected to the level V3, the level V3 is high level, and the clock input terminal clk terminal and the set terminal rstn terminal of the D flip-flop 4010 receive the reference clock signal Fref, then , when the reference clock signal Fref is low level, the forward output terminal Q terminal of the D flip-flop 4010 outputs a low level, and the reverse output terminal The terminal outputs a high level; when a rising edge of the reference clock signal Fref occurs, the forward output terminal Q terminal of the D flip-flop outputs the high level received from the data input terminal D terminal, and the reverse output terminal terminal output level.
  • the enable signal Fenb generated by the D flip-flop 4010 can be considered as the inverse signal of the reference clock signal Fref, and the enable signal Fenb is delayed by a certain period of time compared to the reference clock signal Fref. This delay is caused by the D flip-flop 4010 of.
  • the OR gate 4016 is used to perform OR logic processing based on the received enable signal Fenb, the local clock signal Fckv, and the fourth clock signal Fckv_d output from the forward output terminal Q of the D flip-flop 4014 to generate the control clock signal Fck1.
  • the OR gate 4016 when the fourth clock signal Fckv_d is low level, the OR gate 4016 generates the control clock signal Fck1 according to the reception enable signal Fenb and the local reference signal Fckv. Among them, when the reference clock signal Fref is high level, the enable signal Fenb is low level.
  • control clock signal Fck1 is synchronized with the local reference signal Fckv, and the control clock signal Fck1 is delayed by a certain amount compared with the local reference signal Fckv. time, This delay is caused by the OR gate 4016 and is a logical delay. During the period when the fourth clock signal Fckv_d is at the high level, the control clock signal Fck1 always remains at the high level.
  • D flip-flop 4011 is used to control the reference clock signal Fref received at the set end rstn end of the D flip-flop 4011 and the control clock signal Fck1 received at the clock input end clk end of the D flip-flop 4011, according to the D flip-flop 4011
  • the third level received by the data input terminal D of 4011 generates the first clock signal Fckv_1.
  • the data input terminal D of the D flip-flop 4011 is connected to the third level terminal V3, the third level terminal V3 provides a high level, and the clock input terminal clk of the D flip-flop 4011 receives the control clock signal Fck1, the D flip-flop 4011
  • the set end rstn end of 4011 receives the reference clock signal Fref.
  • the forward output end Q end of the D flip-flop 4011 outputs a low level, and the reverse output end The terminal outputs a high level; when the reference clock signal Fref is a high level and the control clock signal Fck1 has a rising edge, the forward output terminal Q terminal of the D flip-flop outputs the high level received from the data input terminal D terminal.
  • the reference clock signal Fref is a high level and the control clock signal Fck1 has a rising edge
  • the forward output terminal Q terminal of the D flip-flop outputs the high level received from the data input terminal D terminal.
  • the first clock signal Fckv_a output by the positive output terminal Q of the flip-flop 4011 delays the first rising edge, and after the rising edge appears, it remains high until the reference clock signal Fref becomes low. is caused by D flip-flop 1011.
  • the D flip-flop 4012 is used to control the reference clock signal Fref received at the set end rstn end of the D flip-flop 4012 and the control clock signal Fck1 received at the clock input end clk end of the D flip-flop 4012, according to the D flip-flop 4012
  • the first clock signal Fckv_a received by the data input terminal D of 4012 generates a second clock signal Fckv_b.
  • the data input terminal D terminal of the D flip-flop 4012 is connected to the forward output terminal Q terminal of the D flip-flop 4011 and receives the first clock signal Fckv_a, and the clock input terminal clk terminal of the D flip-flop 4012 receives the control clock signal Fck1,
  • the setting terminal rstn of the D flip-flop 4012 receives the reference clock signal Fref.
  • the forward output terminal Q of the D flip-flop 4012 outputs a low level, and the reverse output terminal The terminal outputs a high level; when the reference clock signal Fref is a high level and the control clock signal Fck1 has a rising edge, the forward output terminal Q terminal of the D flip-flop receives the first clock signal Fckv_a from the data input terminal D terminal. .
  • the rising edge of the reference clock signal Fref when the first rising edge of the local clock signal Fckv arrives, the first rising edge of the control clock signal Fck1 appears.
  • the first clock signal Fckv_a is high level, then the second rising edge
  • the clock signal Fckv_b also has a rising edge, and after the rising edge appears, it remains at a high level until the reference clock signal Fref changes to a low level.
  • D flip-flop 4013 is used to control the reference clock signal Fref received at the set end rstn end of the D flip-flop 4013 and the control clock signal Fck1 received at the clock input end clk end of the D flip-flop 4013, according to the D flip-flop 4013
  • the second clock signal Fckv_b received by the data input terminal D of 4013 generates a third clock signal Fckv_c.
  • the data input terminal D terminal of the D flip-flop 4013 is connected to the forward output terminal Q terminal of the D flip-flop 4012 and receives the second clock signal Fckv_b, and the clock input terminal clk terminal of the D flip-flop 4013 receives the control clock signal Fck1,
  • the setting terminal rstn of the D flip-flop 4013 receives the reference clock signal Fref.
  • the forward output terminal Q of the D flip-flop 4013 When it is low level, the forward output terminal Q of the D flip-flop 4013 outputs a low level, and the reverse output terminal The terminal outputs a high level; when the reference clock signal Fref is a high level and the control clock signal Fck1 has a rising edge, the forward output terminal Q terminal of the D flip-flop receives the second clock signal Fckv_b from the data input terminal D terminal. .
  • the control clock signal Fck1 delays a rising edge, then the forward output of the D flip-flop 4011
  • the first rising edge of the first clock signal Fckv_a output from terminal Q is delayed, and the delay is less than one period of the local clock signal Fckv.
  • the second clock signal Fckv_b is low level, then the third clock signal Fckv_c It is also low level.
  • the control clock signal Fck1 also has a second rising edge.
  • the first clock signal Fckv_a is high level
  • the second clock signal Fckv_b A rising edge occurs
  • the third clock signal Fckv_c is still low level.
  • the control clock signal Fck1 also appears the third rising edge.
  • the first clock signal Fckv_a is high level.
  • the second clock When the signal Fckv_b is high level, a rising edge appears on the third clock signal Fckv_c, and after the rising edge appears, it remains high level until the reference clock signal Fref becomes low level.
  • the D flip-flop 4014 is used to control the reference clock signal Fref received at the set end rstn end of the D flip-flop 4014 and the control clock signal Fck1 received at the clock input end clk end of the D flip-flop 4014, according to the D flip-flop 4014.
  • the third clock signal Fckv_c received by the data input terminal D of 4014 generates a fourth clock signal Fckv_d.
  • the data input terminal D terminal of the D flip-flop 4014 is connected to the forward output terminal Q terminal of the D flip-flop 4013 and receives the third clock signal Fckv_c, and the clock input terminal clk terminal of the D flip-flop 4014 receives the control clock signal Fck1,
  • the setting terminal rstn of the D flip-flop 4014 receives the reference clock signal Fref.
  • the forward output terminal Q terminal of the D flip-flop 4014 outputs a low level, and the reverse output terminal The terminal outputs a high level; when the reference clock signal Fref is a high level and the control clock signal Fck1 has a rising edge, the forward output terminal Q terminal of the D flip-flop receives the third clock signal Fckv_c from the data input terminal D terminal. .
  • the control clock signal Fck1 delays to appear a rising edge.
  • the first clock signal Fckv_a output by the forward output terminal Q of the D flip-flop 4011 is delayed to appear the first rising edge, and the delay is less than one period of the local clock signal Fckv, at this time the second clock signal Fckv_b is low level, the third clock signal Fckv_c is also low level, and the fourth clock signal Fckv_d is also low level.
  • the control clock signal Fck1 After the rising edge of the reference clock signal Fref, when the local clock signal Fckv has a second rising edge, the control clock signal Fck1 also has a second rising edge.
  • the first clock signal Fckv_a is high level
  • the second clock signal Fckv_b When a rising edge occurs, the third clock signal Fckv_c is still low level, and the fourth clock signal Fckv_d is also low level.
  • the control clock signal Fck1 After the rising edge of the reference clock signal Fref, when the third rising edge of the local clock signal Fckv appears, the control clock signal Fck1 also appears the third rising edge, the first clock signal Fckv_a is high level, and the second clock signal Fckv_b is high level, the third clock signal Fckv_c has a rising edge, and the fourth clock signal Fckv_d is also low level.
  • the control clock signal Fck1 also appears the fourth rising edge
  • the first clock signal Fckv_a is high level
  • the second clock signal Fckv_b is high level
  • the third clock signal Fckv_c is high level
  • the fourth clock signal Fckv_d appears a rising edge, and after the rising edge appears, it remains high level until the reference clock signal Fref changes to low level.
  • the forward output Q terminal of the D flip-flop 4014 is also connected to the third input terminal of the OR gate 4016 to receive the fourth clock signal Fckv_d. Then, when the fourth clock signal Fckv_d appears high level , the control clock signal Fck1 clock output by the OR gate 4016 remains high and no rising edge appears. Therefore, the levels output by the positive output terminals of the D flip-flop 4011, D flip-flop 4012, D flip-flop 4013 and D flip-flop 4014 are only controlled by the reference clock signal Fref.
  • the delayer 4015 performs delay processing on the reference clock signal Fref to generate a delayed reference clock signal Fref-dly. It can be seen from Figure 8 that the rising edge of the delayed reference clock signal Fref-dly appears after the rising edge of the reference clock signal Fref, and the high-level duration of the delayed reference clock signal Fref-dly is equal to the high-level duration of the reference clock signal Fref. The duration is the same.
  • the time-to-digital converter 403 is used to determine the local time according to the delayed reference clock signal Fref-dly and the first clock signal Fckv_a in the second to nth cycles within n cycles of the reference clock signal Fref.
  • the reference clock signal Fref is delayed to generate the delayed reference clock signal Fref_dly.
  • the primary purpose of the delay 4015 is to compensate the delay of the D flip-flop 4010 and the OR gate 4016, so that the delayed reference clock signal Fref_dly is compared with The delay time of the reference clock signal Fref is the same as the delay time of the first rising edge of the local clock signal Fckv after the first clock signal Fckv_a is compared with the rising edge of the reference clock signal.
  • the secondary purpose of the delay 4015 is to obtain a measurable second number of unit steps in the incomplete cycle of the local clock signal Fckv.
  • the two-phase synchronous logic circuit 401 also includes a selector 4017, a selector 4018 and a selector 4019; the control end of the two-phase synchronous logic circuit 401 is connected to the control end of the selector 4017 and the control end of the selector 4018. terminal and the control terminal of the selector 4019; the first input terminal of the selector 4017 is connected to the output terminal of the delay device 4015, and the second input terminal of the selector 4017 is connected to the positive output terminal of the D flip-flop 4012.
  • the selector 4017 The output terminal is connected to the first output terminal of the two-phase synchronous logic circuit 401; the first input terminal of the selector 4018 is connected to the forward output terminal of the D flip-flop 4011, and the second input terminal of the selector 4018 is connected to the D flip-flop 4011.
  • the positive output terminal of 4013 and the output terminal of selector 4018 are connected to the second output terminal of the two-phase synchronous logic circuit 401; the first input terminal of selector 4019 is connected to the positive output terminal of D flip-flop 4013 and the selector 4019 The second input terminal is connected to the positive output terminal of the D flip-flop 4014, and the output terminal of the selector 4019 is connected to the third output terminal of the two-phase synchronous logic circuit 401; the two-phase synchronous logic circuit 401 receives the frequency discrimination from the control terminal The control signal Fctl generated by the phase detection logic circuit 404.
  • the two-phase synchronous logic circuit 401 will, in the first cycle of n cycles of the reference clock signal Fref, that is, when the control signal Fctl is at the second level (that is, high level).
  • the second clock signal Fckv_b is transmitted to the first output terminal of the two-phase synchronous logic circuit 401;
  • the third clock signal Fckv_c is transmitted to the second output terminal of the two-phase synchronous logic circuit 401;
  • the fourth clock signal Fckv_d is transmitted to the two-phase synchronous logic circuit 401.
  • the third output terminal of the logic circuit 401 is transmitted to the first cycle of n cycles of the reference clock signal Fref, that is, when the control signal Fctl is at the second level (that is, high level).
  • the second clock signal Fckv_b is transmitted to the first output terminal of the two-phase synchronous logic circuit 401;
  • the third clock signal Fckv_c is transmitted to the second output terminal of the two-phase synchronous logic circuit 401;
  • the data input terminal tdc_in of the time-to-digital converter 403 is connected to the first output terminal of the two-phase synchronous logic circuit 401, and the clock input terminal tdc_clk of the time-to-digital converter 403 is connected to the two-phase synchronous logic.
  • the second output terminal of the circuit 401 and the sampling input terminal tdc_smp terminal of the time-to-digital converter 403 are connected to the third output terminal of the two-phase synchronous logic circuit 401.
  • the time-to-digital converter 403 receives the second clock signal Fckv_b from the data input terminal tdc_in, and receives the third clock signal from the clock input terminal tdc_clk.
  • Fckv_c the self-sampling input terminal tdc_smp terminal receives the Four clock signals Fckv_d, then the time-to-digital converter 403 determines a coefficient based on the second clock signal Fckv_b and the third clock signal Fckv_c.
  • the coefficient is the ratio of the unit step size of the time-to-digital converter 403 to the length of one cycle of the local clock signal. More specifically, the time-to-digital converter 403 quantizes the second clock signal Fckv_b according to the third clock signal Fckv_c to determine the coefficient, and then samples the coefficient according to the third clock signal Fckv_c, and stores the coefficient in the time-to-digital converter 403 , and then transmit the stored coefficients to the frequency and phase detection logic circuit 404.
  • the two-phase synchronous logic circuit 401 will delay the delay from the 2nd cycle to the nth cycle within n cycles of the reference clock signal Fref, that is, when the control signal Fctl is at the first level (ie, low level).
  • the reference clock signal Fref_dly is transmitted to the first output end of the two-phase synchronous logic circuit 401; the selector 4018 transmits the first clock signal Fckv_a to the two-phase when the control signal Fctl is the first level (that is, low level).
  • the data input terminal tdc_in of the time-to-digital converter 403 is connected to the first output terminal of the two-phase synchronous logic circuit 401, and the clock input terminal tdc_clk of the time-to-digital converter 403 is connected to the two-phase synchronous logic.
  • the second output terminal of the circuit 401 , the sampling input terminal tdc_smp terminal of the time-to-digital converter 403 is connected to the third output terminal of the two-phase synchronous logic circuit 401 . Then, in the second to nth cycles within n cycles of the reference clock signal Fref, that is, when the control signal Fctl is the first level (ie, low level), the time-to-digital converter 403
  • the input terminal tdc_in receives the delayed reference clock signal Fref_dly, receives the first clock signal Fckv_a from the clock input terminal tdc_clk, and receives the third clock signal Fckv_c from the sampling input terminal tdc_smp.
  • the time-to-digital converter 403 responds to the delayed reference clock signal Fref_dly.
  • the second number of unit steps in the incomplete cycles of the local clock signal within n cycles of the reference clock signal is determined with the first clock signal Fckv_a. More specifically, the time-to-digital converter 403 quantizes the delayed reference clock signal Fref_dly according to the first clock signal Fckv_a, and determines the second unit step of the incomplete cycle of the local clock signal within n cycles of the reference clock signal. quantity, and then samples the second quantity according to the third clock signal Fckv_c, stores the second quantity in the time-to-digital converter 403, and then transmits the stored second quantity to the frequency and phase detection logic circuit 404.
  • the two-phase synchronous logic circuit in the frequency and phase detector 400 is the two-phase synchronous logic circuit 401 shown in Figure 9, and the counter 402 in the frequency and phase detector 400 is a counter implemented by the analog design method, then
  • the frequency and phase detector 400 does not need to frequency divide the local clock signal Fckv, so the frequency and phase detector 400 determines the frequency difference between the target clock signal Fckv1 and the local clock signal Fckv according to the following formula 4:
  • the frequency identification accuracy of the frequency and phase detector 400 is the ratio of the unit step size of the time-to-digital converter to the length of one cycle of the local clock signal, and overcomes the metastable problem of asynchronous sampling. Therefore, the above formula 4
  • the minimum value is the ratio of the unit step size of the time-to-digital converter to the length of one cycle of the local clock signal, resulting in Equation 5 below.
  • Ltdc represents the unit step of the time-to-digital converter.
  • a counting time window of the above-mentioned frequency and phase detector 400 is:
  • the frequency and phase detector provided by the embodiment of the present application is performing frequency and phase identification processing At this time, the time consumed is increased by 400 times compared with the traditional solution.
  • the embodiment of the present application provides a schematic structural diagram of a phase-locked loop 50.
  • the phase-locked loop 50 includes a filter 501, an oscillation circuit 502 and a frequency and phase detector 400; wherein the frequency and phase detector 400 is connected through the filter 501 To the oscillation circuit 502, the oscillation circuit 502 is also connected to the frequency and phase detector 400; the frequency and phase detector 400 receives the reference clock signal Fref, the local clock signal Fckv generated by the oscillation circuit 502, and the target clock signal Fckv1. According to the reference clock signal Fref and the local clock signal Fckv determine the phase difference between the reference clock signal Fref and the local clock signal Fckv within n cycles of the reference clock signal Fref.
  • the current frequency and phase detector also receives the target clock signal.
  • the target clock signal is determined, and the target clock signal Fckv1 has a fixed ratio relationship with the reference clock signal Fref. Then according to n cycles of the reference clock signal Fref, The phase difference between the reference clock signal Fref and the local clock signal Fckv, and the target clock signal Fckv1 and the reference clock signal Fref must have a fixed ratio relationship. It can be known that within n cycles of the reference clock signal Fref, the target clock signal Fckv1 and the local clock The phase difference of the signal Fckv. According to the phase difference between the target clock signal Fckv1 and the local clock signal Fckv, a voltage control signal can be generated and transmitted to the filter 501 .
  • the frequency and phase detector 400 may not receive the target clock signal Fckv1, but instead receive the target clock signal Fckv1 and the reference clock signal Fref, which must have a fixed ratio relationship.
  • the filter 501 receives the voltage control signal and generates the control voltage of the oscillation circuit 502 according to the voltage control signal; the oscillation circuit 502 receives the control voltage and adjusts the frequency of the local clock signal Fckv generated by the oscillation circuit 502 under the control of the control voltage.
  • the oscillator circuit 502 may include a voltage-controlled oscillator or a current-controlled oscillator.
  • the current-controlled oscillator includes an oscillator 5021 and four transistors.
  • the transistor is a hole-type metal-oxide-semiconductor field effect transistor (MOSFET, PMOS transistor for short), in which the first end of the PMOS transistor P1 is connected to the level V4 end through the resistor R1.
  • the level V4 terminal provides a high level.
  • the second terminal of the PMOS tube P1 is connected to the first terminal of the PMOS tube P2.
  • the second terminal of the PMOS tube P2 is connected to the control terminal of the oscillator 5021.
  • the control terminal of the PMOS tube P1 receives the voltage.
  • the level signal U1 is low level, the first end and the second end of the PMOS tube P1 are turned on.
  • the level signal U1 is high level, the first end and the second end of the PMOS tube P1 are turned on. terminal is not conductive, the control terminal of the PMOS tube P2 receives the level signal U2.
  • the level signal U2 is low level, the first terminal and the second terminal of the PMOS tube P2 are conductive.
  • the level signal U2 is high, When the level is high, the first end and the second end of the PMOS tube P2 are not conductive; the first end of the PMOS tube P3 is connected to the level V4 end through a resistor.
  • the level V4 end provides a high level, and the second end of the PMOS tube P3
  • the terminal is connected to the first terminal of the PMOS tube P4, the second terminal of the PMOS tube P4 is connected to the control terminal of the oscillator 5021, and the control terminal of the PMOS tube P3 receives the level signal U3.
  • the level signal U3 is low level, The first end and the second end of the PMOS transistor P3 are conductive.
  • the level signal U3 is high level, the first end and the second end of the PMOS transistor P3 are not conductive, and the control end of the PMOS transistor P4 receives the level signal.
  • U4 when the level signal U4 is low level, the first end and the second end of the PMOS tube P4 are turned on.
  • the level signal U5 is high level, the first end and the second end of the PMOS tube P4 are not connected. conduction.
  • the level signal U1 and the level signal U3 are always low level to control the opening of the PMOS tube P1 and the PMOS tube P3.
  • the control voltage transmitted by the filter 501 can control the level signal U2
  • the sum level signal U4 is high level or low level, thereby controlling the opening or closing of the PMOS transistor P2 and the PMOS transistor P4.
  • the number of times that the PMOS transistor P2 and the PMOS transistor P4 are turned on and off will cause the oscillator 5021 to receive different control currents, so that the phase and/or frequency of the local clock signal Fckv generated by the oscillator 5021 changes.
  • embodiments of the present application provide an electronic device, which includes a printed circuit board (PCB), a phase-locked loop disposed on the PCB, or a frequency identification device disposed on the PCB.
  • Phase detector, the phase-locked loop may be the above-mentioned phase-locked loop 50
  • the frequency-frequency phase detector may be the above-mentioned frequency-phase detector 400.
  • the electronic devices include, for example, mobile phones, tablet computers, personal digital assistants (personal digital assistants, PDAs), vehicle-mounted computers, etc.
  • the embodiments of the present application do not place any special restrictions on the specific form of the electronic device.
  • the embodiment of the present application provides a frequency and phase identification method, including:
  • the period length of the reference clock signal is greater than the period length of the local clock signal; and after the rising edge of the reference clock signal, the first clock signal is generated according to the first rising edge of the local clock signal, wherein the rising edge of the first clock signal The rising edge of the second clock signal is not earlier than the first rising edge of the local clock signal; after the rising edge of the reference clock signal, the second clock signal is generated according to the second rising edge of the local clock signal, where the rising edge of the second clock signal is not earlier than the rising edge of the local clock signal.
  • the fourth clock signal is also generated according to the fourth rising edge of the local clock signal after the rising edge of the reference clock signal, wherein the rising edge of the fourth clock signal is not earlier than the fourth rising edge of the local clock signal. a rising edge.
  • the above-mentioned first clock signal, second clock signal, third clock signal and fourth clock signal can be generated according to the following steps: under the control of the reference clock signal, generate an enable signal according to the third level; The received enable signal, local clock signal and fourth clock signal are OR logically processed to generate a control clock signal; under the control of the reference clock signal and the control clock signal, a first clock signal is generated according to the third level; in the reference Under the control of the clock signal and the control clock signal, a second clock signal is generated according to the first clock signal; under the control of the reference clock signal and the control clock signal, a third clock signal is generated according to the second clock signal; under the control of the reference clock signal , and under the control of the control clock signal, generate a fourth clock signal according to the third clock signal; perform delay processing on the reference clock signal to generate a delayed reference clock signal; then determine the reference clock according to the reference clock signal and the first clock signal Within n cycles of the signal, the second number of unit steps in the incomplete cycle of the local clock signal specifically includes
  • n is a positive integer greater than or equal to 2. For example, when the control signal is at the first level, the first number is sampled according to the third clock signal, and the first number is stored.
  • a coefficient is determined based on the second clock signal and the third clock signal, and the coefficient is a ratio of the unit step size of the time-to-digital converter to the length of one cycle of the local clock signal. For example, when the control signal is at the second level, the root The coefficients are sampled according to the fourth clock signal and stored.
  • a second number of unit steps in incomplete cycles of the local clock signal within n cycles of the reference clock signal is also determined based on the reference clock signal and the first clock signal. For example, when the control signal is at the first level, the second quantity is sampled according to the third clock signal, and the second quantity is stored.
  • a first phase difference between the reference clock signal and the local clock signal within n cycles of the reference clock signal is determined.
  • determining the first phase difference between the reference clock signal and the local clock signal within n cycles of the reference clock signal specifically includes: according to the second quantity and the coefficient, Determine the third number of complete cycles of the local clock signal corresponding to the second number; add the first number to the third number to obtain the fourth number of complete cycles of the local clock signal within n cycles of the reference clock signal; according to The reference clock signal and the fourth quantity determine the first phase difference between the reference clock signal and the local clock signal within n cycles of the reference clock signal.
  • the second phase difference is also determined based on the fourth number within n cycles and the fourth number within the next n cycles; the frequency of the local clock signal is determined based on the second phase difference. Then, based on the difference between the frequency of the reference clock signal and the frequency of the local clock signal, the frequency difference between the reference clock signal and the local clock signal can be obtained.
  • control signal is generated according to the following steps: receiving a reference clock signal, generating a control signal according to the reference clock signal, the control signal is the second level in the first period of the reference clock signal; the control signal is in the second period of the reference clock signal. It is the first level within the period from the nth period to the nth period.
  • Embodiments of the present application also provide a computer-readable storage medium that stores computer program code.
  • the electronic device executes the computer program code
  • the electronic device executes the integrated circuit testing method in the above embodiment.
  • the technical solutions of the embodiments of the present application are essentially or contribute to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium , including several instructions to cause a device (which can be a microcontroller, a chip, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of this application.
  • the aforementioned storage media include: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program code.
  • Embodiments of the present application also provide a computer program product.
  • the computer program product When the computer program product is run on an electronic device, it causes the electronic device to perform the above related steps to implement the integrated circuit testing method in the above embodiment.
  • the disclosed devices and methods can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of modules or units is only a logical function division.
  • there may be other division methods for example, multiple units or components may be The combination can either be integrated into another device, or some features can be omitted, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated.
  • the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be separated. Distributed to many different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium.
  • the above contents are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the present application, and should are covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Landscapes

  • Manipulation Of Pulses (AREA)

Abstract

The present application provides a phase-frequency detector, a phase-locked loop, and an electronic device, and relates to the technical field of integrated circuits. The phase-frequency detector is at least one order of magnitude faster and more precise compared to the time at which traditional solutions are depleted when detecting phase and frequency. The phase-frequency detector comprises: a two-phase synchronous logic circuit, a time-to-digital converter, a counter, and a phase-frequency detection logic circuit. The two-phase synchronous logic circuit receives a local clock signal and a reference clock signal; the counter determines a first number of complete periods of the local clock signal during n periods of the reference clock signal; the time-to-digital converter determines a coefficient and a second number of unit steps in an incomplete period of the local clock signal during n periods of the reference clock signal; and the phase-frequency detection logic circuit determines, according to the first number, the second number and the coefficient, a first phase difference between the reference clock signal and the local clock signal during n periods of the reference clock signal.

Description

鉴频鉴相器、锁相环以及电子设备Frequency detectors, phase locked loops and electronic equipment
本申请要求于2022年03月23日提交国家知识产权局、申请号为202210290537.0、申请名称为“鉴频鉴相器、锁相环以及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the priority of the Chinese patent application submitted to the State Intellectual Property Office on March 23, 2022, with the application number 202210290537.0 and the application name "Frequency Phase Detector, Phase Locked Loop and Electronic Equipment", and all its contents have been approved This reference is incorporated into this application.
技术领域Technical field
本申请涉及集成电路技术领域,尤其是涉及一种鉴频鉴相器、锁相环以及电子设备。The present application relates to the field of integrated circuit technology, and in particular to a frequency and phase detector, a phase-locked loop and electronic equipment.
背景技术Background technique
目前,在中央处理器(central processing unit,CPU)以及图形处理器(graphics processing unit,GPU)等的系统中,大多会引入动态调压调频(dynamic voltage and frequency scaling,DVFS)技术,其中,动态调压调频技术可以根据系统运行的不同应用的需要,动态调整系统运行时的系统电压以及本地时钟信号的频率,进而降低系统能耗。Currently, in most systems such as central processing unit (CPU) and graphics processing unit (GPU), dynamic voltage and frequency scaling (DVFS) technology is introduced. Among them, dynamic voltage and frequency scaling (DVFS) technology is introduced. Voltage regulation and frequency regulation technology can dynamically adjust the system voltage and the frequency of the local clock signal when the system is running according to the needs of different applications running the system, thereby reducing system energy consumption.
为了实现对系统运行时的本地时钟信号的频率的调整,首先需要锁定系统运行时的本地时钟信号的频率。锁定系统运行时的本地时钟信号的频率通常需要使用鉴频鉴相器(phase frequency detector,PFD)进行鉴频,也就是确定目标时钟信号和本地时钟信号的频率差,进而使得系统根据频率差确定如何调整本地时钟信号的频率,以实现本地时钟信号的频率对目标时钟信号的频率的锁定。但是,现有的鉴频鉴相器的鉴频精度为1,也就表示现有的鉴频鉴相器可以确定目标时钟信号和本地时钟信号的频率差最小为1,使得该鉴频鉴相器在进行鉴频鉴相处理时,所消耗的时间较长。In order to adjust the frequency of the local clock signal when the system is running, it is first necessary to lock the frequency of the local clock signal when the system is running. Locking the frequency of the local clock signal when the system is running usually requires the use of a phase frequency detector (PFD) for frequency identification, that is, determining the frequency difference between the target clock signal and the local clock signal, so that the system determines the frequency based on the frequency difference. How to adjust the frequency of the local clock signal so that the frequency of the local clock signal is locked to the frequency of the target clock signal. However, the frequency identification accuracy of the existing frequency and phase detector is 1, which means that the existing frequency and phase detector can determine that the frequency difference between the target clock signal and the local clock signal is at least 1, so that the frequency and phase detector When the device performs frequency and phase identification processing, it takes a long time.
发明内容Contents of the invention
本申请实施例提供一种鉴频鉴相器、锁相环以及电子设备,该鉴频鉴相器在进行鉴频鉴相处理时,相比传统方案消耗的时间要快至少一个数量级且精度更高。Embodiments of the present application provide a frequency and phase detector, a phase-locked loop and electronic equipment. When the frequency and phase detector performs frequency and phase detection processing, it consumes at least one order of magnitude faster time and is more accurate than the traditional solution. high.
为达到上述目的,本申请实施例采用如下技术方案:In order to achieve the above objectives, the embodiments of this application adopt the following technical solutions:
第一方面,本申请实施例提供了一种鉴频鉴相器,包括:两相同步逻辑电路、计数器、时间数字转换器以及鉴频鉴相逻辑电路;两相同步逻辑电路,用于接收本地时钟信号和参考时钟信号,参考时钟信号的周期长度大于本地时钟信号的周期长度;在参考时钟信号的上升沿之后,根据本地时钟信号的第一个上升沿生成第一时钟信号,其中,第一时钟信号的上升沿不早于本地时钟信号的第一个上升沿;在参考时钟信号的上升沿之后,根据本地时钟信号的第二个上升沿生成第二时钟信号,其中,第二时钟信号的上升沿不早于本地时钟信号的第二个上升沿;在参考时钟信号的上升沿之后,根据本地时钟信号的第三个上升沿生成第三时钟信号,其中,第三时钟信号的上升沿不早于本地时钟信号的第三个上升沿;计数器,用于确定参考时钟信号的n个周期内,本地时钟信号的完整周期的第一数量,n为大于等于2的正整数;时间数字转换器,用于根据第二时钟信号与第三时钟信号确定系数,系数是时间数字转换器的单位步长与本地时钟信号的一个周期的长度的比例;还用于根据参考时钟信号与第一时钟信号,确定参考时钟信号的n个周期内,本地时钟信号的不完整周期中的单位步长的第二数 量;鉴频鉴相逻辑电路,用于根据第一数量、第二数量、以及系数,确定在参考时钟信号的n个周期内,参考时钟信号与本地时钟信号的第一相位差。在上述的鉴频鉴相器中,两相同步逻辑电路接收参考时钟信号,本地时钟信号,在参考时钟信号的上升沿之后,根据本地时钟信号的第一个上升沿生成第一时钟信号;在参考时钟信号的上升沿之后,根据本地时钟信号的第二个上升沿生成第二时钟信号,在参考时钟信号的上升沿之后,根据本地时钟信号的第三个上升沿生成第三时钟信号。并且,计数器可以确定参考时钟信号的n个周期内,本地时钟信号的完整周期的第一数量,时间数字转换器可以确定参考时钟信号的n个周期内,本地时钟信号的不完整周期中单位步长的第二数量,并且时间数字转换器还可以确定一个系数,这个系数就是时间数字转换器的单位步长与本地时钟信号的一个周期的长度的比例,那么,在鉴频鉴相逻辑电路接收到第一数量、第二数量、以及系数以后,可以根据第一数量、第二数量、以及系数确定参考时钟信号Fref的n个周期内,参考时钟信号与本地时钟信号的第一相位差。这样的鉴频鉴相器,由于时间数字转换器的存在,使得鉴频鉴相的精度提升至时间数字转换器的单位步长与本地时钟信号的一个周期的长度的比例,并且,时间数字转换器的单位步长通常是皮秒(ps)量级的,那么当前的鉴频鉴相器在进行鉴频鉴相处理时,相比传统方案消耗的时间要快至少一个数量级且精度更高。In the first aspect, embodiments of the present application provide a frequency and phase detector, including: a two-phase synchronous logic circuit, a counter, a time-to-digital converter, and a frequency and phase detector; a two-phase synchronous logic circuit for receiving local The clock signal and the reference clock signal, the period length of the reference clock signal is greater than the period length of the local clock signal; after the rising edge of the reference clock signal, the first clock signal is generated according to the first rising edge of the local clock signal, where the first The rising edge of the clock signal is not earlier than the first rising edge of the local clock signal; after the rising edge of the reference clock signal, the second clock signal is generated according to the second rising edge of the local clock signal, where the second clock signal The rising edge is not earlier than the second rising edge of the local clock signal; after the rising edge of the reference clock signal, the third clock signal is generated according to the third rising edge of the local clock signal, where the rising edge of the third clock signal is not Earlier than the third rising edge of the local clock signal; counter, used to determine the first number of complete cycles of the local clock signal within n cycles of the reference clock signal, where n is a positive integer greater than or equal to 2; time-to-digital converter , used to determine the coefficient based on the second clock signal and the third clock signal, the coefficient is the ratio of the unit step size of the time-to-digital converter to the length of one cycle of the local clock signal; also used to determine the coefficient based on the reference clock signal and the first clock signal , determine the second number of unit steps in the incomplete cycles of the local clock signal within n cycles of the reference clock signal quantity; a frequency and phase detection logic circuit, configured to determine the first phase difference between the reference clock signal and the local clock signal within n cycles of the reference clock signal based on the first quantity, the second quantity, and the coefficient. In the above frequency and phase detector, the two-phase synchronization logic circuit receives the reference clock signal and the local clock signal, and generates the first clock signal according to the first rising edge of the local clock signal after the rising edge of the reference clock signal; After the rising edge of the reference clock signal, the second clock signal is generated based on the second rising edge of the local clock signal. After the rising edge of the reference clock signal, the third clock signal is generated based on the third rising edge of the local clock signal. Furthermore, the counter can determine the first number of complete cycles of the local clock signal within n cycles of the reference clock signal, and the time-to-digital converter can determine the unit steps of the incomplete cycles of the local clock signal within n cycles of the reference clock signal. The second longer number, and the time-to-digital converter can also determine a coefficient. This coefficient is the ratio of the unit step size of the time-to-digital converter to the length of one cycle of the local clock signal. Then, when the frequency identification and phase identification logic circuit receives After reaching the first number, the second number, and the coefficient, the first phase difference between the reference clock signal and the local clock signal within n cycles of the reference clock signal Fref can be determined based on the first number, the second number, and the coefficient. For such a frequency and phase detector, due to the existence of the time-to-digital converter, the accuracy of the frequency and phase identification is improved to the ratio of the unit step of the time-to-digital converter to the length of one cycle of the local clock signal, and the time-to-digital conversion The unit step size of the detector is usually on the order of picoseconds (ps). Therefore, when the current frequency and phase detector performs frequency and phase identification processing, it consumes at least one order of magnitude faster time and has higher accuracy than the traditional solution.
可选的,鉴频鉴相逻辑电路,具体用于根据第二数量以及系数,确定第二数量对应的本地时钟信号的完整周期的第三数量;将第一数量加上第三数量,得到在参考时钟信号的n个周期内,本地时钟信号的完整周期的第四数量;根据参考时钟信号与第四数量,确定在参考时钟信号的n个周期内,参考时钟信号与本地时钟信号的第一相位差。Optionally, the frequency and phase identification logic circuit is specifically used to determine the third number of complete cycles of the local clock signal corresponding to the second number according to the second number and the coefficient; add the first number to the third number to obtain Within n cycles of the reference clock signal, the fourth number of complete cycles of the local clock signal; based on the reference clock signal and the fourth number, determine the first number of complete cycles of the reference clock signal and the local clock signal within n cycles of the reference clock signal. phase difference.
可选的,鉴频鉴相逻辑电路,还用于根据n个周期内的第四数量,以及下一个n个周期内的第四数量,确定第二相位差;根据第二相位差确定本地时钟信号的频率。在该可选方案中,根据相位与频率的关系,鉴频鉴相器根据相邻两个n个周期获取到第四数量,即可获取本地时钟信号的频率,使得该鉴频鉴相器同时拥有鉴频与鉴相功能。Optionally, the frequency and phase identification logic circuit is also used to determine the second phase difference based on the fourth number within n cycles and the fourth number within the next n cycles; determine the local clock based on the second phase difference. The frequency of the signal. In this optional solution, according to the relationship between phase and frequency, the frequency and phase detector obtains the fourth number based on two adjacent n cycles, which can obtain the frequency of the local clock signal, so that the frequency and phase detector simultaneously It has frequency identification and phase identification functions.
可选的,两相同步逻辑电路,在参考时钟信号的上升沿之后,根据本地时钟信号的第四个上升沿生成第四时钟信号,其中,第四时钟信号的上升沿不早于本地时钟信号的第四个上升沿;两相同步逻辑电路,还用于在两相同步逻辑电路的控制端接收的鉴频鉴相逻辑电路生成的控制信号,在控制信号为第一电平时,将参考时钟信号传输至时间数字转换器的数据输入端,将第一时钟信号传输至时间数字转换器的时钟输入端,将第三时钟信号传输至时间数字转换器的采样输入端;在控制信号为第二电平时,将第二时钟信号传输至时间数字转换器的数据输入端,将第三时钟信号传输至时间数字转换器的时钟输入端,将第四时钟信号传输至时间数字转换器的采样输入端。Optionally, the two-phase synchronous logic circuit generates a fourth clock signal based on the fourth rising edge of the local clock signal after the rising edge of the reference clock signal, wherein the rising edge of the fourth clock signal is no earlier than the local clock signal. The fourth rising edge of the two-phase synchronous logic circuit is also used for the control signal generated by the frequency and phase detection logic circuit received at the control end of the two-phase synchronous logic circuit. When the control signal is at the first level, the reference clock The signal is transmitted to the data input terminal of the time-to-digital converter, the first clock signal is transmitted to the clock input terminal of the time-to-digital converter, and the third clock signal is transmitted to the sampling input terminal of the time-to-digital converter; when the control signal is the second level, the second clock signal is transmitted to the data input terminal of the time-to-digital converter, the third clock signal is transmitted to the clock input terminal of the time-to-digital converter, and the fourth clock signal is transmitted to the sampling input terminal of the time-to-digital converter. .
可选的,本申请提供了两相同步逻辑电路的具体连接方式。两相同步逻辑电路,包括:第一D触发器、第二D触发器、第三D触发器、第四D触发器、第五D触发器、延时器、以及或门;两相同步逻辑电路的第一输入端连接至第一D触发器的时钟输入端、第一D触发器的置位端、第二D触发器的置位端、第三D触发器的置位端、第四D触发器的置位端、第五D触发器的置位端以及延时器的输入端;两相同步逻辑电路 的第二输入端连接至或门的第一输入端;延时器的输出端连接至两相同步逻辑电路的第一输出端;第一D触发器的数据输入端连接至第三电平端,第一D触发器的反向输出端连接至或门的第二输入端,其中第三电平端提供第三电平;或门的输出端连接至第二D触发器的时钟输入端、第三D触发器的时钟输入端、第四D触发器的时钟输入端以及第五D触发器的时钟输入端;第二D触发器的数据输入端连接至第三电平端,第二D触发器的正向输出端连接至第三D触发器的数据输入端以及两相同步逻辑电路的第二输出端;第三D触发器的正向输出端连接至第四D触发器的数据输入端以及两相同步逻辑电路的第一输出端;第四D触发器的正向输出端连接至第五D触发器的数据输入端、两相同步逻辑电路的第二输出端以及两相同步逻辑电路的第三输出端;第五D触发器的正向输出端连接至或门的第三输入端以及两相同步逻辑电路的第三输出端;两相同步逻辑电路,用于从两相同步逻辑电路的第一输入端接收参考时钟信号,从两相同步逻辑电路的第二输入端接收本地时钟信号;第一D触发器,用于在第一D触发器的置位端以及时钟输入端接收的参考时钟信号的控制下,根据第一D触发器的数据输入端接收的第三电平生成使能信号;或门,用于对接收的使能信号、本地时钟信号以及第五D触发器的正向输出端输出的第四时钟信号进行或逻辑处理,生成控制时钟信号;第二D触发器,用于在第二D触发器的置位端接收的参考时钟信号、以及第二D触发器的时钟输入端接收的控制时钟信号的控制下,根据第二D触发器的数据输入端接收的第三电平生成第一时钟信号;第三D触发器,用于在第三D触发器的置位端接收的参考时钟信号、以及第三D触发器的时钟输入端接收的控制时钟信号的控制下,根据第三D触发器的数据输入端接收的第一时钟信号生成第二时钟信号;第四D触发器,用于在第四D触发器的置位端接收的参考时钟信号、以及第四D触发器的时钟输入端接收的控制时钟信号的控制下,根据第四D触发器的数据输入端接收的第二时钟信号生成第三时钟信号;第五D触发器,用于在第五D触发器的置位端接收的参考时钟信号、以及第五D触发器的时钟输入端接收的控制时钟信号的控制下,根据第五D触发器的数据输入端接收的第三时钟信号生成第四时钟信号;延时器,用于对参考时钟信号进行延时处理,生成延时参考时钟信号;则时间数字转换器,具体用于根据延时参考时钟信号与第一时钟信号,确定参考时钟信号的n个周期内,本地时钟信号的不完整周期中单位步长的第二数量。Optionally, this application provides specific connection methods for two-phase synchronous logic circuits. Two-phase synchronous logic circuit, including: a first D flip-flop, a second D flip-flop, a third D flip-flop, a fourth D flip-flop, a fifth D flip-flop, a delay, and an OR gate; two-phase synchronous logic The first input end of the circuit is connected to the clock input end of the first D flip-flop, the set end of the first D flip-flop, the set end of the second D flip-flop, the set end of the third D flip-flop, and the fourth D flip-flop. The set end of the D flip-flop, the set end of the fifth D flip-flop and the input end of the delay; two-phase synchronous logic circuit The second input terminal is connected to the first input terminal of the OR gate; the output terminal of the delay device is connected to the first output terminal of the two-phase synchronous logic circuit; the data input terminal of the first D flip-flop is connected to the third level terminal, The inverse output terminal of the first D flip-flop is connected to the second input terminal of the OR gate, wherein the third level terminal provides the third level; the output terminal of the OR gate is connected to the clock input terminal of the second D flip-flop, the third The clock input terminal of the D flip-flop, the clock input terminal of the fourth D flip-flop and the clock input terminal of the fifth D flip-flop; the data input terminal of the second D flip-flop is connected to the third level terminal, and the data input terminal of the second D flip-flop is connected to the third level terminal. The positive output terminal is connected to the data input terminal of the third D flip-flop and the second output terminal of the two-phase synchronous logic circuit; the positive output terminal of the third D flip-flop is connected to the data input terminal of the fourth D flip-flop and the two The first output terminal of the two-phase synchronous logic circuit; the forward output terminal of the fourth D flip-flop is connected to the data input terminal of the fifth D flip-flop, the second output terminal of the two-phase synchronous logic circuit, and the third output terminal of the two-phase synchronous logic circuit. Three output terminals; the positive output terminal of the fifth D flip-flop is connected to the third input terminal of the OR gate and the third output terminal of the two-phase synchronous logic circuit; the two-phase synchronous logic circuit is used to obtain the output terminal from the two-phase synchronous logic circuit. The first input terminal receives the reference clock signal and receives the local clock signal from the second input terminal of the two-phase synchronous logic circuit; the first D flip-flop is used to receive the reference clock signal at the setting terminal of the first D flip-flop and the clock input terminal. Under the control of the clock signal, an enable signal is generated according to the third level received by the data input terminal of the first D flip-flop; the OR gate is used to compare the received enable signal, the local clock signal and the positive signal of the fifth D flip-flop. The fourth clock signal output to the output terminal is OR logically processed to generate a control clock signal; the second D flip-flop is used for the reference clock signal received at the set end of the second D flip-flop, and the second D flip-flop. Under the control of the control clock signal received by the clock input terminal, the first clock signal is generated according to the third level received by the data input terminal of the second D flip-flop; the third D flip-flop is used to set the third D flip-flop. Under the control of the reference clock signal received by the bit terminal and the control clock signal received by the clock input terminal of the third D flip-flop, a second clock signal is generated according to the first clock signal received by the data input terminal of the third D flip-flop; A four-D flip-flop, used for controlling the reference clock signal received by the setting terminal of the fourth D flip-flop and the control clock signal received by the clock input terminal of the fourth D flip-flop, according to the data of the fourth D flip-flop. The second clock signal received at the input terminal generates a third clock signal; the fifth D flip-flop is used for the reference clock signal received at the set terminal of the fifth D flip-flop, and the clock input terminal of the fifth D flip-flop receives Under the control of the control clock signal, a fourth clock signal is generated according to the third clock signal received by the data input terminal of the fifth D flip-flop; the delayer is used to delay the reference clock signal and generate a delayed reference clock signal ; The time-to-digital converter is specifically used to determine the second number of unit steps in the incomplete cycles of the local clock signal within n cycles of the reference clock signal based on the delayed reference clock signal and the first clock signal.
可选的,两相同步逻辑电路,还包括第一选择器,第二选择器以及第三选择器;两相同步逻辑电路的控制端连接至第一选择器的控制端、第二选择器的控制端以及第三选择器的控制端;第一选择器的第一输入端连接至延时器的输出端,第一选择器的第二输入端连接至第三D触发器的正向输出端,第二选择器的输出端连接至两相同步逻辑电路的第一输出端;第二选择器的第一输入端连接至第二D触发器的正向输出端,第二选择器的第二输入端连接至第四D触发器的正向输出端,第二选择器的输出端连接至两相同步逻辑电路的第二输出端;第三选择器的第一输入端连接至第四D触发器的正向输出端,第三选择器的第二输入端连接至第五D触发器的正向输出端,第三选择器的输出端连接至两相同步逻辑电路的第三输出端;两相同步逻辑电路,从两相同步逻辑电路的控制端接收鉴频鉴相逻辑电路生成的控制信号;第一选择器,在控制信号为第一电平时将延时参考信号通过两相同步逻辑电路的第一输出端传输至时间数字 转换器的数据输入端;在控制信号为第二电平时将第二时钟信号通过两相同步逻辑电路的第一输出端传输至时间数字转换器的数据输入端;第二选择器,在控制信号为第一电平时将第一时钟信号通过两相同步逻辑电路的第二输出端传输至时间数字转换器的时钟输入端;在控制信号为第二电平时将第三时钟信号通过两相同步逻辑电路的第二输出端传输至时间数字转换器的时钟输入端;第三选择器,在控制信号为第一电平时将第三时钟信号通过两相同步逻辑电路的第三输出端传输至时间数字转换器的采样输入端;在控制信号为第二电平时将第四时钟信号通过两相同步逻辑电路的第三输出端传输至时间数字转换器的采样输入端。Optionally, the two-phase synchronous logic circuit also includes a first selector, a second selector and a third selector; the control end of the two-phase synchronous logic circuit is connected to the control end of the first selector and the second selector. The control end and the control end of the third selector; the first input end of the first selector is connected to the output end of the delayer, and the second input end of the first selector is connected to the positive output end of the third D flip-flop. , the output terminal of the second selector is connected to the first output terminal of the two-phase synchronous logic circuit; the first input terminal of the second selector is connected to the positive output terminal of the second D flip-flop, and the second terminal of the second selector The input terminal is connected to the positive output terminal of the fourth D flip-flop, the output terminal of the second selector is connected to the second output terminal of the two-phase synchronous logic circuit; the first input terminal of the third selector is connected to the fourth D flip-flop. The forward output end of the third selector is connected to the forward output end of the fifth D flip-flop, and the output end of the third selector is connected to the third output end of the two-phase synchronous logic circuit; the two The one-phase synchronous logic circuit receives the control signal generated by the frequency and phase detection logic circuit from the control end of the two-phase synchronous logic circuit; the first selector passes the delayed reference signal through the two-phase synchronous logic circuit when the control signal is at the first level. The first output of the time digital the data input terminal of the converter; when the control signal is at the second level, the second clock signal is transmitted to the data input terminal of the time-to-digital converter through the first output terminal of the two-phase synchronous logic circuit; the second selector, when the control signal When the control signal is at the second level, the first clock signal is transmitted to the clock input terminal of the time-to-digital converter through the second output terminal of the two-phase synchronous logic circuit; when the control signal is at the second level, the third clock signal is transmitted through the two-phase synchronous logic circuit The second output end of the circuit is transmitted to the clock input end of the time-to-digital converter; the third selector transmits the third clock signal to the time digital through the third output end of the two-phase synchronous logic circuit when the control signal is the first level. The sampling input terminal of the converter; when the control signal is at the second level, the fourth clock signal is transmitted to the sampling input terminal of the time-to-digital converter through the third output terminal of the two-phase synchronous logic circuit.
可选的,计数器,还用于在鉴频鉴相逻辑电路生成的控制信号为第一电平时,根据第三时钟信号对第一数量进行采样,将第一数量存储于计数器中。Optionally, the counter is also used to sample the first number according to the third clock signal when the control signal generated by the frequency and phase detection logic circuit is at the first level, and store the first number in the counter.
可选的,时间数字转换器,还用于在鉴频鉴相逻辑电路生成的控制信号为第一电平时,根据第三时钟信号对第二数量进行采样,将第二数量存储于时间数字转换器中。Optionally, the time-to-digital converter is also used to sample the second quantity according to the third clock signal when the control signal generated by the frequency and phase detection logic circuit is at the first level, and store the second quantity in the time-to-digital conversion in the vessel.
可选的,时间数字转换器,还用于在控制信号为所述第二电平时,根据第四时钟信号对系数进行采样,将系数存储于时间数字转换器中。Optionally, the time-to-digital converter is also configured to sample the coefficients according to the fourth clock signal when the control signal is the second level, and store the coefficients in the time-to-digital converter.
可选的,鉴频鉴相逻辑电路,还用于接收参考时钟信号,根据参考时钟信号生成控制信号,控制信号在参考时钟信号的第1个周期内为第二电平;控制信号在参考时钟信号的第2个周期至第n个周期内为第一电平。Optionally, the frequency and phase detection logic circuit is also used to receive a reference clock signal and generate a control signal according to the reference clock signal. The control signal is the second level in the first cycle of the reference clock signal; the control signal is at the second level in the first cycle of the reference clock signal. The first level is from the 2nd cycle to the nth cycle of the signal.
第二方面,提供了一种锁相环,锁相环包括滤波器,振荡电路以及如上述第一方面任一项所述的鉴频鉴相器;鉴频鉴相器通过滤波器连接至振荡电路,振荡电路还连接至鉴频鉴相器;鉴频鉴相器,接收参考时钟信号、振荡电路生成的本地时钟信号以及目标时钟信号,根据参考时钟信号、本地时钟信号以及目标时钟信号,确定目标时钟信号与本地时钟信号在参考时钟信号的n个周期内的第三相位差,根据第三相位差生成电压控制信号;滤波器,接收电压控制信号,根据电压控制信号生成振荡电路的控制电压;振荡电路,接收控制电压,在控制电压的控制下调整振荡电路生成的本地时钟信号的频率。In a second aspect, a phase-locked loop is provided. The phase-locked loop includes a filter, an oscillation circuit and a frequency and phase detector as described in any one of the above-mentioned first aspects; the frequency and phase detector is connected to the oscillator through the filter. circuit, the oscillation circuit is also connected to the frequency and phase detector; the frequency and phase detector receives the reference clock signal, the local clock signal generated by the oscillation circuit, and the target clock signal, and determines based on the reference clock signal, the local clock signal, and the target clock signal. The third phase difference between the target clock signal and the local clock signal within n cycles of the reference clock signal generates a voltage control signal based on the third phase difference; the filter receives the voltage control signal and generates the control voltage of the oscillation circuit based on the voltage control signal ; The oscillation circuit receives the control voltage and adjusts the frequency of the local clock signal generated by the oscillation circuit under the control of the control voltage.
第三方面,提供了一种电子设备,电子设备包括印刷电路板,还包括:设置于印刷电路板上的如上述第二方面所述的锁相环,或者设置于印刷电路板上的如上述第一方面所述的鉴频鉴相器。In a third aspect, an electronic device is provided. The electronic device includes a printed circuit board, and further includes: a phase-locked loop as described in the second aspect provided on the printed circuit board, or a phase-locked loop as described in the second aspect provided on the printed circuit board. The frequency and phase detector described in the first aspect.
第四方面,提供了一种鉴频鉴相方法,包括:接收本地时钟信号和参考时钟信号;参考时钟信号的周期长度大于本地时钟信号的周期长度;在参考时钟信号的上升沿之后,根据本地时钟信号的第一个上升沿生成第一时钟信号,其中,第一时钟信号的上升沿不早于本地时钟信号的第一个上升沿;在参考时钟信号的上升沿之后,根据本地时钟信号的第二个上升沿生成第二时钟信号,其中,第二时钟信号的上升沿不早于本地时钟信号的第二个上升沿;在参考时钟信号的上升沿之后,根据本地时钟信号的第三个上升沿生成第三时钟信号,其中,第三时钟信号的上升沿不早于本地时钟信号的第三个上升沿;确定参考时钟信号的n个周期内,本地时钟信号的完整周期的第一数量,n为大于等于2的正整数;根据第二时钟信号与第三时钟信号确定系数,系数是时间数字转换器的单位步长与本地时钟信号的一个周期的长度的比例;还根据参考时钟信号与第一时钟信号,确定参考时钟信号的n个周期内,本地时钟信号的不完整周 期中的单位步长的第二数量;根据第一数量、第二数量、以及系数,确定在参考时钟信号的n个周期内,参考时钟信号与本地时钟信号的第一相位差。The fourth aspect provides a frequency and phase identification method, which includes: receiving a local clock signal and a reference clock signal; the period length of the reference clock signal is greater than the period length of the local clock signal; after the rising edge of the reference clock signal, according to the local The first rising edge of the clock signal generates the first clock signal, wherein the rising edge of the first clock signal is not earlier than the first rising edge of the local clock signal; after the rising edge of the reference clock signal, according to the The second rising edge generates a second clock signal, wherein the rising edge of the second clock signal is no earlier than the second rising edge of the local clock signal; after the rising edge of the reference clock signal, according to the third rising edge of the local clock signal The rising edge generates a third clock signal, wherein the rising edge of the third clock signal is no earlier than the third rising edge of the local clock signal; determining the first number of complete cycles of the local clock signal within n cycles of the reference clock signal , n is a positive integer greater than or equal to 2; the coefficient is determined based on the second clock signal and the third clock signal, and the coefficient is the ratio of the unit step size of the time-to-digital converter to the length of one cycle of the local clock signal; also based on the reference clock signal and the first clock signal, determine the incomplete cycles of the local clock signal within n cycles of the reference clock signal A second number of unit steps in the period; according to the first number, the second number, and the coefficient, determine the first phase difference between the reference clock signal and the local clock signal within n cycles of the reference clock signal.
可选的,根据第一数量、第二数量、以及系数,确定在参考时钟信号的n个周期内,参考时钟信号与本地时钟信号的第一相位差,具体包括:根据第二数量以及系数,确定第二数量对应的本地时钟信号的完整周期的第三数量;将第一数量加上第三数量,得到在参考时钟信号的n个周期内,本地时钟信号的完整周期的第四数量;根据参考时钟信号与第四数量,确定在参考时钟信号的n个周期内,参考时钟信号与本地时钟信号的第一相位差。Optionally, determining the first phase difference between the reference clock signal and the local clock signal within n cycles of the reference clock signal according to the first number, the second number, and the coefficient includes: according to the second number and the coefficient, Determine the third number of complete cycles of the local clock signal corresponding to the second number; add the first number to the third number to obtain the fourth number of complete cycles of the local clock signal within n cycles of the reference clock signal; according to The reference clock signal and the fourth quantity determine the first phase difference between the reference clock signal and the local clock signal within n cycles of the reference clock signal.
可选的,根据n个周期内的第四数量,以及下一个n个周期内的第四数量,确定第二相位差;根据第二相位差确定本地时钟信号的频率。Optionally, determine the second phase difference based on the fourth number within n cycles and the fourth number within the next n cycles; determine the frequency of the local clock signal based on the second phase difference.
可选的,接收本地时钟信号和参考时钟信号之后,还包括:在参考时钟信号的上升沿之后,根据本地时钟信号的第四个上升沿生成第四时钟信号,其中,第四时钟信号的上升沿不早于本地时钟信号的第四个上升沿。Optionally, after receiving the local clock signal and the reference clock signal, the method further includes: after the rising edge of the reference clock signal, generating a fourth clock signal according to the fourth rising edge of the local clock signal, wherein the rising edge of the fourth clock signal edge no earlier than the fourth rising edge of the local clock signal.
可选的,接收本地时钟信号和参考时钟信号之后,包括:在参考时钟信号的控制下,根据第三电平生成使能信号;对接收的使能信号、本地时钟信号以及第四时钟信号进行或逻辑处理,生成控制时钟信号;在参考时钟信号、以及控制时钟信号的控制下,根据第三电平生成第一时钟信号;在参考时钟信号、以及控制时钟信号的控制下,根据第一时钟信号生成第二时钟信号;在参考时钟信号、以及控制时钟信号的控制下,根据第二时钟信号生成第三时钟信号;在参考时钟信号、以及控制时钟信号的控制下,根据第三时钟信号生成第四时钟信号;对参考时钟信号进行延时处理,生成延时参考时钟信号;则根据参考时钟信号与第一时钟信号,确定参考时钟信号的n个周期内,本地时钟信号的不完整周期中的单位步长的第二数量,具体包括:根据延时参考时钟信号与第一时钟信号,确定参考时钟信号的n个周期内,本地时钟信号的不完整周期中单位步长的第二数量。Optionally, after receiving the local clock signal and the reference clock signal, the method includes: generating an enable signal according to the third level under the control of the reference clock signal; and performing the processing on the received enable signal, the local clock signal and the fourth clock signal. or logical processing to generate a control clock signal; under the control of the reference clock signal and the control clock signal, generate the first clock signal according to the third level; under the control of the reference clock signal and the control clock signal, according to the first clock signal The signal generates a second clock signal; under the control of the reference clock signal and the control clock signal, a third clock signal is generated according to the second clock signal; under the control of the reference clock signal and the control clock signal, a third clock signal is generated The fourth clock signal; perform delay processing on the reference clock signal to generate a delayed reference clock signal; then, according to the reference clock signal and the first clock signal, determine within n cycles of the reference clock signal, among the incomplete cycles of the local clock signal The second number of unit steps specifically includes: determining the second number of unit steps in the incomplete cycles of the local clock signal within n cycles of the reference clock signal based on the delayed reference clock signal and the first clock signal.
可选的,还包括:在控制信号为第一电平时,根据第三时钟信号对第一数量进行采样,将第一数量存储。Optionally, the method further includes: when the control signal is at the first level, sampling the first number according to the third clock signal, and storing the first number.
可选的,还包括:在控制信号为第一电平时,根据第三时钟信号对第二数量进行采样,将第二数量存储。Optionally, the method further includes: when the control signal is at the first level, sampling the second quantity according to the third clock signal, and storing the second quantity.
可选的,还包括:在控制信号为第二电平时,根据第四时钟信号对系数进行采样,将系数存储。Optionally, the method further includes: when the control signal is at the second level, sampling the coefficient according to the fourth clock signal and storing the coefficient.
可选的,还包括:接收参考时钟信号,根据参考时钟信号生成控制信号,控制信号在参考时钟信号的第1个周期内为第二电平;控制信号在参考时钟信号的第2个周期至第n个周期内为第一电平。Optionally, the method further includes: receiving a reference clock signal, and generating a control signal according to the reference clock signal. The control signal is at the second level during the first cycle of the reference clock signal; the control signal is at the second level during the second cycle of the reference clock signal. It is the first level in the nth cycle.
第五方面,提供了一种计算机可读存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行如上述第四方面任一项所述的鉴频鉴相方法。In a fifth aspect, a computer-readable storage medium is provided, which includes computer instructions. When the computer instructions are run on an electronic device, the electronic device causes the electronic device to perform the frequency and phase identification method as described in any one of the fourth aspects.
第六方面,提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行如上述第四方面任一项所述的鉴频鉴相方法。In a sixth aspect, a computer program product is provided. When the computer program product is run on an electronic device, it causes the electronic device to execute the frequency and phase identification method described in any one of the fourth aspects.
其中,第二方面至第六方面中任一种可能实现方式中所带来的技术效果可参见上述第一方面任一项不同的实现方式所带来的技术效果,此处不再赘述。 Among them, the technical effects brought about by any one of the possible implementation methods of the second to sixth aspects can be referred to the technical effects brought by any different implementation methods of the above-mentioned first aspect, and will not be described again here.
附图说明Description of the drawings
图1为本申请的实施例一提供了D触发器的结构示意图;Figure 1 is a schematic structural diagram of a D flip-flop according to Embodiment 1 of the present application;
图2为本申请的实施例一提供了锁相环的结构示意图;Figure 2 is a schematic structural diagram of a phase-locked loop according to Embodiment 1 of the present application;
图3为本申请的实施例一提供的自动频率控制环路的时序示意图;Figure 3 is a timing diagram of an automatic frequency control loop provided by Embodiment 1 of the present application;
图4为本申请的实施例二提供的鉴频鉴相器的一种结构示意图;Figure 4 is a schematic structural diagram of a frequency and phase detector provided in Embodiment 2 of the present application;
图5为本申请的实施例二提供的鉴频鉴相器的时序示意图;Figure 5 is a timing diagram of the frequency and phase detector provided in Embodiment 2 of the present application;
图6为本申请的实施例二提供的控制信号的时序示意图;Figure 6 is a timing diagram of a control signal provided by Embodiment 2 of the present application;
图7为本申请的实施例三提供的两相同步逻辑电路的一种结构示意图;Figure 7 is a schematic structural diagram of a two-phase synchronous logic circuit provided in Embodiment 3 of the present application;
图8为本申请的实施例三提供的两相同步逻辑电路的时序示意图;Figure 8 is a timing diagram of a two-phase synchronous logic circuit provided in Embodiment 3 of the present application;
图9为本申请的实施例三提供的两相同步逻辑电路的另一种结构示意图;Figure 9 is another structural schematic diagram of a two-phase synchronous logic circuit provided in Embodiment 3 of the present application;
图10为本申请的实施例四提供的锁相环的结构示意图;Figure 10 is a schematic structural diagram of a phase-locked loop provided in Embodiment 4 of the present application;
图11为本申请的实施例四提供的振荡器的结构示意图。Figure 11 is a schematic structural diagram of an oscillator provided in Embodiment 4 of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all of the embodiments.
除非另有定义,否则本文所用的所有科技术语都具有与本领域普通技术人员公知的含义相同的含义。在本申请中,“至少一个(层)”是指一个(层)或者多个(层),“多个(层)”是指两个(层)或两个(层)以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b或c中的至少一项(个),可以表示:a,b,c,a和b,a和c,b和c或a、b和c,其中a、b和c可以是单个,也可以是多个。另外,在本申请的实施例中,“第一”、“第二”等字样并不对数量和次序进行限定。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. In this application, "at least one (layer)" refers to one (layer) or multiple (layers), and "multiple (layers)" refers to two (layers) or more than two (layers). "And/or" describes the association of associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A, B can be singular or plural. The character "/" generally indicates that the related objects are in an "or" relationship. "At least one of the following" or similar expressions thereof refers to any combination of these items, including any combination of a single item (items) or a plurality of items (items). For example, at least one of a, b or c can mean: a, b, c, a and b, a and c, b and c or a, b and c, where a, b and c can It can be single or multiple. In addition, in the embodiments of the present application, words such as “first” and “second” do not limit the number and order.
此外,本申请中,“上”、“下”等方位术语是相对于附图中的部件示意置放的方位来定义的,应当理解到,这些方向性术语是相对的概念,它们用于相对于的描述和澄清,其可以根据附图中部件所放置的方位的变化而相应地发生变化。In addition, in this application, directional terms such as "upper" and "lower" are defined relative to the schematically placed directions of the components in the drawings. It should be understood that these directional terms are relative concepts and they are used relative to each other. The descriptions and clarifications may change accordingly according to the changes in the orientation of the components in the drawings.
需要说明的是,本申请中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。It should be noted that in this application, words such as “exemplary” or “for example” are used to represent examples, illustrations or explanations. Any embodiment or design described herein as "exemplary" or "such as" is not intended to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the words "exemplary" or "such as" is intended to present the concept in a concrete manner.
以下对本申请的实施例中的技术术语说明如下:The technical terms used in the embodiments of this application are explained below:
D触发器是一种具有记忆功能,拥用两个稳定状态的信息存储器件,参照图1所示,本申请的实施例提供了D触发器的结构示意图。D触发器拥有三个输入端和两个输出端,三个输入端分别为数据输入端D端、时钟输入端clk端,置位端rstn端,两个输出端分别是正向输出端Q端以及反向输出端端,并且正向输出端Q端输出的电平与反向输出端端输出的电平始终相反。在D触发器中,当置位端rstn端输入低电平(也被称为LOW)时,无论时钟输入端clk端和数据输入端D端输入什么电平, 该D触发器的正向输出端Q端输出低电平。在置位端rstn端输入高电平(也被称为HIGH)时,且时钟输入端clk端的出现一个上升沿时(也就是时钟输入端clk端输入的电平从低电平变成高电平),该D触发器的正向输出端Q端输出的电平与数据输入端D端输入的电平相同;在置位端rstn端输入高电平(也被称为HIGH)时,且时钟输入端clk端输入低电平时,该D触发器的正向输出端Q端输出的电平与前一时刻的正向输出端Q端输出的电平保持一致。A D flip-flop is an information storage device with a memory function and two stable states. Referring to Figure 1, an embodiment of the present application provides a schematic structural diagram of a D flip-flop. The D flip-flop has three input terminals and two output terminals. The three input terminals are the data input terminal D terminal, the clock input terminal clk terminal, and the set terminal rstn terminal. The two output terminals are the forward output terminal Q terminal and the Reverse output terminal, and the level output by the forward output terminal Q terminal is the same as the reverse output terminal The level of the terminal output is always opposite. In the D flip-flop, when the set terminal rstn terminal inputs a low level (also called LOW), no matter what level the clock input terminal clk terminal and the data input terminal D terminal input, The positive output terminal Q terminal of the D flip-flop outputs a low level. When the setting terminal rstn terminal inputs a high level (also called HIGH), and a rising edge occurs at the clock input terminal clk terminal (that is, the level input at the clock input terminal clk terminal changes from low level to high level) level), the level output by the positive output terminal Q terminal of the D flip-flop is the same as the input level input by the data input terminal D terminal; when the set terminal rstn terminal inputs a high level (also called HIGH), and When the clock input terminal clk inputs a low level, the level output by the forward output terminal Q of the D flip-flop remains consistent with the level output by the forward output terminal Q at the previous moment.
目前,在中央处理器(central processing unit,CPU)以及图形处理器(graphics processing unit,GPU)等的系统中,大多会引入动态调压调频(dynamic voltage and frequency scaling,DVFS)技术,其中,动态调压调频技术可以根据系统运行的不同应用的需要,动态调整系统运行时的系统电压以及本地时钟信号的频率,进而降低系统能耗。Currently, in most systems such as central processing unit (CPU) and graphics processing unit (GPU), dynamic voltage and frequency scaling (DVFS) technology is introduced. Among them, dynamic voltage and frequency scaling (DVFS) technology is introduced. Voltage regulation and frequency regulation technology can dynamically adjust the system voltage and the frequency of the local clock signal when the system is running according to the needs of different applications running the system, thereby reducing system energy consumption.
示例性的,动态调压调频技术的基本流程包括:采集与系统负载有关的信号,计算当前时间段的系统负载;根据当前时间段的系统负载,预测系统在下一个时间段需要的性能;将预测到的性能转换成系统运行时需要的本地时钟信号的频率;根据需要的本地时钟信号的频率计算系统运行时的系统电压,通知系统中的电源管理模块将系统电压提供给系统。For example, the basic process of dynamic voltage and frequency modulation technology includes: collecting signals related to system load, calculating the system load in the current time period; predicting the performance required by the system in the next time period based on the system load in the current time period; predicting The obtained performance is converted into the frequency of the local clock signal required when the system is running; the system voltage when the system is running is calculated based on the required frequency of the local clock signal, and the power management module in the system is notified to provide the system voltage to the system.
为了实现对系统运行时的本地时钟信号的频率的调整,首先需要锁定系统运行时的本地时钟信号的频率。现有的锁相环(phase locked loop,PLL)或者锁频环(frequency locked loop,FLL)均可以实现锁定系统运行时的本地时钟信号的频率的目的。In order to adjust the frequency of the local clock signal when the system is running, it is first necessary to lock the frequency of the local clock signal when the system is running. The existing phase locked loop (PLL) or frequency locked loop (FLL) can achieve the purpose of locking the frequency of the local clock signal when the system is running.
以数字架构的锁相环为例,参照图2所示,本申请的实施例提供了锁相环20的结构示意图,锁相环20包括鉴频鉴相器201,环路滤波器(loop filter,LF)202,压控振荡器(voltage control oscillator,VCO)203,鉴频鉴相器201的第一输入端接收参考时钟信号Fref,鉴频鉴相器201的输出端通过环路滤波器202连接至压控振荡器203,压控振荡器203连接至鉴频鉴相器201的第二输入端。其中,压控振荡器203用于生成本地时钟信号Fckv,将本地时钟信号Fckv传输至鉴频鉴相器201的第二输入端,鉴频鉴相器201比较本地时钟信号Fckv以及参考时钟信号Fref的相位差,根据相位差生成电压控制信号Ud,将电压控制信号Ud通过鉴频鉴相器201的输出端传输至环路滤波器202,环路滤波器202接收电压控制信号Ud,对电压控制信号Ud进行滤波生成压控振荡器203的控制电压Uc,将控制电压Uc传输至压控振荡器203,以使得压控振荡器203对本地时钟信号Fckv的频率和相位进行调整,实现本地时钟信号Fckv的频率和相位对参考时钟信号Fref的频率和相位的锁定。Taking the digital architecture phase-locked loop as an example, with reference to Figure 2, the embodiment of the present application provides a schematic structural diagram of the phase-locked loop 20. The phase-locked loop 20 includes a frequency detector 201, a loop filter (loop filter). , LF) 202, voltage control oscillator (VCO) 203, the first input end of the frequency and phase detector 201 receives the reference clock signal Fref, and the output end of the frequency and phase detector 201 passes through the loop filter 202 Connected to the voltage controlled oscillator 203 , the voltage controlled oscillator 203 is connected to the second input end of the frequency and phase detector 201 . Among them, the voltage controlled oscillator 203 is used to generate the local clock signal Fckv, and transmit the local clock signal Fckv to the second input end of the frequency and phase detector 201. The frequency and phase detector 201 compares the local clock signal Fckv and the reference clock signal Fref. The phase difference of The signal Ud is filtered to generate the control voltage Uc of the voltage-controlled oscillator 203, and the control voltage Uc is transmitted to the voltage-controlled oscillator 203, so that the voltage-controlled oscillator 203 adjusts the frequency and phase of the local clock signal Fckv to realize the local clock signal. The frequency and phase of Fckv are locked to the frequency and phase of the reference clock signal Fref.
需要说明的是,在鉴频鉴相器201用于比较本地时钟信号Fckv以及参考时钟信号Fref的频率时,该数字架构的锁相环也可以被称为数字架构的锁频环。It should be noted that when the frequency and phase detector 201 is used to compare the frequencies of the local clock signal Fckv and the reference clock signal Fref, the phase-locked loop of the digital architecture may also be called a frequency-locked loop of the digital architecture.
示例性的,在数字架构的锁相环中,通常也会存在一个目标时钟信号,其中,目标时钟信号与参考时钟信号都是确定的,并且目标时钟信号与参考时钟信号有固定的比值关系。该锁相环为了实现快速锁相的目的,通常是先锁频,再锁相的,也就是先将本地时钟信号与目标时钟信号的频率对准,再将本地时钟信号与目标时钟信号的相位对准。其中,为了实现数字结构的锁相环的锁频,大多会在数字架构的锁相环中附 加一个自动频率控制(automatic frequency control,AFC)环路,其中,自动频率控制环路需要鉴频,也就是确定目标时钟信号与本地时钟信号的频率差,该自动频率控制环路往往是利用参考时钟信号Fref构造一个计数时间窗,并且在此计数时间窗内对目标时钟信号进行计数生成目标数量,也在此计数时间窗内对本地时钟信号进行计数生成本地数量,然后计算目标数量与本地数量之间的差值,该差值就是目标时钟信号与本地时钟信号的等效频率差。For example, in a phase-locked loop of a digital architecture, there is usually a target clock signal, in which both the target clock signal and the reference clock signal are determined, and the target clock signal and the reference clock signal have a fixed ratio relationship. In order to achieve fast phase locking, the phase-locked loop is usually frequency-locked first and then phase-locked, that is, first aligning the frequency of the local clock signal with the target clock signal, and then aligning the phase of the local clock signal with the target clock signal. alignment. Among them, in order to realize the frequency locking of the digital structure phase-locked loop, most of them will be attached to the digital structure phase-locked loop. Add an automatic frequency control (AFC) loop. The automatic frequency control loop requires frequency identification, that is, to determine the frequency difference between the target clock signal and the local clock signal. The automatic frequency control loop often uses a reference The clock signal Fref constructs a counting time window, and within this counting time window, the target clock signal is counted to generate the target quantity. The local clock signal is also counted within this counting time window to generate the local quantity, and then the target quantity and the local quantity are calculated. The difference between them is the equivalent frequency difference between the target clock signal and the local clock signal.
其中,为了增加计数时间,自动频率控制环路往往会对参考时钟信号Fref进行N分频,由于本地时钟信号的频率通常是GHz量级,但是数字架构中的频率往往很难实现GHz量级,因此也需要对本地时钟信号进行分频,分频到100MHz量级,以满足当前数字结构中的频率要求。参照图3所示,本申请的实施例提供的一种自动频率控制环路的时序示意图,图3包括参考时钟信号Fref的时序,参考时钟信号Fref的进行N分频的时序,目标时钟信号Fckv1的时序,目标时钟信号Fckv1进行M分频的时序。示例性的,参照图3所示,数字锁相环中的自动频率控制环路根据下述公式1确定目标时钟信号Fckv1与本地时钟信号Fckv的等效频率差:
Among them, in order to increase the counting time, the automatic frequency control loop often divides the reference clock signal Fref by N. Since the frequency of the local clock signal is usually in the GHz level, it is often difficult to achieve the GHz level in digital architecture. Therefore, it is also necessary to divide the local clock signal to the 100MHz level to meet the frequency requirements in the current digital structure. Referring to Figure 3, a timing diagram of an automatic frequency control loop provided by an embodiment of the present application is shown. Figure 3 includes the timing of the reference clock signal Fref, the timing of N-dividing the reference clock signal Fref, and the target clock signal Fckv1 The timing of the target clock signal Fckv1 is divided by M. For example, referring to Figure 3, the automatic frequency control loop in the digital phase-locked loop determines the equivalent frequency difference between the target clock signal Fckv1 and the local clock signal Fckv according to the following formula 1:
在公式1中,参考时钟信号Fref的周期为Tref,由于构造的计数时间窗是对参考时钟信号Fref进行N分频,因此计数时间窗可以表示为N*Tref。目标时钟信号Fckv1的周期为Tckv1,并且对目标时钟信号Fckv1进行M分频,因此目标时钟信号Fckv1分频后的一个周期为M*Tckv1;本地时钟信号Fckv的周期为Tckv,并且计数器对本地时钟信号Fckv进行M分频,因此本地时钟信号Fckv分频后的一个周期为M*Tckv。其中,公式1中的第一项表示参考时钟信号Fref的一个计数时间窗内对目标时钟信号Fckv1进行计数所得到的目标数量,公式1中的第二项表示参考时钟信号Fref的一个计数时间窗内,对本地时钟信号Fckv进行计数所得到的本地数量,那么第一项减去第二项,就可以确定参考时钟信号Fref的一个计数周期内,目标时钟信号Fckv1与本地时钟信号Fckv的等效频率差。In Formula 1, the period of the reference clock signal Fref is Tref. Since the constructed counting time window divides the reference clock signal Fref by N, the counting time window can be expressed as N*Tref. The period of the target clock signal Fckv1 is Tckv1, and the target clock signal Fckv1 is divided by M, so one period after the target clock signal Fckv1 is divided is M*Tckv1; the period of the local clock signal Fckv is Tckv, and the counter The signal Fckv is divided by M, so one cycle after the local clock signal Fckv is divided is M*Tckv. Among them, the first term in formula 1 Indicates the target number obtained by counting the target clock signal Fckv1 within a counting time window of the reference clock signal Fref, the second term in Formula 1 Indicates the local number obtained by counting the local clock signal Fckv within a counting time window of the reference clock signal Fref. Then the first term minus the second term can determine the target clock within a counting period of the reference clock signal Fref. The equivalent frequency difference between the signal Fckv1 and the local clock signal Fckv.
其中,在计数时间窗内对目标时钟信号Fckv1进行计数时为异步采样,异步采样存在亚稳态问题,采样误差最小为1,并且上述的自动频率控制环路的鉴频精度为1,也就表示现有的自动频率控制环路可以确定目标时钟信号和本地时钟信号的等效频差最小为1,那么可以确定,上述公式1的绝对值最小为2,由此得到下述公式2。
Among them, when counting the target clock signal Fckv1 within the counting time window, it is asynchronous sampling. Asynchronous sampling has a metastable problem, the minimum sampling error is 1, and the frequency identification accuracy of the above-mentioned automatic frequency control loop is 1, that is, It means that the existing automatic frequency control loop can determine that the equivalent frequency difference between the target clock signal and the local clock signal is at least 1. Then it can be determined that the absolute value of the above formula 1 is at least 2, and the following formula 2 is obtained.
根据公式2可知,上述的自动频率控制环路的构造的计数时间窗为:
According to Formula 2, it can be seen that the counting time window of the above-mentioned automatic frequency control loop structure is:
因此,假定目标时钟信号Fckv1的周期为250皮秒(ps)(表示本地时钟信号Fckv1的频率为4GHz),如果可以识别周期为251ps的本地时钟信号Fckv,对本地时钟信号Fckv进行8分频的条件下,需要的计数时间窗N*Tref≥1us,也就是说,自动频率控制环路进行1次鉴频需要1us,则使用当前的数字锁相环实现本地时钟信号Fckv的频率和相位对目标时钟信号Fckv1的频率和相位的锁定至少需要10us左右。Therefore, assuming that the period of the target clock signal Fckv1 is 250 picoseconds (ps) (indicating that the frequency of the local clock signal Fckv1 is 4GHz), if the local clock signal Fckv with a period of 251ps can be identified, divide the local clock signal Fckv by 8. Under the condition, the required counting time window N*Tref ≥ 1us, that is to say, it takes 1us for the automatic frequency control loop to perform one frequency identification, then use the current digital phase-locked loop to achieve the frequency and phase of the local clock signal Fckv to the target It takes at least about 10us to lock the frequency and phase of the clock signal Fckv1.
如果是模拟架构的锁相环,那么鉴频鉴相器201是非线性鉴频的,并且模拟锁相环的带宽通常是100千赫兹(kHz)量级,使得模拟锁相环20的锁定时间通常在50微妙(us)左右。 If it is a phase-locked loop with an analog architecture, the phase-locked loop 201 is non-linear, and the bandwidth of the analog phase-locked loop is usually on the order of 100 kilohertz (kHz), so that the locking time of the analog phase-locked loop 20 is usually Around 50 microseconds (us).
由此,本申请的实施例提供了一种鉴频鉴相器400,参照图4所示,该鉴频鉴相器400可以应用于图2所示的锁相环20中,该鉴频鉴相器400用于生成图2中的电压控制信号Uvco,并且,该鉴频鉴相器400在进行鉴频鉴相处理时,相比传统方案消耗的时间要快至少一个数量级且精度更高。该鉴频鉴相器400包括:两相同步逻辑电路401、计数器402、时间数字转换器403以及鉴频鉴相逻辑电路404。Therefore, the embodiment of the present application provides a frequency and phase detector 400. Referring to Figure 4, the frequency and phase detector 400 can be applied to the phase-locked loop 20 shown in Figure 2. The frequency and phase detector 400 can be used in the phase-locked loop 20 shown in Figure 2. The phase detector 400 is used to generate the voltage control signal Uvco in Figure 2, and when the frequency and phase detector 400 performs frequency and phase identification processing, it consumes at least one order of magnitude faster time and has higher accuracy than the traditional solution. The frequency and phase detector 400 includes: a two-phase synchronous logic circuit 401, a counter 402, a time-to-digital converter 403, and a frequency and phase detector logic circuit 404.
参照图5所示,本申请的实施例提供的鉴频鉴相器400的时序示意图,其中,两相同步逻辑电路401,接收本地时钟信号Fckv和参考时钟信号Fref,参考时钟信号Fref的周期长度大于本地时钟信号Fckv的周期长度。在参考时钟信号Fref的上升沿之后,根据本地时钟信号Fckv的第一个上升沿生成第一时钟信号Fckv_a,其中,第一时钟信号Fckv_a的上升沿不早于本地时钟信号Fckv的第一个上升沿,如图5所示,在参考时钟信号Fref的上升沿到来后,本地时钟信号Fckv的第一个上升沿与第一时钟信号Fckv_a的第一个上升沿对齐。在参考时钟信号Fref的上升沿之后,根据本地时钟信号Fckv的第二个上升沿生成第二时钟信号Fckv_b,其中,第二时钟信号Fckv_b的上升沿不早于本地时钟信号Fckv的第二个上升沿,如图5所示,在参考时钟信号Fref的上升沿到来后,本地时钟信号Fckv的第二个上升沿与第二时钟信号Fckv_b的第一个上升沿对齐;在参考时钟信号Fref的上升沿之后,根据本地时钟信号Fckv的第三个上升沿生成第三时钟信号Fckv_c,其中,第三时钟信号Fckv_c的上升沿不早于本地时钟信号Fckv的第三个上升沿,如图5所示,在参考时钟信号Fref的上升沿到来后,本地时钟信号Fckv的第三个上升沿与第三时钟信号Fckv_c的第一个上升沿对齐。Referring to FIG. 5 , a timing diagram of the frequency and phase detector 400 provided by the embodiment of the present application is shown. The two-phase synchronization logic circuit 401 receives the local clock signal Fckv and the reference clock signal Fref. The period length of the reference clock signal Fref is is greater than the period length of the local clock signal Fckv. After the rising edge of the reference clock signal Fref, the first clock signal Fckv_a is generated according to the first rising edge of the local clock signal Fckv, wherein the rising edge of the first clock signal Fckv_a is not earlier than the first rising edge of the local clock signal Fckv As shown in Figure 5, after the rising edge of the reference clock signal Fref arrives, the first rising edge of the local clock signal Fckv is aligned with the first rising edge of the first clock signal Fckv_a. After the rising edge of the reference clock signal Fref, the second clock signal Fckv_b is generated according to the second rising edge of the local clock signal Fckv, wherein the rising edge of the second clock signal Fckv_b is not earlier than the second rising edge of the local clock signal Fckv edge, as shown in Figure 5, after the rising edge of the reference clock signal Fref arrives, the second rising edge of the local clock signal Fckv is aligned with the first rising edge of the second clock signal Fckv_b; after the rising edge of the reference clock signal Fref After the edge, the third clock signal Fckv_c is generated according to the third rising edge of the local clock signal Fckv, where the rising edge of the third clock signal Fckv_c is not earlier than the third rising edge of the local clock signal Fckv, as shown in Figure 5 , after the rising edge of the reference clock signal Fref arrives, the third rising edge of the local clock signal Fckv is aligned with the first rising edge of the third clock signal Fckv_c.
示例性的,两相同步逻辑电路401,还会在参考时钟信号Fref的上升沿之后,根据本地时钟信号Fckv的第四个上升沿生成第四时钟信号Fckv_d,其中,第四时钟信号Fckv_d的上升沿不早于本地时钟信号Fckv的第四个上升沿,如图5所示,在参考时钟信号Fref的上升沿到来后,本地时钟信号Fckv的第四个上升沿与第四时钟信号Fckv_d的第一个上升沿对齐。Exemplarily, the two-phase synchronous logic circuit 401 will also generate the fourth clock signal Fckv_d according to the fourth rising edge of the local clock signal Fckv after the rising edge of the reference clock signal Fref, where the rising edge of the fourth clock signal Fckv_d The edge is not earlier than the fourth rising edge of the local clock signal Fckv. As shown in Figure 5, after the rising edge of the reference clock signal Fref arrives, the fourth rising edge of the local clock signal Fckv is consistent with the fourth rising edge of the fourth clock signal Fckv_d. A rising edge aligns.
计数器402,用于确定参考时钟信号Fref的n个周期内,本地时钟信号Fckv的完整周期的第一数量,n为大于等于2的正整数。具体的,计数器402根据参考时钟信号Fref以及本地时钟信号Fckv,确定参考时钟信号Fref的n个周期内包含多少整数个本地时钟信号Fckv的周期,该整数个本地时钟信号Fckv的周期就是本地时钟信号的完整周期。The counter 402 is used to determine the first number of complete cycles of the local clock signal Fckv within n cycles of the reference clock signal Fref, where n is a positive integer greater than or equal to 2. Specifically, the counter 402 determines how many integer periods of the local clock signal Fckv are included in n periods of the reference clock signal Fref based on the reference clock signal Fref and the local clock signal Fckv. The integer period of the local clock signal Fckv is the local clock signal. complete cycle.
时间数字转换器403,用于根据第二时钟信号与第三时钟信号确定系数,系数是时间数字转换器的单位步长与本地时钟信号的一个周期的长度的比例;还用于根据参考时钟信号与第一时钟信号,确定参考时钟信号的n个周期内,本地时钟信号的不完整周期中单位步长的第二数量。具体的,时间数字转换器403,在参考时钟信号Fref的n个周期中的第1个周期内,根据第三时钟信号Fckv_c对第二时钟信号Fckv_b进行量化,以此确定第三时钟信号Fckv_c与第二时钟信号Fckv_b之间的相位差,并且由于第二时钟信号Fckv_b的上升沿与本地时钟信号Fckv在参考时钟信号Fref的上升沿到来后的第二个上升沿对齐,第三时钟信号Fckv_c的上升沿与本地时钟信号Fckv在参考时钟信号Fref的上升沿到来后的第三个上升沿对齐,因此,第二时钟信号 Fckv_b与第三时钟信号Fckv_c之间的相位差恰好可以反应本地时钟信号Fckv的一个周期的长度。并且,时间数字转换器403在确定的本地时钟信号Fckv的一个周期的长度时,其度量单位是当前的时间数字转换器403的一个单位步长,也就是时间数字转换器403确定本地时钟信号Fckv的一个周期的长度等于x个时间数字转换器的单位步长,也就是说,时间数字转换器403的单位步长与本地时钟信号Fckv的一个周期的长度的比例等于1/x,那么1/x就是时间数字转换器确定的系数。然后,时间数字转换器403在参考时钟信号Fref的n个周期内,可以根据第一时钟信号Fckv_a对参考时钟信号Fref进行量化,以此确定参考时钟信号Fref与第一时钟信号Fckv_a之间的相位差,并且由于第一时钟信号的上升沿与本地时钟信号Fckv在参考时钟信号Fref的上升沿到来后的第一个上升沿对齐,因此,参考时钟信号Fref与第一时钟信号Fckv_a之间的相位差恰好可以反应参考时钟信号Fref的n个周期内,本地时钟信号Fckv的不完整周期的数量。并且,时间数字转换器403确定的本地时钟信号Fckv的不完整周期的数量,其度量单位是当前的时间数字转换器403的一个单位步长,也就是时间数字转换器403确定的本地时钟信号Fckv的不完整周期的数量等于y个时间数字转换器403的单位步长,其中,y就表示时间数字转换器403确定的参考时钟信号Fref的n个周期内,本地时钟信号的不完整周期中的单位步长的第二数量。The time-to-digital converter 403 is used to determine a coefficient based on the second clock signal and the third clock signal. The coefficient is the ratio of the unit step size of the time-to-digital converter to the length of one cycle of the local clock signal; it is also used to determine a coefficient based on the reference clock signal. and the first clock signal, determining a second number of unit steps in incomplete cycles of the local clock signal within n cycles of the reference clock signal. Specifically, the time-to-digital converter 403 quantizes the second clock signal Fckv_b according to the third clock signal Fckv_c in the first cycle of n cycles of the reference clock signal Fref, thereby determining the third clock signal Fckv_c and The phase difference between the second clock signal Fckv_b, and since the rising edge of the second clock signal Fckv_b is aligned with the second rising edge of the local clock signal Fckv after the arrival of the rising edge of the reference clock signal Fref, the third clock signal Fckv_c The rising edge is aligned with the third rising edge of the local clock signal Fckv after the arrival of the rising edge of the reference clock signal Fref. Therefore, the second clock signal The phase difference between Fckv_b and the third clock signal Fckv_c can exactly reflect the length of one cycle of the local clock signal Fckv. Moreover, when the time-to-digital converter 403 determines the length of one cycle of the local clock signal Fckv, its measurement unit is a unit step of the current time-to-digital converter 403, that is, the time-to-digital converter 403 determines the length of the local clock signal Fckv. The length of one cycle of is equal to the unit step size of x is the coefficient determined by the time-to-digital converter. Then, the time-to-digital converter 403 can quantize the reference clock signal Fref according to the first clock signal Fckv_a within n cycles of the reference clock signal Fref, thereby determining the phase between the reference clock signal Fref and the first clock signal Fckv_a. difference, and since the rising edge of the first clock signal is aligned with the first rising edge of the local clock signal Fckv after the rising edge of the reference clock signal Fref arrives, the phase between the reference clock signal Fref and the first clock signal Fckv_a The difference can exactly reflect the number of incomplete cycles of the local clock signal Fckv within n cycles of the reference clock signal Fref. Moreover, the measurement unit of the number of incomplete cycles of the local clock signal Fckv determined by the time-to-digital converter 403 is a unit step of the current time-to-digital converter 403 , that is, the local clock signal Fckv determined by the time-to-digital converter 403 The number of incomplete cycles is equal to y unit steps of the time-to-digital converter 403, where y represents the number of incomplete cycles of the local clock signal within n cycles of the reference clock signal Fref determined by the time-to-digital converter 403. The second number of unit steps.
鉴频鉴相逻辑电路404,用于根据第一数量、第二数量、以及系数,确定在参考时钟信号Fref的n个周期内,参考时钟信号Fref与本地时钟信号Fckv的第一相位差。具体的,鉴频鉴相逻辑电路404,根据第二数量以及系数,确定第二数量对应的本地时钟信号的完整周期的第三数量。如上所述,时间数字转换器403确定参考时钟信号Fref的n个周期内,本地时钟信号Fckv的不完整周期的数量等于y个时间数字转换器的单位步长,y就表示本地时钟信号的不完整周期中的单位步长的第二数量。并且,时间数字转换器403还确定本地时钟信号Fckv的一个周期的长度等于x个时间数字转换器的单位步长,1/x就是系数,也就是时间数字转换器403的单位步长与本地时钟信号Fckv的一个周期的长度的比例。等于那么在鉴频鉴相逻辑电路404先获取到x再获取到y以后,将计算y*(1/x)的值,也就是y÷x的值,就可以确定第二数量对应的本地时钟信号的完整周期的第三数量。同时,鉴频鉴相逻辑电路404还可以获取到计数器402确定的参考时钟信号Fref的n个周期内,本地时钟信号Fckv的完整周期的第一数量,那么,鉴频鉴相逻辑电路404将第一数量加上第三数量,得到在参考时钟信号Fref的n个周期内,本地时钟信号的完整周期的第四数量。那么,鉴频鉴相逻辑电路404根据参考时钟信号与第四数量,确定在参考时钟信号的n个周期内,参考时钟信号与本地时钟信号的第一相位差。示例性的,参考时钟信号Fref的计量单位是本地时钟信号Fckv的一个完整周期,并且,鉴频鉴相逻辑电路404还可以根据参考时钟信号Fref获取到参考时钟信号Fref的n个周期内,参考时钟信号Fref的对应的本地时钟信号Fckv的完整周期的数量,那么参考时钟信号Fref的对应的本地时钟信号Fckv的完整周期的数量减去第四数量,即可确定在参考时钟信号的n个周期内,参考时钟信号与本地时钟信号的第一相位差。The frequency and phase detection logic circuit 404 is used to determine the first phase difference between the reference clock signal Fref and the local clock signal Fckv within n cycles of the reference clock signal Fref based on the first quantity, the second quantity, and the coefficient. Specifically, the frequency and phase identification logic circuit 404 determines the third number of complete cycles of the local clock signal corresponding to the second number based on the second number and the coefficient. As mentioned above, the time-to-digital converter 403 determines that within n cycles of the reference clock signal Fref, the number of incomplete cycles of the local clock signal Fckv is equal to y unit steps of the time-to-digital converter, and y represents the incomplete cycles of the local clock signal. The second number of unit steps in a complete cycle. Moreover, the time-to-digital converter 403 also determines that the length of one cycle of the local clock signal Fckv is equal to x unit steps of the time-to-digital converter. 1/x is the coefficient, that is, the unit step of the time-to-digital converter 403 is equal to the unit step of the local clock. The ratio of the length of one cycle of the signal Fckv. It is equal to then that after the frequency and phase detection logic circuit 404 first obtains x and then y, it will calculate the value of y*(1/x), that is, the value of y÷x, and the local clock corresponding to the second number can be determined. The third number of complete cycles of the signal. At the same time, the frequency and phase detection logic circuit 404 can also obtain the first number of complete cycles of the local clock signal Fckv within n cycles of the reference clock signal Fref determined by the counter 402. Then, the frequency and phase detection logic circuit 404 will The first quantity is added to the third quantity to obtain the fourth quantity of complete cycles of the local clock signal within n cycles of the reference clock signal Fref. Then, the frequency and phase detection logic circuit 404 determines the first phase difference between the reference clock signal and the local clock signal within n cycles of the reference clock signal based on the reference clock signal and the fourth quantity. For example, the measurement unit of the reference clock signal Fref is one complete cycle of the local clock signal Fckv, and the frequency and phase detection logic circuit 404 can also obtain n cycles of the reference clock signal Fref according to the reference clock signal Fref. The number of complete cycles of the local clock signal Fckv corresponding to the clock signal Fref, then the number of complete cycles of the local clock signal Fckv corresponding to the reference clock signal Fref minus the fourth number, can be determined in n cycles of the reference clock signal Within, the first phase difference between the reference clock signal and the local clock signal.
在上述的鉴频鉴相器中,两相同步逻辑电路接收参考时钟信号,本地时钟信号,在参考时钟信号的上升沿之后,根据本地时钟信号的第一个上升沿生成第一时钟信号; 在参考时钟信号的上升沿之后,根据本地时钟信号的第二个上升沿生成第二时钟信号,在参考时钟信号的上升沿之后,根据本地时钟信号的第三个上升沿生成第三时钟信号。并且,计数器可以确定参考时钟信号的n个周期内,本地时钟信号的完整周期的第一数量,时间数字转换器可以确定参考时钟信号的n个周期内,本地时钟信号的不完整周期中单位步长的第二数量,并且时间数字转换器还可以确定一个系数,这个系数就是时间数字转换器的单位步长与本地时钟信号的一个周期的长度的比例,那么,在鉴频鉴相逻辑电路接收到第一数量、第二数量、以及系数以后,可以根据第一数量、第二数量、以及系数确定参考时钟信号Fref的n个周期内,参考时钟信号与本地时钟信号的第一相位差。这样的鉴频鉴相器,由于时间数字转换器的存在,使得鉴频鉴相的精度提升至时间数字转换器的单位步长与本地时钟信号的一个周期的长度的比例,并且,时间数字转换器的单位步长通常是皮秒(ps)量级的,那么当前的鉴频鉴相器在进行鉴频鉴相处理时,相比传统方案消耗的时间要快至少一个数量级且精度更高。In the above frequency and phase detector, the two-phase synchronization logic circuit receives the reference clock signal and the local clock signal, and generates the first clock signal according to the first rising edge of the local clock signal after the rising edge of the reference clock signal; After the rising edge of the reference clock signal, the second clock signal is generated according to the second rising edge of the local clock signal. After the rising edge of the reference clock signal, the third clock signal is generated according to the third rising edge of the local clock signal. Furthermore, the counter can determine the first number of complete cycles of the local clock signal within n cycles of the reference clock signal, and the time-to-digital converter can determine the unit steps of the incomplete cycles of the local clock signal within n cycles of the reference clock signal. The second longer number, and the time-to-digital converter can also determine a coefficient. This coefficient is the ratio of the unit step size of the time-to-digital converter to the length of one cycle of the local clock signal. Then, when the frequency identification and phase identification logic circuit receives After reaching the first number, the second number, and the coefficient, the first phase difference between the reference clock signal and the local clock signal within n cycles of the reference clock signal Fref can be determined based on the first number, the second number, and the coefficient. For such a frequency and phase detector, due to the existence of the time-to-digital converter, the accuracy of the frequency and phase identification is improved to the ratio of the unit step of the time-to-digital converter to the length of one cycle of the local clock signal, and the time-to-digital conversion The unit step size of the detector is usually on the order of picoseconds (ps). Therefore, when the current frequency and phase detector performs frequency and phase identification processing, it consumes at least one order of magnitude faster time and has higher accuracy than the traditional solution.
示例性的,鉴频鉴相逻辑电路404,在获取到参考时钟信号Fref的n个周期内,本地时钟信号Fckv的第四数量以后,还会在下一个参考时钟信号Fref的n个周期内,获取本地时钟信号Fckv的第四数量,那么将两个相邻的n个周期内的第四数量作差获得一个差值,再将差值除以2,即可获取本地时钟信号Fckv的频率,那么用参考时钟信号Fref的频率减去本地时钟信号Fckv的频率,即可获取本地时钟信号Fckv与参考时钟信号Fref的频率差。也就是说,在锁相环中应用本申请的实施例提供的鉴频鉴相器400,可以不需要再额外设置自动频率控制环路,也可以实现鉴频的目的。Exemplarily, the frequency and phase detection logic circuit 404, after acquiring the fourth number of the local clock signal Fckv within n cycles of the reference clock signal Fref, will also acquire the fourth number of the local clock signal Fckv within n cycles of the next reference clock signal Fref. The fourth number of the local clock signal Fckv, then the difference between the fourth numbers in two adjacent n cycles is obtained, and then the difference is divided by 2 to obtain the frequency of the local clock signal Fckv, then The frequency difference between the local clock signal Fckv and the reference clock signal Fref can be obtained by subtracting the frequency of the local clock signal Fckv from the frequency of the reference clock signal Fref. That is to say, by applying the phase frequency detector 400 provided by the embodiment of the present application in a phase-locked loop, there is no need to set up an additional automatic frequency control loop, and the purpose of frequency identification can be achieved.
需要说明的是,在上述的鉴频鉴相器用于确定目标时钟信号与本地时钟信号的相位差和/或频率差时,由于目标时钟信号是确定的,参考时钟信号也是确定的,目标时钟信号与参考时钟信号有固定的比值关系,那么,在鉴频鉴相器确定参考时钟信号与本地时钟信号的相位差或者频率差以后,根据目标时钟信号与参考时钟信号的固定的比值关系,即可确定目标时钟信号与本地时钟信号的相位差和/或频率差。It should be noted that when the above-mentioned frequency and phase detector is used to determine the phase difference and/or frequency difference between the target clock signal and the local clock signal, since the target clock signal is determined and the reference clock signal is also determined, the target clock signal There is a fixed ratio relationship with the reference clock signal. Then, after the phase frequency detector determines the phase difference or frequency difference between the reference clock signal and the local clock signal, based on the fixed ratio relationship between the target clock signal and the reference clock signal, Determine the phase difference and/or frequency difference between the target clock signal and the local clock signal.
示例性的,参照图4所示,鉴频鉴相逻辑电路404,还用于接收参考时钟信号Fref,根据参考时钟信号Fref生成控制信号Fctl,将控制信号Fctl传输至两相同步逻辑电路401的控制端;参照图6所示,示例性的,在鉴频鉴相器确定参考时钟信号Fref的2个周期内,参考时钟信号Fref与本地时钟信号Fckv的第一相位差时,该控制信号Fctl在参考时钟信号Fref的2个周期中的第1个周期内为第二电平,控制信号Fctl在参考时钟信号Fref的2个周期中的第2个周期内为第一电平。在鉴频鉴相器确定参考时钟信号Fref的n个周期内,参考时钟信号Fref与本地时钟信号Fckv的第一相位差时,该控制信号Fctl在参考时钟信号Fref的n个周期中的第1个周期内为第二电平,控制信号Fctl在参考时钟信号Fref的n个周期中的第2个周期至第n个周期内为第一电平。具体的,第一电平可以是低电平,第二电平可以是高电平,或者,第一电平为高电平,第二电平为低电平。本申请的实施例对控制信号Fctl不做限定。Exemplarily, referring to Figure 4, the frequency and phase detection logic circuit 404 is also used to receive the reference clock signal Fref, generate the control signal Fctl according to the reference clock signal Fref, and transmit the control signal Fctl to the two-phase synchronous logic circuit 401. Control terminal; Referring to Figure 6, for example, when the frequency and phase detector determines the first phase difference between the reference clock signal Fref and the local clock signal Fckv within 2 cycles of the reference clock signal Fref, the control signal Fctl It is the second level during the first period of the two periods of the reference clock signal Fref, and the control signal Fctl is the first level during the second period of the two periods of the reference clock signal Fref. When the frequency and phase detector determines the first phase difference between the reference clock signal Fref and the local clock signal Fckv within n cycles of the reference clock signal Fref, the control signal Fctl is at the first of n cycles of the reference clock signal Fref. The control signal Fctl is at the second level within n cycles, and the control signal Fctl is at the first level within the second to nth cycles of the n cycles of the reference clock signal Fref. Specifically, the first level may be low level and the second level may be high level, or the first level may be high level and the second level may be low level. The embodiment of the present application does not limit the control signal Fctl.
为了清晰可见,下面以鉴频鉴相器确定参考时钟信号Fref的2个周期内,参考时钟信号Fref与本地时钟信号Fckv的第一相位差为例对本申请的实施例所提供的鉴频鉴相器进行说明,并且两相同步逻辑电路401生成第一时钟信号Fckv_a、第二时钟信号Fckv_b、第三时钟信号Fckv_c、以及第四时钟信号Fckv_d。 For the sake of clarity, the following takes the frequency and phase detector to determine the first phase difference between the reference clock signal Fref and the local clock signal Fckv within 2 cycles of the reference clock signal Fref as an example to describe the frequency and phase detection provided by the embodiment of the present application. The two-phase synchronous logic circuit 401 generates the first clock signal Fckv_a, the second clock signal Fckv_b, the third clock signal Fckv_c, and the fourth clock signal Fckv_d.
其中,由于鉴频鉴相逻辑电路404生成的控制信号Fctl在参考时钟信号Fref的2个周期内的的第1个周期内为第二电平,在参考时钟信号Fref的2个周期内的第2个周期内为第一电平。Among them, since the control signal Fctl generated by the frequency and phase detection logic circuit 404 is the second level in the first cycle of the two cycles of the reference clock signal Fref, It is the first level within 2 cycles.
那么,两相同步逻辑电路401,在参考时钟信号Fref的2个周期内的第1个周期内,也就是控制信号Fctl为第二电平时,将第二时钟信号Fckv_b传输至时间数字转换器403的数据输入端tdc_in端,将第三时钟信号Fckv_c传输至时间数字转换器403的时钟输入端tdc_clk端,将第四时钟信号Fckv_d传输至时间数字转换器403的数据输入端tdc_smp端,以使得时间数字转换器403根据第三时钟信号Fckv_c对第二时钟信号Fckv_b进行量化,以此确定系数,再根据第三时钟信号Fckv_c对系数进行采样,将系数存储于时间数字转换器403中,再将存储的系数传输至鉴频鉴相逻辑电路404。Then, the two-phase synchronous logic circuit 401 transmits the second clock signal Fckv_b to the time-to-digital converter 403 in the first cycle of the two cycles of the reference clock signal Fref, that is, when the control signal Fctl is at the second level. The data input terminal tdc_in terminal, the third clock signal Fckv_c is transmitted to the clock input terminal tdc_clk terminal of the time-to-digital converter 403, and the fourth clock signal Fckv_d is transmitted to the data input terminal tdc_smp terminal of the time-to-digital converter 403, so that the time The digitizer 403 quantizes the second clock signal Fckv_b according to the third clock signal Fckv_c to determine the coefficient, then samples the coefficient according to the third clock signal Fckv_c, stores the coefficient in the time-to-digital converter 403, and then stores the coefficient The coefficients are transmitted to the frequency and phase detection logic circuit 404.
然后,两相同步逻辑电路401,在参考时钟信号Fref的2个周期内的第2个周期内,也就是控制信号Fctl为第一电平时,将参考时钟信号Fref传输至时间数字转换器403的数据输入端tdc_in端,将第一时钟信号Fckv_a传输至时间数字转换器403的时钟输入端tdc_clk端,将第三时钟信号Fckv_c传输至时间数字转换器403的数据输入端tdc_smp端;以使得时间数字转换器403根据第一时钟信号Fckv_a对参考时钟信号Fref进行量化,确定参考时钟信号的2个周期内,本地时钟信号的不完整周期中的单位步长的第二数量,再根据第三时钟信号Fckv_c对第二数量进行采样,将第二数量存储于时间数字转换器403中,再将存储的第二数量传输至鉴频鉴相逻辑电路404。Then, the two-phase synchronous logic circuit 401 transmits the reference clock signal Fref to the time-to-digital converter 403 in the second cycle of the two cycles of the reference clock signal Fref, that is, when the control signal Fctl is at the first level. The data input terminal tdc_in transmits the first clock signal Fckv_a to the clock input terminal tdc_clk of the time-to-digital converter 403, and transmits the third clock signal Fckv_c to the data input terminal tdc_smp of the time-to-digital converter 403; so that the time digital The converter 403 quantizes the reference clock signal Fref according to the first clock signal Fckv_a, determines the second number of unit steps in the incomplete cycle of the local clock signal within 2 cycles of the reference clock signal, and then quantizes the unit step size according to the third clock signal Fckv_c samples the second quantity, stores the second quantity in the time-to-digital converter 403 , and then transmits the stored second quantity to the frequency and phase detection logic circuit 404 .
计数器402,在参考时钟信号Fref的2个周期内的第1个周期内,也就是控制信号Fctl为第二电平时,根据第四时钟信号Fckv_d对第一数量进行采样,将第一数量存储于计数器402中,再将存储的第一数量传输至鉴频鉴相逻辑电路404,但是,鉴频鉴相逻辑电路404不会使用在参考时钟信号Fref的2个周期内的第1个周期内接收到的第一数量。在参考时钟信号Fref的2个周期内的第2个周期内,也就是控制信号Fctl为第一电平时,根据第三时钟信号Fckv_c对第一数量进行采样,将第一数量存储于计数器402中,再将存储的第一数量传输至鉴频鉴相逻辑电路404,鉴频鉴相逻辑电路404会使用在参考时钟信号Fref的2个周期内的第2个周期内接收到的第一数量。那么,由于第三时钟信号Fckv_c一定是在参考时钟信号Fref的一个上升沿到来以后才出现一个上升沿的,那么通过第三时钟信号Fckv_c对第一数量进行采样,也使得该鉴频鉴相器400中不存在采样误差。The counter 402, in the first cycle of the two cycles of the reference clock signal Fref, that is, when the control signal Fctl is at the second level, samples the first number according to the fourth clock signal Fckv_d, and stores the first number in In the counter 402, the stored first number is then transmitted to the frequency and phase detection logic circuit 404. However, the frequency and phase detection logic circuit 404 does not use the signal received in the first cycle of the two cycles of the reference clock signal Fref. The first quantity arrived. In the second cycle of the two cycles of the reference clock signal Fref, that is, when the control signal Fctl is at the first level, the first number is sampled according to the third clock signal Fckv_c, and the first number is stored in the counter 402 , and then transmit the stored first quantity to the frequency and phase detection logic circuit 404. The frequency and phase detection logic circuit 404 will use the first quantity received in the second cycle of the two cycles of the reference clock signal Fref. Then, since the third clock signal Fckv_c must have a rising edge only after the arrival of a rising edge of the reference clock signal Fref, sampling the first quantity through the third clock signal Fckv_c also makes the frequency and phase detector There is no sampling error in 400.
示例性的,计数器402也可以不接收参考时钟信号Fref,由于计数器在参考时钟信号Fref的2个周期内的第2个周期内,也就是控制信号Fctl为第一电平时,会接收到第三时钟信号Fckv_c,该第三时钟信号Fckv_c是根据参考时钟信号Fref周期性变化的,因此在计数器402不接收参考时钟信号Fref时,根据第三时钟信号Fckv_c对第一数量进行采样,该第一数量也就表示参考时钟信号Fref的2个周期内,本地时钟信号Fckv的完整周期的第一数量。For example, the counter 402 may not receive the reference clock signal Fref, because the counter will receive the third cycle in the second cycle of the two cycles of the reference clock signal Fref, that is, when the control signal Fctl is at the first level. Clock signal Fckv_c. The third clock signal Fckv_c changes periodically according to the reference clock signal Fref. Therefore, when the counter 402 does not receive the reference clock signal Fref, the first quantity is sampled according to the third clock signal Fckv_c. The first quantity That is, it represents the first number of complete cycles of the local clock signal Fckv within 2 cycles of the reference clock signal Fref.
因此,鉴频鉴相逻辑电路404在参考时钟信号Fref的2个周期内的第1个周期内,也就是控制信号Fctl为第二电平时,接收系数,在参考时钟信号Fref的2个周期内的第2个周期内,也就是控制信号Fctl为第二电平时,接收第一数量和第二数量,以使得该鉴频鉴相逻辑电路404根据第一数量、第二数量、以及系数,确定在参考时钟 信号Fref的n个周期内,参考时钟信号Fref与本地时钟信号Fckv的第一相位差。Therefore, the frequency and phase detection logic circuit 404 receives coefficients within the first cycle of the two cycles of the reference clock signal Fref, that is, when the control signal Fctl is at the second level, within the two cycles of the reference clock signal Fref. In the second cycle of , that is, when the control signal Fctl is at the second level, the first quantity and the second quantity are received, so that the frequency and phase detection logic circuit 404 determines based on the first quantity, the second quantity, and the coefficient. in reference clock Within n cycles of the signal Fref, the first phase difference between the reference clock signal Fref and the local clock signal Fckv.
示例性的,参照图7所示,本申请的实施例提供了两相同步逻辑电路的结构示意图,该两相同步逻辑电路401包括:D触发器4010、D触发器4011、D触发器4012、D触发器4013、D触发器4014、延时器4015以及或门4016。Illustratively, with reference to FIG. 7 , the embodiment of the present application provides a schematic structural diagram of a two-phase synchronous logic circuit. The two-phase synchronous logic circuit 401 includes: D flip-flop 4010, D flip-flop 4011, D flip-flop 4012. D flip-flop 4013, D flip-flop 4014, delay 4015 and OR gate 4016.
其中两相同步逻辑电路401的第一输入端连接至D触发器4010的时钟输入端clk端、D触发器4010的置位端rstn端、D触发器4011的置位端rstn端、D触发器4012的置位端rstn端、D触发器4013的置位端rstn端、D触发器4014的置位端rstn端以及延时器4015的输入端。两相同步逻辑电路401的第二输入端连接至或门4016的第一输入端。延时器4015的输出端连接至两相同步逻辑电路401的第一输出端。D触发器4010的数据输入端D端连接至第三电平端V3,该第三电平端V3提供第三电平,第三电平为高电平;D触发器4010的反向输出端端连接至或门4016的第二输入端。或门4016的输出端连接至D触发器4011的时钟输入端clk端、D触发器4012的时钟输入端clk端、D触发器4013的时钟输入端clk端以及D触发器4014的时钟输入端clk端。D触发器4011的数据输入端D端连接至第三电平端V3,D触发器4011的正向输出端Q端连接至D触发器4012的数据输入端D端以及两相同步逻辑电路401的第二输出端。D选择器4012的正向输出端Q端连接至D触发器4013的数据输入端D端以及两相同步逻辑电路401的第一输出端。D触发器4013的正向输出端Q端连接至D触发器4014的数据输入端D端、两相同步逻辑电路401的第二输出端以及两相同步逻辑电路401的第三输出端。D触发器4014的正向输出端Q端连接至或门4016的第三输入端以及两相同步逻辑电路401的第三输出端。The first input terminal of the two-phase synchronous logic circuit 401 is connected to the clock input terminal clk terminal of the D flip-flop 4010, the set terminal rstn terminal of the D flip-flop 4010, the set terminal rstn terminal of the D flip-flop 4011, and the D flip-flop 4011. The set end rstn end of the D flip-flop 4012, the set end rstn end of the D flip-flop 4013, the set end rstn end of the D flip-flop 4014 and the input end of the delayer 4015. The second input terminal of the two-phase synchronous logic circuit 401 is connected to the first input terminal of the OR gate 4016 . The output terminal of the delay device 4015 is connected to the first output terminal of the two-phase synchronous logic circuit 401 . The data input terminal D of the D flip-flop 4010 is connected to the third level terminal V3, which provides the third level, and the third level is high level; the reverse output terminal of the D flip-flop 4010 terminal is connected to the second input terminal of the OR gate 4016. The output terminal of the OR gate 4016 is connected to the clock input terminal clk terminal of the D flip-flop 4011, the clock input terminal clk terminal of the D flip-flop 4012, the clock input terminal clk terminal of the D flip-flop 4013 and the clock input terminal clk of the D flip-flop 4014. end. The data input terminal D of the D flip-flop 4011 is connected to the third level terminal V3. The forward output terminal Q of the D flip-flop 4011 is connected to the data input terminal D of the D flip-flop 4012 and the third level terminal of the two-phase synchronous logic circuit 401. Two output terminals. The positive output terminal Q terminal of the D selector 4012 is connected to the data input terminal D terminal of the D flip-flop 4013 and the first output terminal of the two-phase synchronous logic circuit 401 . The forward output terminal Q terminal of the D flip-flop 4013 is connected to the data input terminal D terminal of the D flip-flop 4014, the second output terminal of the two-phase synchronous logic circuit 401, and the third output terminal of the two-phase synchronous logic circuit 401. The positive output Q terminal of the D flip-flop 4014 is connected to the third input terminal of the OR gate 4016 and the third output terminal of the two-phase synchronous logic circuit 401 .
两相同步逻辑电路401,用于从两相同步逻辑电路401的第一输入端接收参考时钟信号Fref,从两相同步逻辑电路401的第二输入端接收本地时钟信号Fckv。The two-phase synchronous logic circuit 401 is configured to receive the reference clock signal Fref from the first input terminal of the two-phase synchronous logic circuit 401 and receive the local clock signal Fckv from the second input terminal of the two-phase synchronous logic circuit 401 .
参照图8所示,本申请的实施例提供了两相同步逻辑电路401的时序示意图。Referring to FIG. 8 , an embodiment of the present application provides a timing diagram of a two-phase synchronous logic circuit 401 .
D触发器4010,用于在D触发器4010的置位端rstn端以及时钟输入端clk端接收的参考时钟信号Fref的控制下,根据D触发器4010的数据输入端D端接收的第三电平生成使能信号Fenb。其中,由于D触发器4010的数据输入端D端连接至电平V3,电平V3为高电平,D触发器4010的时钟输入端clk端和置位端rstn端接收参考时钟信号Fref,那么,在参考时钟信号Fref为低电平时,D触发器4010的正向输出端Q端输出低电平,反向输出端端输出高电平;在参考时钟信号Fref出现一个上升沿时,D触发器的正向输出端Q端输出自数据输入端D端接收的高电平,反向输出端端输出第电平。那么,D触发器4010生成的使能信号Fenb可以认为是参考时钟信号Fref的反相信号,并且使能信号Fenb相较于参考时钟信号Fref延时一定时间,该延时是D触发器4010造成的。The D flip-flop 4010 is used for controlling the reference clock signal Fref received by the setting terminal rstn terminal of the D flip-flop 4010 and the clock input terminal clk terminal, and according to the third voltage received by the data input terminal D terminal of the D flip-flop 4010. The level generates the enable signal Fenb. Among them, since the data input terminal D terminal of the D flip-flop 4010 is connected to the level V3, the level V3 is high level, and the clock input terminal clk terminal and the set terminal rstn terminal of the D flip-flop 4010 receive the reference clock signal Fref, then , when the reference clock signal Fref is low level, the forward output terminal Q terminal of the D flip-flop 4010 outputs a low level, and the reverse output terminal The terminal outputs a high level; when a rising edge of the reference clock signal Fref occurs, the forward output terminal Q terminal of the D flip-flop outputs the high level received from the data input terminal D terminal, and the reverse output terminal terminal output level. Then, the enable signal Fenb generated by the D flip-flop 4010 can be considered as the inverse signal of the reference clock signal Fref, and the enable signal Fenb is delayed by a certain period of time compared to the reference clock signal Fref. This delay is caused by the D flip-flop 4010 of.
或门4016,用于根据接收的使能信号Fenb、本地时钟信号Fckv以及D触发器4014的正向输出端Q端输出的第四时钟信号Fckv_d进行或逻辑处理,生成控制时钟信号Fck1。参照图8所示,在第四时钟信号Fckv_d为低电平的阶段,或门4016根据接收使能信号Fenb以及本地参考信号Fckv,生成控制时钟信号Fck1。其中,在参考时钟信号Fref为高电平时,使能信号Fenb为低电平,此时的控制时钟信号Fck1与本地参考信号Fckv同步,并且控制时钟信号Fck1相较于本地参考信号Fckv延时一定时间, 该延时是或门4016造成的,是逻辑延时。在第四时钟信号Fckv_d为高电平的阶段,控制时钟信号Fck1始终保持高电平。The OR gate 4016 is used to perform OR logic processing based on the received enable signal Fenb, the local clock signal Fckv, and the fourth clock signal Fckv_d output from the forward output terminal Q of the D flip-flop 4014 to generate the control clock signal Fck1. Referring to FIG. 8 , when the fourth clock signal Fckv_d is low level, the OR gate 4016 generates the control clock signal Fck1 according to the reception enable signal Fenb and the local reference signal Fckv. Among them, when the reference clock signal Fref is high level, the enable signal Fenb is low level. At this time, the control clock signal Fck1 is synchronized with the local reference signal Fckv, and the control clock signal Fck1 is delayed by a certain amount compared with the local reference signal Fckv. time, This delay is caused by the OR gate 4016 and is a logical delay. During the period when the fourth clock signal Fckv_d is at the high level, the control clock signal Fck1 always remains at the high level.
D触发器4011,用于在D触发器4011的置位端rstn端接收的参考时钟信号Fref、以及D触发器4011的时钟输入端clk端接收的控制时钟信号Fck1的控制下,根据D触发器4011的数据输入端D端接收的第三电平生成第一时钟信号Fckv_1。其中,由于D触发器4011的数据输入端D端连接至第三电平端V3,第三电平端V3提供高电平,D触发器4011的时钟输入端clk端接收控制时钟信号Fck1,D触发器4011的置位端rstn端接收参考时钟信号Fref,那么,在参考时钟信号Fref为低电平时,D触发器4011的正向输出端Q端输出低电平,反向输出端端输出高电平;在参考时钟信号Fref为高电平时,且控制时钟信号Fck1出现一个上升沿时,D触发器的正向输出端Q端输出自数据输入端D端接收的高电平。参照图8所示,在参考时钟信号Fref的上升沿之后,在本地时钟信号Fckv的第一个上升沿到来时,控制时钟信号Fck1出现第一个上升沿,在该上升沿的触发下,D触发器4011的正向输出端Q端输出的第一时钟信号Fckv_a延时出现第一个上升沿,并且该上升沿出现后一直维持高电平至参考时钟信号Fref变为低电平,该延时由D触发器1011造成。D flip-flop 4011 is used to control the reference clock signal Fref received at the set end rstn end of the D flip-flop 4011 and the control clock signal Fck1 received at the clock input end clk end of the D flip-flop 4011, according to the D flip-flop 4011 The third level received by the data input terminal D of 4011 generates the first clock signal Fckv_1. Among them, since the data input terminal D of the D flip-flop 4011 is connected to the third level terminal V3, the third level terminal V3 provides a high level, and the clock input terminal clk of the D flip-flop 4011 receives the control clock signal Fck1, the D flip-flop 4011 The set end rstn end of 4011 receives the reference clock signal Fref. Then, when the reference clock signal Fref is low level, the forward output end Q end of the D flip-flop 4011 outputs a low level, and the reverse output end The terminal outputs a high level; when the reference clock signal Fref is a high level and the control clock signal Fck1 has a rising edge, the forward output terminal Q terminal of the D flip-flop outputs the high level received from the data input terminal D terminal. Referring to Figure 8, after the rising edge of the reference clock signal Fref, when the first rising edge of the local clock signal Fckv arrives, the first rising edge of the control clock signal Fck1 appears. Under the trigger of this rising edge, D The first clock signal Fckv_a output by the positive output terminal Q of the flip-flop 4011 delays the first rising edge, and after the rising edge appears, it remains high until the reference clock signal Fref becomes low. is caused by D flip-flop 1011.
D触发器4012,用于在D触发器4012的置位端rstn端接收的参考时钟信号Fref、以及D触发器4012的时钟输入端clk端接收的控制时钟信号Fck1的控制下,根据D触发器4012的数据输入端D端接收的第一时钟信号Fckv_a生成第二时钟信号Fckv_b。其中,由于D触发器4012的数据输入端D端连接至D触发器4011的正向输出端Q端,接收第一时钟信号Fckv_a,D触发器4012的时钟输入端clk端接收控制时钟信号Fck1,D触发器4012的置位端rstn端接收参考时钟信号Fref。那么,在参考时钟信号Fref为低电平时,D触发器4012的正向输出端Q端输出低电平,反向输出端端输出高电平;在参考时钟信号Fref为高电平时,且控制时钟信号Fck1出现一个上升沿时,D触发器的正向输出端Q端输出自数据输入端D端接收第一时钟信号Fckv_a。参照图8所示,在参考时钟信号Fref的上升沿之后,在本地时钟信号Fckv的第一个上升沿到来时,控制时钟信号Fck1出现第一个上升沿,在该上升沿的触发下,D触发器4011的正向输出端Q端输出的第一时钟信号Fckv_a延时出现第一个上升沿,且该延时小于一个本地时钟信号Fckv的周期,因此在控制时钟信号Fck1出现第一个上升沿时,由于第一时钟信号Fckv_a是低电平,那么第二时钟信号Fckv_b也是低电平。在参考时钟信号Fref的上升沿之后,在本地时钟信号Fckv的第二个上升沿到来时,控制时钟信号Fck1出现第二个上升沿,此时第一时钟信号Fckv_a是高电平,那么第二时钟信号Fckv_b也出现一个上升沿,并且该上升沿出现后一直维持高电平至参考时钟信号Fref变为低电平。The D flip-flop 4012 is used to control the reference clock signal Fref received at the set end rstn end of the D flip-flop 4012 and the control clock signal Fck1 received at the clock input end clk end of the D flip-flop 4012, according to the D flip-flop 4012 The first clock signal Fckv_a received by the data input terminal D of 4012 generates a second clock signal Fckv_b. Among them, since the data input terminal D terminal of the D flip-flop 4012 is connected to the forward output terminal Q terminal of the D flip-flop 4011 and receives the first clock signal Fckv_a, and the clock input terminal clk terminal of the D flip-flop 4012 receives the control clock signal Fck1, The setting terminal rstn of the D flip-flop 4012 receives the reference clock signal Fref. Then, when the reference clock signal Fref is low level, the forward output terminal Q of the D flip-flop 4012 outputs a low level, and the reverse output terminal The terminal outputs a high level; when the reference clock signal Fref is a high level and the control clock signal Fck1 has a rising edge, the forward output terminal Q terminal of the D flip-flop receives the first clock signal Fckv_a from the data input terminal D terminal. . Referring to Figure 8, after the rising edge of the reference clock signal Fref, when the first rising edge of the local clock signal Fckv arrives, the first rising edge of the control clock signal Fck1 appears. Under the trigger of this rising edge, D The first rising edge of the first clock signal Fckv_a output by the positive output terminal Q of the flip-flop 4011 is delayed, and the delay is less than one period of the local clock signal Fckv. Therefore, the first rising edge of the control clock signal Fck1 appears. edge, since the first clock signal Fckv_a is low level, then the second clock signal Fckv_b is also low level. After the rising edge of the reference clock signal Fref, when the second rising edge of the local clock signal Fckv arrives, the control clock signal Fck1 has a second rising edge. At this time, the first clock signal Fckv_a is high level, then the second rising edge The clock signal Fckv_b also has a rising edge, and after the rising edge appears, it remains at a high level until the reference clock signal Fref changes to a low level.
D触发器4013,用于在D触发器4013的置位端rstn端接收的参考时钟信号Fref、以及D触发器4013的时钟输入端clk端接收的控制时钟信号Fck1的控制下,根据D触发器4013的数据输入端D端接收的第二时钟信号Fckv_b生成第三时钟信号Fckv_c。其中,由于D触发器4013的数据输入端D端连接至D触发器4012的正向输出端Q端,接收第二时钟信号Fckv_b,D触发器4013的时钟输入端clk端接收控制时钟信号Fck1,D触发器4013的置位端rstn端接收参考时钟信号Fref。那么,在参考时钟信号Fref 为低电平时,D触发器4013的正向输出端Q端输出低电平,反向输出端端输出高电平;在参考时钟信号Fref为高电平时,且控制时钟信号Fck1出现一个上升沿时,D触发器的正向输出端Q端输出自数据输入端D端接收第二时钟信号Fckv_b。参照图8所示,在参考时钟信号Fref的上升沿之后,在本地时钟信号Fckv的第一个上升沿到来时,控制时钟信号Fck1延时出现一个上升沿,则D触发器4011的正向输出端Q端输出的第一时钟信号Fckv_a延时出现第一个上升沿,且该延时小于一个本地时钟信号Fckv的周期,此时第二时钟信号Fckv_b是低电平,那么第三时钟信号Fckv_c也是低电平。在参考时钟信号Fref的上升沿之后,在本地时钟信号Fckv出现第二个上升沿时,控制时钟信号Fck1也出现第二个上升沿,第一时钟信号Fckv_a是高电平,第二时钟信号Fckv_b出现一个上升沿,第三时钟信号Fckv_c还是低电平。在参考时钟信号Fref的上升沿之后,在本地时钟信号Fckv出现第三个上升沿时,控制时钟信号Fck1也出现第三个上升沿,第一时钟信号Fckv_a是高电平,此时第二时钟信号Fckv_b是高电平,那么第三时钟信号Fckv_c则出现一个上升沿,并且该上升沿出现后一直维持高电平至参考时钟信号Fref变为低电平。D flip-flop 4013 is used to control the reference clock signal Fref received at the set end rstn end of the D flip-flop 4013 and the control clock signal Fck1 received at the clock input end clk end of the D flip-flop 4013, according to the D flip-flop 4013 The second clock signal Fckv_b received by the data input terminal D of 4013 generates a third clock signal Fckv_c. Among them, since the data input terminal D terminal of the D flip-flop 4013 is connected to the forward output terminal Q terminal of the D flip-flop 4012 and receives the second clock signal Fckv_b, and the clock input terminal clk terminal of the D flip-flop 4013 receives the control clock signal Fck1, The setting terminal rstn of the D flip-flop 4013 receives the reference clock signal Fref. Then, in the reference clock signal Fref When it is low level, the forward output terminal Q of the D flip-flop 4013 outputs a low level, and the reverse output terminal The terminal outputs a high level; when the reference clock signal Fref is a high level and the control clock signal Fck1 has a rising edge, the forward output terminal Q terminal of the D flip-flop receives the second clock signal Fckv_b from the data input terminal D terminal. . Referring to Figure 8, after the rising edge of the reference clock signal Fref, when the first rising edge of the local clock signal Fckv arrives, the control clock signal Fck1 delays a rising edge, then the forward output of the D flip-flop 4011 The first rising edge of the first clock signal Fckv_a output from terminal Q is delayed, and the delay is less than one period of the local clock signal Fckv. At this time, the second clock signal Fckv_b is low level, then the third clock signal Fckv_c It is also low level. After the rising edge of the reference clock signal Fref, when the local clock signal Fckv has a second rising edge, the control clock signal Fck1 also has a second rising edge. The first clock signal Fckv_a is high level, and the second clock signal Fckv_b A rising edge occurs, and the third clock signal Fckv_c is still low level. After the rising edge of the reference clock signal Fref, when the third rising edge of the local clock signal Fckv appears, the control clock signal Fck1 also appears the third rising edge. The first clock signal Fckv_a is high level. At this time, the second clock When the signal Fckv_b is high level, a rising edge appears on the third clock signal Fckv_c, and after the rising edge appears, it remains high level until the reference clock signal Fref becomes low level.
D触发器4014,用于在D触发器4014的置位端rstn端接收的参考时钟信号Fref、以及D触发器4014的时钟输入端clk端接收的控制时钟信号Fck1的控制下,根据D触发器4014的数据输入端D端接收的第三时钟信号Fckv_c生成第四时钟信号Fckv_d。其中,由于D触发器4014的数据输入端D端连接至D触发器4013的正向输出端Q端,接收第三时钟信号Fckv_c,D触发器4014的时钟输入端clk端接收控制时钟信号Fck1,D触发器4014的置位端rstn端接收参考时钟信号Fref,那么,在参考时钟信号Fref为低电平时,D触发器4014的正向输出端Q端输出低电平,反向输出端端输出高电平;在参考时钟信号Fref为高电平时,且控制时钟信号Fck1出现一个上升沿时,D触发器的正向输出端Q端输出自数据输入端D端接收第三时钟信号Fckv_c。参照图8所示,在参考时钟信号Fref的上升沿之后,在本地时钟信号Fckv的一个上升沿到来时,在本地时钟信号Fckv出现第一个上升沿时,控制时钟信号Fck1延时出现一个上升沿,则D触发器4011的正向输出端Q端输出的第一时钟信号Fckv_a延时出现第一个上升沿,且该延时小于一个本地时钟信号Fckv的周期,此时第二时钟信号Fckv_b是低电平,第三时钟信号Fckv_c也是低电平,第四时钟信号Fckv_d也是低电平。在参考时钟信号Fref的上升沿之后,在本地时钟信号Fckv出现第二个上升沿时,控制时钟信号Fck1也出现第二个上升沿,第一时钟信号Fckv_a是高电平,第二时钟信号Fckv_b出现一个上升沿,第三时钟信号Fckv_c还是低电平,第四时钟信号Fckv_d也是低电平。在参考时钟信号Fref的上升沿之后,在本地时钟信号Fckv出现第三个上升沿时,控制时钟信号Fck1也出现第三个上升沿,第一时钟信号Fckv_a是高电平,第二时钟信号Fckv_b是高电平,第三时钟信号Fckv_c则出现一个上升沿,第四时钟信号Fckv_d也是低电平。在参考时钟信号Fref的上升沿之后,在本地时钟信号Fckv出现第四个上升沿时,控制时钟信号Fck1也出现第四个上升沿,第一时钟信号Fckv_a是高电平,第二时钟信号Fckv_b是高电平,第三时钟信号Fckv_c是高电平,则第四时钟信号Fckv_d出现一个上升沿,并且该上升沿出现后一直维持高电平至参考时钟信号Fref变为低电平。 The D flip-flop 4014 is used to control the reference clock signal Fref received at the set end rstn end of the D flip-flop 4014 and the control clock signal Fck1 received at the clock input end clk end of the D flip-flop 4014, according to the D flip-flop 4014. The third clock signal Fckv_c received by the data input terminal D of 4014 generates a fourth clock signal Fckv_d. Among them, since the data input terminal D terminal of the D flip-flop 4014 is connected to the forward output terminal Q terminal of the D flip-flop 4013 and receives the third clock signal Fckv_c, and the clock input terminal clk terminal of the D flip-flop 4014 receives the control clock signal Fck1, The setting terminal rstn of the D flip-flop 4014 receives the reference clock signal Fref. Then, when the reference clock signal Fref is low level, the forward output terminal Q terminal of the D flip-flop 4014 outputs a low level, and the reverse output terminal The terminal outputs a high level; when the reference clock signal Fref is a high level and the control clock signal Fck1 has a rising edge, the forward output terminal Q terminal of the D flip-flop receives the third clock signal Fckv_c from the data input terminal D terminal. . Referring to Figure 8, after the rising edge of the reference clock signal Fref, when a rising edge of the local clock signal Fckv arrives, when the first rising edge of the local clock signal Fckv appears, the control clock signal Fck1 delays to appear a rising edge. edge, then the first clock signal Fckv_a output by the forward output terminal Q of the D flip-flop 4011 is delayed to appear the first rising edge, and the delay is less than one period of the local clock signal Fckv, at this time the second clock signal Fckv_b is low level, the third clock signal Fckv_c is also low level, and the fourth clock signal Fckv_d is also low level. After the rising edge of the reference clock signal Fref, when the local clock signal Fckv has a second rising edge, the control clock signal Fck1 also has a second rising edge. The first clock signal Fckv_a is high level, and the second clock signal Fckv_b When a rising edge occurs, the third clock signal Fckv_c is still low level, and the fourth clock signal Fckv_d is also low level. After the rising edge of the reference clock signal Fref, when the third rising edge of the local clock signal Fckv appears, the control clock signal Fck1 also appears the third rising edge, the first clock signal Fckv_a is high level, and the second clock signal Fckv_b is high level, the third clock signal Fckv_c has a rising edge, and the fourth clock signal Fckv_d is also low level. After the rising edge of the reference clock signal Fref, when the fourth rising edge of the local clock signal Fckv appears, the control clock signal Fck1 also appears the fourth rising edge, the first clock signal Fckv_a is high level, and the second clock signal Fckv_b is high level, the third clock signal Fckv_c is high level, then the fourth clock signal Fckv_d appears a rising edge, and after the rising edge appears, it remains high level until the reference clock signal Fref changes to low level.
其中,参照图7所示,D触发器4014的正向输出端Q端还连接至或门4016的第三输入端,接收第四时钟信号Fckv_d,那么,在第四时钟信号Fckv_d出现高电平时,或门4016输出的控制时钟信号Fck1时钟保持高电平,不再出现上升沿。以使得D触发器4011、D触发器4012、D触发器4013以及D触发器4014的正向输出端输出的电平只受参考时钟信号Fref的控制。7, the forward output Q terminal of the D flip-flop 4014 is also connected to the third input terminal of the OR gate 4016 to receive the fourth clock signal Fckv_d. Then, when the fourth clock signal Fckv_d appears high level , the control clock signal Fck1 clock output by the OR gate 4016 remains high and no rising edge appears. Therefore, the levels output by the positive output terminals of the D flip-flop 4011, D flip-flop 4012, D flip-flop 4013 and D flip-flop 4014 are only controlled by the reference clock signal Fref.
其中,延时器4015,对参考时钟信号Fref进行延时处理生成延时参考时钟信号Fref-dly。由图8可知,延时参考时钟信号Fref-dly的上升沿在参考时钟信号Fref的上升沿之后出现,延时参考时钟信号Fref-dly的高电平持续时间与参考时钟信号Fref的高电平的持续时间相同。Among them, the delayer 4015 performs delay processing on the reference clock signal Fref to generate a delayed reference clock signal Fref-dly. It can be seen from Figure 8 that the rising edge of the delayed reference clock signal Fref-dly appears after the rising edge of the reference clock signal Fref, and the high-level duration of the delayed reference clock signal Fref-dly is equal to the high-level duration of the reference clock signal Fref. The duration is the same.
那么,时间数字转换器403,在参考时钟信号Fref的n个周期内的第2个周期至第n个周期内,是用于根据延时参考时钟信号Fref-dly与第一时钟信号Fckv_a确定本地时钟信号Fckv的不完整周期中的单位步长的第二数量。其中,对参考时钟信号Fref进行延时生成延时参考时钟信号Fref_dly,该延时器4015的首要目的在于补偿D触发器4010以及或门4016的延时,使得延时参考时钟信号Fref_dly相较于参考时钟信号Fref的延时时长,与第一时钟信号Fckv_a相较于参考时钟信号的上升沿之后本地时钟信号Fckv的第一个上升沿的延时时长相同。该延时器4015的次要目的在于获取到一个可以测量的本地时钟信号Fckv的不完整周期中的单位步长的第二数量。Then, the time-to-digital converter 403 is used to determine the local time according to the delayed reference clock signal Fref-dly and the first clock signal Fckv_a in the second to nth cycles within n cycles of the reference clock signal Fref. The second number of unit steps in the incomplete cycle of the clock signal Fckv. Among them, the reference clock signal Fref is delayed to generate the delayed reference clock signal Fref_dly. The primary purpose of the delay 4015 is to compensate the delay of the D flip-flop 4010 and the OR gate 4016, so that the delayed reference clock signal Fref_dly is compared with The delay time of the reference clock signal Fref is the same as the delay time of the first rising edge of the local clock signal Fckv after the first clock signal Fckv_a is compared with the rising edge of the reference clock signal. The secondary purpose of the delay 4015 is to obtain a measurable second number of unit steps in the incomplete cycle of the local clock signal Fckv.
参照图9所示,两相同步逻辑电路401,还包括选择器4017,选择器4018以及选择器4019;两相同步逻辑电路401的控制端连接至选择器4017的控制端、选择器4018的控制端以及选择器4019的控制端;选择器4017的第一输入端连接至延时器4015的输出端,选择器4017的第二输入端连接至D触发器4012的正向输出端,选择器4017的输出端连接至两相同步逻辑电路401的第一输出端;选择器4018的第一输入端连接至D触发器4011的正向输出端,选择器4018的第二输入端连接至D触发器4013的正向输出端,选择器4018的输出端连接至两相同步逻辑电路401的第二输出端;选择器4019的第一输入端连接至D触发器4013的正向输出端,选择器4019的第二输入端连接至D触发器4014的正向输出端,选择器4019的输出端连接至两相同步逻辑电路401的第三输出端;两相同步逻辑电路401,从控制端接收鉴频鉴相逻辑电路404生成的控制信号Fctl。Referring to Figure 9, the two-phase synchronous logic circuit 401 also includes a selector 4017, a selector 4018 and a selector 4019; the control end of the two-phase synchronous logic circuit 401 is connected to the control end of the selector 4017 and the control end of the selector 4018. terminal and the control terminal of the selector 4019; the first input terminal of the selector 4017 is connected to the output terminal of the delay device 4015, and the second input terminal of the selector 4017 is connected to the positive output terminal of the D flip-flop 4012. The selector 4017 The output terminal is connected to the first output terminal of the two-phase synchronous logic circuit 401; the first input terminal of the selector 4018 is connected to the forward output terminal of the D flip-flop 4011, and the second input terminal of the selector 4018 is connected to the D flip-flop 4011. The positive output terminal of 4013 and the output terminal of selector 4018 are connected to the second output terminal of the two-phase synchronous logic circuit 401; the first input terminal of selector 4019 is connected to the positive output terminal of D flip-flop 4013 and the selector 4019 The second input terminal is connected to the positive output terminal of the D flip-flop 4014, and the output terminal of the selector 4019 is connected to the third output terminal of the two-phase synchronous logic circuit 401; the two-phase synchronous logic circuit 401 receives the frequency discrimination from the control terminal The control signal Fctl generated by the phase detection logic circuit 404.
参照图8所示,两相同步逻辑电路401,在参考时钟信号Fref的n个周期内的第1个周期内,也就是控制信号Fctl为第二电平(也就是高电平)时,将第二时钟信号Fckv_b传输至两相同步逻辑电路401的第一输出端;将第三时钟信号Fckv_c传输至两相同步逻辑电路401的第二输出端;将第四时钟信号Fckv_d传输至两相同步逻辑电路401的第三输出端。参照图4所示,其中,时间数字转换器403的数据输入端tdc_in端连接至两相同步逻辑电路401的第一输出端,时间数字转换器403的时钟输入端tdc_clk端连接至两相同步逻辑电路401的第二输出端,时间数字转换器403的采样输入端tdc_smp端连接至两相同步逻辑电路401的第三输出端,那么,在参考时钟信号Fref的n个周期内的第1个周期内,也就是控制信号Fctl为第二电平(也就是高电平)时,时间数字转换器403自数据输入端tdc_in端接收第二时钟信号Fckv_b,自时钟输入端tdc_clk端接收第三时钟信号Fckv_c,自采样输入端tdc_smp端接收第 四时钟信号Fckv_d,那么,时间数字转换器403根据第二时钟信号Fckv_b与第三时钟信号Fckv_c确定系数,系数是时间数字转换器403的单位步长与本地时钟信号的一个周期的长度的比例。更具体的,时间数字转换器403根据第三时钟信号Fckv_c对第二时钟信号Fckv_b进行量化,以此确定系数,再根据第三时钟信号Fckv_c对系数进行采样,将系数存储于时间数字转换器403中,再将存储的系数传输至鉴频鉴相逻辑电路404。Referring to FIG. 8 , the two-phase synchronous logic circuit 401 will, in the first cycle of n cycles of the reference clock signal Fref, that is, when the control signal Fctl is at the second level (that is, high level). The second clock signal Fckv_b is transmitted to the first output terminal of the two-phase synchronous logic circuit 401; the third clock signal Fckv_c is transmitted to the second output terminal of the two-phase synchronous logic circuit 401; the fourth clock signal Fckv_d is transmitted to the two-phase synchronous logic circuit 401. The third output terminal of the logic circuit 401. Referring to Figure 4, the data input terminal tdc_in of the time-to-digital converter 403 is connected to the first output terminal of the two-phase synchronous logic circuit 401, and the clock input terminal tdc_clk of the time-to-digital converter 403 is connected to the two-phase synchronous logic. The second output terminal of the circuit 401 and the sampling input terminal tdc_smp terminal of the time-to-digital converter 403 are connected to the third output terminal of the two-phase synchronous logic circuit 401. Then, in the first cycle within n cycles of the reference clock signal Fref , that is, when the control signal Fctl is at the second level (that is, high level), the time-to-digital converter 403 receives the second clock signal Fckv_b from the data input terminal tdc_in, and receives the third clock signal from the clock input terminal tdc_clk. Fckv_c, the self-sampling input terminal tdc_smp terminal receives the Four clock signals Fckv_d, then the time-to-digital converter 403 determines a coefficient based on the second clock signal Fckv_b and the third clock signal Fckv_c. The coefficient is the ratio of the unit step size of the time-to-digital converter 403 to the length of one cycle of the local clock signal. More specifically, the time-to-digital converter 403 quantizes the second clock signal Fckv_b according to the third clock signal Fckv_c to determine the coefficient, and then samples the coefficient according to the third clock signal Fckv_c, and stores the coefficient in the time-to-digital converter 403 , and then transmit the stored coefficients to the frequency and phase detection logic circuit 404.
两相同步逻辑电路401,在参考时钟信号Fref的n个周期内的第2个周期至第n个周期内,也就是控制信号Fctl为第一电平(也就是低电平)时,将延时参考时钟信号Fref_dly传输至两相同步逻辑电路401的第一输出端;选择器4018,在控制信号Fctl为第一电平(也就是低电平)时将第一时钟信号Fckv_a传输至两相同步逻辑电路401的第二输出端;选择器4019,在控制信号Fctl为第一电平(也就是低电平)时将第三时钟信号Fckv_c传输至两相同步逻辑电路401的第三输出端。参照图4所示,其中,时间数字转换器403的数据输入端tdc_in端连接至两相同步逻辑电路401的第一输出端,时间数字转换器403的时钟输入端tdc_clk端连接至两相同步逻辑电路401的第二输出端,时间数字转换器403的采样输入端tdc_smp端连接至两相同步逻辑电路401的第三输出端。那么,在参考时钟信号Fref的n个周期内的第2个周期至第n个周期内,也就是控制信号Fctl为第一电平(也就是低电平)时,时间数字转换器403自数据输入端tdc_in端接收延时参考时钟信号Fref_dly,自时钟输入端tdc_clk端接收第一时钟信号Fckv_a,自采样输入端tdc_smp端接收第三时钟信号Fckv_c,时间数字转换器403根据延时参考时钟信号Fref_dly与第一时钟信号Fckv_a确定参考时钟信号的n个周期内,本地时钟信号的不完整周期中的单位步长的第二数量。更具体的,时间数字转换器403根据第一时钟信号Fckv_a对延时参考时钟信号Fref_dly进行量化,确定参考时钟信号的n个周期内,本地时钟信号的不完整周期中的单位步长的第二数量,再根据第三时钟信号Fckv_c对第二数量进行采样,将第二数量存储于时间数字转换器403中,再将存储的第二数量传输至鉴频鉴相逻辑电路404。The two-phase synchronous logic circuit 401 will delay the delay from the 2nd cycle to the nth cycle within n cycles of the reference clock signal Fref, that is, when the control signal Fctl is at the first level (ie, low level). The reference clock signal Fref_dly is transmitted to the first output end of the two-phase synchronous logic circuit 401; the selector 4018 transmits the first clock signal Fckv_a to the two-phase when the control signal Fctl is the first level (that is, low level). The second output terminal of the synchronous logic circuit 401; the selector 4019 transmits the third clock signal Fckv_c to the third output terminal of the two-phase synchronous logic circuit 401 when the control signal Fctl is a first level (that is, a low level). . Referring to Figure 4, the data input terminal tdc_in of the time-to-digital converter 403 is connected to the first output terminal of the two-phase synchronous logic circuit 401, and the clock input terminal tdc_clk of the time-to-digital converter 403 is connected to the two-phase synchronous logic. The second output terminal of the circuit 401 , the sampling input terminal tdc_smp terminal of the time-to-digital converter 403 is connected to the third output terminal of the two-phase synchronous logic circuit 401 . Then, in the second to nth cycles within n cycles of the reference clock signal Fref, that is, when the control signal Fctl is the first level (ie, low level), the time-to-digital converter 403 The input terminal tdc_in receives the delayed reference clock signal Fref_dly, receives the first clock signal Fckv_a from the clock input terminal tdc_clk, and receives the third clock signal Fckv_c from the sampling input terminal tdc_smp. The time-to-digital converter 403 responds to the delayed reference clock signal Fref_dly. The second number of unit steps in the incomplete cycles of the local clock signal within n cycles of the reference clock signal is determined with the first clock signal Fckv_a. More specifically, the time-to-digital converter 403 quantizes the delayed reference clock signal Fref_dly according to the first clock signal Fckv_a, and determines the second unit step of the incomplete cycle of the local clock signal within n cycles of the reference clock signal. quantity, and then samples the second quantity according to the third clock signal Fckv_c, stores the second quantity in the time-to-digital converter 403, and then transmits the stored second quantity to the frequency and phase detection logic circuit 404.
示例性的,在鉴频鉴相器400中的两相同步逻辑电路为图9所示两相同步逻辑电路401,并且鉴频鉴相器400中的计数器402是模拟设计方法实现的计数器,则该鉴频鉴相器400也不需要对本地时钟信号Fckv进行分频,那么该鉴频鉴相器400则是根据下述公式4确定目标时钟信号Fckv1与本地时钟信号Fckv的频率差:
For example, the two-phase synchronous logic circuit in the frequency and phase detector 400 is the two-phase synchronous logic circuit 401 shown in Figure 9, and the counter 402 in the frequency and phase detector 400 is a counter implemented by the analog design method, then The frequency and phase detector 400 does not need to frequency divide the local clock signal Fckv, so the frequency and phase detector 400 determines the frequency difference between the target clock signal Fckv1 and the local clock signal Fckv according to the following formula 4:
其中,鉴频鉴相器400的鉴频精度为时间数字转换器的单位步长与本地时钟信号的一个周期的长度的比例,并且克服了异步采样的亚稳态问题,因此,上述公式4的最小值为时间数字转换器的单位步长与本地时钟信号的一个周期的长度的比例,得到下述公式5。
Among them, the frequency identification accuracy of the frequency and phase detector 400 is the ratio of the unit step size of the time-to-digital converter to the length of one cycle of the local clock signal, and overcomes the metastable problem of asynchronous sampling. Therefore, the above formula 4 The minimum value is the ratio of the unit step size of the time-to-digital converter to the length of one cycle of the local clock signal, resulting in Equation 5 below.
其中,在上述公式5中,Ltdc表示时间数字转换器的单位步长。Among them, in the above equation 5, Ltdc represents the unit step of the time-to-digital converter.
根据公式5可知,上述的鉴频鉴相器400的一个计数时间窗为:
According to Formula 5, it can be seen that a counting time window of the above-mentioned frequency and phase detector 400 is:
因此,假定目标时钟信号Fckv1的周期为250皮秒(ps)(表示本地时钟信号Fckv1的频率为4GHz),时间数字转换器的单位步长为10ps,如果可以识别周期为251ps的本地时钟信号Fckv,需要的计数时间窗N*Tref≥2.5纳秒(ns),鉴频鉴相器4001次鉴频需要2.5ns,那么本申请的实施例提供的鉴频鉴相器在进行鉴频鉴相处理时,相比传统方案消耗的时间提升了400倍。Therefore, assuming that the period of the target clock signal Fckv1 is 250 picoseconds (ps) (meaning that the frequency of the local clock signal Fckv1 is 4GHz) and the unit step of the time-to-digital converter is 10ps, if the local clock signal Fckv with the period of 251ps can be identified , the required counting time window N*Tref≥2.5 nanoseconds (ns), the frequency and phase detector requires 2.5ns for 4001 times of frequency identification, then the frequency and phase detector provided by the embodiment of the present application is performing frequency and phase identification processing At this time, the time consumed is increased by 400 times compared with the traditional solution.
参照图10所示。本申请的实施例提供了一种锁相环50的结构示意图,锁相环50包括滤波器501,振荡电路502以及鉴频鉴相器400;其中,鉴频鉴相器400通过滤波器501连接至振荡电路502,振荡电路502还连接至鉴频鉴相器400;鉴频鉴相器400,接收参考时钟信号Fref、振荡电路502生成的本地时钟信号Fckv以及目标时钟信号Fckv1,根据参考时钟信号Fref与本地时钟信号Fckv,确定在参考时钟信号Fref的n个周期内,参考时钟信号Fref与本地时钟信号Fckv的相位差。并且,当前的鉴频鉴相器还接收目标时钟信号,目标时钟信号是确定的,并且目标时钟信号Fckv1与参考时钟信号Fref有固定的比值关系,那么根据参考时钟信号Fref的n个周期内,参考时钟信号Fref与本地时钟信号Fckv的相位差,以及目标时钟信号Fckv1与参考时钟信号Fref一定有固定的比值关系,可以得知参考时钟信号Fref的n个周期内,目标时钟信号Fckv1与本地时钟信号Fckv的相位差。根据目标时钟信号Fckv1与本地时钟信号Fckv的相位差,可以生成电压控制信号,将电压控制信号传输至滤波器501。Refer to Figure 10. The embodiment of the present application provides a schematic structural diagram of a phase-locked loop 50. The phase-locked loop 50 includes a filter 501, an oscillation circuit 502 and a frequency and phase detector 400; wherein the frequency and phase detector 400 is connected through the filter 501 To the oscillation circuit 502, the oscillation circuit 502 is also connected to the frequency and phase detector 400; the frequency and phase detector 400 receives the reference clock signal Fref, the local clock signal Fckv generated by the oscillation circuit 502, and the target clock signal Fckv1. According to the reference clock signal Fref and the local clock signal Fckv determine the phase difference between the reference clock signal Fref and the local clock signal Fckv within n cycles of the reference clock signal Fref. Moreover, the current frequency and phase detector also receives the target clock signal. The target clock signal is determined, and the target clock signal Fckv1 has a fixed ratio relationship with the reference clock signal Fref. Then according to n cycles of the reference clock signal Fref, The phase difference between the reference clock signal Fref and the local clock signal Fckv, and the target clock signal Fckv1 and the reference clock signal Fref must have a fixed ratio relationship. It can be known that within n cycles of the reference clock signal Fref, the target clock signal Fckv1 and the local clock The phase difference of the signal Fckv. According to the phase difference between the target clock signal Fckv1 and the local clock signal Fckv, a voltage control signal can be generated and transmitted to the filter 501 .
示例性的,鉴频鉴相器400也可以不接收目标时钟信号Fckv1,改为接收目标时钟信号Fckv1与参考时钟信号Fref一定有固定的比值关系。For example, the frequency and phase detector 400 may not receive the target clock signal Fckv1, but instead receive the target clock signal Fckv1 and the reference clock signal Fref, which must have a fixed ratio relationship.
滤波器501,接收电压控制信号,根据电压控制信号生成振荡电路502的控制电压;振荡电路502,接收控制电压,在控制电压的控制下调整振荡电路502生成的本地时钟信号Fckv的频率。The filter 501 receives the voltage control signal and generates the control voltage of the oscillation circuit 502 according to the voltage control signal; the oscillation circuit 502 receives the control voltage and adjusts the frequency of the local clock signal Fckv generated by the oscillation circuit 502 under the control of the control voltage.
其中,振荡电路502可以包括压控振荡器,也可以包括电流控制的振荡器,参照图11所示,电流控制的振荡器包括振荡器5021以及4个晶体管,示例性的,图11所示的晶体管为空穴型金属-氧化物半导体场效应晶体管(metal-oxide-semiconductor field effect transistor,MOSFET,简称PMOS管),其中,PMOS管P1的第一端通过电阻R1连接至电平V4端,该电平V4端提供高电平,PMOS管P1的第二端连接至PMOS管P2的第一端,PMOS管P2的第二端连接至振荡器5021的控制端,PMOS管P1的控制端接收电平信号U1,在该电平信号U1为低电平时,PMOS管P1的第一端和第二端导通,在该电平信号U1为高电平时,PMOS管P1的第一端和第二端不导通,PMOS管P2的控制端接收电平信号U2,在该电平信号U2为低电平时,PMOS管P2的第一端和第二端导通,在该电平信号U2为高电平时,PMOS管P2的第一端和第二端不导通;PMOS管P3的第一端通过电阻连接至电平V4端,该电平V4端提供高电平,PMOS管P3的第二端连接至PMOS管P4的第一端,PMOS管P4的第二端连接至振荡器5021的控制端,PMOS管P3的控制端接收电平信号U3,在该电平信号U3为低电平时,PMOS管P3的第一端和第二端导通,在该电平信号U3为高电平时,PMOS管P3的第一端和第二端不导通,PMOS管P4的控制端接收电平信号U4,在该电平信号U4为低电平时,PMOS管P4的第一端和第二端导通,在该电平信号U5为高电平时,PMOS管P4的第一端和第二端不导通。 The oscillator circuit 502 may include a voltage-controlled oscillator or a current-controlled oscillator. As shown in FIG. 11 , the current-controlled oscillator includes an oscillator 5021 and four transistors. For example, as shown in FIG. 11 The transistor is a hole-type metal-oxide-semiconductor field effect transistor (MOSFET, PMOS transistor for short), in which the first end of the PMOS transistor P1 is connected to the level V4 end through the resistor R1. The level V4 terminal provides a high level. The second terminal of the PMOS tube P1 is connected to the first terminal of the PMOS tube P2. The second terminal of the PMOS tube P2 is connected to the control terminal of the oscillator 5021. The control terminal of the PMOS tube P1 receives the voltage. When the level signal U1 is low level, the first end and the second end of the PMOS tube P1 are turned on. When the level signal U1 is high level, the first end and the second end of the PMOS tube P1 are turned on. terminal is not conductive, the control terminal of the PMOS tube P2 receives the level signal U2. When the level signal U2 is low level, the first terminal and the second terminal of the PMOS tube P2 are conductive. When the level signal U2 is high, When the level is high, the first end and the second end of the PMOS tube P2 are not conductive; the first end of the PMOS tube P3 is connected to the level V4 end through a resistor. The level V4 end provides a high level, and the second end of the PMOS tube P3 The terminal is connected to the first terminal of the PMOS tube P4, the second terminal of the PMOS tube P4 is connected to the control terminal of the oscillator 5021, and the control terminal of the PMOS tube P3 receives the level signal U3. When the level signal U3 is low level, The first end and the second end of the PMOS transistor P3 are conductive. When the level signal U3 is high level, the first end and the second end of the PMOS transistor P3 are not conductive, and the control end of the PMOS transistor P4 receives the level signal. U4, when the level signal U4 is low level, the first end and the second end of the PMOS tube P4 are turned on. When the level signal U5 is high level, the first end and the second end of the PMOS tube P4 are not connected. conduction.
在图11所示的振荡电路中,电平信号U1和电平信号U3常为低电平,以控制PMOS管P1和PMOS管P3开启,滤波器501传输的控制电压,可以控制电平信号U2和电平信号U4为高电平或低电平,以此控制PMOS管P2和PMOS管P4的开启或关闭。在一定时间内,PMOS管P2和PMOS管P4的开启和关闭的次数将使得振荡器5021接收到不同的控制电流,以使得振荡器5021生成的本地时钟信号Fckv的相位和/或频率发生变化。In the oscillator circuit shown in Figure 11, the level signal U1 and the level signal U3 are always low level to control the opening of the PMOS tube P1 and the PMOS tube P3. The control voltage transmitted by the filter 501 can control the level signal U2 The sum level signal U4 is high level or low level, thereby controlling the opening or closing of the PMOS transistor P2 and the PMOS transistor P4. Within a certain period of time, the number of times that the PMOS transistor P2 and the PMOS transistor P4 are turned on and off will cause the oscillator 5021 to receive different control currents, so that the phase and/or frequency of the local clock signal Fckv generated by the oscillator 5021 changes.
示例性的,本申请的实施例提供了一种电子设备,该电子设备包括印刷电路板(printed circuit board,PCB),还包括设置于PCB上的锁相环,或者设置于PCB上的鉴频鉴相器,该锁相环可以是上述的锁相环50,该鉴频鉴相器可以为上述的鉴频鉴相器400。该电子设备包括例如手机、平板电脑、个人数字助理(personal digital assistant,PDA)、车载电脑等。本申请的实施例对电子设备的具体形式不做特殊限制。Illustratively, embodiments of the present application provide an electronic device, which includes a printed circuit board (PCB), a phase-locked loop disposed on the PCB, or a frequency identification device disposed on the PCB. Phase detector, the phase-locked loop may be the above-mentioned phase-locked loop 50, and the frequency-frequency phase detector may be the above-mentioned frequency-phase detector 400. The electronic devices include, for example, mobile phones, tablet computers, personal digital assistants (personal digital assistants, PDAs), vehicle-mounted computers, etc. The embodiments of the present application do not place any special restrictions on the specific form of the electronic device.
示例性的,本申请的实施例提供了一种鉴频鉴相方法,包括:Illustratively, the embodiment of the present application provides a frequency and phase identification method, including:
接收本地时钟信号和参考时钟信号。Receive local clock signal and reference clock signal.
其中,参考时钟信号的周期长度大于本地时钟信号的周期长度;并且在参考时钟信号的上升沿之后,根据本地时钟信号的第一个上升沿生成第一时钟信号,其中,第一时钟信号的上升沿不早于本地时钟信号的第一个上升沿;在参考时钟信号的上升沿之后,根据本地时钟信号的第二个上升沿生成第二时钟信号,其中,第二时钟信号的上升沿不早于本地时钟信号的第二个上升沿;在参考时钟信号的上升沿之后,根据本地时钟信号的第三个上升沿生成第三时钟信号,其中,第三时钟信号的上升沿不早于本地时钟信号的第三个上升沿。Wherein, the period length of the reference clock signal is greater than the period length of the local clock signal; and after the rising edge of the reference clock signal, the first clock signal is generated according to the first rising edge of the local clock signal, wherein the rising edge of the first clock signal The rising edge of the second clock signal is not earlier than the first rising edge of the local clock signal; after the rising edge of the reference clock signal, the second clock signal is generated according to the second rising edge of the local clock signal, where the rising edge of the second clock signal is not earlier than the rising edge of the local clock signal. on the second rising edge of the local clock signal; after the rising edge of the reference clock signal, generate a third clock signal based on the third rising edge of the local clock signal, wherein the rising edge of the third clock signal is not earlier than the local clock The third rising edge of the signal.
在一些情况下,还会在参考时钟信号的上升沿之后,根据本地时钟信号的第四个上升沿生成第四时钟信号,其中,第四时钟信号的上升沿不早于本地时钟信号的第四个上升沿。In some cases, the fourth clock signal is also generated according to the fourth rising edge of the local clock signal after the rising edge of the reference clock signal, wherein the rising edge of the fourth clock signal is not earlier than the fourth rising edge of the local clock signal. a rising edge.
具体的,上述的第一时钟信号、第二时钟信号、第三时钟信号以及第四时钟信号可以是根据如下步骤生成:在参考时钟信号的控制下,根据第三电平生成使能信号;对接收的使能信号、本地时钟信号以及第四时钟信号进行或逻辑处理,生成控制时钟信号;在参考时钟信号、以及控制时钟信号的控制下,根据第三电平生成第一时钟信号;在参考时钟信号、以及控制时钟信号的控制下,根据第一时钟信号生成第二时钟信号;在参考时钟信号、以及控制时钟信号的控制下,根据第二时钟信号生成第三时钟信号;在参考时钟信号、以及控制时钟信号的控制下,根据第三时钟信号生成第四时钟信号;对参考时钟信号进行延时处理,生成延时参考时钟信号;则根据参考时钟信号与第一时钟信号,确定参考时钟信号的n个周期内,本地时钟信号的不完整周期中的单位步长的第二数量,具体包括:根据延时参考时钟信号与第一时钟信号,确定参考时钟信号的n个周期内,本地时钟信号的不完整周期中单位步长的第二数量。Specifically, the above-mentioned first clock signal, second clock signal, third clock signal and fourth clock signal can be generated according to the following steps: under the control of the reference clock signal, generate an enable signal according to the third level; The received enable signal, local clock signal and fourth clock signal are OR logically processed to generate a control clock signal; under the control of the reference clock signal and the control clock signal, a first clock signal is generated according to the third level; in the reference Under the control of the clock signal and the control clock signal, a second clock signal is generated according to the first clock signal; under the control of the reference clock signal and the control clock signal, a third clock signal is generated according to the second clock signal; under the control of the reference clock signal , and under the control of the control clock signal, generate a fourth clock signal according to the third clock signal; perform delay processing on the reference clock signal to generate a delayed reference clock signal; then determine the reference clock according to the reference clock signal and the first clock signal Within n cycles of the signal, the second number of unit steps in the incomplete cycle of the local clock signal specifically includes: determining, based on the delayed reference clock signal and the first clock signal, within n cycles of the reference clock signal, the local The second number of unit steps in an incomplete cycle of a clock signal.
确定参考时钟信号的n个周期内,本地时钟信号的完整周期的第一数量,n为大于等于2的正整数。示例性的,在控制信号为第一电平时,根据第三时钟信号对第一数量进行采样,将第一数量存储。Determine the first number of complete cycles of the local clock signal within n cycles of the reference clock signal, where n is a positive integer greater than or equal to 2. For example, when the control signal is at the first level, the first number is sampled according to the third clock signal, and the first number is stored.
根据第二时钟信号与第三时钟信号确定系数,系数是时间数字转换器的单位步长与本地时钟信号的一个周期的长度的比例。示例性的,在控制信号为第二电平时,根 据第四时钟信号对系数进行采样,将系数存储。A coefficient is determined based on the second clock signal and the third clock signal, and the coefficient is a ratio of the unit step size of the time-to-digital converter to the length of one cycle of the local clock signal. For example, when the control signal is at the second level, the root The coefficients are sampled according to the fourth clock signal and stored.
还根据参考时钟信号与第一时钟信号,确定参考时钟信号的n个周期内,本地时钟信号的不完整周期中的单位步长的第二数量。示例性的,在控制信号为第一电平时,根据第三时钟信号对第二数量进行采样,将第二数量存储。A second number of unit steps in incomplete cycles of the local clock signal within n cycles of the reference clock signal is also determined based on the reference clock signal and the first clock signal. For example, when the control signal is at the first level, the second quantity is sampled according to the third clock signal, and the second quantity is stored.
根据第一数量、第二数量、以及系数,确定在参考时钟信号的n个周期内,参考时钟信号与本地时钟信号的第一相位差。According to the first quantity, the second quantity, and the coefficient, a first phase difference between the reference clock signal and the local clock signal within n cycles of the reference clock signal is determined.
示例性的,根据第一数量、第二数量、以及系数,确定在参考时钟信号的n个周期内,参考时钟信号与本地时钟信号的第一相位差,具体包括:根据第二数量以及系数,确定第二数量对应的本地时钟信号的完整周期的第三数量;将第一数量加上第三数量,得到在参考时钟信号的n个周期内,本地时钟信号的完整周期的第四数量;根据参考时钟信号与第四数量,确定在参考时钟信号的n个周期内,参考时钟信号与本地时钟信号的第一相位差。Exemplarily, based on the first quantity, the second quantity, and the coefficient, determining the first phase difference between the reference clock signal and the local clock signal within n cycles of the reference clock signal specifically includes: according to the second quantity and the coefficient, Determine the third number of complete cycles of the local clock signal corresponding to the second number; add the first number to the third number to obtain the fourth number of complete cycles of the local clock signal within n cycles of the reference clock signal; according to The reference clock signal and the fourth quantity determine the first phase difference between the reference clock signal and the local clock signal within n cycles of the reference clock signal.
在另一些实施例中,还根据n个周期内的第四数量,以及下一个n个周期内的第四数量,确定第二相位差;根据第二相位差确定本地时钟信号的频率。那么根据参考时钟信号的频率与本地时钟信号的频率作差,即可获得参考时钟信号与本地时钟信号的频率差。In other embodiments, the second phase difference is also determined based on the fourth number within n cycles and the fourth number within the next n cycles; the frequency of the local clock signal is determined based on the second phase difference. Then, based on the difference between the frequency of the reference clock signal and the frequency of the local clock signal, the frequency difference between the reference clock signal and the local clock signal can be obtained.
其中,上述控制信号根据如下步骤生成:接收参考时钟信号,根据参考时钟信号生成控制信号,控制信号在参考时钟信号的第1个周期内为第二电平;控制信号在参考时钟信号的第2个周期至第n个周期内为第一电平。Wherein, the above control signal is generated according to the following steps: receiving a reference clock signal, generating a control signal according to the reference clock signal, the control signal is the second level in the first period of the reference clock signal; the control signal is in the second period of the reference clock signal. It is the first level within the period from the nth period to the nth period.
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序代码,当电子设备执行该计算机程序代码时,电子设备执行上述实施例中的集成电路测试方法。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。Embodiments of the present application also provide a computer-readable storage medium that stores computer program code. When the electronic device executes the computer program code, the electronic device executes the integrated circuit testing method in the above embodiment. Based on this understanding, the technical solutions of the embodiments of the present application are essentially or contribute to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium , including several instructions to cause a device (which can be a microcontroller, a chip, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage media include: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program code.
本申请的实施例还提供了一种计算机程序产品,当该计算机程序产品在电子设备上运行时,使得电子设备执行上述相关步骤,以实现上述实施例中集成电路的测试方法。Embodiments of the present application also provide a computer program product. When the computer program product is run on an electronic device, it causes the electronic device to perform the above related steps to implement the integrated circuit testing method in the above embodiment.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, for example, multiple units or components may be The combination can either be integrated into another device, or some features can be omitted, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分 布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated. The components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be separated. Distributed to many different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium. The above contents are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the present application, and should are covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
尽管结合具体特征及其实施例对本发明进行了描述,显而易见的,在不脱离本发明的精神和范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利要求所界定的本发明的示例性说明,且视为已覆盖本发明范围内的任意和所有修改、变化、组合或等同物。显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。 Although the invention has been described in conjunction with specific features and embodiments thereof, it will be apparent that various modifications and combinations may be made without departing from the spirit and scope of the invention. Accordingly, the specification and drawings are intended to be illustrative only of the invention as defined by the appended claims and are to be construed to cover any and all modifications, variations, combinations or equivalents within the scope of the invention. Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the invention. In this way, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and equivalent technologies, the present invention is also intended to include these modifications and variations.

Claims (23)

  1. 一种鉴频鉴相器,其特征在于,包括:两相同步逻辑电路、计数器、时间数字转换器以及鉴频鉴相逻辑电路;A frequency and phase detector, characterized in that it includes: a two-phase synchronous logic circuit, a counter, a time-to-digital converter, and a frequency and phase detector logic circuit;
    所述两相同步逻辑电路,用于接收本地时钟信号和参考时钟信号,所述参考时钟信号的周期长度大于所述本地时钟信号的周期长度;在所述参考时钟信号的上升沿之后,根据所述本地时钟信号的第一个上升沿生成第一时钟信号,其中,所述第一时钟信号的上升沿不早于所述本地时钟信号的第一个上升沿;在所述参考时钟信号的上升沿之后,根据所述本地时钟信号的第二个上升沿生成第二时钟信号,其中,所述第二时钟信号的上升沿不早于所述本地时钟信号的第二个上升沿;在所述参考时钟信号的上升沿之后,根据所述本地时钟信号的第三个上升沿生成第三时钟信号,其中,所述第三时钟信号的上升沿不早于所述本地时钟信号的第三个上升沿;The two-phase synchronous logic circuit is used to receive a local clock signal and a reference clock signal. The period length of the reference clock signal is greater than the period length of the local clock signal; after the rising edge of the reference clock signal, according to the The first rising edge of the local clock signal generates the first clock signal, wherein the rising edge of the first clock signal is no earlier than the first rising edge of the local clock signal; after the rising edge of the reference clock signal After the edge of the local clock signal, a second clock signal is generated according to the second rising edge of the local clock signal, wherein the rising edge of the second clock signal is not earlier than the second rising edge of the local clock signal; in the After the rising edge of the reference clock signal, a third clock signal is generated according to the third rising edge of the local clock signal, wherein the rising edge of the third clock signal is no earlier than the third rising edge of the local clock signal. along;
    所述计数器,用于确定所述参考时钟信号的n个周期内,所述本地时钟信号的完整周期的第一数量,所述n为大于等于2的正整数;The counter is used to determine the first number of complete cycles of the local clock signal within n cycles of the reference clock signal, where n is a positive integer greater than or equal to 2;
    所述时间数字转换器,用于根据所述第二时钟信号与所述第三时钟信号确定系数,所述系数是所述时间数字转换器的单位步长与所述本地时钟信号的一个周期的长度的比例;还用于根据所述参考时钟信号与所述第一时钟信号,确定所述参考时钟信号的所述n个周期内,所述本地时钟信号的不完整周期中的单位步长的第二数量;The time-to-digital converter is used to determine a coefficient based on the second clock signal and the third clock signal, where the coefficient is the unit step of the time-to-digital converter and one cycle of the local clock signal. The ratio of the length; also used to determine the unit step size in the incomplete cycle of the local clock signal within the n cycles of the reference clock signal based on the reference clock signal and the first clock signal. second quantity;
    所述鉴频鉴相逻辑电路,用于根据所述第一数量、所述第二数量、以及所述系数,确定在所述参考时钟信号的所述n个周期内,所述参考时钟信号与所述本地时钟信号的第一相位差。The frequency and phase identification logic circuit is used to determine, according to the first quantity, the second quantity, and the coefficient, within the n periods of the reference clock signal, the difference between the reference clock signal and The first phase difference of the local clock signal.
  2. 根据权利要求1所述的鉴频鉴相器,其特征在于,所述鉴频鉴相逻辑电路,具体用于根据所述第二数量以及所述系数,确定所述第二数量对应的所述本地时钟信号的完整周期的第三数量;The frequency and phase detector according to claim 1, characterized in that the frequency and phase detection logic circuit is specifically used to determine the second number corresponding to the second number according to the second number and the coefficient. the third number of complete cycles of the local clock signal;
    将所述第一数量加上所述第三数量,得到在所述参考时钟信号的所述n个周期内,所述本地时钟信号的完整周期的第四数量;Adding the first number to the third number yields a fourth number of complete cycles of the local clock signal within the n cycles of the reference clock signal;
    根据所述参考时钟信号与所述第四数量,确定在所述参考时钟信号的所述n个周期内,所述参考时钟信号与所述本地时钟信号的第一相位差。According to the reference clock signal and the fourth quantity, a first phase difference between the reference clock signal and the local clock signal within the n periods of the reference clock signal is determined.
  3. 根据权利要求2所述的鉴频鉴相器,其特征在于,所述鉴频鉴相逻辑电路,还用于根据所述n个周期内的所述第四数量,以及下一个所述n个周期内的所述第四数量,确定第二相位差;根据所述第二相位差确定所述本地时钟信号的频率。The frequency and phase detector according to claim 2, characterized in that the frequency and phase detection logic circuit is also used to determine the fourth number in the n cycles and the next n The fourth number within the period determines a second phase difference; the frequency of the local clock signal is determined based on the second phase difference.
  4. 根据权利要求1-3任一项所述的鉴频鉴相器,其特征在于,The frequency and phase detector according to any one of claims 1-3, characterized in that:
    所述两相同步逻辑电路,在所述参考时钟信号的上升沿之后,根据所述本地时钟信号的第四个上升沿生成第四时钟信号,其中,所述第四时钟信号的上升沿不早于所述本地时钟信号的第四个上升沿;The two-phase synchronous logic circuit generates a fourth clock signal according to the fourth rising edge of the local clock signal after the rising edge of the reference clock signal, wherein the rising edge of the fourth clock signal is not earlier than the rising edge of the reference clock signal. On the fourth rising edge of the local clock signal;
    所述两相同步逻辑电路,还用于在所述两相同步逻辑电路的控制端接收的所述鉴频鉴相逻辑电路生成的控制信号,在所述控制信号为第一电平时,将所述参考时钟信号传输至所述时间数字转换器的数据输入端,将所述第一时钟信号传输至所述时间数字转换器的时钟输入端,将所述第三时钟信号传输至所述时间数字转换器的采样输入端;在所述控制信号为第二电平时,将所述第二时钟信号传输至所述时间数字转换器 的数据输入端,将所述第三时钟信号传输至所述时间数字转换器的时钟输入端,将所述第四时钟信号传输至所述时间数字转换器的采样输入端。The two-phase synchronous logic circuit is also used to control the control signal generated by the frequency identification and phase identification logic circuit received at the control end of the two-phase synchronous logic circuit. When the control signal is at the first level, the The reference clock signal is transmitted to the data input terminal of the time-to-digital converter, the first clock signal is transmitted to the clock input terminal of the time-to-digital converter, and the third clock signal is transmitted to the time digital converter. The sampling input terminal of the converter; when the control signal is at the second level, transmit the second clock signal to the time-to-digital converter The data input terminal transmits the third clock signal to the clock input terminal of the time-to-digital converter, and transmits the fourth clock signal to the sampling input terminal of the time-to-digital converter.
  5. 根据权利要求1所述的鉴频鉴相器,其特征在于,所述两相同步逻辑电路,包括:第一D触发器、第二D触发器、第三D触发器、第四D触发器、第五D触发器、延时器、以及或门;The frequency and phase detector according to claim 1, wherein the two-phase synchronous logic circuit includes: a first D flip-flop, a second D flip-flop, a third D flip-flop, and a fourth D flip-flop. , fifth D flip-flop, delayer, and OR gate;
    所述两相同步逻辑电路的第一输入端连接至所述第一D触发器的时钟输入端、所述第一D触发器的置位端、所述第二D触发器的置位端、所述第三D触发器的置位端、所述第四D触发器的置位端、所述第五D触发器的置位端以及所述延时器的输入端;The first input end of the two-phase synchronous logic circuit is connected to the clock input end of the first D flip-flop, the set end of the first D flip-flop, the set end of the second D flip-flop, The setting terminal of the third D flip-flop, the setting terminal of the fourth D flip-flop, the setting terminal of the fifth D flip-flop and the input terminal of the delayer;
    所述两相同步逻辑电路的第二输入端连接至所述或门的第一输入端;The second input terminal of the two-phase synchronous logic circuit is connected to the first input terminal of the OR gate;
    所述延时器的输出端连接至所述两相同步逻辑电路的第一输出端;The output terminal of the delayer is connected to the first output terminal of the two-phase synchronous logic circuit;
    所述第一D触发器的数据输入端连接至第三电平端,所述第一D触发器的反向输出端连接至所述或门的第二输入端,其中所述第三电平端提供第三电平;The data input terminal of the first D flip-flop is connected to a third level terminal, and the reverse output terminal of the first D flip-flop is connected to the second input terminal of the OR gate, wherein the third level terminal provides third level;
    所述或门的输出端连接至所述第二D触发器的时钟输入端、所述第三D触发器的时钟输入端、所述第四D触发器的时钟输入端以及所述第五D触发器的时钟输入端;The output terminal of the OR gate is connected to the clock input terminal of the second D flip-flop, the clock input terminal of the third D flip-flop, the clock input terminal of the fourth D flip-flop and the fifth D flip-flop. The clock input of the flip-flop;
    所述第二D触发器的数据输入端连接至所述第三电平端,所述第二D触发器的正向输出端连接至所述第三D触发器的数据输入端以及所述两相同步逻辑电路的第二输出端;The data input terminal of the second D flip-flop is connected to the third level terminal, and the positive output terminal of the second D flip-flop is connected to the data input terminal of the third D flip-flop and the two-phase a second output terminal of the synchronous logic circuit;
    所述第三D触发器的正向输出端连接至所述第四D触发器的数据输入端以及所述两相同步逻辑电路的第一输出端;The forward output terminal of the third D flip-flop is connected to the data input terminal of the fourth D flip-flop and the first output terminal of the two-phase synchronous logic circuit;
    所述第四D触发器的正向输出端连接至所述第五D触发器的数据输入端、所述两相同步逻辑电路的第二输出端以及所述两相同步逻辑电路的第三输出端;The positive output terminal of the fourth D flip-flop is connected to the data input terminal of the fifth D flip-flop, the second output terminal of the two-phase synchronous logic circuit, and the third output of the two-phase synchronous logic circuit. end;
    所述第五D触发器的正向输出端连接至所述或门的第三输入端以及所述两相同步逻辑电路的第三输出端;The positive output terminal of the fifth D flip-flop is connected to the third input terminal of the OR gate and the third output terminal of the two-phase synchronous logic circuit;
    所述两相同步逻辑电路,用于从所述两相同步逻辑电路的第一输入端接收所述参考时钟信号,从所述两相同步逻辑电路的第二输入端接收所述本地时钟信号;The two-phase synchronous logic circuit is configured to receive the reference clock signal from the first input terminal of the two-phase synchronous logic circuit and receive the local clock signal from the second input terminal of the two-phase synchronous logic circuit;
    所述第一D触发器,用于在所述第一D触发器的置位端以及时钟输入端接收的所述参考时钟信号的控制下,根据所述第一D触发器的数据输入端接收的所述第三电平生成使能信号;The first D flip-flop is configured to receive a signal at the data input end of the first D flip-flop under the control of the reference clock signal received by the setting end of the first D flip-flop and the clock input end. The third level generates an enable signal;
    所述或门,用于对接收的所述使能信号、所述本地时钟信号以及所述第五D触发器的正向输出端输出的第四时钟信号进行或逻辑处理,生成控制时钟信号;The OR gate is used to perform logical OR processing on the received enable signal, the local clock signal and the fourth clock signal output by the forward output terminal of the fifth D flip-flop to generate a control clock signal;
    所述第二D触发器,用于在所述第二D触发器的置位端接收的所述参考时钟信号、以及所述第二D触发器的时钟输入端接收的所述控制时钟信号的控制下,根据所述第二D触发器的数据输入端接收的所述第三电平生成所述第一时钟信号;The second D flip-flop is used to adjust the reference clock signal received at the set end of the second D flip-flop and the control clock signal received at the clock input end of the second D flip-flop. Under control, generate the first clock signal according to the third level received by the data input terminal of the second D flip-flop;
    所述第三D触发器,用于在所述第三D触发器的置位端接收的所述参考时钟信号、以及所述第三D触发器的时钟输入端接收的所述控制时钟信号的控制下,根据所述第三D触发器的数据输入端接收的所述第一时钟信号生成所述第二时钟信号;The third D flip-flop is used to adjust the reference clock signal received at the set end of the third D flip-flop and the control clock signal received at the clock input end of the third D flip-flop. Under control, generate the second clock signal according to the first clock signal received by the data input terminal of the third D flip-flop;
    所述第四D触发器,用于在所述第四D触发器的置位端接收的所述参考时钟信号、以及所述第四D触发器的时钟输入端接收的所述控制时钟信号的控制下,根据所述第四D触发器的数据输入端接收的所述第二时钟信号生成所述第三时钟信号; The fourth D flip-flop is used to adjust the reference clock signal received at the set end of the fourth D flip-flop and the control clock signal received at the clock input end of the fourth D flip-flop. Under control, generate the third clock signal according to the second clock signal received by the data input terminal of the fourth D flip-flop;
    所述第五D触发器,用于在所述第五D触发器的置位端接收的所述参考时钟信号、以及所述第五D触发器的时钟输入端接收的所述控制时钟信号的控制下,根据所述第五D触发器的数据输入端接收的所述第三时钟信号生成所述第四时钟信号;The fifth D flip-flop is used to adjust the reference clock signal received at the set end of the fifth D flip-flop and the control clock signal received at the clock input end of the fifth D flip-flop. Under control, generate the fourth clock signal according to the third clock signal received by the data input terminal of the fifth D flip-flop;
    所述延时器,用于对所述参考时钟信号进行延时处理,生成延时参考时钟信号;The delayer is used to delay the reference clock signal and generate a delayed reference clock signal;
    则所述时间数字转换器,具体用于根据所述延时参考时钟信号与所述第一时钟信号,确定所述参考时钟信号的n个周期内,所述本地时钟信号的不完整周期中单位步长的第二数量。The time-to-digital converter is specifically configured to determine, based on the delayed reference clock signal and the first clock signal, the unit in the incomplete cycle of the local clock signal within n cycles of the reference clock signal. The second number of steps.
  6. 根据权利要求5所述的鉴频鉴相器,其特征在于,The frequency and phase detector according to claim 5, characterized in that:
    所述两相同步逻辑电路,还包括第一选择器,第二选择器以及第三选择器;The two-phase synchronous logic circuit also includes a first selector, a second selector and a third selector;
    所述两相同步逻辑电路的控制端连接至所述第一选择器的控制端、所述第二选择器的控制端以及所述第三选择器的控制端;The control terminal of the two-phase synchronous logic circuit is connected to the control terminal of the first selector, the control terminal of the second selector and the control terminal of the third selector;
    所述第一选择器的第一输入端连接至所述延时器的输出端,所述第一选择器的第二输入端连接至所述第三D触发器的正向输出端,所述第二选择器的输出端连接至所述两相同步逻辑电路的第一输出端;The first input terminal of the first selector is connected to the output terminal of the delay device, the second input terminal of the first selector is connected to the positive output terminal of the third D flip-flop, and the The output terminal of the second selector is connected to the first output terminal of the two-phase synchronous logic circuit;
    所述第二选择器的第一输入端连接至所述第二D触发器的正向输出端,所述第二选择器的第二输入端连接至所述第四D触发器的正向输出端,所述第二选择器的输出端连接至所述两相同步逻辑电路的第二输出端;The first input terminal of the second selector is connected to the positive output terminal of the second D flip-flop, and the second input terminal of the second selector is connected to the positive output terminal of the fourth D flip-flop. terminal, the output terminal of the second selector is connected to the second output terminal of the two-phase synchronous logic circuit;
    所述第三选择器的第一输入端连接至所述第四D触发器的正向输出端,所述第三选择器的第二输入端连接至所述第五D触发器的正向输出端,所述第三选择器的输出端连接至所述两相同步逻辑电路的第三输出端;The first input terminal of the third selector is connected to the positive output terminal of the fourth D flip-flop, and the second input terminal of the third selector is connected to the positive output terminal of the fifth D flip-flop. terminal, the output terminal of the third selector is connected to the third output terminal of the two-phase synchronous logic circuit;
    所述两相同步逻辑电路,从所述两相同步逻辑电路的控制端接收所述鉴频鉴相逻辑电路生成的控制信号;The two-phase synchronous logic circuit receives the control signal generated by the frequency and phase detection logic circuit from the control end of the two-phase synchronous logic circuit;
    所述第一选择器,在所述控制信号为第一电平时将所述延时参考信号通过所述两相同步逻辑电路的第一输出端传输至所述时间数字转换器的数据输入端;在所述控制信号为第二电平时将所述第二时钟信号通过所述两相同步逻辑电路的第一输出端传输至所述时间数字转换器的数据输入端;The first selector transmits the delay reference signal to the data input end of the time-to-digital converter through the first output end of the two-phase synchronous logic circuit when the control signal is a first level; When the control signal is at the second level, transmit the second clock signal to the data input end of the time-to-digital converter through the first output end of the two-phase synchronous logic circuit;
    所述第二选择器,在所述控制信号为所述第一电平时将所述第一时钟信号通过所述两相同步逻辑电路的第二输出端传输至所述时间数字转换器的时钟输入端;在所述控制信号为所述第二电平时将所述第三时钟信号通过所述两相同步逻辑电路的第二输出端传输至所述时间数字转换器的时钟输入端;The second selector transmits the first clock signal to the clock input of the time-to-digital converter through the second output end of the two-phase synchronous logic circuit when the control signal is the first level. terminal; when the control signal is the second level, transmit the third clock signal to the clock input terminal of the time-to-digital converter through the second output terminal of the two-phase synchronous logic circuit;
    所述第三选择器,在所述控制信号为所述第一电平时将所述第三时钟信号通过所述两相同步逻辑电路的第三输出端传输至所述时间数字转换器的采样输入端;在所述控制信号为所述第二电平时将所述第四时钟信号通过所述两相同步逻辑电路的第三输出端传输至所述时间数字转换器的采样输入端。The third selector transmits the third clock signal to the sampling input of the time-to-digital converter through the third output end of the two-phase synchronous logic circuit when the control signal is the first level. terminal; when the control signal is the second level, the fourth clock signal is transmitted to the sampling input terminal of the time-to-digital converter through the third output terminal of the two-phase synchronous logic circuit.
  7. 根据权利要求1-6任一项所述的鉴频鉴相器,其特征在于,所述计数器,还用于在所述鉴频鉴相逻辑电路生成的控制信号为第一电平时,根据所述第三时钟信号对所述第一数量进行采样,将所述第一数量存储于所述计数器中。The frequency and phase detector according to any one of claims 1 to 6, characterized in that the counter is also used to: when the control signal generated by the frequency and phase detection logic circuit is at the first level, according to the The third clock signal samples the first number and stores the first number in the counter.
  8. 根据权利要求1-6任一项所述的鉴频鉴相器,其特征在于,所述时间数字转换器,还用于在所述鉴频鉴相逻辑电路生成的控制信号为第一电平时,根据所述第三时 钟信号对所述第二数量进行采样,将所述第二数量存储于所述时间数字转换器中。The frequency and phase detector according to any one of claims 1 to 6, characterized in that the time-to-digital converter is also used when the control signal generated by the frequency and phase detection logic circuit is at the first level. , according to the third time The clock signal samples the second quantity and the second quantity is stored in the time-to-digital converter.
  9. 根据权利要求4-6任一项所述的鉴频鉴相器,其特征在于,所述时间数字转换器,还用于在所述控制信号为所述第二电平时,根据所述第四时钟信号对所述系数进行采样,将所述系数存储于所述时间数字转换器中。The frequency and phase detector according to any one of claims 4 to 6, characterized in that the time-to-digital converter is further configured to, when the control signal is the second level, generate the signal according to the fourth level when the control signal is the second level. The clock signal samples the coefficients, which are stored in the time-to-digital converter.
  10. 根据权利要求1-9任一项所述的鉴频鉴相器,其特征在于,The frequency and phase detector according to any one of claims 1-9, characterized in that:
    所述鉴频鉴相逻辑电路,还用于接收所述参考时钟信号,根据所述参考时钟信号生成控制信号,所述控制信号在所述参考时钟信号的第1个周期内为第二电平;所述控制信号在所述参考时钟信号的第2个周期至第n个周期内为第一电平。The frequency and phase identification logic circuit is also used to receive the reference clock signal and generate a control signal according to the reference clock signal. The control signal is the second level in the first cycle of the reference clock signal. ; The control signal is the first level within the 2nd cycle to the nth cycle of the reference clock signal.
  11. 一种锁相环,其特征在于,所述锁相环包括滤波器,振荡电路以及如权利要求1-10任一项所述的鉴频鉴相器;A phase-locked loop, characterized in that the phase-locked loop includes a filter, an oscillation circuit and a frequency and phase detector according to any one of claims 1-10;
    所述鉴频鉴相器通过所述滤波器连接至所述振荡电路,所述振荡电路还连接至所述鉴频鉴相器;The frequency and phase detector is connected to the oscillation circuit through the filter, and the oscillation circuit is also connected to the frequency and phase detector;
    所述鉴频鉴相器,接收参考时钟信号、所述振荡电路生成的本地时钟信号以及目标时钟信号,根据所述参考时钟信号、所述本地时钟信号以及所述目标时钟信号,确定所述目标时钟信号与所述本地时钟信号在所述参考时钟信号的n个周期内的第三相位差,根据所述第三相位差生成电压控制信号;The frequency and phase detector receives a reference clock signal, a local clock signal generated by the oscillator circuit, and a target clock signal, and determines the target based on the reference clock signal, the local clock signal, and the target clock signal. A third phase difference between the clock signal and the local clock signal within n cycles of the reference clock signal, and generating a voltage control signal according to the third phase difference;
    所述滤波器,接收所述电压控制信号,根据所述电压控制信号生成所述振荡电路的控制电压;The filter receives the voltage control signal and generates a control voltage of the oscillation circuit according to the voltage control signal;
    所述振荡电路,接收所述控制电压,在所述控制电压的控制下调整所述振荡电路生成的所述本地时钟信号的频率。The oscillation circuit receives the control voltage and adjusts the frequency of the local clock signal generated by the oscillation circuit under the control of the control voltage.
  12. 一种电子设备,其特征在于,所述电子设备包括印刷电路板,还包括:设置于所述印刷电路板上的如权利要求11所述的锁相环,或者设置于所述印刷电路板上的如权利要求1-10任一项所述的鉴频鉴相器。An electronic device, characterized in that the electronic device includes a printed circuit board, and further includes: a phase-locked loop as claimed in claim 11 disposed on the printed circuit board, or disposed on the printed circuit board The frequency and phase detector according to any one of claims 1-10.
  13. 一种鉴频鉴相方法,其特征在于,包括:A frequency and phase identification method, which is characterized by including:
    接收本地时钟信号和参考时钟信号;所述参考时钟信号的周期长度大于所述本地时钟信号的周期长度;在所述参考时钟信号的上升沿之后,根据所述本地时钟信号的第一个上升沿生成第一时钟信号,其中,所述第一时钟信号的上升沿不早于所述本地时钟信号的第一个上升沿;在所述参考时钟信号的上升沿之后,根据所述本地时钟信号的第二个上升沿生成第二时钟信号,其中,所述第二时钟信号的上升沿不早于所述本地时钟信号的第二个上升沿;在所述参考时钟信号的上升沿之后,根据所述本地时钟信号的第三个上升沿生成第三时钟信号,其中,所述第三时钟信号的上升沿不早于所述本地时钟信号的第三个上升沿;Receive a local clock signal and a reference clock signal; the period length of the reference clock signal is greater than the period length of the local clock signal; after the rising edge of the reference clock signal, according to the first rising edge of the local clock signal Generate a first clock signal, wherein the rising edge of the first clock signal is no earlier than the first rising edge of the local clock signal; after the rising edge of the reference clock signal, according to the The second rising edge generates a second clock signal, wherein the rising edge of the second clock signal is no earlier than the second rising edge of the local clock signal; after the rising edge of the reference clock signal, according to the The third rising edge of the local clock signal generates a third clock signal, wherein the rising edge of the third clock signal is no earlier than the third rising edge of the local clock signal;
    确定所述参考时钟信号的n个周期内,所述本地时钟信号的完整周期的第一数量,所述n为大于等于2的正整数;Determine the first number of complete cycles of the local clock signal within n cycles of the reference clock signal, where n is a positive integer greater than or equal to 2;
    根据所述第二时钟信号与所述第三时钟信号确定系数,所述系数是所述时间数字转换器的单位步长与所述本地时钟信号的一个周期的长度的比例;还根据所述参考时钟信号与所述第一时钟信号,确定所述参考时钟信号的所述n个周期内,所述本地时钟信号的不完整周期中的单位步长的第二数量;A coefficient is determined according to the second clock signal and the third clock signal, and the coefficient is the ratio of the unit step size of the time-to-digital converter to the length of one cycle of the local clock signal; also according to the reference The clock signal and the first clock signal determine the second number of unit steps in the incomplete cycles of the local clock signal within the n cycles of the reference clock signal;
    根据所述第一数量、所述第二数量、以及所述系数,确定在所述参考时钟信号的 所述n个周期内,所述参考时钟信号与所述本地时钟信号的第一相位差。According to the first quantity, the second quantity, and the coefficient, it is determined that the value of the reference clock signal is Within the n periods, the first phase difference between the reference clock signal and the local clock signal.
  14. 根据权利要求13所述的鉴频鉴相方法,其特征在于,所述根据所述第一数量、所述第二数量、以及所述系数,确定在所述参考时钟信号的所述n个周期内,所述参考时钟信号与所述本地时钟信号的第一相位差,具体包括:The frequency and phase identification method according to claim 13, characterized in that, according to the first quantity, the second quantity, and the coefficient, it is determined that in the n periods of the reference clock signal Within, the first phase difference between the reference clock signal and the local clock signal specifically includes:
    根据所述第二数量以及所述系数,确定所述第二数量对应的所述本地时钟信号的完整周期的第三数量;Determine a third number of complete cycles of the local clock signal corresponding to the second number according to the second number and the coefficient;
    将所述第一数量加上所述第三数量,得到在所述参考时钟信号的所述n个周期内,所述本地时钟信号的完整周期的第四数量;Adding the first number to the third number yields a fourth number of complete cycles of the local clock signal within the n cycles of the reference clock signal;
    根据所述参考时钟信号与所述第四数量,确定在所述参考时钟信号的所述n个周期内,所述参考时钟信号与所述本地时钟信号的第一相位差。According to the reference clock signal and the fourth quantity, a first phase difference between the reference clock signal and the local clock signal within the n periods of the reference clock signal is determined.
  15. 根据权利要求14所述的鉴频鉴相方法,其特征在于,还包括:The method of frequency and phase identification according to claim 14, further comprising:
    根据所述n个周期内的所述第四数量,以及下一个所述n个周期内的所述第四数量,确定第二相位差;根据所述第二相位差确定所述本地时钟信号的频率。Determine a second phase difference according to the fourth number within the n cycles and the fourth number within the next n cycles; determine the local clock signal according to the second phase difference. frequency.
  16. 根据权利要求13-15任一项所述的鉴频鉴相方法,其特征在于,The frequency and phase identification method according to any one of claims 13-15, characterized in that:
    所述接收本地时钟信号和参考时钟信号之后,还包括:在所述参考时钟信号的上升沿之后,根据所述本地时钟信号的第四个上升沿生成第四时钟信号,其中,所述第四时钟信号的上升沿不早于所述本地时钟信号的第四个上升沿。After receiving the local clock signal and the reference clock signal, the method further includes: after the rising edge of the reference clock signal, generating a fourth clock signal according to the fourth rising edge of the local clock signal, wherein the fourth The rising edge of the clock signal is no earlier than the fourth rising edge of the local clock signal.
  17. 根据权利要求13所述的鉴频鉴相方法,其特征在于,所述接收本地时钟信号和参考时钟信号之后,包括:The frequency and phase identification method according to claim 13, characterized in that after receiving the local clock signal and the reference clock signal, it includes:
    在所述参考时钟信号的控制下,根据第三电平生成使能信号;Under the control of the reference clock signal, generate an enable signal according to the third level;
    对接收的所述使能信号、所述本地时钟信号以及第四时钟信号进行或逻辑处理,生成控制时钟信号;Perform logical OR processing on the received enable signal, the local clock signal and the fourth clock signal to generate a control clock signal;
    在所述参考时钟信号、以及所述控制时钟信号的控制下,根据所述第三电平生成所述第一时钟信号;Under the control of the reference clock signal and the control clock signal, generate the first clock signal according to the third level;
    在所述参考时钟信号、以及所述控制时钟信号的控制下,根据所述第一时钟信号生成所述第二时钟信号;Under the control of the reference clock signal and the control clock signal, generate the second clock signal according to the first clock signal;
    在所述参考时钟信号、以及所述控制时钟信号的控制下,根据所述第二时钟信号生成所述第三时钟信号;Under the control of the reference clock signal and the control clock signal, generate the third clock signal according to the second clock signal;
    在所述参考时钟信号、以及所述控制时钟信号的控制下,根据所述第三时钟信号生成所述第四时钟信号;Under the control of the reference clock signal and the control clock signal, generate the fourth clock signal according to the third clock signal;
    对所述参考时钟信号进行延时处理,生成延时参考时钟信号;Perform delay processing on the reference clock signal to generate a delayed reference clock signal;
    则所述根据所述参考时钟信号与所述第一时钟信号,确定所述参考时钟信号的所述n个周期内,所述本地时钟信号的不完整周期中的单位步长的第二数量,具体包括:Then, according to the reference clock signal and the first clock signal, determine the second number of unit steps in the incomplete cycles of the local clock signal within the n cycles of the reference clock signal, Specifically include:
    根据所述延时参考时钟信号与所述第一时钟信号,确定所述参考时钟信号的n个周期内,所述本地时钟信号的不完整周期中单位步长的第二数量。According to the delayed reference clock signal and the first clock signal, a second number of unit steps in incomplete cycles of the local clock signal within n cycles of the reference clock signal is determined.
  18. 根据权利要求13-17任一项所述的鉴频鉴相方法,其特征在于,还包括:在控制信号为第一电平时,根据所述第三时钟信号对所述第一数量进行采样,将所述第一数量存储。The frequency and phase identification method according to any one of claims 13 to 17, further comprising: when the control signal is at the first level, sampling the first quantity according to the third clock signal, Store the first quantity.
  19. 根据权利要求13-17任一项所述的鉴频鉴相方法,其特征在于,还包括:在控 制信号为第一电平时,根据所述第三时钟信号对所述第二数量进行采样,将所述第二数量存储。The frequency and phase identification method according to any one of claims 13 to 17, characterized in that it further includes: in the control When the clock signal is at the first level, the second quantity is sampled according to the third clock signal, and the second quantity is stored.
  20. 根据权利要求16或17所述的鉴频鉴相方法,其特征在于,还包括:在控制信号为第二电平时,根据所述第四时钟信号对所述系数进行采样,将所述系数存储。The frequency and phase identification method according to claim 16 or 17, further comprising: when the control signal is at the second level, sampling the coefficient according to the fourth clock signal, and storing the coefficient .
  21. 根据权利要求13-20任一项所述的鉴频鉴相方法,其特征在于,The frequency and phase identification method according to any one of claims 13-20, characterized in that,
    还包括:接收所述参考时钟信号,根据所述参考时钟信号生成控制信号,所述控制信号在所述参考时钟信号的第1个周期内为第二电平;所述控制信号在所述参考时钟信号的第2个周期至第n个周期内为第一电平。It also includes: receiving the reference clock signal, generating a control signal according to the reference clock signal, the control signal being a second level in the first cycle of the reference clock signal; The clock signal is at the first level from the 2nd cycle to the nth cycle.
  22. 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如上述权利要求13-21任一项所述的鉴频鉴相方法。A computer-readable storage medium, characterized in that it includes computer instructions. When the computer instructions are run on an electronic device, the electronic device causes the electronic device to perform frequency identification as described in any one of claims 13-21. phase method.
  23. 一种计算机程序产品,其特征在于,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行如上述权利要求13-21任一项所述的鉴频鉴相方法。 A computer program product, characterized in that, when the computer program product is run on an electronic device, it causes the electronic device to execute the frequency and phase identification method as described in any one of claims 13-21.
PCT/CN2023/076786 2022-03-23 2023-02-17 Phase-frequency detector, phase-locked loop, and electronic device WO2023179261A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210290537.0 2022-03-23
CN202210290537.0A CN116846386A (en) 2022-03-23 2022-03-23 Phase frequency detector, phase-locked loop and electronic equipment

Publications (1)

Publication Number Publication Date
WO2023179261A1 true WO2023179261A1 (en) 2023-09-28

Family

ID=88099847

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/076786 WO2023179261A1 (en) 2022-03-23 2023-02-17 Phase-frequency detector, phase-locked loop, and electronic device

Country Status (2)

Country Link
CN (1) CN116846386A (en)
WO (1) WO2023179261A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117169593B (en) * 2023-11-02 2024-01-30 成都电科星拓科技有限公司 Indirect measurement method, system, equipment and medium for step length of time-to-digital converter

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010030565A1 (en) * 2000-04-04 2001-10-18 Matsushita Electric Industrial Co., Ltd. Multiphase clock generator and selector circuit
US6466098B2 (en) * 2000-02-23 2002-10-15 Texas Instruments Incorporated Analogue-controlled phase interpolator
CN1494218A (en) * 2002-12-26 2004-05-05 北京大学 Discriminator and lock phase ring using said discriminator
CN1617451A (en) * 2003-11-15 2005-05-18 华为技术有限公司 Digital phase detector
CN103441759A (en) * 2013-08-28 2013-12-11 电子科技大学 Phase frequency detector
CN113411081A (en) * 2021-08-06 2021-09-17 迈科微电子(深圳)有限公司 Frequency discriminator for phase-locked loop and phase-locked loop
CN114142851A (en) * 2021-11-11 2022-03-04 浙江大学 Sampling type phase frequency detector circuit

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6466098B2 (en) * 2000-02-23 2002-10-15 Texas Instruments Incorporated Analogue-controlled phase interpolator
US20010030565A1 (en) * 2000-04-04 2001-10-18 Matsushita Electric Industrial Co., Ltd. Multiphase clock generator and selector circuit
CN1494218A (en) * 2002-12-26 2004-05-05 北京大学 Discriminator and lock phase ring using said discriminator
CN1617451A (en) * 2003-11-15 2005-05-18 华为技术有限公司 Digital phase detector
CN103441759A (en) * 2013-08-28 2013-12-11 电子科技大学 Phase frequency detector
CN113411081A (en) * 2021-08-06 2021-09-17 迈科微电子(深圳)有限公司 Frequency discriminator for phase-locked loop and phase-locked loop
CN114142851A (en) * 2021-11-11 2022-03-04 浙江大学 Sampling type phase frequency detector circuit

Also Published As

Publication number Publication date
CN116846386A (en) 2023-10-03

Similar Documents

Publication Publication Date Title
US6731667B1 (en) Zero-delay buffer circuit for a spread spectrum clock system and method therefor
KR101750414B1 (en) Digital phase frequency detector, digital phase locked loop including the same and method of detecting digital phase frequency
US6429693B1 (en) Digital fractional phase detector
US7994828B2 (en) Frequency divider, frequency dividing method thereof, and phase locked loop utilizing the frequency divider
EP3170262B1 (en) Clock synchronization
US6169501B1 (en) Adjustable serial-to-parallel or parallel-to-serial converter
US6060928A (en) Device for delaying clock signal
US6879195B2 (en) PLL lock detection circuit using edge detection
US11342925B2 (en) Signal generation circuit and method, and digit-to-time conversion circuit and method
WO2023179261A1 (en) Phase-frequency detector, phase-locked loop, and electronic device
KR102123901B1 (en) All digital phase locked loop, semiconductor apparatus, and portable information device
US20170270984A1 (en) Data Reading Circuit
US20060164141A1 (en) Controlled delay line circuit with integrated transmission line reference
CN101729063B (en) Delay phase locked loop circuit and method for adjusting output clock signal phase
US7792650B2 (en) Edge-aligned ratio counter
US9164134B2 (en) High-resolution phase detector
CN110635800B (en) Locking indication circuit and method applied to phase-locked loop and based on frequency comparison
JP2012049660A (en) Phase lock loop
US20220052703A1 (en) Signal generation circuit and method, and digit-to-time conversion circuit and method
CN107528584A (en) It is multiplexed the high accuracy number delay locked loop of delay line
KR101000486B1 (en) DLL-based frequency multiplier
US7366943B1 (en) Low-latency synchronous-mode sync buffer circuitry having programmable margin
CN113489488A (en) Phase-locked detection circuit
JP2005184833A (en) Triggered dds pulse generator
KR100937716B1 (en) Apparatus and method for DLL-based frequency multiplier

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: 23773512

Country of ref document: EP

Kind code of ref document: A1