A queue-based clock frequency deviation monitoring device

CN121349256BActive Publication Date: 2026-11-17HENGCHEN MICROELECTRONICS (SHANDONG) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511503716.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-21
Publication Date
2026-11-17
Estimated Expiration
2045-10-21

Smart Images

  • Figure CN121349256B_ABST
    Figure CN121349256B_ABST
Patent Text Reader

Abstract

This invention relates to the field of integrated circuit verification technology, specifically a queue-based clock frequency deviation monitoring device. It includes an initialization module for setting module-related initialization data; a clock event capture module for real-time monitoring of clock signal edges and obtaining the precise simulation time at that moment; a queue management and reference model module for storing timestamp information into a dynamic queue as needed; and a comparison and reporting module for obtaining the queue size and comparing it in real-time with alarm upper and lower limits, outputting a corresponding report based on the comparison results. This invention utilizes the dynamic allocation and efficient operation characteristics of SystemVerilog queues to store and process clock events in real-time, supporting continuous monitoring over long periods and across multiple clock domains. It provides an efficient, reliable, and low-cost solution for clock verification of modern digital integrated circuits, significantly improving the completeness and automation level of verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of integrated circuit verification, specifically providing a clock frequency deviation detection device based on SystemVerilog queues. This device utilizes the queue data structure of the SystemVerilog language to detect frequency deviations between clocks of the same source but different frequencies, and between clocks from different sources. Background Technology

[0002] As the complexity of integrated circuit design increases dramatically, modern System-on-Chip (SoC) and processors typically integrate multiple clock domains. These clocks may be generated by dividing the same PLL (same source, different frequency) or originate from independent crystal oscillators or clock generators (different sources). While multiple clock domains meet the differentiated timing requirements of complex circuits, clock signals are susceptible to factors such as process variations, voltage fluctuations, and temperature drift during transmission and frequency division, resulting in clock frequency deviations and posing potential risks to system stability. Clock frequency deviations can directly cause serious problems: On the one hand, when the deviation exceeds the timing constraints, it can lead to timing violations such as data sampling errors and signal synchronization failures. For example, abnormal phase differences between the clock and data in high-speed interfaces may cause data transmission errors. On the other hand, the accumulation of small deviations over a long period can cause functional errors, such as processor instruction execution cycle disorder and memory cell read / write timing mismatch. In severe cases, it can even cause the entire integrated circuit to crash, which has a particularly significant impact on fields with high reliability requirements such as automotive electronics and industrial control. Traditional clock frequency deviation detection methods have significant limitations: First, they heavily rely on external testing equipment such as oscilloscopes and frequency meters. These devices are costly and bulky, allowing only offline testing in laboratory environments, which cannot meet the high-efficiency requirements of integrated circuit mass production testing or on-site maintenance. Second, some scenarios rely on engineers manually analyzing time-frequency data, which is not only inefficient but also prone to misjudgments due to human error, and it is difficult to cover the full-scenario testing needs of complex multi-clock domains. Therefore, a more efficient, accurate, and integrated testing solution is urgently needed. This device automatically performs real-time monitoring and evaluation of frequency deviation in a simulation environment through queue structures and frequency division technology built into a hardware description language. Summary of the Invention

[0003] To address the problems in the prior art, the present invention provides a clock frequency deviation monitoring device based on a queue.

[0004] The technical solution adopted by this invention to solve its technical problem is: a clock frequency deviation monitoring device based on a queue, comprising: The initialization module is used to set the module's initialization data. The clock event capture module is used to monitor the edge of the clock signal in real time and obtain the accurate simulation time at that moment. The queue management and reference model module stores timestamp information into a dynamic queue as needed; The comparison and reporting module obtains the queue size and compares it with the alarm upper and lower limits in real time, and outputs the corresponding report based on the comparison results.

[0005] Furthermore, the initialization data related to the module includes the frequency division of the reference clock, the frequency division of the monitoring clock, the initial value of the queue, the alarm upper limit, the alarm lower limit, and the check time.

[0006] Furthermore, the edge of the real-time monitoring clock signal includes monitoring the rising edge of the target clock via an always@ block; Obtaining the precise simulation time at that moment involves calling the $realtime system function to obtain the precise simulation time each time a valid clock edge is captured.

[0007] Furthermore, the queue management and reference model module writes the number of times to the queue to the reference clock's frequency division value, and simultaneously reads the timestamp out of the queue based on the monitoring clock's frequency division value.

[0008] Furthermore, when the queue size reaches either the alarm upper limit or the alarm lower limit, an assertion error is immediately triggered, and a detailed alarm value is reported.

