Clock detection circuit, detection method, chip and communication system
By designing a clock detection circuit including a flip-flop and a counter, the problem of untimely and complex detection by traditional clock detection methods is solved, low-cost, high-reliability clock detection is achieved, multi-clock detection is supported and the circuit structure is simplified.
Patent Information
- Application Number
- CN202410236899.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-01
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-03-01
AI Technical Summary
Traditional clock signal loss detection methods are not timely and have complex circuits, making it difficult to achieve fast response and low-cost integration.
A clock detection circuit is designed, including a flip-flop unit, a synchronization unit, an inversion unit, a reset synchronization unit and a clock detection unit. The detection of clock loss and recovery signals is realized through D flip-flops and counters. A parameter design unit is used to support multiple Clock detection, simplifying the circuit structure.
It realizes clock detection of purely digital circuits, has low cost, fast response, easy integration, improves the reliability and flexibility of clock detection, and can be implemented in PLD.
Smart Images

Figure CN118118010B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of signal processing and relates to a detection circuit, and in particular to a clock detection circuit, a detection method, a chip and a communication system. Background Art
[0002] Clock signals are crucial in various application fields such as communication systems, and the reliability requirements for clocks are very strict. In order to ensure stable signal transmission, the phenomenon of continuous loss of clock signal pulses is not allowed. When the clock signal is lost or abnormal, the chip cannot work normally, so it is necessary to design a special clock detection circuit.
[0003] Traditional methods of detecting clock signal loss include sending the clock signal to the outside of the chip, such as an oscilloscope, for observation; or testing the average clock frequency within a preset period. This method may not immediately detect input clock loss errors; the other method is to use a reference clock edge extraction circuit to extract the reference clock edge and then control the discharge of the capacitor of the basic timing unit, output the capacitor voltage information through the Schmitt trigger, and then process it through the counter to obtain the final status information. Although this method does not rely on an additional reference clock, the circuit is relatively complex and difficult to integrate. Summary of the invention
[0004] The present application provides a clock detection circuit, a detection method, a chip and a communication system, which are used to solve the problems of untimely detection and complex detection circuits in traditional clock detection methods.
[0005] In the first aspect, the present application provides a clock detection circuit, which includes: a trigger unit, including a first trigger and a second trigger; a detected clock is input to the first trigger; a synchronization unit, connected to the output end of the first trigger, and outputs a synchronization signal of the first trigger; an inverting unit, connected to the output end of the synchronization unit and the input end of the second trigger, respectively, and outputs an inverted signal corresponding to the synchronization signal, and the inverted signal is received by the second trigger and then outputs an intermediate detection signal; a reset synchronization unit, connected to the reset input end of the first trigger and the output end of the second trigger, respectively, resets the intermediate detection signal output by the second trigger and then transmits it to the reset input end of the first trigger; a clock detection unit, connected to the output end of the second trigger, and outputs a clock detection signal after detecting the intermediate detection signal output by the second trigger.
[0006] In an implementation manner of the first aspect, the first trigger is a D trigger; the detected clock is input to a clock terminal of the D trigger, and an input terminal of the D trigger is connected to a high level.
[0007] In an implementation of the first aspect, the clock detection signal includes a clock loss signal; the clock detection unit includes a loss cycle counter and a loss threshold comparator, and the loss cycle counter is connected to the loss threshold comparator; in response to the intermediate detection signal being a high level, the loss cycle counter inputs the high level, outputs the loss count result to the loss threshold comparator, and the loss threshold comparator outputs the clock loss signal.
[0008] In an implementation of the first aspect, the clock detection signal includes a clock recovery signal; the clock detection unit includes a recovery cycle counter and a recovery threshold comparator, and the recovery cycle counter is connected to the recovery threshold comparator; in response to the intermediate detection signal being a recovery clock rising edge, the recovery cycle counter inputs the recovery clock rising edge, outputs the recovery count result to the recovery threshold comparator, and the recovery threshold comparator outputs the clock recovery signal.
[0009] In an implementation manner of the first aspect, the circuit further includes a first parameter design unit; the first parameter design unit is used to determine one of a plurality of detected clocks to be input to the first trigger.
[0010] In an implementation manner of the first aspect, the second trigger includes at least one trigger, and each trigger is cascaded to output the intermediate detection signal.
[0011] In an implementation manner of the first aspect, the circuit further includes a second parameter design unit; the second parameter design unit is used to determine that at least one of the plurality of second triggers outputs the intermediate detection signal after being cascaded.
[0012] In the second aspect, the present application provides a clock detection method, which includes: inputting a detected clock into a first trigger; outputting a synchronization signal of the first trigger; outputting an inverted signal corresponding to the synchronization signal, and the inverted signal is received by a second trigger and then outputs an intermediate detection signal; resetting the intermediate detection signal output by the second trigger and then transmitting it to the input of the first trigger; and outputting a clock detection signal after detecting the intermediate detection signal output by the second trigger.
[0013] In a third aspect, the present application provides a chip, comprising: the circuit described above.
[0014] In a fourth aspect, the present application provides a communication system, comprising: the circuit described above; the communication system communicates using a detected clock, and the detected clock performs clock detection through the circuit.
[0015] As described above, the clock detection circuit, detection method, chip and communication system described in the present application have the following beneficial effects:
[0016] The present application provides a clock detection method that is built with a pure digital circuit, has low cost, fast response, and is easy to integrate. Through parameter design, multiple clocks can also be detected, saving circuit resources. The present application is simple to integrate and can be integrated into a PLD (Programmable Logic Device), thereby improving the reliability of clock detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 Shown is a circuit diagram of a clock detection circuit described in an embodiment of the present application.
[0018] Figure 2 Shown is a circuit schematic diagram of the clock detection circuit described in an embodiment of the present application.
[0019] Figure 3 Shown is a clock detection schematic diagram of the clock detection circuit described in an embodiment of the present application.
[0020] Figure 4 Shown is a clock detection timing diagram of the clock detection circuit described in an embodiment of the present application.
[0021] Figure 5 Shown is a principle flow chart of the clock detection method described in an embodiment of the present application.
[0022] Figure 6 Shown is a schematic diagram of the structure of the chip described in an embodiment of the present application.
[0023] Figure 7 Shown is a schematic diagram of the structure of the communication system described in an embodiment of the present application.
[0024] Component number description
[0025] 1 Clock detection circuit
[0026] 11 Trigger unit
[0027] 111 First Trigger
[0028] 112 Second trigger
[0029] 12 Synchronous unit
[0030] 13 Inverting unit
[0031] 14 Reset synchronization unit
[0032] 15. Clock detection unit
[0033] 151 Lost cycle counter
[0034] 152 Loss Threshold Comparator
[0035] 153 Recovery cycle counter
[0036] 154 Restoration Threshold Comparator
[0037] Steps S51 to S55 DETAILED DESCRIPTION
[0038] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0039] It should be noted that the illustrations provided in the following embodiments are only used to illustrate the basic concept of the present application in a schematic manner, and therefore the illustrations only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0040] The technical solutions in the embodiments of the present application will be described in detail below in conjunction with the drawings in the embodiments of the present application.
[0041] See also Figure 1 , which is a circuit diagram of a clock detection circuit according to an embodiment of the present application. Figure 1 As shown, this embodiment provides a clock detection circuit 1, which specifically includes: a trigger unit 11, a synchronization unit 12, an inversion unit 13, a reset synchronization unit 14 and a clock detection unit 15.
[0042] The trigger unit 11 includes a first trigger 111 and a second trigger 112 ; the detected clock is input to the first trigger 111 .
[0043] The synchronization unit 12 is connected to the output end of the first trigger 111 and outputs a synchronization signal of the first trigger 111 .
[0044] The inverting unit 13 is connected to the output end of the synchronization unit 12 and the input end of the second trigger 112 respectively, and outputs an inverted signal corresponding to the synchronization signal. The inverted signal is received by the second trigger 112 and then outputs an intermediate detection signal.
[0045] The reset synchronization unit 14 is connected to the reset input terminal of the first trigger 111 and the output terminal of the second trigger 112 respectively, and resets the intermediate detection signal output by the second trigger 112 and then transmits it to the reset input terminal of the first trigger 111 .
[0046] The clock detection unit 15 is connected to the output end of the second flip-flop 112 , and outputs a clock detection signal after detecting the intermediate detection signal output by the second flip-flop 112 .
[0047] See also Figure 2 , which is a circuit schematic diagram of the clock detection circuit described in the embodiment of the present application. Figure 2 As shown, the first trigger 111 and the second trigger 112 are both D triggers with a reset input terminal. The D trigger used by the first trigger 111 is used as the first D trigger, and the D trigger used by the second trigger 112 is used as the second D trigger.
[0048] Combination Figure 2 , the detected clock is input to the clock terminal of the first D flip-flop, and the input terminal D of the D flip-flop is connected to the high level 1'b1.
[0049] The synchronization unit 12 is connected to the output terminal Q of the first D flip-flop 111 , and the synchronization unit 12 outputs a synchronization signal of the first D flip-flop 111 .
[0050] The inverting unit 13 is respectively connected to the output end of the synchronization unit 12 and the input end D of the second D trigger 112, and outputs an inverted signal corresponding to the synchronization signal. The inverted signal is received by the D end of the second trigger 112 and then outputs an intermediate detection signal through the Q end.
[0051] The reset synchronization unit 14 is respectively connected to the reset input terminal CLR of the first D flip-flop 111 and the output terminal Q of the second D flip-flop 112 , and resets the intermediate detection signal output by the second D flip-flop 112 and then transmits it to the reset input terminal CLR of the first D flip-flop 111 .
[0052] The clock detection unit 15 is connected to the output terminal Q of the second D flip-flop 112 , and under the action of the enable signal enable, detects the intermediate detection signal output by the second D flip-flop 112 and then outputs a clock detection signal, such as a clock loss signal clk_loss.
[0053] Specifically, the synchronization unit includes a synchronizer, the inversion unit includes an inverter, and the reset synchronization unit includes a reset synchronizer.
[0054] It should be noted that the first trigger and the second trigger being a D trigger is only one implementation of the present application, and other electronic components having a data input terminal, a clock input terminal, a reset input terminal and a data output terminal and capable of implementing the clock detection principle of the present application are all within the scope of protection of the present application.
[0055] See also Figure 3 , which is a schematic diagram of clock detection of the clock detection circuit described in the embodiment of the present application. Figure 3 As shown, the clock detection signal output by the clock detection unit 15 is different in different clock states. The clock detection signal output when the clock is lost is a clock loss signal; the clock detection signal output when the clock is lost and then recovered is a clock recovery signal.
[0056] In one embodiment, the clock detection signal includes a clock loss signal.
[0057] like Figure 3 As shown, the clock detection unit 15 includes a lost cycle counter 151 and a lost threshold comparator 152 , and the lost cycle counter 151 is connected to the lost threshold comparator 152 .
[0058] In response to the intermediate detection signal being at a high level, the lost cycle counter 151 inputs the high level and outputs a lost count result to the lost threshold comparator 152 , and the lost threshold comparator 152 outputs the clock lost signal.
[0059] In another embodiment, the clock detection signal includes a clock recovery signal.
[0060] like Figure 3 As shown, the clock detection unit includes a recovery cycle counter 153 and a recovery threshold comparator 154 , and the recovery cycle counter 153 is connected to the recovery threshold comparator 154 .
[0061] In response to the intermediate detection signal being a rising edge of the recovery clock, the recovery cycle counter 153 inputs the rising edge of the recovery clock and outputs a recovery counting result to the recovery threshold comparator 154 , and the recovery threshold comparator 154 outputs the clock recovery signal.
[0062] In one embodiment, the circuit further includes a first parameter design unit;
[0063] The first parameter design unit is used to determine one of a plurality of detected clocks to be input to the first trigger.
[0064] Specifically, by instantiating multiple times or using mux to select the detected clock, the present application selects the detected clock through mux and reuses the same set of clock detection logic to save circuit resources. In practical applications, multiple detected clocks can be determined according to different multiples of the reference clock.
[0065] In one embodiment, the second trigger includes at least one trigger, and each trigger is cascaded to output the intermediate detection signal. Figure 2 As shown, each second D flip-flop is cascaded, the input terminal D of the front second D flip-flop is connected to the inverting unit 13, the output terminal Q of the rear second D flip-flop is connected to the clock detection unit 15, and the second D flip-flops in the middle are all connected between the Q output of the previous one and the D input of the next one. The clock terminals of all the second D flip-flops are connected to the internal reliable clock, and the CLR reset terminal is connected to the reliable reset. Among them, the reliable clock refers to the crystal oscillator clock, or the clock that is determined not to be lost, and the reliable reset refers to the reset generated under the reliable clock.
[0066] In one embodiment, the circuit further includes a second parameter design unit.
[0067] The second parameter design unit is used to determine that at least one of the plurality of second triggers outputs the intermediate detection signal after being cascaded.
[0068] Specifically, the second parameter unit can be implemented by a selection circuit including a switch on-off device, and one or some second triggers are short-circuited or connected by opening and closing the switch, thereby determining which second triggers are connected to the clock detection circuit.
[0069] Due to the parameterized design of the first parameter design unit, the present application can realize the detection of different clocks; through the parameterized design of the second parameter design unit, the number of D trigger groups is parameter-controllable, thereby, the present application can ensure the reliability and stability detection of clock loss.
[0070] Combination Figure 2 and Figure 3 , the working principle of the clock detection circuit in this embodiment is as follows:
[0071] like Figure 2As shown, the high level is connected to the D end of the first D flip-flop. When the detected clock is lost, the Q end of the first D flip-flop outputs 0 because of the lost clock. After a first-level synchronizer, the synchronized signal is inverted to 1 and connected to the D end of the second D flip-flop. After several D flip-flops, 1 is output from the Q end of the second D flip-flop of the last level. One end is connected to the reset end CLR of the first D flip-flop through the reset synchronizer, and the other end is connected to the clock detection unit. Since the first D flip-flop has no clock, the Q end output is always 0, so the Q end of the last level D flip-flop is always high level; in the clock detection unit, the existence time of the high level will be recorded through the loss cycle counter. When the set loss threshold is reached, for example, the preset loss threshold is 5 cycles, a clock loss signal will be output. In practical applications, the setting of the loss threshold mainly considers the frequency relationship between the detected clock and the reference clock and the criterion for the clock to be considered lost; for the criterion, in order to avoid the clock just flashing off, the detected clock is generally pulled down for at least 5-6 cycles before it is considered lost; and the final threshold is set according to the multiple relationship between the two.
[0072] When the detected clock is recovered, the Q terminal of the first D flip-flop outputs 1, and after passing through the synchronizer and inverter, the output 0 is connected to the second D flip-flop group. The last second D flip-flop outputs 0, and one end is connected to the reset terminal CLR of the first D flip-flop after passing through the reset synchronizer. Since the reset low level is effective, the first D flip-flop outputs 0, and after passing through the synchronizer and inverter, it outputs 1; therefore, in the clock detection unit, the signal seen is a 0, 1 jump; the clock detection unit will record the number of jumps from 0 to 1 through the recovery cycle counter, and when the recovery threshold is reached, the clock loss signal will be cancelled, that is, it will become a clock recovery signal. In actual applications, the setting of the recovery threshold is the same as the loss threshold. It is necessary to consider whether the detected clock is really recovered or jumped for a moment. Therefore, the detected clock must be maintained for at least 4-5 cycles before it is considered to be recovered.
[0073] See also Figure 4 , which shows a clock detection timing diagram of the clock detection circuit described in the embodiment of the present application. Figure 4 As shown in the figure, dut_clk represents the detected clock, ref_clk represents the reference clock, clk_loss represents the clock loss signal, ifm_en represents the clock detection unit enable signal, and dout represents the output signal of the last second D flip-flop. It can be seen that the high level period of clk_loss is the output period of the clock loss signal.
[0074] See also Figure 5 , which is a principle flow chart of the clock detection method described in the embodiment of the present application. Figure 5As shown, this embodiment provides a clock detection method, which is applied to a clock detection circuit, and the clock detection circuit includes: a trigger unit, including a first trigger and a second trigger; a detected clock is input to the first trigger; a synchronization unit, connected to the output end of the first trigger, outputting the synchronization signal of the first trigger; an inversion unit, respectively connected to the output end of the synchronization unit and the input end of the second trigger, outputting an inversion signal corresponding to the synchronization signal, and the inversion signal is received by the second trigger and then outputs an intermediate detection signal; a reset synchronization unit, respectively connected to the reset input end of the first trigger and the output end of the second trigger, resetting the intermediate detection signal output by the second trigger and then transmitting it to the reset input end of the first trigger; a clock detection unit, connected to the output end of the second trigger, and outputting a clock detection signal after detecting the intermediate detection signal output by the second trigger. The clock detection method specifically includes steps S51 to S55:
[0075] S51, inputting the detected clock into the first trigger.
[0076] In one embodiment, the first trigger is a D trigger; the detected clock is input to a clock terminal of the D trigger, and an input terminal of the D trigger is connected to a high level.
[0077] In one embodiment, the circuit further includes a first parameter design unit; the first parameter design unit is used to determine one of a plurality of detected clocks to be input to the first trigger.
[0078] S52, output the synchronization signal of the first trigger.
[0079] S53, outputting an inverted signal corresponding to the synchronization signal, wherein the inverted signal is received by the second trigger and then outputs an intermediate detection signal.
[0080] In one embodiment, the second trigger includes at least one trigger, and each trigger is cascaded to output the intermediate detection signal.
[0081] In one embodiment, the circuit further includes a second parameter design unit; the second parameter design unit is used to determine that at least one of the plurality of second triggers outputs the intermediate detection signal after being cascaded.
[0082] S54, resetting the intermediate detection signal output by the second trigger and then transmitting it to the input of the first trigger.
[0083] S55, outputting a clock detection signal after detecting the intermediate detection signal output by the second trigger.
[0084] In one embodiment, the clock detection signal includes a clock loss signal; the clock detection unit includes a loss cycle counter and a loss threshold comparator, and the loss cycle counter is connected to the loss threshold comparator; in response to the intermediate detection signal being a high level, the loss cycle counter inputs the high level, outputs the loss count result to the loss threshold comparator, and the loss threshold comparator outputs the clock loss signal.
[0085] In one embodiment, the clock detection signal includes a clock recovery signal; the clock detection unit includes a recovery cycle counter and a recovery threshold comparator, and the recovery cycle counter is connected to the recovery threshold comparator; in response to the intermediate detection signal being a recovery clock rising edge, the recovery cycle counter inputs the recovery clock rising edge, outputs the recovery count result to the recovery threshold comparator, and the recovery threshold comparator outputs the clock recovery signal.
[0086] The protection scope of the clock detection method described in the embodiment of the present application is not limited to the execution order of the steps listed in the present embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present application are included in the protection scope of the present application.
[0087] The clock detection circuit provided in the embodiment of the present application can implement the clock detection method described in the present application, but the implementation device of the clock detection method described in the present application includes but is not limited to the structure of the clock detection circuit listed in the present embodiment. All structural deformations and replacements of the prior art made according to the principles of the present application are included in the protection scope of the present application.
[0088] In the several embodiments provided in the present application, it should be understood that the disclosed circuit device or method can be implemented in other ways. For example, the circuit embodiments described above are only schematic, for example, the division of modules / units is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules or units, which can be electrical, mechanical or other forms.
[0089] The modules / units described as separate components may or may not be physically separated, and the components displayed as modules / units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules / units may be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, the functional modules / units in the various embodiments of the present application may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.
[0090] Those of ordinary skill in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0091] See also Figure 6 , which is a schematic diagram of the structure of the chip described in the embodiment of the present application. Figure 6 As shown, this embodiment provides a chip, and the chip includes: the above-mentioned clock detection circuit.
[0092] The clock detection circuit includes: a trigger unit, including a first trigger and a second trigger; a detected clock is input to the first trigger; a synchronization unit, connected to the output end of the first trigger, and outputs a synchronization signal of the first trigger; an inversion unit, connected to the output end of the synchronization unit and the input end of the second trigger, respectively, and outputs an inversion signal corresponding to the synchronization signal, and the inversion signal is received by the second trigger and then outputs an intermediate detection signal; a reset synchronization unit, connected to the reset input end of the first trigger and the output end of the second trigger, respectively, resets the intermediate detection signal output by the second trigger and then transmits it to the reset input end of the first trigger; a clock detection unit, connected to the output end of the second trigger, and outputs a clock detection signal after detecting the intermediate detection signal output by the second trigger.
[0093] In one embodiment, the first trigger is a D trigger; the detected clock is input to a clock terminal of the D trigger, and an input terminal of the D trigger is connected to a high level.
[0094] In one embodiment, the clock detection signal includes a clock loss signal; the clock detection unit includes a loss cycle counter and a loss threshold comparator, and the loss cycle counter is connected to the loss threshold comparator; in response to the intermediate detection signal being a high level, the loss cycle counter inputs the high level, outputs the loss count result to the loss threshold comparator, and the loss threshold comparator outputs the clock loss signal.
[0095] In one embodiment, the clock detection signal includes a clock recovery signal; the clock detection unit includes a recovery cycle counter and a recovery threshold comparator, and the recovery cycle counter is connected to the recovery threshold comparator; in response to the intermediate detection signal being a recovery clock rising edge, the recovery cycle counter inputs the recovery clock rising edge, outputs the recovery count result to the recovery threshold comparator, and the recovery threshold comparator outputs the clock recovery signal.
[0096] In one embodiment, the circuit further includes a first parameter design unit; the first parameter design unit is used to determine one of a plurality of detected clocks to be input to the first trigger.
[0097] In one embodiment, the second trigger includes at least one trigger, and each trigger is cascaded to output the intermediate detection signal.
[0098] In one embodiment, the circuit further includes a second parameter design unit; the second parameter design unit is used to determine that at least one of the plurality of second triggers outputs the intermediate detection signal after being cascaded.
[0099] See also Figure 7 , which is a schematic diagram of the structure of the communication system described in the embodiment of the present application. Figure 7 As shown, this embodiment provides a communication system, which includes: the above-mentioned clock detection circuit; the communication system uses the detected clock to communicate, and the detected clock is detected by the circuit.
[0100] The clock detection circuit includes: a trigger unit, including a first trigger and a second trigger; a detected clock is input to the first trigger; a synchronization unit, connected to the output end of the first trigger, and outputs a synchronization signal of the first trigger; an inversion unit, connected to the output end of the synchronization unit and the input end of the second trigger, respectively, and outputs an inversion signal corresponding to the synchronization signal, and the inversion signal is received by the second trigger and then outputs an intermediate detection signal; a reset synchronization unit, connected to the reset input end of the first trigger and the output end of the second trigger, respectively, resets the intermediate detection signal output by the second trigger and then transmits it to the reset input end of the first trigger; a clock detection unit, connected to the output end of the second trigger, and outputs a clock detection signal after detecting the intermediate detection signal output by the second trigger.
[0101] In one embodiment, the first trigger is a D trigger; the detected clock is input to a clock terminal of the D trigger, and an input terminal of the D trigger is connected to a high level.
[0102] In one embodiment, the clock detection signal includes a clock loss signal; the clock detection unit includes a loss cycle counter and a loss threshold comparator, and the loss cycle counter is connected to the loss threshold comparator; in response to the intermediate detection signal being a high level, the loss cycle counter inputs the high level, outputs the loss count result to the loss threshold comparator, and the loss threshold comparator outputs the clock loss signal.
[0103] In one embodiment, the clock detection signal includes a clock recovery signal; the clock detection unit includes a recovery cycle counter and a recovery threshold comparator, and the recovery cycle counter is connected to the recovery threshold comparator; in response to the intermediate detection signal being a recovery clock rising edge, the recovery cycle counter inputs the recovery clock rising edge, outputs the recovery count result to the recovery threshold comparator, and the recovery threshold comparator outputs the clock recovery signal.
[0104] In one embodiment, the circuit further includes a first parameter design unit; the first parameter design unit is used to determine one of a plurality of detected clocks to be input to the first trigger.
[0105] In one embodiment, the second trigger includes at least one trigger, and each trigger is cascaded to output the intermediate detection signal.
[0106] In one embodiment, the circuit further includes a second parameter design unit; the second parameter design unit is used to determine that at least one of the plurality of second triggers outputs the intermediate detection signal after being cascaded.
[0107] The principles and implementation effects of the communication system described in this application in different application scenarios are as follows:
[0108] In scenario one, PHY (Physical, port physical layer, is a common abbreviation for the physical layer of the OSI model), MAC (Media Access Control Address, also known as physical address) and Switch are connected to the clock detection circuit. When the clock is normal, the message is sent and received normally; if the PHY clock configuration is turned off, the message cannot be sent and received normally, and the clock loss signal is output. Therefore, in this scenario, this application can quickly eliminate the fault that does not come from the Switch and MAC, and can quickly determine that it is a problem with the physical PHY.
[0109] Scenario 2: Access the internal registers of the chip through the configuration bus and connect to the clock detection circuit. Regardless of reading or writing, the chip does not respond, but the clock loss signal of the configuration clock is output. In this scenario, this application can determine that the bus read and write failure is not a logical path problem, but a configuration clock problem.
[0110] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
[0111] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A clock detection circuit, characterized in that: The circuit comprises: The trigger unit includes a first trigger and a second trigger; the detected clock is input to the first trigger; a synchronization unit, connected to the output terminal of the first trigger, and outputting a synchronization signal of the first trigger; an inverting unit connected to the output terminal of the synchronization unit and the input terminal of the second trigger, respectively, and outputting an inverted signal corresponding to the synchronization signal, wherein the inverted signal is received by the second trigger and then outputs an intermediate detection signal; a reset synchronization unit, connected to the reset input terminal of the first trigger and the output terminal of the second trigger, respectively, to reset the intermediate detection signal output by the second trigger and then transmit it to the reset input terminal of the first trigger; A clock detection unit is connected to the output end of the second trigger, and outputs a clock detection signal after detecting the intermediate detection signal output by the second trigger; the clock detection signal output by the clock detection unit is different in different clock states, and the clock detection signal output when the clock is lost is a clock loss signal; the clock detection signal output when the clock is recovered after being lost is a clock recovery signal.
2. The circuit according to claim 1, wherein: The first trigger is a D trigger; The detected clock is input to the clock terminal of the D flip-flop, and the input terminal of the D flip-flop is connected to a high level.
3. The circuit according to claim 1, wherein: The clock detection signal includes a clock loss signal; The clock detection unit includes a lost cycle counter and a lost threshold comparator, wherein the lost cycle counter is connected to the lost threshold comparator; In response to the intermediate detection signal being at a high level, the lost cycle counter inputs the high level and outputs a lost counting result to the lost threshold comparator, and the lost threshold comparator outputs the clock lost signal.
4. The circuit according to claim 1, wherein: The clock detection signal includes a clock recovery signal; The clock detection unit includes a recovery cycle counter and a recovery threshold comparator, wherein the recovery cycle counter is connected to the recovery threshold comparator; In response to the intermediate detection signal being a rising edge of the recovery clock, the recovery cycle counter inputs the rising edge of the recovery clock and outputs a recovery counting result to the recovery threshold comparator, and the recovery threshold comparator outputs the clock recovery signal.
5. The circuit according to claim 1, wherein: The circuit further includes a first parameter design unit; The first parameter design unit is used to determine one of a plurality of detected clocks to be input to the first trigger.
6. The circuit according to claim 1, wherein: The second trigger includes at least one trigger, and each trigger is cascaded to output the intermediate detection signal.
7. The circuit according to claim 6, characterized in that The circuit further includes a second parameter design unit; The second parameter design unit is used to determine that at least one of the plurality of second flip-flops outputs the intermediate detection signal after being cascaded.
8. A clock detection method, characterized in that: The method comprises: inputting the detected clock into the first flip-flop; outputting a synchronization signal of the first trigger; outputting an inverted signal corresponding to the synchronization signal, wherein the inverted signal is received by a second trigger and then outputs an intermediate detection signal; Resetting the intermediate detection signal output by the second trigger and then transmitting the signal to the input of the first trigger; After detecting the intermediate detection signal output by the second trigger, a clock detection signal is output; the clock detection signal output in different clock states is different, and the clock detection signal output when the clock is lost is a clock loss signal; the clock detection signal output when the clock is recovered after being lost is a clock recovery signal.
9. A chip, characterized in that: The chip comprises: the circuit according to any one of claims 1 to 7.
10. A communication system, characterized in that: The communication system comprises: the circuit according to any one of claims 1 to 7; the communication system communicates using a detected clock, and the detected clock is subjected to clock detection by the circuit.
