Signal detection circuit and method and electronic equipment
Through the signal determination unit and monitoring unit of the signal detection circuit, the clock signal in the on-board system is detected, the problem of clock signal abnormality is solved, the signal stability and reliability are improved, and the flexible detection of multiple clock signals to be measured is realized. .
Patent Information
- Application Number
- CN202411194932.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-06
AI Technical Summary
In on-board computer systems, abnormal clock signals may lead to system failures, and the prior art is difficult to effectively detect and solve the stability and reliability problems of clock signals.
Provided is a signal detection circuit, including a signal determination unit and a signal monitoring unit, determines a first clock signal by receiving signals from a plurality of reference clock sources and clock sources to be measured, and detects the first clock signal based on the second clock signal, and outputs the The detection results ensure the stability and reliability of the clock signal.
It realizes flexible detection of a variety of clock signals to be measured, improves the stability and reliability of the reference clock signal, and ensures the continuous operation and high accuracy of the signal detection circuit.
Smart Images

Figure CN119088168A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of electronic technology, and in particular to a signal detection circuit, method and electronic device. Background Art
[0002] In the field of electronic technology, clock signals are crucial to maintaining the normal operation of computer systems. Taking the computer system as an in-vehicle system as an example, the in-vehicle system integrates a large number of electronic devices and computing modules, and the clock signals between the electronic devices and computing modules ensure normal operation. Summary of the invention
[0003] The embodiments of the present application provide a signal detection circuit, method and electronic device, which can be used to detect clock signals. The technical solution is as follows:
[0004] In a first aspect, the present application provides a signal detection circuit, the signal detection circuit comprising a signal determination unit and a signal monitoring unit; the signal determination unit is connected to a plurality of reference clock sources and a plurality of clock sources to be tested;
[0005] The signal determination unit is configured to receive the reference clock signals sent by the multiple reference clock sources and the clock signals to be measured sent by the multiple clock sources to be measured, determine a first clock signal from the multiple clock signals to be measured, and determine a second clock signal from the multiple reference clock signals according to the first clock signal;
[0006] The signal monitoring unit is used to detect the first clock signal based on the second clock signal to obtain a detection result of the first clock signal.
[0007] In a possible implementation, the signal determination unit is configured to determine a candidate reference clock signal from the multiple reference clock signals according to the first clock signal, and determine the second clock signal from the candidate reference clock signals.
[0008] In a possible implementation, the signal determination unit is used to determine the candidate reference clock signal from a reference clock signal different from a fourth clock signal among the multiple reference clock signals when the first clock signal and the third clock signal are different, the third clock signal is a clock signal to be tested detected before the first clock signal, and the fourth clock signal is a reference clock signal for detecting the third clock signal;
[0009] Alternatively, when the first clock signal and the third clock signal are the same, the candidate reference clock signal is determined from the plurality of reference clock signals.
[0010] In a possible implementation, the reference clock signal has a priority, and the signal determination unit is used to select the second clock signal from the candidate reference clock signals according to the priority of each candidate reference clock signal when there are multiple candidate reference clock signals.
[0011] In a possible implementation manner, the first clock signal includes a clock signal that serves as a reference clock signal in a historical period.
[0012] In one possible implementation, the signal monitoring unit is used to count the first clock signal and the second clock signal to obtain a first count value corresponding to the first clock signal and a second count value corresponding to the second clock signal; when the second count value reaches a reference count value, the detection result is determined according to the first count value and a threshold window, the reference count value indicates that the detection of the first clock signal is completed, and the threshold window indicates the counting range of the normally transmitted first clock signal.
[0013] In a possible implementation, the signal monitoring unit is configured to determine that the detection result indicates that the first clock signal is abnormal if the first count value is not within the threshold window;
[0014] Alternatively, when the first count value is within the threshold window, it is determined that the detection result indicates that the first clock signal is normal.
[0015] In a possible implementation, the signal monitoring unit is further configured to output a detection completion signal when the second count value reaches a reference count value, wherein the detection completion signal indicates that detection of the first clock signal is completed.
[0016] In a possible implementation manner, the threshold window and the reference count value are determined based on the frequency of the first clock signal.
[0017] In a possible implementation, the signal monitoring unit is further configured to output a status signal based on the detection result, where the status signal indicates whether the first clock signal is normal.
[0018] In a second aspect, a signal detection method is provided, the method comprising:
[0019] Acquire reference clock signals sent by multiple reference clock sources and clock signals to be tested sent by multiple clock sources to be tested;
[0020] Determine a first clock signal from a plurality of clock signals to be measured, and determine a second clock signal from a plurality of reference clock signals according to the first clock signal;
[0021] The first clock signal is detected based on the second clock signal to obtain a detection result of the first clock signal.
[0022] In a possible implementation manner, determining the second clock signal from a plurality of reference clock signals according to the first clock signal includes:
[0023] A candidate reference clock signal is determined from the plurality of reference clock signals according to the first clock signal, and the second clock signal is determined from the candidate reference clock signals.
[0024] In a possible implementation manner, determining a candidate reference clock signal from the multiple reference clock signals according to the first clock signal includes:
[0025] In the case where the first clock signal and the third clock signal are different, determining the candidate reference clock signal from a reference clock signal different from the fourth clock signal among the multiple reference clock signals, the third clock signal being a clock signal to be tested detected before the first clock signal, and the fourth clock signal being a reference clock signal for detecting the third clock signal;
[0026] Alternatively, when the first clock signal and the third clock signal are the same, the candidate reference clock signal is determined from the plurality of reference clock signals.
[0027] In a possible implementation manner, the reference clock signal has a priority, and determining the second clock signal from the candidate reference clock signals includes:
[0028] When there are multiple candidate reference clock signals, the second clock signal is selected from the candidate reference clock signals according to the priority of each candidate reference clock signal.
[0029] In a possible implementation manner, the first clock signal includes a clock signal that serves as a reference clock signal in a historical period.
[0030] In a possible implementation manner, detecting the first clock signal based on the second clock signal to obtain a detection result of the first clock signal includes:
[0031] Counting the first clock signal and the second clock signal to obtain a first count value corresponding to the first clock signal and a second count value corresponding to the second clock signal;
[0032] When the second count value reaches a reference count value, the detection result is determined according to the first count value and a threshold window, the reference count value indicating that the detection of the first clock signal is finished, and the threshold window indicating a count range of the normally transmitted first clock signal.
[0033] In a possible implementation manner, determining the detection result according to the first count value and a threshold window includes:
[0034] In a case where the first count value is not within the threshold window, determining that the detection result indicates that the first clock signal is abnormal;
[0035] Alternatively, when the first count value is within the threshold window, it is determined that the detection result indicates that the first clock signal is normal.
[0036] In a possible implementation manner, after obtaining the first count value corresponding to the first clock signal and the second count value corresponding to the second clock signal, the method further includes:
[0037] When the second count value reaches the reference count value, a detection completion signal is output, the detection completion signal indicating that detection of the first clock signal is completed.
[0038] In a possible implementation manner, the threshold window and the reference count value are determined based on the frequency of the first clock signal.
[0039] In a possible implementation manner, after obtaining the detection result of the first clock signal, the method further includes:
[0040] A status signal is output based on the detection result, wherein the status signal indicates whether the first clock signal is normal.
[0041] According to a third aspect, an electronic device is provided, wherein the electronic device comprises the signal detection circuit according to the first aspect or any possible implementation manner of the first aspect.
[0042] In a possible implementation manner, the electronic device is a chip or a chip system.
[0043] The technical solution provided by this application brings at least the following beneficial effects:
[0044] The signal determination unit can determine the first clock signal to be detected from multiple clock signals to be measured, and use any one of the multiple clock signals to be measured as the first clock signal. The first clock signal can be any clock signal to be measured, and supports the detection of multiple clock signals to be measured, with high flexibility and a wide detection range. In addition, the signal determination unit can also determine the second clock signal from multiple reference clock signals based on the first clock signal, so as to clarify the reference clock signal corresponding to the first clock signal according to the first clock signal, with high flexibility. By providing multiple reference clock signals, the stability and reliability of the reference clock signal are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0046] Figure 1 is a structural schematic diagram of a signal detection circuit provided in an embodiment of the present application;
[0047] Figure 2 is a structural schematic diagram of another signal detection circuit provided in an embodiment of the present application;
[0048] Figure 3 is a structural schematic diagram of another signal detection circuit provided in an embodiment of the present application;
[0049] Figure 4 is a schematic diagram of a threshold window provided in an embodiment of the present application;
[0050] Figure 5 is a structural schematic diagram of a signal monitoring unit provided in an embodiment of the present application;
[0051] Figure 6 It is a flow chart of a signal detection method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0053] In the field of electronic technology, the operation of a computer system depends on a clock system. For example, the clock system generates a clock signal as a signal source, and the clock signal is used as the pulse of the computer system to control the operation of each module in the computer system. Taking the modules as the processor core and the processor peripherals as an example, the processor core completes actions such as instruction execution and state change under the drive of the clock signal, and the processor peripherals complete various actions under the drive of the clock signal, such as serial port data transmission, analog-to-digital conversion, and timer counting.
[0054] However, the clock system may be abnormal. When the computer system is a vehicle-mounted system, the vehicle-mounted system may experience temperature changes and electromagnetic interference, and temperature changes or electromagnetic interference may cause abnormalities in the clock system in the vehicle-mounted system. Since the clock signal generated by the abnormal clock system will also be abnormal, the operation of the module controlled by the abnormal clock signal may go wrong. Therefore, a signal detection circuit is urgently needed to detect whether the clock signal generated by the clock system is abnormal.
[0055] Figure 1 A structural diagram of a signal detection circuit provided in an embodiment of the present application, the signal detection circuit includes a signal determination unit 11 and a signal monitoring unit 12. Among them, the signal determination unit 11 is connected to the signal monitoring unit 12, and the signal determination unit 11 is also connected to a clock source that generates a clock signal. The embodiment of the present application does not limit the clock source connected to the signal determination unit 11, and can be any clock system that can generate a clock signal, including but not limited to a crystal oscillator and an RC (Resistor-Capacitor) oscillator.
[0056] Exemplarily, the signal determination unit 11 can be any kind of selector, such as a MUX (multiplexer), which can be called a multiplexer in some cases, and the multiplexer is used to select a signal from the received multiple signals. In one possible case, the clock source connected to the signal determination unit 11 includes a reference clock source and a clock source to be tested. Among them, the reference clock source is used to generate a reference clock signal, and the reference clock signal refers to the clock signal referenced by the signal monitoring unit 12 in the process of detecting the clock signal to be tested, which can be used to determine the start and end of the count, and the clock source to be tested refers to a clock source with a detection requirement, which is used to generate the clock signal to be tested. The embodiment of the present application does not limit the detection requirement of the clock source to be tested, and can be any detection of the frequency of the clock signal, such as stability detection of the clock source to be tested, or monitoring of frequency changes or rapid response to abnormal clock conditions of the first clock signal.
[0057] Optionally, the signal determination unit 11 may be connected to a plurality of reference clock sources and a plurality of clock sources to be tested. The plurality of reference clock sources may be oscillators of different types, for example, the signal determination unit 11 is connected to two reference clock sources, which are a crystal oscillator and an RC oscillator. The plurality of reference clock sources may also be oscillators of the same type, for example, the plurality of reference clock sources are all RC oscillators.
[0058] In addition, the reference clock signals generated by the multiple reference clock sources may be different, for example, the reference clock signals generated by different reference clock sources may have different frequencies, amplitudes, etc. Similar to the case of multiple reference clock sources, the multiple clock sources to be tested may also be oscillators of different types or of the same type. Optionally, the multiple clock sources to be tested may be configured at different locations within the computer system, for example, the clock source 1 to be tested may be configured at the input end of the computer system, and the clock source 2 to be tested may be configured at the output end of the computer system.
[0059] Regardless of the situation of the reference clock source and the clock source to be tested, each reference clock source can send a reference clock signal to the signal determination unit 11 based on the connection relationship with the signal determination unit 11, and one reference clock source sends one reference clock signal. Each clock source to be tested can also send a clock signal to be tested to the signal determination unit 11 based on the connection relationship with the signal determination unit 11, and one clock source to be tested sends one clock signal to be tested.
[0060] Exemplarily, the signal determination unit 11 may use the same module to receive multiple reference clock signals and multiple clock signals to be measured, or may use different modules to receive the reference clock signal and the clock signal to be measured respectively. Figure 2 A schematic diagram of another signal detection circuit provided in an embodiment of the present application is shown in FIG. Figure 2 The signal determination unit 11 includes a first determination unit 111 and a second determination unit 112. The first determination unit 111 is connected to a plurality of clock sources to be measured, and is used to receive a plurality of clock signals to be measured. The second determination unit 112 is connected to a plurality of reference clock sources, and is used to receive a plurality of reference clock signals.
[0061] After receiving multiple reference clock signals and multiple clock signals to be measured, the signal determination unit 11 can determine a first clock signal from the multiple clock signals to be measured, and then determine a second clock signal from the multiple reference clock signals based on the first clock signal. Figure 2 Taking the signal processing circuit shown in FIG. 1 as an example, the process of determining the first clock signal and the second clock signal are respectively illustrated.
[0062] In a possible implementation, the signal determination unit 11 may select a clock signal to be measured from a plurality of clock signals to be measured as a first clock signal through the first determination unit 111. The embodiment of the present application does not limit the clock signal to be measured, and may be a clock signal generated by any clock source to be measured that has a detection requirement. The clock source to be measured may be a clock system for controlling the operation of a computer system, or a clock source for generating a reference clock signal, that is, the clock signal to be measured includes a clock signal that serves as a reference clock signal in a historical period. For example, there is a detection moment for the reference clock signal A generated by the reference clock source A. The first determination unit 111 may receive the reference clock signal A sent by the reference clock source A based on the connection relationship with the reference clock source A, and use the reference clock signal A as the clock signal to be measured.
[0063] Optionally, the first determination unit 111 may receive a reference clock signal of the signal detection circuit in which it is located, that is, the reference clock source A in the above embodiment will send the reference clock signal A to the second determination unit 112. The first determination unit 111 may also receive reference clock signals of other signal detection circuits. For example, the signal detection circuit in which the first determination unit 111 is located is signal detection circuit 1, and the other signal detection circuit is signal detection circuit 2. The reference clock source A sends a reference clock signal A to signal detection circuit 2, and the reference clock signal A is used to determine the second clock signal of signal detection circuit 2. The reference clock source A also sends a reference clock signal A to signal detection circuit 1, and the reference clock signal A is used to determine the first clock signal of signal detection circuit 1.
[0064] Regardless of the situation of the clock signal to be measured, the first determination unit 111 can select the first clock signal from the clock signal to be measured. The first determination unit 111 can select the first clock signal based on the selection parameter. For example, the operation and maintenance personnel configure the selection parameter of the first determination unit 111 through software, and the selection parameter indicates the signal identifier of the first clock signal. The first determination unit 111 can select the first clock signal from multiple clock signals to be measured according to the signal identifier. Among them, the signal identifier can be any information that can distinguish different clock signals to be measured, which can be the name of the clock signal to be measured, the configuration location of the clock source to be measured that generates the clock signal to be measured, or the interface information of the clock signal to be measured. Since the first determination unit 111 selects the first clock signal based on the selection parameter, different clock signals to be measured can be selected as the first clock signal by adjusting the signal identifier indicated in the selection parameter.
[0065] In some cases, the first determination unit 111 may also determine the detection order of each clock signal to be measured, and select the first clock signal from multiple clock signals to be measured according to the detection order. Optionally, the first determination unit 111 may arrange the clock signals to be measured in order according to the historical detection moments, and determine the detection order of each clock signal to be measured according to the arrangement result. Among them, the historical detection moment refers to the moment when the signal to be measured was most recently detected from the current moment. Taking the current moment as 12:00 as an example, the clock signal 1 to be measured was detected at 11:30 and 12:00 respectively, then the moment closest to the current moment is 12:00, and the historical detection moment of the clock signal 1 to be measured is 12:00. Taking the clock signal 2 to be measured as an example, which was detected at 11:00 and 11:45 respectively, then the moment closest to the current moment is 11:45, and the historical detection moment of the clock signal 2 to be measured is 11:45.
[0066] In the process of arranging in order according to the historical detection time, it can be arranged from near to far, or from far to near. Continuing to take the clock signal 1 to be measured and the clock signal 2 to be measured in the above embodiment as an example, if it is from near to far, since the historical detection time of the clock signal 1 to be measured is 12:00, and the historical detection time of the clock signal 2 to be measured is 11:45, the distance between the historical detection time of the clock signal 1 to be measured and the current time 12:00 is less than the distance between the historical detection time of the clock signal 2 to be measured and the current time 12:00, therefore, the arrangement order is clock signal 1 to be measured, clock signal 2 to be measured. If it is from far to near, the arrangement order is clock signal 2 to be measured, clock signal 1 to be measured.
[0067] In some cases, the detection order can also be determined according to the clock source to be tested corresponding to the clock signal to be tested, and the first parameter of each clock signal to be tested is determined according to the clock source to be tested, the first parameter indicates the importance of the clock signal to be tested, and the clock signals to be tested are arranged in sequence according to the first parameter to obtain the detection order of each clock signal to be tested.
[0068] Optionally, the first determination unit 111 may determine the first parameter of the clock signal to be measured according to the configuration position of the clock source to be measured in the computer system. Since the importance of the clock sources to be measured configured at different configuration positions is different, for example, the importance of the clock source to be measured configured at the input end is higher than that of the clock source to be measured configured at the output end. In some cases, the first determination unit 111 may also determine the first parameter of the clock signal to be measured according to the number of modules controlled by each clock source to be measured. When the number of modules controlled by the clock source to be measured is greater, the importance indicated by the first parameter of the clock signal to be measured generated by the clock source to be measured is higher. In addition, the first determination unit 111 may also perform weighted summation according to the number of modules and the configuration position to obtain the first parameter, for example, determine the second parameter according to the number of modules, determine the third parameter according to the configuration position, and perform weighted summation on the second parameter and the third parameter to obtain the first parameter.
[0069] Regardless of the method by which the detection order of each clock signal to be measured is determined, the first determining unit 111 can select the first clock signal from multiple clock signals to be measured according to the detection order. For example, the clock signal to be measured with the first detection order is first selected as the first clock signal, and then, when the detection duration of the clock signal to be measured reaches the switching duration, the clock signal to be measured with the second detection order is selected as the first clock signal. Among them, the switching duration can be a duration set based on experience and implementation environment, and the switching durations of different clock signals to be measured can be the same. In this case, the first determining unit 111 periodically uses different clock signals to be measured as the first clock signal to ensure that each clock signal to be measured can be detected. In some cases, the switching durations of different clock signals to be measured may be different. For example, the earlier the detection order of the clock signal to be measured is, the longer the switching duration of the clock signal to be measured is.
[0070] The first determination unit 111 is used to select a first clock signal from a plurality of clock signals to be measured. If the first clock signal selected by the first determination unit 111 includes a clock signal that serves as a reference clock signal at a historical moment, the signal detection circuit also supports detection of the reference clock signal, and the detection range is wide. In addition, by connecting a plurality of clock sources to be measured using a first determination unit 111, it is possible to detect a plurality of clock sources to be measured without increasing the number of signal detection circuits. Even if there is a new clock signal to be measured, there is no need to add a new signal detection circuit. Instead, by establishing a connection relationship between the first determination unit 111 and the new clock signal to be measured, the detection of the new clock signal to be measured can be achieved. The detection process is more flexible and the detection cost is low.
[0071] In one possible case, the above-mentioned process of selecting the first clock signal can be executed by the first determination unit 111, and can also be set by other units. For example, the control unit determines the detection order of each clock signal to be measured, selects the first clock signal based on the detection order, and sends the signal identifier of the selected first clock signal to the first determination unit 111. The first determination unit 111 determines the selected clock signal to be measured based on the signal identifier, thereby receiving multiple clock signals to be measured and outputting a first clock signal.
[0072] Optionally, in addition to selecting the first clock signal from multiple clock signals to be measured according to the first determination unit 111, the signal determination unit 11 can also determine the second clock signal from multiple reference clock signals according to the first clock signal through the second determination unit 112.
[0073] In one possible case, the second determination unit 112 is used to determine a candidate reference clock signal from a plurality of reference clock signals according to the first clock signal, and determine the second clock signal from the candidate reference clock signal. The candidate reference clock signal refers to a reference clock signal that can be used to detect the first clock signal. The second determination unit 112 can determine the candidate reference clock signal in different determination methods based on whether the first clock signal changes.
[0074] Determination method 1: when the first clock signal and the third clock signal are different, a candidate reference clock signal is determined from a reference clock signal different from the fourth clock signal among a plurality of reference clock signals.
[0075] Exemplarily, the third clock signal is the clock signal to be tested that is detected before the first clock signal, that is, the clock signal to be tested that is detected most recently at the current moment. Figure 3 A schematic diagram of a signal detection circuit provided in an embodiment of the present application is shown in FIG. Figure 3 The two selectors in Figure 2 The signal determination unit 11, CMU (Clock Monitoring Unit, clock monitoring unit) corresponds to Figure 2 The signal monitoring unit 12 is configured to monitor the signal of the device. Figure 3 CMU_MON_CLK_SEL in Figure 2The first determination unit 111 is used to receive three clock signals to be measured, namely CLK_MON_1, CLK_MON_2 and CLK_MON_3. Among them, CMU MON CLK SEL determines that the CLK MON CLK to be output is CLK_MON_3 based on the current selection parameters, and CLK_MON_3 is also the first clock signal. The CLK_MON_CLK outputted by CMU_MON_CLK_SEL last time is CLK_MON_2, which is also the third clock signal.
[0076] If the first clock signal and the third clock signal are different, it means that the clock signal to be measured detected by the signal detection circuit has changed. Since the detected clock signals to be measured are different, the reference clock signal used to detect the clock signal to be measured should also change. The second determination unit 112 thus determines that the selected second clock signal and the fourth clock signal are different. The fourth clock signal is the reference clock signal corresponding to the third clock signal, and refers to the reference clock signal used in the process of detecting the third clock signal. Figure 3 Take the signal detection circuit shown in the figure as an example, CMU_REF_CLK_SEL corresponds to Figure 2 The second determination unit 112 is used to receive two reference clock signals, namely CLK_REF_1 and CLK_REF_2, and the CMU_REF_CLK outputted by CMU_REF_CLK_SEL last time is CLK_REF_1. In this case, CLK_REF_1 is the fourth clock signal.
[0077] The embodiment of the present application does not limit the determination process of the fourth clock signal. It can be that a reference clock signal is used as the fourth clock signal, or the fourth clock signal is obtained based on multiple reference clock signals. The detailed processing process can refer to the determination process of the second clock signal, which will not be repeated here. In the case where the fourth clock signal is obtained based on a reference clock signal, the reference clock signal different from the fourth clock signal can refer to a reference clock signal other than the reference clock signal among multiple reference clock signals. Continuing with the fourth clock signal in the above embodiment Figure 3 If CLK_REF_1 is used as the reference clock signal, the reference clock signal other than CLK_REF_1 is CLK_REF_2.
[0078] In the case where the fourth clock signal is obtained based on multiple reference clock signals, the reference clock signal different from the fourth clock signal may refer to a reference clock signal that is completely different from the multiple reference clock signals. For example, the second determination unit 112 receives eight reference clock signals, and the fourth clock signal is obtained based on the first four reference clock signals. Then, the reference clock signal different from the fourth clock signal may refer to the last four reference clock signals. The reference clock signal different from the fourth clock signal may also refer to a reference clock signal that is partially different from the multiple reference clock signals. For example, the second determination unit 112 receives three reference clock signals, namely, reference clock signal 1, reference clock signal 2, and reference clock signal 3. The fourth clock signal is obtained based on reference clock signal 1 and reference clock signal 2. The reference clock signals different from the fourth clock signal may be reference clock signal 2 and reference clock signal 3.
[0079] After determining the reference clock signal different from the fourth clock signal, the second determination unit 112 may directly determine the reference clock signal different from the fourth clock signal as a candidate reference clock signal, or may screen the reference clock signal different from the fourth clock signal to obtain a candidate reference clock signal.
[0080] Optionally, the second determination unit 112 may filter out a reference clock signal that is transmitted normally from reference clock signals that are different from the fourth clock signal as a candidate reference clock signal. In one possible implementation, the reference clock signal is also detected to obtain a detection result indicating whether the reference clock signal is transmitted normally. In this case, the second determination unit 112 also receives the detection results of each reference clock signal, determines whether each reference clock signal is transmitted normally based on the detection results, and determines the reference clock signal that is transmitted normally from the reference clock signals that are different from the fourth clock signal as a candidate reference clock signal.
[0081] In some cases, since the reference clock signal needs to ensure high accuracy, the reference clock signal will also be periodically detected in the process of using the reference clock signal to assist in detecting the clock signal. In this case, the second determination unit 112 can filter out reference clock signals that do not have detection requirements from reference clock signals that are different from the fourth clock signal to obtain candidate reference clock signals. For example, the three reference clock signals that are different from the fourth clock signal are reference clock signal A, reference clock signal B, and reference clock signal C. Reference clock signal A, reference clock signal B, and reference clock signal C are all transmitted normally and the detection cycle is 2 hours, while the last detection time of reference clock signal A was two hours ago. Reference clock signal A currently has a detection requirement, thereby determining reference clock signal B and reference clock signal C as candidate reference clock signals.
[0082] Determination method 2: when the first clock signal and the third clock signal are the same, determining a candidate reference clock signal from a plurality of reference clock signals.
[0083] Exemplarily, the first clock signal and the third clock signal are the same, indicating that the clock signal to be tested detected by the signal detection circuit has not changed. In this case, the reference clock signal used in the process of detecting the first clock signal can remain unchanged, for example, the fourth clock signal in the reference clock signal is determined as a candidate reference clock signal.
[0084] Optionally, the reference clock signal used in the process of detecting the first clock signal may also change. For example, when the usage time of the fourth clock signal reaches a time threshold, a candidate reference clock signal is determined from a reference clock signal different from the fourth clock signal. The time threshold may be set based on experience and an implementation environment, where the implementation environment is, for example, a third clock signal detected based on the fourth clock signal. The higher the importance of the third clock signal, the shorter the time threshold. Through the time threshold, different reference clock signals are periodically adjusted to avoid using one reference clock signal for detection for a long time. By increasing the number of reference clock signals, the stability and reliability of the reference clock signal are improved.
[0085] Alternatively, when the fourth clock signal is abnormal, the second determination unit 112 may also determine a candidate reference clock signal from a reference clock signal different from the fourth clock signal. For the specific process of determining a candidate reference clock signal from a reference clock signal different from the fourth clock signal, please refer to the relevant content of the determination method 1, which will not be repeated here.
[0086] After determining the candidate reference clock signal, the second determination unit 112 may determine the second clock signal based on the candidate reference clock signal. In the case where there is one candidate reference clock signal, the second determination unit 112 may directly determine the candidate reference clock signal as the second clock signal. In the case where there are multiple candidate reference clock signals, the second determination unit 112 may select one reference clock signal from the candidate reference clock signals as the second clock signal. The selection may be random selection or selection based on priority.
[0087] In one possible case, the reference clock signal has a priority. The second determination unit 112 can select the second clock signal from the candidate reference clock signals according to the priority of each candidate reference clock signal. Optionally, the priority of the reference clock signal can be set based on experience and implementation environment. The implementation environment can be the reference clock source of each reference clock signal. The priority of each reference clock signal is determined based on the fault frequency of the reference clock source of each reference clock signal. The reference clock signal generated by the reference clock source with a lower fault frequency has a higher priority. Alternatively, the priority of each reference clock signal can also be determined based on the historical usage time of each reference clock signal. The longer the historical usage time is from the current time, the higher the priority of the reference clock signal.
[0088] Optionally, the priority of the reference clock signal can also be determined according to the frequency of the reference clock signal. Exemplarily, the second determination unit 112 determines the difference between the frequency of each reference clock signal and the frequency of the first clock signal, and determines the priority of each reference clock signal according to the difference, for example, the smaller the difference, the higher the priority of the reference clock signal. By comparing the difference between the frequencies, the reference clock signal with the smallest frequency difference with the first clock signal is preferentially selected as the second clock signal to avoid the situation where the frequency difference between the second clock signal and the first clock signal is too large, resulting in an abnormal counting duration. The frequency difference causes the counting duration to be abnormal, for example, the frequency of the first clock signal is much higher than the frequency of the second clock signal, the counting duration determined based on the second clock signal is too long, and the verification efficiency is low. Alternatively, the frequency of the first clock signal is much lower than the frequency of the second clock signal, the counting duration determined based on the second clock signal is too short, and the count value of the first clock signal is too small.
[0089] After acquiring the priorities of the candidate reference clock signals, the second determining unit 112 may select a reference clock signal with the highest priority from the candidate reference clock signals as the second clock signal based on the priorities of the reference clock signals.
[0090] In a possible case, the second determination unit 112 may also process multiple reference clock signals to obtain a second clock signal, and the processing may be verification and frequency adjustment, etc. Exemplarily, the second determination unit 112 receives multiple reference clock signals, selects a reference clock signal to be verified and a reference clock signal as a reference based on the priority of each reference clock signal, verifies the selected reference clock signal using the reference reference clock signal, obtains a verification result of the selected reference clock signal, and determines the selected reference clock signal as the second clock signal if the verification result is passed, and continues to verify if the verification result is not passed. Optionally, the second determination unit 112 may use the reference clock signal with the highest priority as the reference clock signal to be verified, and use the reference clock signal with the second highest priority as the reference clock signal to be verified as the reference clock signal. What is verified may be the frequency, phase, jitter, and drift, etc. of the reference clock signal.
[0091] Optionally, the second determination unit 112 may also adjust the frequency of the reference clock signal, and use the adjusted reference clock signal as the second clock signal, wherein the frequency adjustment includes frequency division and frequency multiplication. Frequency division is used to reduce the frequency of the reference clock signal, for example, to 1 / 2 or 1 / 3, etc., and frequency multiplication is used to increase the frequency of the reference clock signal, for example, to 2 or 3 times, etc. By adjusting the frequency, reference clock signals of different frequencies may be obtained.
[0092] In some cases, the process of determining the second clock signal by the second determination unit 112 may also be independent of the first clock signal. For example, the second determination unit 112 directly periodically switches different reference clock signals, or, when an abnormality occurs in the reference clock signal in use, selects the second clock signal based on priority. Next, two reference clock signals are taken as an example to illustrate the process of independently selecting the second clock signal based on priority.
[0093] The second determination unit 112 receives two reference clock signals, namely, a reference clock signal A and a reference clock signal B, wherein the priority of the reference clock signal A is higher than that of the reference clock signal B, that is, the reference clock signal A is the main reference clock signal, and the reference clock signal B is the backup reference clock signal. After receiving the reference clock signal A and the reference clock signal B, the second determination unit 112 preferentially selects the reference clock signal A as the second clock signal based on the priority. After the signal monitoring unit 12 performs clock detection based on the reference clock signal A for a period of time, the reference clock signal A becomes abnormal, and the reference clock signal transmitted normally is the reference clock signal B. The second determination unit 112 thus selects the reference clock signal B as the second clock signal. By receiving multiple reference clock signals, a backup clock signal is provided in the process of detecting the clock signal, so as to switch to the backup clock signal in time when a problem occurs with the main reference clock signal, thereby ensuring the continuous operation and synchronization of the signal detection, and realizing the provision of a high-precision and high-stability reference clock signal.
[0094] Regardless of the method by which the signal determination unit 11 determines the first clock signal and the second clock signal, the first clock signal and the second clock signal can be sent to the signal monitoring unit 12, so as to detect the first clock signal using the second clock signal to obtain the detection result of the first clock signal. Figure 3 As shown, the signal determination unit 11 uses CMU_REF_CLK_SEL to send CMU_REF_CLK to the CMU, and uses CMU_MON_CLK_SEL to send CMU_MON_CLK to the CMU. Among them, CMU_REF_CLK corresponds to the second clock signal, CMU_MON_CLK corresponds to the first clock signal, and CMU corresponds to the signal monitoring unit 12.
[0095] Exemplarily, the signal monitoring unit 12 is used to count the first clock signal and the second clock signal to obtain a first count value corresponding to the first clock signal and a second count value corresponding to the second clock signal; when the second count value reaches a reference count value, the detection result is determined according to the first count value and the threshold window, the reference count value indicates that the detection of the first clock signal is completed, and the threshold window indicates the counting range of the normally transmitted first clock signal.
[0096] Optionally, the first count value is used to count the clock cycles of the first clock signal, and the second count value is used to count the clock cycles of the second clock signal. In some cases, the signal monitoring unit 12 is configured with a first counter for the first clock signal and a second counter for the second clock signal. When the first counter receives the first clock signal, the count value is increased by 1 every time the first clock signal passes through a clock cycle, thereby obtaining a first count value. When the second counter receives the second clock signal, the count value is increased by 1 every time the second clock signal passes through a clock cycle, thereby obtaining a second count value. The clock cycle can be determined by counting the rising edge or falling edge of the signal. In some cases, the first counter and the second counter start synchronously, that is, the first count value and the second count value are count values obtained by synchronous counting.
[0097] Among them, the second count value is used to determine the counting end time of the first clock signal. The signal monitoring unit 12 obtains the reference count value, compares the second count value with the reference count value, and if the second count value is less than the reference count value, it is determined that the counting end time has not been reached, and the counting continues. If the second count value is equal to the reference count value, it is determined that the counting end time has been reached, and the counting of the first clock signal and the second clock signal is stopped. The count value counted by the first counter at the current moment is determined as the first count value, and whether the first clock signal is normal is judged based on the first count value.
[0098] In one possible case, the reference count value can be determined according to the frequency of the first clock signal. For example, there is a corresponding relationship between the frequency and the reference count value. The higher the frequency of the first clock signal, the smaller the reference count value. Since the frequency of the first clock signal is high, more signals are generated per unit time, and the more count values counted by the first counter per unit time, the first counter does not need to count for too long to collect the first count value that can be detected. Based on this, a smaller reference count value can be set. The shorter the time for the second count value counted by the second counter to reach the reference count value, the earlier the counting ends.
[0099] Exemplarily, the reference count value can also be determined based on experience and implementation environment, where the implementation environment indicates the scenario of monitoring the frequency of the first clock signal, and the detection accuracy and response rate of different scenarios are different. Since a larger reference count value will result in a longer inspection window, that is, the longer the counting time, the higher the accuracy of the detected first clock signal. A smaller reference count value will result in a shorter inspection window, the shorter the counting time, and the faster the response of detecting the first clock signal. Therefore, the reference count value can be set based on experience based on the requirements of the current implementation environment for detection accuracy and response rate.
[0100] Optionally, the reference count value corresponding to the frequency can be determined by a calculation formula, or the interval in which the frequency is located can be determined, one interval corresponds to a reference count value, and the corresponding reference count value is found according to the interval in which the frequency of the first clock signal is located. In some cases, the above-mentioned process of configuring the reference count value can be implemented by a register, for example, CMU_REF_CNT (reference clock count value), that is, the reference count value, is obtained by configuring the reference count value register. In addition, the reference count value can also be obtained by user configuration. Based on the case where the second count value indicates the clock cycle of the second clock signal, the reference count value can also correspond to the clock cycle of the second clock signal. When the reference count value is 2, it indicates two clock cycles of the second clock signal.
[0101] In a possible implementation, when the second count value reaches the reference count value, the signal monitoring unit 12 not only stops counting the first clock signal, but also outputs a detection completion signal indicating that the detection of the first clock signal is completed. Figure 3 CMU_MEAS_DONE corresponds to the detection completion signal. The signal monitoring unit 12 can output the detection completion signal through CMU_MEAS_DONE. For example, CMU_MEAS_DONE==1 indicates that the detection is completed, and CMU_MEAS_DONE==0 indicates that the detection is not completed.
[0102] After determining that the first clock signal count is completed, the signal monitoring unit 12 may determine the detection result of the first clock signal according to the first count value. Optionally, the signal monitoring unit 12 may detect the first clock signal using a threshold window and the first count value. The threshold window includes a first threshold and a second threshold, the first threshold indicates the lowest value of the threshold window, and the second threshold indicates the highest value of the threshold window, see Figure 4 , Figure 4 CMU_TH_LVAL indicates the first threshold, CMU_TH_HVAL indicates the second threshold, and the first threshold and the second threshold constitute a threshold window.
[0103] Similar to the case of the reference count value, the threshold window can also be determined based on the frequency of the first clock signal, the frequency of the second clock signal and the reference count value. For example, the ideal clock count is calculated based on the frequency of the first clock signal, the frequency of the second clock signal and the reference count value, and the threshold window is determined based on the ideal clock count. Taking the frequency of the second clock signal as FReference_clock=10MHz, the frequency of the first clock signal as FMonitored_clock=100MHz, and the reference count value CMU_REF_CNT=10 as an example, the ideal clock count=(FMonitored_clock / FReference_clock)×CMU_REF_CNT=100. The ideal clock count indicates the clock cycle that should be theoretically passed if there is no signal interference in the first clock signal when the second clock signal passes through the reference count value clock cycles.
[0104] After determining the ideal clock count, the signal monitoring unit 12 can obtain the first threshold value by subtracting the boundary value from the ideal clock count, and obtain the second threshold value by adding the boundary value to the ideal clock count, thereby obtaining a threshold window including the first threshold value and the second threshold value. Optionally, the signal monitoring unit 12 can set the boundary value based on experience. For example, the signal monitoring unit 12 sets the boundary value to 10 based on experience, and the threshold window is 90 to 110.
[0105] In one possible case, the boundary value can also be determined based on the uncertainty of the first clock signal, where the uncertainty of the first clock signal is caused by the possible existence of clock jitter and clock offset in the first clock signal. Taking the uncertainty of the first clock signal as 5 clock cycles as an example, the boundary value determined based on the uncertainty is also 5. The first threshold CMU_TH_LVAL=100-5=95 and the second threshold CMU_TH_HVAL=100+5=105 determined according to the boundary value and the ideal clock count are obtained, and the threshold window of 95~105 is obtained.
[0106] In some cases, the threshold window can also be obtained using register configuration, for example, the second threshold is obtained using the high threshold register configuration, and the first threshold is obtained using the low threshold register configuration. The above first threshold and second threshold are software parameters configured in the signal monitoring unit 12.
[0107] Regardless of the threshold window, the signal monitoring unit 12 can determine the detection result of the first clock signal based on the threshold window. For example, when the first count value is not within the threshold window, the signal monitoring unit 12 determines that the detection result indicates that the first clock signal is abnormal; or, when the first count value is within the threshold window, the signal monitoring unit 12 determines that the detection result indicates that the first clock signal is normal.
[0108] Optionally, the first count value being within the threshold window means that the first count value is not less than a first threshold value and not greater than a second threshold value, for example Figure 4 The first clock signal of Normal is shown in FIG. When the first count value is not within the threshold window, it may be that the first count value is less than the first threshold value or the first count value is greater than the second threshold value, for example Figure 4 The first clock signal shown is Low_err (low abnormality), or the first clock signal shown is High_err (high abnormality).
[0109] Since the threshold window reflects the value range of the first clock signal under normal transmission, if the first count value is within the threshold window, it indicates that the transmission of the first clock signal is normal, and there is no over-fast or over-slow transmission, and the detection result indicates that the first clock signal is normal. On the contrary, if the first count value is not within the threshold window, it indicates that the transmission of the first clock signal is abnormal, and it may be transmitted too fast or too slowly, and the detection result indicates that the first clock signal is abnormal.
[0110] In addition, since the threshold window includes the first threshold and the second threshold, the signal monitoring unit 12 can determine whether the first clock signal is abnormal or not, and further determine whether it is a high abnormality or a low abnormality when the first clock signal is abnormal. For example, when the first count value is less than the first threshold, the detection result is determined to be that the first clock signal is a low abnormality, corresponding to Figure 4 When the first count value is greater than the second threshold value, the detection result is determined to be that the first clock signal is abnormally high, corresponding to Figure 4 High_err.
[0111] By comparing the first count value and the threshold window, faults and errors of the first clock signal can be detected, such as frequency offset, clock loss or clock jump, and the signal monitoring unit 12 can detect the abnormality of the first clock signal in time.
[0112] In one possible case, in addition to determining the detection result, the signal monitoring unit 12 also outputs a status signal based on the detection result, where the status signal indicates whether the first clock signal is normal. Figure 3 As shown, when the detection result of the first clock signal is normal, the output status signal is CMU_MEA_STATUS, which can be called a clock detection completion interrupt status signal in some cases.
[0113] In the case where the detection result of the second clock signal is a detection abnormality, the output status signal is CMU_TH_STATUS, which can be called a clock operation abnormal interrupt status signal in some cases. Optionally, in the case where the detection result indicating the abnormality is divided into a detection result corresponding to a high abnormality and a detection result corresponding to a low abnormality, the status signal can also distinguish between high abnormalities and low abnormalities. The distinction can be made by using different values for CMU_TH_STATUS or by using different status signals. By sending a status signal, the detection result is reported, so that when the first clock signal is abnormal, other units in the computer system are notified to take corresponding fault handling measures in a timely manner to improve the fault tolerance of the computer system.
[0114] In a possible implementation, after the signal monitoring unit 12 outputs the status signal, the signal detection circuit can start a new round of detection of the clock signal to be tested. For example, the new round of detection is that the signal determination unit 11 determines a fifth clock signal different from the first clock signal from multiple clock signals to be tested, and outputs the fifth clock signal for detection. Before starting a new round of detection, the signal detection circuit can turn off the signal monitoring unit 12 through the CMU enable register (CMU_EN), reconfigure the reference count value and the threshold window, and then reopen the signal monitoring unit 12 to update the signal monitoring unit 12, so as to use the updated signal monitoring unit 12 to detect the new fifth clock signal.
[0115] In addition, the above examples are intended to illustrate the process of the signal detection circuit detecting the first clock signal, rather than to limit the operation order of each unit. In the case of using registers to configure the reference count value and the threshold window required by the signal monitoring unit 12, since the reference count value and the threshold window are obtained through different register configurations, the configuration process of the reference count value and the threshold window can be performed synchronously. Optionally, the configuration process of the reference count value and the threshold window can also be performed asynchronously. Regardless of the order in which the reference count value and the threshold window are configured, the signal monitoring unit 12 can be enabled after the register configuration is completed, so that the signal monitoring unit 12 can detect the first clock signal.
[0116] Figure 5 A signal monitoring unit 12 provided in an embodiment of the present application, Figure 5 It includes three comparators, Reference Counter and Control Logic. Figure 5ref_clk in the clock signal corresponds to the second clock signal, ref_cnt corresponds to the reference count value, and mon_clk corresponds to the first clock signal. After receiving the Enable signal, the Reference Counter starts counting ref_clk to obtain the second count value. Optionally, the Enable signal is also sent to the Control Logic, and after receiving the Enable signal, the Control Logic sends a start signal to the Monitor Counter to control the Monitor Counter to count mon_clk to obtain the first count value. Figure 5 The Control Logic in the controller also receives ref_clk, which is used for cross-clock domain synchronization.
[0117] After counting to obtain the second count value, the Reference Counter will input the second count value to the comparator. After receiving the second count value, the comparator will compare the second count value with ref_cnt. When the second count value and ref_cnt are equal, it is determined that the counting is finished and an end signal is sent to the Control Logic. Based on the received end signal, the Control Logic sends a signal to stop counting to the Monitor Counter. The Monitor Counter sends the first count value counted to the two comparators respectively. The comparator compares the first count value with the High Threshold to determine whether the first count value is greater than the High Threshold. In addition, the comparator will also compare the first count value with the Low Threshold to determine whether the first count value is less than the Low Threshold. The two comparators send the comparison results to the Control Logic. The Control Logic determines the detection result of the first clock signal based on the comparison result and outputs a signal based on the detection result. Figure 5 In the process, Control Logic sends a signal to the interrupt controller.
[0118] Optionally, the above example is intended to illustrate the process of detecting the first clock signal by the signal detection circuit, rather than to limit the structure of the signal detection circuit. The signal detection circuit includes a signal determination unit 11 and a signal monitoring unit 12 which can be as follows: Figure 1The two units shown are independent units, but they can also be integrated into the same module. For example, the signal monitoring unit 12 is CIM_CORE (CMU core), and the signal determination unit 11 is CMU_WRAPPER (CMU peripheral logic), that is, the signal monitoring unit 12 and the signal determination unit 11 can be used as a main body and belong to the same CMU, that is, Figure 3 The CMU corresponding to the signal monitoring unit 12 may be considered as a part of the CMU in some cases.
[0119] In summary, the signal detection circuit provided in the embodiment of the present application is newly added with a signal determination unit 11 for selection. The signal determination unit 11 can determine the first clock signal to be finally detected from multiple clock signals to be tested. The first clock signal can be any clock signal to be tested. The type of the first clock signal is variable, which is highly flexible. The number of detectable clock signals to be tested is large, and the detection range is wide. In addition, the signal determination unit 11 can also determine the second clock signal from multiple reference clock signals based on the first clock signal, so as to realize the flexible selection of the reference clock signal according to the first clock signal, which is highly flexible.
[0120] By providing multiple reference clock signals, the stability and reliability of the reference clock signals are improved, thereby ensuring the continuous operation of the signal detection circuit. By register configuration, the reference count value and threshold window of the signal monitoring unit 12 can be adjusted and optimized according to the working conditions, which can flexibly meet the monitoring and calibration requirements for multiple clock sources to be tested under various working conditions.
[0121] The present application also provides a signal detection method, which can be Figure 1-Figure 3 Any of the signal detection circuits shown in the figure is executed, and the flowchart of the method is as follows Figure 6 As shown, steps 601-603 are included.
[0122] In step 601, a first clock signal is determined from a plurality of clock signals to be measured.
[0123] In a possible implementation, a reference clock source sends a reference clock signal, and the signal detection circuit receives multiple reference clock signals sent from multiple reference clock sources. A clock source to be tested sends a clock signal to be tested, and the signal detection circuit can receive multiple clock signals to be tested sent from multiple clock sources to be tested. For details on obtaining the reference clock signal and obtaining the clock signal to be tested, see Figure 1 The description of the signal determination unit 11 receiving the clock signal to be measured and the reference clock signal in the illustrated embodiment will not be repeated here.
[0124] Exemplarily, the signal detection circuit can select a first clock signal from a plurality of clock signals to be detected, and the selected first clock signal includes a clock signal that serves as a reference clock signal in a historical period. The process of selecting the first clock signal can be found in Figure 2 The illustrated embodiment shows a process in which the first determining unit 111 selects the first clock signal.
[0125] In step 602, a second clock signal is determined from a plurality of reference clock signals according to a first clock signal.
[0126] Optionally, the process of determining the second clock signal based on the first clock signal includes but is not limited to: determining a candidate reference clock signal from a plurality of reference clock signals according to the first clock signal, and determining the second clock signal from the candidate reference clock signals.
[0127] In one possible case, the process of determining a candidate reference clock signal includes: when the first clock signal and the third clock signal are different, determining the candidate reference clock signal from a plurality of reference clock signals and a reference clock signal different from the fourth clock signal, the third clock signal being a clock signal to be detected before the first clock signal, and the fourth clock signal being a reference clock signal for detecting the third clock signal; or, when the first clock signal and the third clock signal are the same, determining the candidate reference clock signal from a plurality of reference clock signals. For a detailed process of determining a candidate reference clock signal, see Figure 2 The first and second determination methods in the illustrated embodiment will not be described again in detail.
[0128] Optionally, in the case where the reference clock signal has a priority, the process of determining the second clock signal according to the candidate reference clock signal includes: in the case where there are multiple candidate reference clock signals, selecting the second clock signal from the candidate reference clock signals according to the priority of each candidate reference clock signal. For the specific process of selecting the second clock signal based on the priority, please refer to Figure 2 The process of determining the second clock signal from the candidate reference clock signals in the illustrated embodiment will not be described in detail here.
[0129] In step 603, the first clock signal is detected based on the second clock signal to obtain a detection result of the first clock signal.
[0130] In one possible case, the signal detection circuit can obtain a threshold window through a high threshold register and a low threshold register configuration, and obtain a reference count value through a clock detection threshold register configuration. Wherein, the threshold window and the reference count value are determined based on the frequency of the first clock signal. After completing the configuration of the signal monitoring unit using the register, the signal monitoring unit can be enabled to detect the first clock signal using the signal monitoring unit.
[0131] Exemplarily, the detection process includes: counting the first clock signal and the second clock signal to obtain a first count value corresponding to the first clock signal and a second count value corresponding to the second clock signal; when the second count value reaches a reference count value, determining the detection result according to the first count value and the threshold window, the reference count value indicates that the detection of the first clock signal is finished, and the threshold window indicates the counting range of the first clock signal that is normally transmitted. For the process of counting to obtain the first count value and the second count value, please refer to the above Figure 1 In the embodiment shown in FIG. 1 , the signal monitoring unit 12 counts to obtain the first count value and the second count value. For the process of comparing the first count value and the reference count value, refer to the above Figure 1 The process of the signal monitoring unit 12 comparing the first count value and the reference count value in the illustrated embodiment will not be described again in detail.
[0132] Optionally, the process of determining the detection result according to the first count value and the threshold window includes: when the first count value is not within the threshold window, determining that the detection result indicates that the first clock signal is abnormal; or, when the first count value is within the threshold window, determining that the detection result indicates that the first clock signal is normal. For a detailed process of determining the detection result, see Figure 1 The process of the signal monitoring unit 12 determining the detection result in the illustrated embodiment will not be described in detail here.
[0133] In one possible case, the signal monitoring unit also outputs a signal during the detection process. For example, when the second count value reaches the reference count value, a detection completion signal is output, and the detection completion signal indicates that the detection of the first clock signal is completed. Alternatively, a status signal is output based on the detection result, and the status signal indicates whether the first clock signal is normal. For the process of outputting the detection completion signal and the status signal, please refer to the above Figure 1 The process of the signal monitoring unit 12 outputting the detection completion signal and the status completion signal in the illustrated embodiment will not be repeated here.
[0134] Next, Figure 3Taking the signal detection circuit shown as an example, the process of detecting the clock signal is illustrated. First, the first clock signal CMU_MON_CLK_SEL and the second clock signal CMU_REF_CLK_SEL are selected, CMU_REF_CNT is programmed to define the frequency check window duration of the first clock signal, and CMU_TH_LVAL and CMU_TH_HVAL are programmed to set the threshold window of the first clock signal. After completing the above steps, enable is started, and CMU_EN=1 is set to indicate the start of detecting the frequency of the first clock signal. In addition, after CMU_EN=1, the values of CMU_REF_CNT, CMU_TH_LVAL, and CMU_TH_HVAL set are not allowed to be written and modified again. Attempting to write to any of these registers will generate a bus transmission error.
[0135] After being enabled, the signal monitoring unit performs continuous periodic clock checks on the first clock signal. The periodic check process includes: the reference clock counter corresponding to the second clock signal runs CMU_REF_CNT clock cycles. During the counting time period of the second clock signal, the clock counter corresponding to the first clock signal runs in parallel and also counts the first clock signal.
[0136] After the counting is completed, the signal monitoring unit compares the first count value obtained by counting with the set threshold window. If the first count value is not within the threshold window, a status register field is set and a clock frequency abnormal interrupt is triggered; if the first count value is within the threshold window, the clock detection is completed, indicating that the clock frequency of the first clock signal is normal. If the CMU_REF_CNT, CMU_TH_LVAL, CMU_TH_HVAL registers are reconfigured, or the frequency check operation is stopped, the enable can be turned off (CMU_EN=0) first, and then the reconfiguration operation is performed, or the frequency check operation of the next round of signals is started.
[0137] In summary, in the signal detection method provided by the embodiment of the present application, the first clock signal can be any clock signal to be tested, the type of the first clock signal is variable, the flexibility is high, the number of detectable first clock signals is large, and the detection range is wide. In addition, the second clock signal can also be determined from multiple reference clock signals based on the first clock signal, so that the reference clock signal can be flexibly selected according to the first clock signal, which is highly flexible. By providing multiple reference clock signals, the stability and reliability of the reference clock signal are improved, thereby ensuring the continuous operation of the signal detection circuit.
[0138] An embodiment of the present application provides an electronic device, the electronic device comprising Figure 1-Figure 3 Any of the signal detection circuits shown, the signal detection circuit is used to perform Figure 6 The signal detection method shown.
[0139] Exemplarily, the electronic device may be any device with a display function, and may be any terminal. Optionally, the terminal may be any electronic product that can interact with a user through one or more methods such as a keyboard, a touch pad, a touch screen, a remote control, voice interaction, or a handwriting device, such as a PC (Personal Computer), a mobile phone, a smart phone, a PDA (Personal Digital Assistant), a wearable device, a PPC (Pocket PC), a tablet computer, a smart car machine, a smart TV, etc.
[0140] Exemplarily, the electronic device may also be a chip or a chip system, and the chip may be a vehicle-mounted chip or an MCU (Microcontroller Unit) chip.
[0141] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions. For example, the clock signals to be tested involved in this application are all obtained with full authorization.
[0142] It should be understood that the "plurality" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0143] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A signal detection circuit, characterized in that: The signal detection circuit includes a signal determination unit and a signal monitoring unit; The signal determination unit is used to determine a first clock signal from a plurality of clock signals to be measured, and to determine a second clock signal from a plurality of reference clock signals according to the first clock signal; The signal monitoring unit is used to detect the first clock signal based on the second clock signal to obtain a detection result of the first clock signal.
2. The signal detection circuit according to claim 1, characterized in that: The signal determination unit is used to determine a candidate reference clock signal from the multiple reference clock signals according to the first clock signal, and determine the second clock signal from the candidate reference clock signals.
3. The signal detection circuit according to claim 2, characterized in that: The signal determination unit is used to determine the candidate reference clock signal from a reference clock signal different from a fourth clock signal among the multiple reference clock signals when the first clock signal and the third clock signal are different, the third clock signal being a clock signal to be tested detected before the first clock signal, and the fourth clock signal being a reference clock signal for detecting the third clock signal; Alternatively, when the first clock signal and the third clock signal are the same, the candidate reference clock signal is determined from the plurality of reference clock signals.
4. The signal detection circuit according to claim 2, characterized in that: The reference clock signal has a priority, and the signal determination unit is used to select the second clock signal from the candidate reference clock signals according to the priority of each candidate reference clock signal when there are multiple candidate reference clock signals.
5. The signal detection circuit according to any one of claims 1 to 4, characterized in that: The first clock signal includes a clock signal that serves as a reference clock signal in a historical period.
6. The signal detection circuit according to any one of claims 1 to 4, characterized in that: The signal monitoring unit is used to count the first clock signal and the second clock signal to obtain a first count value corresponding to the first clock signal and a second count value corresponding to the second clock signal; when the second count value reaches a reference count value, the detection result is determined according to the first count value and a threshold window, the reference count value indicates that the detection of the first clock signal is completed, and the threshold window indicates the counting range of the first clock signal that is transmitted normally.
7. The signal detection circuit according to claim 6, characterized in that: The signal monitoring unit is configured to determine that the detection result indicates that the first clock signal is abnormal if the first count value is not within the threshold window; Alternatively, when the first count value is within the threshold window, it is determined that the detection result indicates that the first clock signal is normal.
8. The signal detection circuit according to claim 6, characterized in that: The signal monitoring unit is further configured to output a detection completion signal when the second count value reaches a reference count value, wherein the detection completion signal indicates that the detection of the first clock signal is completed.
9. The signal detection circuit according to claim 6, characterized in that: The threshold window and the reference count value are determined based on a frequency of the first clock signal.
10. The signal detection circuit according to any one of claims 1 to 4, characterized in that: The signal monitoring unit is further configured to output a status signal based on the detection result, wherein the status signal indicates whether the first clock signal is normal.
11. A signal detection method, characterized in that: The method comprises: Determine a first clock signal from a plurality of clock signals to be measured; determining a second clock signal from a plurality of reference clock signals according to the first clock signal; The first clock signal is detected based on the second clock signal to obtain a detection result of the first clock signal.
12. The method according to claim 11, characterized in that The determining a second clock signal from a plurality of reference clock signals according to the first clock signal comprises: A candidate reference clock signal is determined from the plurality of reference clock signals according to the first clock signal, and the second clock signal is determined from the candidate reference clock signals.
13. The method according to claim 12, characterized in that The determining a candidate reference clock signal from the plurality of reference clock signals according to the first clock signal comprises: In the case where the first clock signal and the third clock signal are different, determining the candidate reference clock signal from a reference clock signal different from the fourth clock signal among the multiple reference clock signals, the third clock signal being a clock signal to be tested detected before the first clock signal, and the fourth clock signal being a reference clock signal for detecting the third clock signal; Alternatively, when the first clock signal and the third clock signal are the same, the candidate reference clock signal is determined from the plurality of reference clock signals.
14. The method according to claim 12, characterized in that The reference clock signal has a priority, and determining the second clock signal from the candidate reference clock signals includes: When there are multiple candidate reference clock signals, the second clock signal is selected from the candidate reference clock signals according to the priority of each candidate reference clock signal.
15. The method according to any one of claims 11 to 14, characterized in that: The first clock signal includes a clock signal that serves as a reference clock signal in a historical period.
16. The method according to any one of claims 11 to 14, characterized in that: The detecting the first clock signal based on the second clock signal to obtain a detection result of the first clock signal includes: Counting the first clock signal and the second clock signal to obtain a first count value corresponding to the first clock signal and a second count value corresponding to the second clock signal; When the second count value reaches a reference count value, the detection result is determined according to the first count value and a threshold window, the reference count value indicating that the detection of the first clock signal is finished, and the threshold window indicating a count range of the normally transmitted first clock signal.
17. The method according to claim 16, characterized in that The determining the detection result according to the first count value and the threshold window includes: In a case where the first count value is not within the threshold window, determining that the detection result indicates that the first clock signal is abnormal; Alternatively, when the first count value is within the threshold window, it is determined that the detection result indicates that the first clock signal is normal.
18. The method according to claim 16, characterized in that After obtaining the first count value corresponding to the first clock signal and the second count value corresponding to the second clock signal, the method further includes: When the second count value reaches the reference count value, a detection completion signal is output, the detection completion signal indicating that detection of the first clock signal is completed.
19. The method according to claim 16, characterized in that The threshold window and the reference count value are determined based on a frequency of the first clock signal.
20. The method according to any one of claims 11 to 14, characterized in that: After obtaining the detection result of the first clock signal, the method further includes: A status signal is output based on the detection result, wherein the status signal indicates whether the first clock signal is normal.
21. An electronic device, characterized in that: The electronic device comprises the signal detection circuit according to any one of claims 1 to 10.
22. The electronic device according to claim 21, characterized in that: The electronic device is a chip or a chip system.