[0009] Furthermore, if the queue size is always between the upper and lower alarm limits, then after the check time ends, a check-passed report will be output.

[0010] Furthermore, when performing the detection of clocks from the same source but different frequencies, the initial frequency division of the reference clock is set to ref_div=1, and the initial frequency division of the monitoring clock, test_div, is set according to the multiple of the two clocks.

[0011] Furthermore, when performing different source clock detection, the initial frequency division of the reference clock is set to ref_div=N, and the initial frequency division of the monitoring clock, test_div, is set to test_div=M.

[0012] The beneficial effects of this invention are: This invention can be seamlessly integrated into existing verification methodologies such as UVM as a verification IP (VIP) to achieve fully automated inspection, realizing automation and integration; This invention performs mathematical calculations and comparisons in real time during the simulation process, with high accuracy and immediate error reporting, exhibiting both high precision and real-time performance. This invention can detect clock problems in the design stage before tape-out, avoiding huge later costs, and has the characteristics of being forward-looking and low-cost; This invention can handle complex multi-clock domain scenarios and asynchronous clock synchronization problems, providing comprehensive and reliable detection coverage, real-time storage and processing of clock events, and supporting long-term, multi-clock domain continuous monitoring, making it flexible and powerful. This invention provides an efficient, reliable, and low-cost solution for clock verification of modern digital integrated circuits, greatly improving the completeness and automation level of verification. Attached Figure Description

[0013] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a flowchart illustrating the monitoring process of a queue-based clock frequency deviation monitoring device according to the present invention. Figure 2 This is a schematic diagram of the input data interface in a queue-based clock frequency deviation monitoring device of the present invention. Detailed Implementation

[0014] To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below in conjunction with specific embodiments.

[0015] The core of this invention lies in constructing a hardware-software co-verification component (typically used as a verification IP, VIP) based on SystemVerilog. This component runs in a simulation environment, monitoring clock signals, dynamically recording data, and performing real-time analysis to determine whether the clock frequency deviation is within acceptable tolerance limits. Specifically: Please see Figure 1 and Figure 2 This invention provides a queue-based clock frequency deviation monitoring device, which mainly includes a clock event capture module, a queue management and reference model module, and a comparison and reporting module. Specifically, the device includes the following modules: The initialization module is used to set the module's initialization data. The module-related initialization data includes the frequency division of the reference clock, the frequency division of the monitoring clock, the initial value of the queue, the alarm upper limit, the alarm lower limit, and the check time, etc.

[0016] The clock event capture module is used to monitor the edge of the clock signal in real time and obtain the accurate simulation time at that moment. Among them, real-time monitoring of the clock signal edge includes monitoring the rising edge of the target clock through the always@ block; Obtaining the precise simulation time at a given moment involves calling the $realtime system function each time a valid clock edge is captured to obtain the precise simulation time at that moment.

[0017] The queue management and reference model module stores timestamp information into a dynamic queue as needed; The queue management and reference model module writes the number of times to the queue based on the frequency division value of the reference clock, and at the same time reads the timestamp out of the queue based on the frequency division value of the monitored clock.

[0018] The comparison and reporting module obtains the queue size and compares it with the alarm upper and lower limits in real time, and outputs the corresponding report based on the comparison results.

[0019] When the queue size reaches either the alarm upper limit or the alarm lower limit, an assertion error is immediately triggered, and a detailed alarm value is reported.

[0020] If the queue size remains between the upper and lower alarm limits, the check time will end, and a report indicating that the check has passed will be output.

[0021] When performing clock detection with the same source but different frequencies, the initial frequency division of the reference clock is set to ref_div=1, and the frequency division of the monitoring clock, test_div, is initially set according to the multiple of the two clocks.

[0022] When performing clock detection from different sources, the initial division of the reference clock is set to ref_div=N, and the initial division of the monitoring clock, test_div, is set to test_div=M.

[0023] This invention can perform clock detection with the same source but different frequency and clock detection with different sources. It utilizes the first-in-first-out data structure of SystemVerilog queues and object-oriented programming features to automatically complete the real-time monitoring and evaluation of frequency deviation in a simulation environment. It has the advantages of high efficiency, reliability and low cost, and perfectly solves the problems of low efficiency and easy error in traditional methods.

