A system and method for real-time monitoring and dynamic correction of metastable state
The edge detection circuit monitors the clock phase difference at the asynchronous interface and performs dynamic correction, which solves the metastable problem at the asynchronous interface and improves the stability and reliability of the system.
Patent Information
- Application Number
- CN202411064310.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-08-05
AI Technical Summary
At the asynchronous interface, the clock frequency difference between asynchronous modules leads to metastable phenomena, which may lead to system paralysis. It is difficult to monitor and avoid data jumps in the metastable window in real time with existing technology.
The edge detection circuit detects the clock phase difference between the source register and the destination register, and monitors in real time whether it is in the metastable dangerous range. If so, the data path is enabled and the phase gear is selected for data phase adjustment to complete dynamic correction.
It improves the stability and reliability of the asynchronous interface circuit, avoids data jumps in the metastable window, and ensures the stability of the system.
Smart Images

Figure CN118566703B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of chip design, and in particular to a system and method for real-time monitoring and dynamic correction of metastable states. Background Art
[0002] There are many asynchronous interfaces in SOC chips. Asynchronous means that two modules work at different clock frequencies. Asynchronous interface refers to the place where two modules working at different frequencies exchange data. Metastable phenomenon is prone to occur in the circuit at the asynchronous interface. The asynchronous interface data interaction is carried out between registers. The two registers come from two modules with different operating frequencies. The party sending the data is called the source register, and the party receiving the data is called the destination register.
[0003] When the data transition of the destination register at the interface happens to be in the metastable window, the circuit will become metastable. The metastable state will propagate and may cause the entire system to crash. For this asynchronous interface, how to monitor the clock phase difference between the source register and the destination register in real time, and then take measures to prevent the data from jumping in the metastable window to make the circuit more stable and reliable, is an urgent problem that needs to be solved in the current chip design field. Summary of the invention
[0004] In order to solve the above problems, the object of the present invention is to provide a system and method for real-time monitoring and dynamic correction of metastable state.
[0005] The purpose of the present invention can be achieved by the following technical solution: A method for real-time monitoring and dynamic correction of metastable state, comprising the following steps:
[0006] Step S1: two data ends working in different clock domains perform data exchange at an asynchronous interface, the data ends including a source register and a destination register, and detecting a clock phase difference between the source register and the destination register by an edge detection circuit;
[0007] Step S2: Real-time monitoring of whether the acquired clock phase difference is within the dangerous range of metastable state of the asynchronous interface circuit. If so, the data path is enabled and the data path phase gear is selected. If not, no operation is performed.
[0008] Step S3: for the circuit of the asynchronous interface in the dangerous range of the occurrence of metastable state, continue to adjust the data phase after selecting the data path phase gear, thereby completing the final dynamic correction of the circuit delay.
[0009] Furthermore, the process of exchanging data between two data terminals operating in different clock domains at an asynchronous interface includes:
[0010] The clock domains corresponding to the two data ends include Clock_domain_0 and Clock_domain_1. The data end with the clock domain of Clock_domain_0 is used as the data sending end for data interaction, and the data end with the clock domain of Clock_domain_1 is used as the data receiving end for data interaction.
[0011] Among them, the data end as the data sending end corresponds to the source register, and the data end as the data receiving end corresponds to the destination register. The phase of the clock corresponding to the source register is obtained, and the phase is recorded as CLK0. The phase of the clock corresponding to the destination register is obtained, and the phase is recorded as CLK1. The interaction position where data interaction occurs between the two data ends is the asynchronous interface.
[0012] Furthermore, the process of detecting the clock phase difference between the source register and the destination register by the edge detection circuit includes:
[0013] The edge detection circuit includes an edge trigger 0 and an edge trigger 1, wherein the edge trigger 1 is used to detect the clock corresponding to the destination register, and the edge trigger 0 is used to detect the clock corresponding to the source register. The phases of the clocks corresponding to the destination register and the source register are detected by the edge detection circuit, and the clock phase difference between the source register and the destination register is obtained according to the phases CLK0 and CLK1.
[0014] The clock phase difference between the source register and the destination register is recorded as t0, and t0=CLK0-CLK1. The value of t0 includes positive and negative values. When the clock of the destination register corresponding to edge trigger 1 is later than the clock of the source register corresponding to edge trigger 0, the clock phase difference t0 takes a positive value. When the clock of the source register corresponding to edge trigger 0 is later than the clock of the source register corresponding to edge trigger 1, the clock phase difference t0 takes a negative value.
[0015] Define the metastable region of the circuit corresponding to the asynchronous interface. The metastable region includes Tsu and Tu. Tsu in the metastable region indicates that before the clock of the data end corresponding to the destination register arrives, the data at the data end is in a stable and unchanged window, and D1 needs to remain unchanged before the rising edge of the clock of CLK1. Tu in the metastable region indicates that after the clock of the data end corresponding to the destination register arrives, the data at the data end is in a stable and unchanged window, and D1 needs to remain unchanged after the rising edge of the clock of CLK1. The source register outputs Q0 after being triggered by the rising edge of the clock CLK0, and D1 is the waveform of Q0 reaching the data end of the destination register after passing through a data path.
[0016] Furthermore, when the edge detection circuit collects the clock phase difference between the source register and the destination register, a clock is set for the edge detection circuit, and the clock meets the following requirements: the clock corresponding to the current edge detection circuit is larger than the clock with the larger frequency between the source register and the destination register, and the clock of the edge detection circuit is set to twice the clock with the larger frequency between the source register and the destination register. After the clock corresponding to the edge detection circuit is set, the edge detection circuit performs edge sampling on the clocks of the destination register and the source register respectively. The types of edge sampling include rising edge sampling and falling edge sampling, and rising edge sampling and falling edge sampling are performed on the two clocks at the same time.
[0017] Furthermore, the process of real-time monitoring whether the acquired clock phase difference is within a dangerous range of a metastable state of the circuit of the asynchronous interface includes:
[0018] The delay of the entire data path is set to Td. When D1 is in the metastable region of the clock sampling of the destination register, a jump occurs, and the circuit at the asynchronous interface is metastable. The formula is expressed as follows: when Td-t0 < Th, or t0-Td+T < Tsu, where T is the period of the destination register, Td-t0 is a negative number, and t0-Td+T can be a negative number. At this time, Td-t0 < Th and t0-Td+T < Tsu are both in the dangerous range of the clock phase difference causing the circuit at the asynchronous interface to be metastable.
[0019] When the clock phase difference obtained by real-time monitoring is within the dangerous range of metastable state in the circuit of the asynchronous interface, the data path of the circuit is enabled and the data path phase gear is selected. When the clock phase difference obtained by real-time monitoring is not within the dangerous range of metastable state in the circuit of the asynchronous interface, no operation is performed.
[0020] Furthermore, the process of enabling the data path and selecting the data path phase gear includes:
[0021] According to Td-t0<Th or t0-Td+T<Tsu, whether there is a delay requirement for enabling the data path is determined, Td-t0<Th is marked as judgment formula 1, and t0-Td+T<Tsu is marked as judgment formula 2;
[0022] When the judgment formula 1 is satisfied, the operation of increasing Td is performed, and while increasing Td, the value of Td is ensured not to satisfy the judgment formula 2; when the judgment formula 2 is satisfied, the operation of decreasing Td is performed, and while decreasing Td, the value of Td is ensured not to satisfy the judgment formula 1;
[0023] By changing Td through judgment formula 1 and judgment formula 2, the data path is enabled, and the phase position of the data path is selected, wherein the selection of the phase position of the data path is an n-to-1 circuit.
[0024] Furthermore, for a circuit of an asynchronous interface in a dangerous range of a metastable state, after selecting a data path phase gear, the data phase is continuously adjusted, thereby completing the process of finally dynamically correcting the circuit delay, including:
[0025] When the circuit of the asynchronous interface is in the dangerous range of metastable state, the phase gear of the data path corresponding to the circuit is selected. The phase gear of the data path is divided into 8 gears, and each phase gear corresponds to 1 / 4 of the clock cycle of the clock corresponding to the destination register, among which the lowest phase gear is 1 / 4 of the clock cycle, and the highest phase gear is 2 clock cycles;
[0026] The periods of the second to seventh phase gears are: 1 / 2, 3 / 4, 1, 5 / 4, 3 / 2 and 7 / 4 of the clock period corresponding to the destination register, respectively. The lowest gear is directly set at 1 / 4 of the clock period, and the highest gear is set based on the maximum difference between the source register and the destination register period.
[0027] When the data path selects the corresponding path phase gear, the data phase of the asynchronous interface circuit currently experiencing metastable phenomenon is adjusted through the selected path phase gear, thereby completing the dynamic correction of the circuit delay of the corresponding circuit of the asynchronous interface.
[0028] Further, a system for real-time monitoring and dynamic correction of metastable state includes:
[0029] A clock phase difference detection module, used for exchanging data between two data ends working in different clock domains at an asynchronous interface, wherein the data ends include a source register and a destination register, and detecting the clock phase difference between the source register and the destination register through an edge detection circuit;
[0030] The circuit metastable state monitoring module is used to monitor in real time whether the acquired clock phase difference is within the dangerous range of the circuit metastable state of the asynchronous interface. If so, the data path is enabled and the data path phase gear is selected. If not, no operation is performed.
[0031] The dynamic correction module is used to select the data path phase gear for the asynchronous interface circuit in the dangerous range of metastable state and then continue to adjust the data phase, thereby completing the final dynamic correction of the circuit delay.
[0032] Compared with the prior art, the beneficial effects of the present invention are as follows: by making two data ends working in different clock domains perform data interaction at an asynchronous interface, wherein the data end includes a source register and a destination register, the clock phase difference between the source register and the destination register is detected by an edge detection circuit, and the acquired clock phase difference is monitored in real time to see whether it is within the dangerous range of metastable state of the circuit of the asynchronous interface. For the circuit of the asynchronous interface within the dangerous range of metastable state, the data path phase gear is selected and then the data phase adjustment is continued, thereby completing the final dynamic correction of the circuit delay, abandoning the traditional method of adding circuit delay to the clock and converting to adding delay to the data path, realizing real-time monitoring of the clock phase difference between the source register and the destination register, and taking timely measures to avoid data jumps in the metastable window, so that the circuit becomes more stable and reliable. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0034] like Figure 1 As shown, a method for real-time monitoring and dynamic correction of metastable state comprises the following steps:
[0035] Step S1: two data ends working in different clock domains perform data exchange at an asynchronous interface, the data ends including a source register and a destination register, and detecting a clock phase difference between the source register and the destination register by an edge detection circuit;
[0036] Step S2: Real-time monitoring of whether the acquired clock phase difference is within the dangerous range of metastable state of the asynchronous interface circuit. If so, the data path is enabled and the data path phase gear is selected. If not, no operation is performed.
[0037] Step S3: for the circuit of the asynchronous interface in the dangerous range of the occurrence of metastable state, continue to adjust the data phase after selecting the data path phase gear, thereby completing the final dynamic correction of the circuit delay.
[0038] It should be further explained that, in a specific implementation process, the process of exchanging data between two data terminals working in different clock domains at an asynchronous interface includes:
[0039] The clock domains corresponding to the two data ends are respectively recorded as Clock_domain_0 and Clock_domain_1, wherein the data end with the clock domain of Clock_domain_0 is used as the data sending end for data interaction, and the data end with the clock domain of Clock_domain_1 is used as the data receiving end for data interaction.
[0040] Among them, the data end as the data sending end corresponds to the source register, and the data end as the data receiving end corresponds to the destination register. The phase of the clock corresponding to the source register is obtained, and the phase is recorded as CLK0. The phase of the clock corresponding to the destination register is obtained, and the phase is recorded as CLK1. The interaction position where data interaction occurs between the two data ends is the asynchronous interface.
[0041] It should be further explained that, in a specific implementation process, the process of detecting the clock phase difference between the source register and the destination register by the edge detection circuit includes:
[0042] The edge detection circuit includes edge trigger 0 and edge trigger 1, edge trigger 1 is used to detect the clock corresponding to the destination register, and edge trigger 0 is used to detect the clock corresponding to the source register. The edge detection circuit detects the phases of the clocks corresponding to the destination register and the source register, and then obtains the clock phase difference between the source register and the destination register based on their phases.
[0043] The clock phase difference between the source register and the destination register is denoted as t0, that is, t0=CLK0-CLK1. The value of t0 can be positive or negative. When the clock of the destination register corresponding to edge trigger 1 is later than the clock of the source register corresponding to edge trigger 0, the clock phase difference t0 is positive. When the clock of the source register corresponding to edge trigger 0 is later than the clock of the source register corresponding to edge trigger 1, the clock phase difference t0 is negative.
[0044] It should be noted that when the edge detection circuit collects the clock phase difference between the source register and the destination register, a clock is set for the edge detection circuit, and the clock meets the following requirements: the clock corresponding to the current edge detection circuit needs to be larger than the clock with the larger frequency between the source register and the destination register. The clock of the edge detection circuit is usually set to twice the clock with the larger frequency between the source register and the destination register. After the clock corresponding to the edge detection circuit is set, the edge detection circuit performs edge sampling on the clocks of the destination register and the source register. The types of edge sampling include rising edge sampling and falling edge sampling, and rising edge sampling and falling edge sampling are performed on the two clocks at the same time.
[0045] Define the metastable region of the circuit corresponding to the asynchronous interface when two data ends perform data exchange in the asynchronous interface, wherein the metastable region includes Tsu and Tu, wherein Tsu in the metastable region indicates that before the clock of the data end corresponding to the destination register arrives, the data of the data end is in a stable and unchanged window, that is, D1 needs to remain unchanged before the rising edge of the clock CLK1, and Tu in the metastable region indicates that after the clock of the data end corresponding to the destination register arrives, the data of the data end is in a stable and unchanged window, that is, D1 needs to remain unchanged after the rising edge of the clock CLK1, wherein the source register outputs Q0 after being triggered by the rising edge of the clock CLK0, and D1 is the waveform of Q0 reaching the data end of the destination register after passing through a data path.
[0046] It should be further explained that, in a specific implementation process, the process of real-time monitoring whether the acquired clock phase difference is within the dangerous range of the circuit metastable state of the asynchronous interface includes:
[0047] The delay of the entire data path is set to Td. When D1 jumps in the metastable region of the clock sampling of the destination register, the circuit at the asynchronous interface will be metastable.
[0048] Expressed in formula, metastable state will occur when Td-t0<Th or t0-Td+T<Tsu, T is the period of the destination register, the registers of digital circuits are all standard units in the process library, the Th and Tsu parameter values of the standard register units are related to the manufacturing process, and the process factory will give these two values when they are used. The combined area of the two is the metastable area of the register, Td-t0 can be a negative number, t0-Td+T can be a negative number, indicating that metastable state will occur, among which Td-t0<Th and t0-Td+T<Tsu are both the clock phase difference in the dangerous range of metastable state of the asynchronous interface circuit;
[0049] When the clock phase difference obtained by real-time monitoring is within the dangerous range of metastable state in the circuit of the asynchronous interface, the data path of the circuit is enabled and the data path phase gear is selected. When the clock phase difference obtained by real-time monitoring is not within the dangerous range of metastable state in the circuit of the asynchronous interface, no operation is performed.
[0050] It should be further explained that, in a specific implementation process, the process of enabling the data path and selecting the data path phase gear includes:
[0051] According to the phase of the two clocks, the formula Td-t0<Th (judgment formula 1) or t0-Td+T<Tsu (judgment formula 2) is used to determine whether there is a delay requirement for enabling the data path. Assume that Th is 100ps, Tsu is 100ps, and the clock of the destination register is 100M, that is, T is 10ns, the delay Td of the data path is 7ns, and t0 is the phase difference between the two clocks, which is 8ns.
[0052] In the above formula, only the phase difference between the two registers is a variable, which needs to be captured through detection. The other values are known. Through calculation, it is known that if the judgment formula 1 is satisfied, a metastable state will occur and the delay of Td needs to be increased. However, while increasing Td, judgment formula 2 must not be satisfied. Therefore, the range of Td increase is between [1ns, 11ns-100ps]. In terms of the transmission efficiency of the integrated circuit data, it is generally sufficient to select the smallest value plus a 20% margin. However, the smallest scalable value here is 1 / 4 clock cycle, so the delay gear we choose to increase is 10 / 4, which is 2.5ns.
[0053] t0 may also be a negative value. When t0 is -3ns, it will obviously trigger judgment formula 2. Obviously, Td needs to be subtracted at this time. Assuming that the metastable correction has been triggered before, it is necessary to directly subtract the increased delay to see if the circuit meets the requirements. Otherwise, a larger delay needs to be added to avoid being sampled in the current clock cycle, and sampling needs to be performed at the next clock sampling edge.
[0054] The data path phase gear selection is an n-to-1 circuit that selects a suitable path based on the phase difference result. It also includes some readable register values, the current gear query register, which can be directly observed by the host computer, and some status registers such as the metastable trigger flag register.
[0055] It should be further explained that, in a specific implementation process, for a circuit of an asynchronous interface in a dangerous range of a metastable state, after selecting a data path phase gear, the data phase is continuously adjusted, and the process of completing the final dynamic correction of the circuit delay includes:
[0056] When the circuit of the asynchronous interface is in the dangerous range of metastable state, the phase gear selection of the data path corresponding to the circuit is performed. The phase gear of the data path is divided into 8 gears, and each phase gear corresponds to 1 / 4 clock cycle of the clock corresponding to the destination register. Among them, the lowest phase gear is 1 / 4 cycle, and the highest phase gear is 2 cycles.
[0057] The periods of the second to seventh phase gears are: 1 / 2, 3 / 4, 1, 5 / 4, 3 / 2 and 7 / 4 of the clock period corresponding to the destination register. The lowest gear is directly set to 1 / 4 period, and the highest gear is set based on the maximum difference between the source register and the destination register periods. It should be noted that, under normal circumstances, the frequency of the destination register is twice that of the source register, which is already at the limit. Then the highest delay gear is to add one period of the source register, that is, two clock periods of the destination register.
[0058] When the data path selects the corresponding path phase gear, the data phase of the asynchronous interface circuit currently experiencing metastable phenomenon is adjusted through the selected path phase gear, thereby completing the dynamic correction of the circuit delay of the corresponding circuit of the asynchronous interface.
[0059] The present invention also provides a system for real-time monitoring and dynamic correction of metastable states, the system comprising:
[0060] The clock phase difference detection module is used to exchange data between two data ends working in different clock domains at an asynchronous interface. The data ends include a source register and a destination register. The clock phase difference between the source register and the destination register is detected by an edge detection circuit.
[0061] The circuit metastable monitoring module is used to monitor in real time whether the acquired clock phase difference is within the dangerous range of metastable state of the asynchronous interface circuit. If so, the data path is enabled and the data path phase gear is selected. If not, no operation is performed.
[0062] The dynamic correction module is used to select the data path phase gear for the asynchronous interface circuit in the dangerous range of metastable state and then continue to adjust the data phase, thereby completing the final circuit delay.
[0063] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.
Claims
1. A method for real-time monitoring and dynamic correction of metastable state, It is characterized in that The following steps are involved: Step S1: two data ends working in different clock domains perform data exchange at an asynchronous interface, the data ends including a source register and a destination register, and detecting a clock phase difference between the source register and the destination register by an edge detection circuit; Step S2: Real-time monitoring of whether the acquired clock phase difference is within the dangerous range of metastable state of the asynchronous interface circuit. If so, the data path is enabled and the data path phase gear is selected. If not, no operation is performed. Step S3: for the circuit of the asynchronous interface in the dangerous range of the occurrence of metastable state, after selecting the data path phase gear, continue to adjust the data phase, thereby completing the final dynamic correction of the circuit delay; The process of exchanging data between two data terminals working in different clock domains at an asynchronous interface includes: The clock domains corresponding to the two data ends include Clock_domain_0 and Clock_domain_1. The data end with the clock domain of Clock_domain_0 is used as the data sending end for data interaction, and the data end with the clock domain of Clock_domain_1 is used as the data receiving end for data interaction. The data end as the data transmitting end corresponds to the source register, and the data end as the data receiving end corresponds to the destination register. The phase of the clock corresponding to the source register is obtained, and the phase is recorded as CLK0. The phase of the clock corresponding to the destination register is obtained, and the phase is recorded as CLK1. The interaction position where data interaction occurs between the two data ends is the asynchronous interface. The process of detecting the clock phase difference between the source register and the destination register by the edge detection circuit includes: The edge detection circuit includes an edge trigger 0 and an edge trigger 1, wherein the edge trigger 1 is used to detect the clock corresponding to the destination register, and the edge trigger 0 is used to detect the clock corresponding to the source register. The phases of the clocks corresponding to the destination register and the source register are detected by the edge detection circuit, and the clock phase difference between the source register and the destination register is obtained according to the phases CLK0 and CLK1. The clock phase difference between the source register and the destination register is recorded as t0, and t0=CLK0-CLK1. The value of t0 includes positive and negative values. When the clock of the destination register corresponding to edge trigger 1 is later than the clock of the source register corresponding to edge trigger 0, the clock phase difference t0 takes a positive value. When the clock of the source register corresponding to edge trigger 0 is later than the clock of the source register corresponding to edge trigger 1, the clock phase difference t0 takes a negative value. Define the metastable region of the circuit corresponding to the asynchronous interface. The metastable region includes Tsu and Th. Tsu in the metastable region indicates that before the clock of the data end corresponding to the destination register arrives, the data at the data end is in a stable and unchanged window, and D1 needs to remain unchanged before the rising edge of the corresponding CLK1 clock. Th in the metastable region indicates that after the clock of the data end corresponding to the destination register arrives, the data at the data end is in a stable and unchanged window, and D1 needs to remain unchanged after the rising edge of the corresponding CLK1 clock. The source register outputs Q0 after being triggered by the rising edge of the clock CLK0, and D1 is the waveform of Q0 reaching the data end of the destination register after passing through a data path; When the edge detection circuit collects the clock phase difference between the source register and the destination register, a clock is set for the edge detection circuit, and the requirements that the clock meets are: the clock corresponding to the current edge detection circuit is larger than the clock with the larger frequency between the source register and the destination register, and the clock of the edge detection circuit is set to twice the clock with the larger frequency between the source register and the destination register. After the clock corresponding to the edge detection circuit is set, the edge detection circuit performs edge sampling on the clocks of the destination register and the source register respectively. The types of edge sampling include rising edge sampling and falling edge sampling, and rising edge sampling and falling edge sampling are performed on the two clocks at the same time; The process of real-time monitoring whether the acquired clock phase difference is within the dangerous range of the circuit metastable state of the asynchronous interface includes: The delay of the entire data path is set to Td. When D1 is in the metastable region of the clock sampling of the destination register, a jump occurs, and the circuit at the asynchronous interface is metastable. The formula is expressed as follows: when Td-t0 < Th, or t0-Td+T < Tsu, where T is the period of the destination register, Td-t0 is a negative number, and t0-Td+T is a negative number. At this time, Td-t0 < Th and t0-Td+T < Tsu are both in the dangerous range of the clock phase difference causing the circuit at the asynchronous interface to be metastable. When the clock phase difference obtained by real-time monitoring is within the dangerous range of metastable state in the circuit of the asynchronous interface, the data path of the circuit is enabled and the data path phase gear is selected. When the clock phase difference obtained by real-time monitoring is not within the dangerous range of metastable state in the circuit of the asynchronous interface, no operation is performed.
2. A method for real-time monitoring and dynamic correction of metastable state according to claim 1, It is characterized in that The process of enabling a datapath and selecting the datapath phase position includes: According to Td-t0<Th or t0-Td+T<Tsu, whether there is a delay requirement for enabling the data path is determined, Td-t0<Th is marked as judgment formula 1, and t0-Td+T<Tsu is marked as judgment formula 2; When the judgment formula 1 is satisfied, the operation of increasing Td is performed, and while increasing Td, the value of Td is ensured not to satisfy the judgment formula 2; when the judgment formula 2 is satisfied, the operation of decreasing Td is performed, and while decreasing Td, the value of Td is ensured not to satisfy the judgment formula 1; By changing Td through judgment formula 1 and judgment formula 2, the data path is enabled, and the phase position of the data path is selected, wherein the selection of the phase position of the data path is an n-to-1 circuit.
3. A method for real-time monitoring and dynamic correction of metastable state according to claim 2, It is characterized in that For a circuit of an asynchronous interface in a dangerous range of a metastable state, the process of continuing to adjust the data phase after selecting the data path phase gear, thereby completing the final dynamic correction of the circuit delay includes: When the circuit of the asynchronous interface is in the dangerous range of metastable state, the phase gear of the data path corresponding to the circuit is selected. The phase gear of the data path is divided into 8 gears, and each phase gear corresponds to 1 / 4 of the clock cycle of the clock corresponding to the destination register, among which the lowest phase gear is 1 / 4 of the clock cycle, and the highest phase gear is 2 clock cycles; The periods of the second to seventh phase gears are: 1 / 2, 3 / 4, 1, 5 / 4, 3 / 2 and 7 / 4 of the clock period corresponding to the destination register, respectively. The lowest gear is directly set at 1 / 4 of the clock period, and the highest gear is set based on the maximum difference between the source register and the destination register period. When the data path selects the corresponding path phase gear, the data phase of the asynchronous interface circuit currently experiencing metastable phenomenon is adjusted through the selected path phase gear, thereby completing the dynamic correction of the circuit delay of the corresponding circuit of the asynchronous interface.
4. A system for real-time monitoring and dynamic correction of metastable states, used to implement the method for real-time monitoring and dynamic correction of metastable states as claimed in any one of claims 1 to 3, It is characterized in that The system includes: A clock phase difference detection module, used for exchanging data between two data ends working in different clock domains at an asynchronous interface, wherein the data ends include a source register and a destination register, and detecting the clock phase difference between the source register and the destination register through an edge detection circuit; The circuit metastable state monitoring module is used to monitor in real time whether the acquired clock phase difference is within the dangerous range of the circuit metastable state of the asynchronous interface. If so, the data path is enabled and the data path phase gear is selected. If not, no operation is performed. The dynamic correction module is used to select the data path phase gear for the asynchronous interface circuit in the dangerous range of metastable state and then continue to adjust the data phase, thereby completing the final dynamic correction of the circuit delay.