[0024] The entire process of the device is as follows Figure 1 As shown, this forms a continuous monitoring closed loop. For Figure 1 The clock monitoring process in the system is described below: 1. Initialization and Configuration: Set the frequency divider of the reference clock (ref_div), the frequency divider of the monitoring clock (test_div), the initial value of the queue (init_value), the alarm limit (high_alarm_value), the alarm lower limit (low_alarm_value), and the check time (chk_time).

[0025] 2. Configure the enable signal (chk_en) and record the start time (start_time). The clock event capture module starts working, monitoring the rising edge of the target clock through the always@(posedgeclk) block. Whenever a valid clock edge is captured, the module calls the $realtime system function to obtain the precise simulation time at that moment (usually in picoseconds or nanoseconds).

[0026] 3. The queue management module writes this timestamp to a SystemVerilog dynamic queue (such as realtime_queue[$]), and the number of times it writes to the queue (push_back) is determined by the clock's division value (ref_div). At the same time, it reads the timestamp out of the queue (pop_front) according to the monitored clock's division value (test_div).

[0027] 4. Compare the queue size with the alarm limit (high_alarm_value) and alarm lower limit (low_alarm_value); 5. If the alarm value is reached, an assertion error will be triggered immediately, and a detailed alarm value report will be generated.

[0028] 6. If the alarm conditions are not met, wait for the inspection time to end and then output an inspection pass report.

[0029] 7. If multiple monitoring sessions are required, the queue status needs to be cleared (configure the check clear signal clear_alarm), the check enable signal needs to be disabled (configure the check enable signal to be 0), and the initialization process needs to be re-executed.

[0030] Input / output interface signals are shown below Figure 2 The implementation of this invention mainly operates during the chip simulation stage for monitoring deviations in clock frequencies that are at the same frequency or have a corresponding multiple relationship. Please refer to the two embodiments below for details.

[0031] Example 1: When detecting clocks of the same origin but different frequencies using the queue-based clock frequency deviation monitoring device of the present invention, it is necessary to generate multiple expected frequencies by dividing the reference clock, using a queue to record the actual clock edges, and automatically calculating the frequency deviation by comparing the queue data with the expected model. The specific implementation method is as follows: a1. Initialization and Configuration: Set the frequency divider of the reference clock (ref_div=1), the frequency divider of the monitoring clock (test_div is set according to the multiple of the two clocks), the initial value of the queue (init_value), the alarm limit (high_alarm_value), the alarm lower limit (low_alarm_value), and the check time (chk_time).

[0032] a2. Configure the enable signal (chk_en) and record the start time (start_time). The clock event capture module starts working, monitoring the rising edge of the target clock through the always@(posedgeclk) block. Whenever a valid clock edge is captured, the module calls the $realtime system function to obtain the precise simulation time at that moment (usually in picoseconds or nanoseconds). a3. The queue management module writes this timestamp to a SystemVerilog dynamic queue (such as realtime_queue[$]). The number of times the timestamp is written to the queue (push_back) is determined by the clock's division value (1 time for ref_div). At the same time, the timestamp is read out of the queue (pop_front) according to the monitored clock's division value (read test_div times).

[0033] a4. Compare the queue size with the alarm limit (high_alarm_value) and alarm lower limit (low_alarm_value); a5. If the alarm value is reached, immediately trigger an assertion error and report the detailed alarm value.

[0034] a6. If the alarm conditions are not met, wait for the inspection time to end and output an inspection pass report.

[0035] a7. If multiple monitoring sessions are required, the queue status needs to be cleared (configure the check clear signal clear_alarm), the check enable signal needs to be disabled (configure the check enable signal to be 0), and the initialization process needs to be re-executed.

[0036] Example 2: When using the queue-based clock frequency deviation monitoring device of the present invention to detect clocks from different sources, it is based on asynchronous clock synchronization technology to align clock signals from different sources to a unified detection window. The frequency difference is analyzed by counting the number of cycles through the queue. The specific implementation method is as follows: b1. Initialization and Configuration: Set the reference clock divider (ref_div=N), the monitoring clock divider (test_div=M), the queue initial value (init_value), the alarm limit (high_alarm_value), the alarm lower limit (low_alarm_value), and the check time (chk_time). It is important to note that M:N is the ratio of the clock frequency of the reference clock to the clock under test, ensuring that the subsequent dequeue and enqueue speeds are consistent.

[0037] b2. Configure the enable signal (chk_en) and record the start time (start_time). The clock event capture module starts working, monitoring the rising edge of the target clock through the always@(posedgeclk) block. Whenever a valid clock edge is captured, the module calls the $realtime system function to obtain the precise simulation time at that moment (usually in picoseconds or nanoseconds). b3. The queue management module writes this timestamp to a SystemVerilog dynamic queue (such as realtime_queue[$]). The number of times to write to the queue (push_back) is determined by the clock's division value (write ref_div times). At the same time, the timestamp is read out of the queue (pop_front) according to the monitored clock's division value (read test_div times).

[0038] b4. Compare the queue size with the alarm limit (high_alarm_value) and alarm lower limit (low_alarm_value); b5. If the alarm value is reached, immediately trigger an assertion error and report the detailed alarm value.

[0039] b6. If the alarm conditions are not met, wait for the inspection time to end and output an inspection pass report.

[0040] b7. If multiple monitoring sessions are required, the queue state needs to be cleared (configure the check clear signal clear_alarm), the check enable signal needs to be disabled (configure the check enable signal to be 0), and the initialization process needs to be re-executed.

[0041] This invention utilizes the dynamic allocation and efficient operation characteristics of SystemVerilog queues to store and process clock events in real time, supporting continuous monitoring over long periods and across multiple clock domains, and achieving dynamic queue management. Furthermore, this invention can be seamlessly integrated as a verification IP (VIP) into existing verification methodologies such as UVM to achieve fully automated checks, realizing automation and integration.

[0042] refer to Figure 1 The detection flowchart in this invention shows that it can perform mathematical calculations and comparisons in real time during simulation with high accuracy and can immediately report errors. It has high precision and real-time performance, and can detect clock problems in the design stage before tape-out, avoiding huge later costs. It has the characteristics of foresight and low cost. In addition, this invention can also handle complex multi-clock domain scenarios and asynchronous clock synchronization problems, provide comprehensive and reliable detection coverage, store and process clock events in real time, and support long-term, multi-clock domain continuous monitoring.

[0043] This invention provides an efficient, reliable, and low-cost solution for clock verification of modern digital integrated circuits, greatly improving the completeness and automation level of verification.

[0044] Although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

Claims

1. A queue-based clock frequency deviation monitoring device, used to monitor the deviation of clock frequencies of the same frequency or with corresponding multiples during the chip simulation stage, characterized in that, include: The initialization module is used to set initialization data; The clock event capture module is used to monitor the edge of the clock signal in real time and obtain the accurate simulation time when a valid clock edge is captured. The queue management and reference model module stores timestamp information into a dynamic queue as needed; The comparison and reporting module obtains the queue size and compares it with the alarm upper and lower limits in real time, and outputs the corresponding report based on the comparison results. The initialization data includes the frequency division of the reference clock, the frequency division of the monitoring clock, the initial value of the queue, the alarm upper limit, the alarm lower limit, and the check time. Configure the enable signal chk_en and record the start time start_time. The clock event capture module starts working and monitors the rising edge of the target clock through the always@(posedgeclk) block. Whenever a valid clock edge is captured, the clock event capture module calls the $realtime system function to obtain the accurate simulation time when the valid clock edge is captured. The queue management and reference model module writes the timestamp into the SystemVerilog dynamic queue. The number of times the times the timestamp is written to the queue is determined by the frequency division value ref_div of the reference clock. At the same time, the timestamp is read out of the queue pop_front according to the frequency division value test_div of the monitoring clock. When the queue size reaches either the alarm upper limit or the alarm lower limit, an assertion error is immediately triggered, and a detailed alarm value is reported. If the queue size is always between the alarm upper limit and the alarm lower limit, then wait for the check time to end and output a check passed report; If multiple monitoring sessions are required, the check clear signal (clear_alarm) needs to be configured, the check enable signal needs to be set to 0, and the initialization process needs to be re-executed.

2. The clock frequency deviation monitoring device based on a queue according to claim 1, characterized in that: When performing clock detection with the same source but different frequencies, the initial frequency division of the reference clock is set to ref_div=1, and the initial frequency division of the monitoring clock, test_div, is set according to the clock multiples of the two clocks.

3. The clock frequency deviation monitoring device based on queue according to claim 1, characterized in that: When detecting clocks from different sources, asynchronous clock synchronization technology is used to align clock signals from different sources to a unified detection window. The number of cycles is counted by queue and the frequency difference is analyzed. The initial frequency division of the reference clock is set to ref_div=N, and the initial frequency division of the monitoring clock is set to test_div=M. M:N is the frequency ratio of the reference clock and the monitoring clock, ensuring that the subsequent dequeue and enqueue speeds are consistent.

Citation Information

Patent Citations

  • PLL / DLL dual loop data synchronization utilizing a granular FIFO fill level indicator

    US7366270B2