Delay duration calibration method and apparatus
By acquiring and delaying clock and data signals within the chip, calculating signal timing differences, and adjusting delay durations, the problem of signal timing differences caused by environmental changes and aging is solved, achieving stability and adaptive adjustment of signal transmission.
Patent Information
- Application Number
- CN202611207484.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-10
- Publication Date
- 2026-11-10
AI Technical Summary
In chip design and PCB board design, data transmission is prone to abnormalities due to environmental changes and product aging. Existing technologies are unable to effectively adjust the timing difference between clock signals and data signals, resulting in unstable signal transmission.
By acquiring the initial clock signal and data signal, performing delay processing, calculating the signal timing difference, and determining the delay adjustment value based on the signal timing difference and the reference timing difference, the initial delay duration is adjusted to calibrate the delay duration, thereby achieving adaptive dynamic adjustment.
It reduces the difficulty of PCB design, improves the stability and reliability of signal transmission, and can adaptively adjust the delay time during chip use without user intervention.
Smart Images

Figure CN123070041A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of interface chip technology, and in particular to a delay duration calibration method and apparatus. Background Technology
[0002] With the development of chip technology, clock delays can be added in chip design and PCB design to create a timing difference between clock and data signals. In traditional technology, additional clock trace lengths are added during PCB routing to increase the clock delay and achieve a fixed timing difference between the clock and data signals.
[0003] However, changes in the environment, product aging, and differences in product manufacturing can easily lead to anomalies in the data transmission and parsing process. Summary of the Invention
[0004] Therefore, it is necessary to provide a delay duration calibration method and apparatus to address the aforementioned technical problems.
[0005] In a first aspect, this application provides a delay duration calibration method applied to a target chip, the method comprising:
[0006] Acquire the initial clock signal and the initial data signal;
[0007] Based on the initial delay duration, the initial clock signal and the initial data signal are delayed to obtain the adjusted clock signal and the adjusted data signal.
[0008] The signal timing difference is obtained by calculating the difference between the detection times of the adjusted clock signal and the adjusted data signal.
[0009] The delay adjustment value is determined based on the signal timing difference and the reference timing difference, and the initial delay duration is adjusted according to the delay adjustment value to obtain the calibrated delay duration.
[0010] In one embodiment, determining the delay adjustment value based on the signal timing difference and the reference timing difference includes:
[0011] If the signal timing difference is less than the reference timing difference, a delay adjustment value for increasing the signal timing difference is determined;
[0012] If the signal timing difference is greater than the reference timing difference, a delay adjustment value for reducing the signal timing difference is determined;
[0013] The magnitude of the delay adjustment value is positively correlated with the difference between the signal timing difference and the reference timing difference.
[0014] In one embodiment, the initial delay duration includes the delay duration of the initial clock signal;
[0015] Determining the delay adjustment value used to increase the signal timing difference includes:
[0016] Determine the delay adjustment value used to increase the delay duration of the initial clock signal;
[0017] Determining the delay adjustment value for reducing the signal timing difference includes:
[0018] Determine a delay adjustment value for reducing the initial delay duration.
[0019] In one embodiment, the initial delay duration further includes the delay duration of the initial data signal; determining the delay adjustment value for increasing the signal timing difference further includes:
[0020] Determine the delay adjustment value used to reduce the delay duration of the initial data signal;
[0021] Determining the delay adjustment value for reducing the signal timing difference includes:
[0022] Determine the delay adjustment value used to increase the delay duration of the initial data signal.
[0023] In one embodiment, the reference timing difference is matched with half a sampling clock cycle used by the target chip; the sampling clock cycle is the clock cycle of the initial clock signal and the adjusted clock signal.
[0024] In one embodiment, after determining the delay adjustment value based on the signal timing difference and the reference timing difference, the method further includes:
[0025] If the difference between the delay adjustment value and the delay adjustment value threshold satisfies the adjustment condition, the step of obtaining the calibrated delay duration is performed.
[0026] If the difference between the delay adjustment value and the delay adjustment value threshold does not meet the adjustment condition, return to the step of obtaining the initial clock signal and the initial data signal; the difference value that meets the adjustment condition is greater than the difference value that does not meet the adjustment condition.
[0027] In one embodiment, the step of calculating the signal timing difference based on the difference between the detection times of the adjusted clock signal and the adjusted data signal includes:
[0028] When the transition edges of the adjusted clock signal and the adjusted data signal are detected, the detection time of each of the adjusted clock signal and the adjusted data signal is determined.
[0029] The difference between the detection times of the adjusted clock signal and the adjusted data signal is calculated to obtain the signal timing difference.
[0030] In one embodiment, determining the delay adjustment value based on the signal timing difference and the reference timing difference, and adjusting the initial delay duration according to the delay adjustment value to obtain the calibrated delay duration, includes:
[0031] The delay adjustment value of the first time granularity is determined based on the signal timing difference and the reference timing difference, and the initial delay time granularity is adjusted based on the delay adjustment value of the first time granularity to obtain the calibrated delay duration of the first time granularity.
[0032] The initial delay duration of the second time granularity is determined based on the calibrated delay time granularity of the second time granularity; the first time granularity is greater than the second time granularity;
[0033] The steps of obtaining the adjusted clock signal and adjusted data signal are repeated based on the initial delay duration of the second time granularity until the calibrated delay duration of the second time granularity is obtained.
[0034] In one embodiment, when the initial clock signal and the initial data signal are sent by the MAC chip, the target chip is a PHY chip; when the initial clock signal and the initial data signal are sent by the PHY chip, the target chip is a MAC chip.
[0035] Secondly, this application also provides a delay duration calibration device, the device comprising:
[0036] The signal acquisition module is used to acquire the initial clock signal and the initial data signal;
[0037] The delay processing module is used to perform delay processing on the initial clock signal and the initial data signal according to the initial delay duration to obtain the adjusted clock signal and the adjusted data signal.
[0038] The timing module is used to calculate the difference between the detection times of the adjusted clock signal and the adjusted data signal to obtain the signal timing difference.
[0039] The delay duration update module is used to determine the adjustment delay value based on the signal timing difference and the reference timing difference, and to obtain the calibrated delay duration according to the delay adjustment value and the initial delay duration.
[0040] The aforementioned delay calibration method and apparatus acquire an initial clock signal and an initial data signal; based on the initial delay duration, delay processing is applied to the initial clock signal and the initial data signal to obtain an adjusted clock signal and an adjusted data signal, ensuring that the phase difference of the initial data signal meets sampling requirements; furthermore, the difference between the detection times of the adjusted clock signal and the adjusted data signal is calculated to obtain a signal timing difference, which reflects the delay effect of the initial delay duration, reflecting the degree to which chip and PCB board manufacturing deviations and characteristic deviations affect the initial delay duration, facilitating a stable assessment of whether the initial delay duration is usable; furthermore, a delay adjustment value is determined based on the signal timing difference and a reference timing difference, and the initial delay duration is adjusted according to the delay adjustment value to obtain a calibrated delay duration. This allows for adjustment via the delay adjustment value, no longer strictly relying on the signal timing difference design of the PCB board, reducing PCB design difficulty, and enabling adaptive dynamic adjustment of the chip's own configured delay duration during use, without user intervention. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is a diagram illustrating the application environment of the delay duration calibration method in one embodiment;
[0043] Figure 2 This is a flowchart illustrating a delay duration calibration method in one embodiment;
[0044] Figure 3 This is a flowchart illustrating the steps for determining the delay adjustment value in one embodiment;
[0045] Figure 4A This is a schematic diagram of a waveform scenario in one embodiment where the delay duration does not need to be adjusted;
[0046] Figure 4B This is a waveform scenario diagram illustrating the need to reduce clock delay signal timing differences in one embodiment.
[0047] Figure 4C This is a schematic diagram of a waveform scenario in one embodiment where the timing difference of the clock delay signal needs to be increased;
[0048] Figure 5 This is a waveform diagram of a data signal transmitted on the rising edge in one embodiment;
[0049] Figure 6 This is a waveform diagram of a signal collected at a data center location in one embodiment;
[0050] Figure 7 This is a structural block diagram of a delay duration calibration device in one embodiment;
[0051] Figure 8 This is a block diagram of the delay duration calibration device in one embodiment;
[0052] Figure 9 This is a schematic diagram of a programmable delay unit in one embodiment;
[0053] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0055] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various types of data, but these data are not limited by these terms. These terms are only used to distinguish between the first type of data and the second type of data. The term "comprising" and any variations thereof, as used in this application, are intended to cover non-exclusive inclusion. The term "multiple" as used in this application refers to two or more. The term "and / or" as used in this application refers to one of the solutions, or any combination of multiple solutions.
[0056] The delay duration calibration method provided in this application embodiment can be applied to, for example... Figure 1The application environment is shown. Ethernet is a computer local area network (LAN) technology based on the IEEE 802.3 standard, which specifies the physical layer, electrical signals, and media access control (MAC) layer protocols. In the seven-layer network communication protocol (OSI model), the main functions of the Ethernet MAC (Media Access Control) sublayer are: frame encapsulation and decapsulation, media access control, MAC address addressing and filtering, and error detection (such as CRC). The PHY is responsible for implementing the physical layer functions of data transmission, converting data signals into analog signals and sending them to the communication medium; simultaneously, it recovers the data signals from the received analog signals and transmits them to the upper-layer chip for processing. The Ethernet MAC and PHY are integrated into different chips, and they are connected in a standardized manner through a PCB board using a media-independent interface (xMII). A separate PHY chip can realize signal conversion, protocol adaptation, and electrical isolation between the digital system (MAC layer) and the analog physical medium (such as network cable, fiber optic cable), while taking into account standardization, flexibility, anti-interference, and cost optimization. Figure 1 In the diagram, Delay 1 is the transmit clock delay actively inserted by the MAC chip's transmitting side: a common design involves reserving a fixed or adjustable delay unit in the chip to add extra delay to the clock signal, thus obtaining the signal timing difference between the clock and data signals. Delay 2 is achieved by adding extra clock trace length during PCB routing, which can increase the clock delay and obtain a fixed signal timing difference between the clock and data signals. Delay 3 is the transmit clock delay actively inserted by the PHY chip's transmitting side; this can also be achieved by reserving a fixed or adjustable delay unit in the chip to add extra delay to the clock signal, thus obtaining the signal timing difference between the clock and data signals.
[0057] In one exemplary embodiment, such as Figure 2 As shown, a delay duration calibration method is provided, which is applied to a target chip, where the target chip is... Figure 1 The MAC chip or PHY chip in the process includes the following steps 202 to 208. Wherein:
[0058] Step 202: Obtain the initial clock signal and the initial data signal.
[0059] The initial clock signal is the target chip's clock signal. It can be sent or configured according to the transmitter's cycle, or it can be a clock signal configured or used by the target chip itself. The initial data signal is a digital signal sent to the target chip to represent specific data. Both the initial clock signal and the initial data signal are sent by circuits or chips outside the target chip. Due to manufacturing and characteristic deviations of chips and PCB boards, the phase of the initial data signal may not be suitable for sampling when it arrives at the target chip. Therefore, the target chip can perform delay processing on the initial clock signal and the initial data signal to more accurately detect the content contained in the signal.
[0060] In some embodiments, the chip for signal transmission delays the data signal before sending the delayed data signal to the target chip; at this time, the signal received by the target chip includes the initial data signal. Optionally, after the initial data signal arrives at the programmable delay unit of the target chip, at least one of the initial clock signal and the initial data signal needs to be delayed by the programmable delay unit.
[0061] Step 204: Based on the initial delay duration, delay the initial clock signal and the initial data signal to obtain the adjusted clock signal and the adjusted data signal.
[0062] The initial delay duration is the unadjusted delay duration, which is the time length required to delay at least one of the initial clock signal and the initial data signal. The initial delay duration can be set according to delay levels, each of which is adjusted separately. The delay level indicates the adjustment granularity of the initial delay duration, forming delay durations within different granularities. The initial delay duration is used to change the signal difference between the initial clock signal and the initial data signal. The initial delay duration is a configuration parameter of the target chip; it can be the initial configuration parameter of the delay unit, used for delay processing.
[0063] The adjusted clock signal and the adjusted data signal include clock signals and data signals that arrive in sequence at different times; after delaying at least one of the initial clock signal and the initial data signal, the adjusted clock signal and the adjusted data signal can be obtained.
[0064] The adjusted clock signal and the adjusted data signal are relative concepts. The time difference between the adjusted clock signal and the adjusted data signal differs from the time difference between the initial clock signal and the initial data signal, creating a difference in detection time. The adjusted clock signal controls the timing of data sampling and detection of the adjusted data signal. Therefore, by adjusting the initial delay duration, the sampling time of the asynchronous data signal can be changed, altering the signal phase difference between the adjusted clock signal and the adjusted data signal. This allows for more accurate detection of the data signal at the sampling time when the signal phase difference is reasonable. However, due to factors such as chip and PCB manufacturing deviations, characteristic deviations, and environmental conditions, the initial delay duration may not be suitable and requires adaptive adjustment in subsequent steps.
[0065] Optionally, if the initial delay duration includes delaying the initial clock signal, the initial clock signal is delayed based on the initial delay duration to obtain an adjusted clock signal; the transition edge of the adjusted data signal is the same as the transition edge of the initial data signal, only its deviation from the adjusted clock signal is changed. If the initial delay duration is only used to delay the initial data signal, the initial data signal is delayed based on the initial delay duration to obtain an adjusted data signal; the transition edge of the adjusted clock signal is the same as the transition edge of the initial clock signal, only its deviation from the adjusted data signal is changed.
[0066] In some embodiments, the target chip adjusts the delay time of the initial clock signal based on the initial clock delay duration, without adjusting the initial data signal, to obtain the adjusted clock signal and the adjusted data signal. Thus, processing the clock signal separately allows for the synchronous change of subsequent signal positions.
[0067] In some embodiments, the target chip does not adjust the delay time of the initial clock signal, but adjusts the initial data signal according to the initial data delay duration to obtain the adjusted clock signal and the adjusted data signal. Therefore, by processing the data signal separately, the signal position of specific bits can be selectively controlled to increase the fineness of the adjustment.
[0068] In some embodiments, a high-frequency clock domain is known. Based on the initial delay duration and the target chip's reference clock domain, the initial clock signal and the initial data signal are delayed to obtain adjusted clock and data signals. The delayed clock and data signals are synchronized with the reference clock domain, ensuring that the adjusted clock and data signals are aligned with the reference clock domain. Thus, external clock signals are adjusted according to the signal in the reference clock domain, aligning the initial clock and initial data signals with the reference clock domain.
[0069] In one embodiment, the reference clock domain is a high-frequency clock domain; the initial clock signal and the initial data signal are first adjusted to the high-frequency clock domain, and then the clock signal and data signal of the high-frequency clock domain are adjusted according to the initial delay duration of the high-frequency clock domain to obtain the adjusted clock signal and the adjusted data signal.
[0070] Step 206: Calculate the difference between the detection times of the adjusted clock signal and the adjusted data signal to obtain the signal timing difference.
[0071] The detection time is the time it takes to detect an asynchronous signal; the adjusted clock signal has its own detection time, and the adjusted data signal also has its own detection time. Optionally, the detection time can be a timestamp, or an incrementing or decrementing digital sequence.
[0072] The signal timing difference includes the time difference between the detection times of the adjusted clock signal and the adjusted data signal, and this time difference is neither positive nor negative. The signal timing difference reflects the time difference between detecting the adjusted clock signal and the adjusted data signal, that is, the time points when the adjusted clock signal and the adjusted data signal are sampled. Since data sampling has a certain tolerance, keeping the signal timing difference within a reasonable range helps to stably acquire correct data.
[0073] In some embodiments, the asynchronous signal detection time is determined based on the rising edges of the adjusted clock signal and the adjusted data signal, respectively; the signal timing difference is calculated based on the asynchronous signal detection time. Optionally, the detection time of the adjusted clock signal and the adjusted data signal can be determined by inputting data from a chip outside the target chip; alternatively, the asynchronous signal detection time can be determined by edge detection, which includes the time to detect the rising edge of the delayed clock signal and the time to detect the rising edge of the delayed data signal. The rising edge can be a rising edge or a falling edge of the signal to control the corresponding processing procedure.
[0074] Step 208: Determine the delay adjustment value based on the signal timing difference and the reference timing difference, and obtain the calibrated delay duration based on the delay adjustment value and the initial delay duration.
[0075] The reference timing difference is a parameter configured for the target chip, representing the time interval at which data can be accurately detected. Optionally, the reference timing difference can be half a clock cycle of the target chip, or other time intervals used to increase accuracy.
[0076] The delay adjustment value is related to the deviation between the signal timing difference and the reference timing difference; for example, the delay adjustment value can be the deviation between the signal timing difference and the reference timing difference, or it can be adjusted based on the deviation between the signal timing difference and the reference timing difference. For example, it can be adjusted by mapping rules.
[0077] The post-calibration delay duration is a chip parameter obtained by adjusting the initial delay duration; it is an update of the initial delay duration. If the target chip is configured such that the initial delay duration includes the delay duration of the initial clock signal, the delay duration used for subsequent initial clock signals is obtained and used as part of the post-calibration delay duration. If the target chip is configured such that the initial delay duration includes the delay duration of the initial data signal, the delay duration of the initial data signal is adjusted using a delay adjustment value to obtain the delay duration used for subsequent data signals, and this is also used as part of the post-calibration delay duration.
[0078] In some embodiments, the delay adjustment value can be determined based on the difference between the signal timing difference and the reference timing difference. In this case, the delay adjustment value has a corresponding positive or negative sign. Alternatively, the delay adjustment value can be obtained by calculating the absolute value of the difference between the signal timing difference and the reference timing difference. In this case, the delay adjustment value is a specific numerical value, and the adjustment method of the delay adjustment value on the initial delay duration needs to be determined based on the type of the initial delay duration.
[0079] In some embodiments, when the delay adjustment value is used to increase the initial delay duration, the initial delay duration is adjusted using the delay adjustment value according to the processing method corresponding to the type of the initial delay duration, so as to obtain the calibrated delay duration.
[0080] In one exemplary embodiment, the delay adjustment value is added to or subtracted from the initial delay duration to obtain the calibrated delay duration. Thus, the delay adjustment value directly corresponds to the corresponding duration, ensuring the appropriate adjustment efficiency.
[0081] In an exemplary embodiment, a signal delay module with adjustable delay parameters is used to delay the initial clock signal and the initial data signal input to the target chip respectively to obtain the adjusted clock signal and the adjusted data signal. Then, an edge detection module performs delay processing on the initial clock signal and the initial data signal under the local high-frequency clock and obtains the signal transition edge. Then, a timing module obtains the occurrence time of the initial clock signal transition edge and the data signal transition edge and calculates the signal timing difference. Finally, a calculation module determines the delay adjustment value based on the signal timing difference and the reference timing difference, and adjusts the initial delay duration according to the delay adjustment value to obtain the calibrated delay duration.
[0082] In the aforementioned delay calibration method, an initial clock signal and an initial data signal are acquired. Based on the initial delay duration, the initial clock signal and initial data signal are delayed to obtain adjusted clock and data signals, ensuring the phase difference of the initial data signal meets sampling requirements. Then, the difference between the detection times of the adjusted clock and data signals is calculated to obtain a signal timing difference, which reflects the delay effect of the initial delay duration and the degree to which chip and PCB manufacturing deviations and characteristic deviations affect the initial delay duration, facilitating a stable assessment of its usability. Furthermore, a delay adjustment value is determined based on the signal timing difference and a reference timing difference, and the initial delay duration is adjusted according to this value to obtain a calibrated delay duration. This allows for adjustment via the delay adjustment value, eliminating strict reliance on the PCB signal timing difference design, reducing PCB design complexity, and enabling adaptive dynamic adjustment of the chip's own configured delay duration during use without user intervention. In addition, the signal timing difference can be obtained again to intuitively verify whether the current parameters are available. This method is more reliable for delay chains whose delay duration is affected by PVT.
[0083] In some embodiments, such as Figure 3 As shown, the delay adjustment value is determined based on the signal timing difference and the reference timing difference, including:
[0084] Step 302: If the signal timing difference is less than the reference timing difference, determine the delay adjustment value used to increase the signal timing difference.
[0085] In one embodiment, it can be determined whether the signal timing difference is less than the reference timing difference by the ratio or difference between the signal timing difference and the reference timing difference; it can also be determined whether the signal timing difference is less than the reference timing difference by comparing the magnitude of the signal timing difference and the reference timing difference.
[0086] In one embodiment, when the detected level signal indicates that the signal timing difference is less than a reference timing difference, a preset delay adjustment value for increasing the signal timing difference is obtained. This preset delay adjustment value is used to adjust the initial delay duration to obtain a calibrated delay duration, thereby increasing the subsequent signal timing difference. Alternatively, when the detected level signal indicates that the signal timing difference is less than a reference timing difference, a delay adjustment value for increasing the signal timing difference is obtained by mapping the difference between the signal timing difference and the reference timing difference or the absolute value of the difference.
[0087] Step 304: When the signal timing difference is greater than the reference timing difference, determine the delay adjustment value to reduce the signal timing difference; wherein, the magnitude of the delay adjustment value is positively correlated with the difference between the signal timing difference and the reference timing difference.
[0088] In one embodiment, when the detected level signal indicates that the signal timing difference is greater than a reference timing difference, a preset delay adjustment value for reducing the signal timing difference is obtained. This preset delay adjustment value is used to adjust the initial delay duration to obtain a calibrated delay duration, thereby reducing the subsequent signal timing difference. Alternatively, when the detected level signal indicates that the signal timing difference is greater than a reference timing difference, a delay adjustment value for reducing the signal timing difference is obtained by mapping the difference between the signal timing difference and the reference timing difference or the absolute value of the difference.
[0089] In an exemplary embodiment, the delay adjustment value is obtained by calculating the absolute value of the difference between the signal timing difference and the reference timing difference, and its expression is as follows:
[0090] Delay adjustment value = absolute value of (half clock cycle value – current skew value); or,
[0091] Delay adjustment value = half clock cycle value – absolute value of current skew value.
[0092] In one exemplary embodiment, the signal timing difference is less than 4ns, which is less than half of the transmission clock period T_cycle8ns; that is, the actual data sampling point is after the ideal sampling point; the ideal sampling point can be obtained by adjusting the delay value to increase the signal timing difference.
[0093] In one exemplary embodiment, the signal timing difference is greater than 4ns, which is greater than half of the transmission clock cycle T_cycle8ns; that is, the actual data sampling point is before the ideal sampling point; the ideal sampling point can be obtained by adjusting the delay value to reduce the signal timing difference.
[0094] In this embodiment, on the one hand, the adjustment direction of the delay adjustment value is determined by comparing the magnitude of the signal timing difference with the reference timing difference. Therefore, when using the reference timing difference as a benchmark, if the signal timing difference is small, the subsequent signal timing difference is increased by adjusting the delay value; if the signal timing difference is large, the subsequent signal timing difference is decreased by adjusting the delay value, thus achieving adaptive adjustment of the subsequent signal timing difference. On the other hand, the adjustment range of the delay adjustment value is determined by the difference between the signal timing difference and the reference timing difference, allowing for more precise control of the sampling process. Thus, through control processes in both direction and magnitude, ideal sampling points are easily obtained, enabling the stable and reliable acquisition of correct data.
[0095] In some embodiments, the initial delay duration includes the delay duration of the initial clock signal; determining a delay adjustment value for increasing the signal timing difference includes: determining a delay adjustment value for increasing the delay duration of the initial clock signal. Correspondingly, determining a delay adjustment value for decreasing the signal timing difference includes: determining a delay adjustment value for decreasing the delay duration of the initial delay duration.
[0096] Determine the delay adjustment value used to increase the delay duration of the initial clock signal. This delays the initial clock signal so that, when the signal timing difference is small relative to the reference timing difference, the sampling time of the data signal is delayed, thereby increasing the signal timing difference and bringing it closer to the reference timing difference.
[0097] Determining the delay adjustment value used to reduce the initial delay duration allows the delay duration of the initial clock signal to be advanced. This enables the data signal sampling time point to be moved forward when the signal timing difference is large relative to the reference timing difference, thereby reducing the signal timing difference and making it closer to the reference timing difference.
[0098] When adjusting the data signal, i.e., adjusting TXD[*], only the delay duration corresponding to a certain bit changes; however, when adjusting the delay duration of the initial clock signal, i.e., adjusting TXC, the sampling time of subsequent multiple bits of data is adjusted accordingly, causing the timing difference of subsequent signals to change, thus forming a larger range of adjustments.
[0099] In an exemplary embodiment, adjusting the initial delay duration according to the delay adjustment value to obtain the calibrated delay duration includes: when the signal timing difference is less than the reference timing difference, adding the delay adjustment value used to increase the delay duration of the initial clock signal to the delay duration of the initial clock signal to obtain the calibrated delay duration.
[0100] In an exemplary embodiment, adjusting the initial delay duration according to the delay adjustment value to obtain the calibrated delay duration includes: when the signal timing difference is greater than the reference timing difference, subtracting the delay adjustment value used to reduce the delay duration of the initial clock signal from the delay duration of the initial clock signal to obtain the calibrated delay duration.
[0101] In an exemplary embodiment, a set of clock signals is used to simultaneously control the sampling process of 8-bit data signals within a sampling set. In this case, if only placed on the clock signal side, the 8-bit data signal can be delayed by only the delay adjustment value corresponding to the set of clock signals. In this case, in order to ensure the signal transmission quality, it is necessary to ensure that the target chip, PCB design, and the transmission of the initial clock signal and the initial data signal all use matching 8-bit data signal trace lengths.
[0102] In this embodiment, at least a clock signal is used for delay processing. When the signal timing difference is too small, the delay duration of the initial clock signal is increased to reduce the delay at the sampling positions of subsequent data signals; conversely, when the signal timing difference is too large, the delay duration of the initial clock signal is decreased to reduce the delay at the sampling positions of subsequent data signals. Thus, by adjusting the initial clock signal, the midpoint of the phase of each subsequent clock signal and the phase difference between the subsequent data signal and the clock signal are positioned appropriately, resulting in more accurate and stable data signal parsing.
[0103] In some embodiments, the initial delay duration further includes the delay duration of the initial data signal; determining the delay adjustment value for increasing the signal timing difference further includes: determining a delay adjustment value for decreasing the delay duration of the initial data signal. Correspondingly, determining the delay adjustment value for decreasing the signal timing difference includes: determining a delay adjustment value for increasing the delay duration of the initial data signal.
[0104] Determining a delay adjustment value for reducing the delay duration of the initial data signal can shorten the delay duration of the initial data signal. This allows the timing difference of the data signal to be shifted forward when the timing difference is small relative to the reference timing difference, thereby increasing the timing difference and bringing it closer to the reference timing difference.
[0105] Determining the delay adjustment value used to increase the initial delay duration can increase the delay duration of the initial data signal. This delays the time point when the data signal has a rising edge, thus reducing the signal timing difference and bringing it closer to the reference timing difference, especially when the signal timing difference is large relative to the reference timing difference.
[0106] When adjusting the data signal, i.e., adjusting TXD[*], the delay duration of each bit of data signal can be adjusted without affecting the sampling time of subsequent multi-bit data, resulting in a finer-grained adjustment. Moreover, the sampling process of 8-bit data signals within a group can be processed separately through each bit of data signal, without requiring the target chip, PCB design, or the use of matching 8-bit data signal trace lengths between the initial clock signal and the initial data signal.
[0107] In an exemplary embodiment, obtaining the calibrated delay duration based on the delay adjustment value and the initial delay duration includes: when the signal timing difference is less than the reference timing difference, subtracting the delay adjustment value used to reduce the delay duration of the initial data signal from the delay duration of the initial data signal to obtain the calibrated delay duration.
[0108] In an exemplary embodiment, obtaining the calibrated delay duration based on the delay adjustment value and the initial delay duration includes: when the signal timing difference is greater than the reference timing difference, adding the delay adjustment value used to increase the delay duration of the initial data signal to the delay duration of the initial data signal to obtain the calibrated delay duration.
[0109] In this embodiment, the target chip uses both clock and data signals for delay processing, which can further reduce the design requirements of PCB boards for sending multi-bit wide data signals. Moreover, when the timing difference of the adjusted signal is greater than or less than the reference timing difference, the delay duration of each bit of the data signal can be adjusted to achieve data alignment of each bit in the data signal, so as to ensure consistent data signal delay within the data signal.
[0110] In some embodiments, the reference timing difference is matched with half a sampling clock cycle used by the target chip; the sampling clock cycle is the clock cycle of the initial clock signal and the adjusted clock signal.
[0111] The sampling clock period is the clock period of the system signal acquired by the target chip. It is the clock period of the initial clock signal and also the clock period of the adjusted clock signal. At this time, the delay processing does not change the clock period.
[0112] Optionally, the half-sampling clock cycle used by the target chip can be set by the target chip itself based on its own configuration parameters, or it can be determined based on signals sent by external chips. For example, in the case of a PHY chip, the clock signal sent by the MAC chip is used to determine the sampling clock cycle used by the target chip.
[0113] In one embodiment, the target chip uses a sampling clock cycle of 8ns, at which time the reference timing difference is 4ns, so that the reference timing difference matches half a sampling clock cycle used by the target chip.
[0114] In one embodiment, the target chip uses a sampling clock cycle of 16 ns. In this case, the reference timing difference is 7 ns, 8 ns, or 9 ns, so that the reference timing difference matches half a sampling clock cycle used by the target chip. This reduces the stringency of the matching condition and allows for adaptive adjustment according to the product in which the target chip is located.
[0115] In this embodiment, the reference realization difference is dynamically adjusted according to the sampling clock cycle used by the target chip. With the signal timing difference being close to half a sampling clock cycle as the target, the initial delay duration is adjusted to the calibrated delay duration, which enables the sampling time of the data signal to be the center position of the data signal. This determines the setup time or hold time used for data acquisition, which helps to resolve stable and reliable data.
[0116] In some embodiments, after determining the delay adjustment value based on the signal timing difference and the reference timing difference, the method further includes: if the difference between the delay adjustment value and the delay adjustment value threshold satisfies the adjustment condition, performing the step of obtaining the calibrated delay duration; if the difference between the delay adjustment value and the delay adjustment value threshold does not satisfy the adjustment condition, returning to the step of obtaining the initial clock signal and the initial data signal; the difference value that satisfies the adjustment condition is greater than the difference value that does not satisfy the adjustment condition.
[0117] The delay adjustment threshold is a threshold related to the reference timing difference. The delay adjustment threshold is less than the reference timing difference and greater than 0. When the delay adjustment value is large, the initial delay duration is updated to obtain the calibrated delay duration. The difference between the delay adjustment value and the delay adjustment threshold can be the result of comparing the magnitude of the delay adjustment value and the delay adjustment threshold. For example, it can be compared by a comparator circuit to output the difference value. Alternatively, it can be the difference or ratio between the delay adjustment value and the delay adjustment threshold. This difference value is used to represent the comparison result and the magnitude of the numerical difference between the delay adjustment value and the delay adjustment threshold.
[0118] The optimal sampling point is located at the center of the data, i.e., when the signal timing difference is half a clock cycle. However, data sampling has a certain tolerance, and correct data can be collected near the data center location. Correspondingly, the sampling point is located at the center of the data, i.e., when the signal timing difference is half a clock cycle. However, data sampling has a certain tolerance, and correct data can be collected near the data center location. Therefore, the step used to obtain the calibrated delay time is controlled based on whether the difference value meets the adjustment conditions.
[0119] In some embodiments, the step of obtaining the calibrated delay duration includes: obtaining the calibrated delay duration based on the delay adjustment value and the initial delay duration.
[0120] In some embodiments, the step of returning to obtain the initial clock signal and the initial data signal includes: after determining the delay adjustment value of the previous round, receiving the current initial clock signal and the current initial data signal; performing delay processing on the current initial clock signal and the current initial data signal according to the initial delay duration of the previous round to obtain the current adjusted clock signal and the current adjusted data signal; calculating the difference based on the detection time of the current adjusted clock signal and the current adjusted data signal to obtain the current signal timing difference; determining the current delay adjustment value based on the current signal timing difference and the reference timing difference; if the difference between the current delay adjustment value and the delay adjustment value threshold meets the adjustment condition, adjusting the initial delay duration according to the current delay adjustment value to obtain the current calibrated delay duration; if the difference between the current delay adjustment value and the delay adjustment value threshold does not meet the adjustment condition, obtaining the delay adjustment value for the next round according to the current delay adjustment value, and executing the delay duration calibration method for the next round.
[0121] In one embodiment, the delay needs to be adjusted only when the delay adjustment value is too large. That is, when the delay adjustment value is greater than the delay adjustment value threshold, a delay update is triggered.
[0122] In an exemplary embodiment, if it is determined that the delay adjustment value belongs to a first delay adjustment value based on the difference between the delay adjustment value and the delay adjustment value threshold, the step of obtaining the calibrated delay duration is performed; if it is determined that the delay adjustment value belongs to a second delay adjustment value based on the difference between the delay adjustment value and the delay adjustment value threshold, the step of obtaining the initial clock signal and the initial data signal is returned; the value of the first delay adjustment value is greater than the value of the second delay adjustment value.
[0123] In this embodiment, since the data sampling function has fault tolerance capability, the difference between the signal timing difference and the delay adjustment threshold is used to more accurately measure the magnitude of the signal timing difference. When the adjustment conditions are met, the difference between the signal timing difference and the delay adjustment threshold is relatively large, and only then is the step of obtaining the calibrated delay duration executed, thus avoiding real-time adjustment occupying more computing resources.
[0124] In some embodiments, the signal timing difference is obtained by calculating the difference between the detection times of the adjusted clock signal and the adjusted data signal, including: determining the detection time of the adjusted clock signal and the adjusted data signal when the respective transition edges of the adjusted clock signal and the adjusted data signal are detected; and calculating the difference between the detection times of the adjusted clock signal and the adjusted data signal to obtain the signal timing difference.
[0125] In some embodiments, the transition edge can be a rising edge or a falling edge. A rising edge is the signal change process from a low level to a high level. Since the target chip uses a Media Independent Interface (MII), the data sampling process of the target chip often occurs at the rising edge. Therefore, taking the rising edge as an example, when the circuit detects the rising edge, the detection time of the adjusted clock signal and the adjusted data signal are determined respectively.
[0126] In one embodiment, when the rising edge of the adjusted clock signal is detected, a timestamp is recorded to obtain the detection time of the adjusted clock signal; when the rising edge of the adjusted data signal is detected, a timestamp is recorded to obtain the detection time of the adjusted data signal.
[0127] In one embodiment, the time difference between the detection time of the adjusted clock signal and the detection time of the adjusted data signal is determined as the signal timing difference; or, the absolute value of the time difference is determined as the signal timing difference.
[0128] In this embodiment, the signal timing difference is determined based on the rising edge detection method, which can reduce the delay problem caused by other lines and has relatively high processing efficiency. Moreover, the detection time is set according to the rising edge, which establishes a direct relationship with the data sampling process of the medium-independent interface, and the rising edge is obtained before the falling edge, which can determine the signal timing difference more quickly.
[0129] In some embodiments, determining a delay adjustment value based on a signal timing difference and a reference timing difference, and obtaining a calibrated delay duration based on the delay adjustment value and an initial delay duration, includes: determining a delay adjustment value of a first time granularity based on a signal timing difference and a reference timing difference of a first time granularity, and adjusting the initial delay time granularity based on the delay adjustment value of the first time granularity to obtain a calibrated delay duration of the first time granularity; determining an initial delay duration of a second time granularity based on a calibrated delay time granularity of a second time granularity; the first time granularity is greater than the second time granularity; returning to the step of obtaining the adjusted clock signal and the adjusted data signal based on the initial delay duration of the second time granularity, until the calibrated delay duration of the second time granularity is obtained.
[0130] The first time granularity and the second time granularity correspond to different delay duration levels of the chip. The precision of the first time granularity adjustment is coarser than that of the second time granularity adjustment. Therefore, in this embodiment, the delay duration is changed from a coarse-grained adjustment process to a fine-grained adjustment process to ensure the accuracy of the delay time granularity after calibration.
[0131] In some embodiments, the calibration delay duration at the first time granularity and the calibration delay duration at the second time granularity belong to different time granularities and have different time units. However, the calibration delay duration at the first time granularity and the calibration delay duration at the second time granularity are obtained in the same or different ways. For example, the corresponding implementation method can be adaptively selected with reference to steps 202-208 and the various embodiments therein.
[0132] In some embodiments, the delay duration level is optional, and the time granularity is selected based on the delay chain of the stdcell in the process library. For example, the first time granularity is the working clock of the timestamp timer, that is, the clock cycle value of the on-chip high-frequency clock, while the second time granularity is the delay duration of a single delay cell within a small range. The timestamp timer is implemented based on the on-chip high-frequency clock. For example, when the high-frequency clock is 1GHz, the calibrated delay time granularity of the first time granularity, that is, the measurement accuracy is 1ns and the delay duration adjustment value accuracy is also 1ns. However, the delay duration value of a single delay cell implemented based on the stdcell in the process library can often be at the ps level. Therefore, based on the calibrated delay duration of the first time granularity, ps-level fine-tuning is continued to obtain the calibrated delay duration of the second time granularity.
[0133] In this embodiment, the post-calibration delay duration is adjusted step by step. First, a coarse-grained post-calibration delay duration is determined. Then, based on the coarse-grained post-calibration delay duration, a fine-grained post-calibration delay duration is determined. This allows the target chip to reach the working post-calibration delay threshold more quickly through coarse-grained adjustment. Subsequently, fine-grained adjustments are gradually performed to gradually approach the optimal solution, avoiding inaccuracies in the adjustment process of a small number of initial clock signals and initial data signals.
[0134] In some embodiments, when the initial clock signal and initial data signal are sent by the MAC chip, the target chip is the PHY chip; when the initial clock signal and initial data signal are sent by the PHY chip, the target chip is the MAC chip.
[0135] The main functions of the MAC (Media Access Control) sublayer are: frame encapsulation and decapsulation, media access control, MAC address addressing and filtering, and error detection (such as CRC). The PHY layer is responsible for implementing the physical layer functions of data transmission, converting data signals into analog signals and sending them to the communication medium; simultaneously, it recovers the data signals from the received analog signals and then transmits them to the upper-layer chip for processing.
[0136] The Ethernet MAC and PHY are integrated into different chips, and they are connected in a standardized manner through a PCB board using a media-independent interface (xMII). A separate PHY chip enables signal conversion, protocol adaptation, and electrical isolation between the digital system (MAC layer) and analog physical media (such as network cables and fiber optics), while also ensuring standardization, flexibility, interference immunity, and cost optimization.
[0137] Media-independent interfaces (xMII) are an Ethernet industry standard defined by IEEE 802.3. Depending on the speed and interface type, xMII includes MII, RMII, SMII, GMII, etc. Typically, an xMII interface includes a set of bidirectional data transmission interfaces and a management interface between the MAC and PHY. The data interface includes two independent channels for transmitting and receiving data, each with its own clock, data, and control signals. Taking GMII as an example, the GMII interface uses a parallel data transmission mechanism; both the transmit and receive channels have one clock signal, eight data signals, and several control signals.
[0138] Data transmission between the MAC and PHY is bidirectional, including data transmission from the MAC to the PHY (transmitting side) and data transmission from the PHY to the MAC (receiving side). In the case of data transmission from the MAC to the PHY (transmitting side), the target chip is the PHY; in the case of data transmission from the PHY to the MAC (receiving side), the target chip is the MAC. Taking data transmission from the MAC to the PHY (transmitting side) as an example, the transmitting MAC outputs data signal A on the rising edge of clock signal A; clock signal A and data signal A are routed through the PCB board to the receiving PHY; the receiving PHY uses its own clock signal A', obtained after a delay from the transmitting clock signal A, to acquire the data signal A', which has also been delayed. The conditions for correct data transmission are: each bit of data signal A sent by the transmitting side can be correctly acquired by the receiving side; and the 8 bits of data signal A sent in parallel by the transmitting side are aligned and acquired by the receiving side. On the receiving side, the delayed data signal A' is acquired at the rising edge of the clock signal A' after the delay. Ideally, the data sampling point is the center position of the data signal A'. At this point, the setup time and hold time of data acquisition can be easily satisfied, and the correct data can be acquired stably and reliably. When the clock signal A' is delayed by half a clock cycle relative to the data signal A', an ideal data acquisition timing can be obtained. That is, the transmitting side clock signal A is delayed by an additional half clock cycle compared to the data signal A, i.e., a skew between the clock signal A' and the data signal A' for half a clock cycle is constructed, which can stably and reliably complete data acquisition.
[0139] In this embodiment, the delay duration calibration method can be applied to the MAC chip alone or to the PHY chip alone, so that both the MAC chip and the PHY chip can acquire reliable data signals.
[0140] In one exemplary embodiment, this embodiment provides a method for directly and quickly determining the initial delay duration by measuring the signal timing difference between the current clock signal and the data signal on the receiving side after the chip and PCB manufacturing are completed and the chip is mounted on the board; and it is used for dynamic adaptive adjustment of the delay duration during use.
[0141] First, the receiving side acquires the transition edges of the input clock TXC' and data TXD' [7:0] after delay processing based on the on-chip high-frequency clock. The delay processing involves synchronizing the asynchronous input TXC' and TXD' signals by timing multiple D flip-flops under the on-chip high-frequency clock. The transition edge can be either the rising edge or the falling edge of the signal. Taking the rising edge as an example, acquiring the transition edge of the input signal involves timing the delayed TXC' and TXD' signals again to obtain the signal after a one-time delay. The moment when the delayed TXC' and TXD' signals are 1 and the signal after a one-time delay is 0 is the rising edge of the signal. The above delay processing and rising edge acquisition are common logic in typical digital chip design and will not be elaborated further.
[0142] Next, the receiving side obtains the timestamp values of TXC' and TXD'[7:0] corresponding to the transition times in step 1 based on the same timestamp timer. These timestamp values are the detection times of the adjusted clock signal and the adjusted data signal, respectively denoted as Ttxc, Ttxd7, ..., Ttxd0. The timestamp timer is a real-time timer based on the on-chip high-speed clock. The timestamp value is the timing value of the timestamp timer when the transition edge occurs. At this time, the corresponding detection time of the first time granularity is obtained.
[0143] Then, using the timestamps of the respective detection times TXC' and TXD[7:0]' of the adjusted clock signal and the adjusted data signal, the signal timing difference between the current clock TXC' and data TXD' is calculated; the delay adjustment value for the receiving-side delay unit is determined based on the signal timing difference; the signal timing difference is the time deviation value of the same transition edge (rising edge, falling edge) between the receiving-side clock and data signals. Specifically, the signal timing difference is the difference between Ttxd and Ttxc.
[0144] The steps for implementing delay adjustment are illustrated using the Gigabit Media Independent Interface (GMII) as an example. At this rate, the clock and data transmission frequency is 125MHz, and the single clock cycle T_cycle is 8ns. Figure 4A Scene 1 Figure 4B Scene 2 and Figure 4CScenario 3 corresponds to three scenarios: no adjustment required, reducing clock delay signal timing difference, and increasing clock delay signal timing difference. In Scenario 1, the timing difference between the clock signal and the data signal is 4ns, which is half of the transmission clock cycle T_cycle8ns, meaning the current sampling timing is ideal, and no adjustment of the timing difference is needed. In Scenario 2, the timing difference between the clock signal and the data signal is less than 4ns, which is less than half of the transmission clock cycle T_cycle8ns; meaning the actual data sampling point is after the ideal sampling point; the ideal sampling point can be obtained by increasing the timing difference. In Scenario 3, the timing difference between the clock signal and the data signal is greater than 4ns, which is greater than half of the transmission clock cycle T_cycle8ns; meaning the actual data sampling point is before the ideal sampling point; the ideal sampling point can be obtained by reducing the timing difference. Methods to increase the timing difference include: 1. Increasing the clock TXC delay; 2. Reducing the data TXD delay. The methods to reduce signal timing differences can be: 1. Reduce the delay of clock TXC; 2. Increase the delay of data TXD; For details on the advantages and disadvantages of these four methods and their combinations, please refer to steps 302-304 and the corresponding embodiments.
[0145] Next, based on the delay adjustment value used for delay, the corresponding programmable delay unit of TXC or TXD is adjusted to modify the delay duration. The RXC or RXD delay adjustment value and the updated delay duration are calculated based on the current signal timing difference. The calculation method is: Delay adjustment value = Half clock period value (4ns) – Absolute value of the current signal timing difference;
[0146] The delay adjustment value is obtained by adding or subtracting the currently used delay duration from the delay adjustment value. Specifically, Scenario 1: No adjustment required; Scenario 2: Optionally, decrease the delay duration of TXC, the amount of which is the delay adjustment value; or increase the delay duration of TXD, the amount of which is the delay adjustment value; Scenario 3: Optionally, increase the delay duration of TXC, the amount of which is the delay adjustment value; or decrease the delay duration of TXD, the amount of which is the delay adjustment value.
[0147] Optionally, after delay adjustment or in subsequent use, the timing difference of the repetitive signal is detected in real time or periodically, and the delay duration is modified again when the following delay duration update strategy is met, i.e., the delay duration of the programmable delay unit is dynamically adjusted. The update strategy can be real-time or triggered based on or when the delay adjustment value is greater than the delay adjustment value threshold. The delay adjustment value threshold should be set to a value greater than or equal to 0 and less than half a clock cycle.
[0148] Ideally, the sampling point should be located at the center of the data, i.e., when the timing difference between the clock signal and the data signal is half a clock cycle. However, data sampling has a certain tolerance, and correct data can be collected near the data center location. Therefore, when the current sampling point is not in an ideal sampling position, it is not necessary to immediately adjust the signal timing difference; adjustment is only necessary when the measured signal timing difference deviates too much from half a clock cycle or the delay adjustment value is too large. That is, when the delay adjustment value is greater than the delay adjustment value threshold, a delay update is triggered. The timestamp, clock-data signal timing difference, and delay adjustment value used for the delay in the above steps are all calculated based on the on-chip high-frequency clock, and the delay adjustment accuracy is the period value of the on-chip high-frequency clock.
[0149] In an exemplary embodiment, when a data signal is transmitted based on the rising edge of a clock signal, its waveform is as follows: Figure 5 As shown, the data acquisition timing of the receiving side is as follows: when it is acquired at the data center location, the waveform is as follows. Figure 6 As shown.
[0150] At this point, by adding a half-clock cycle delay of TXD' relative to TXD', an ideal data acquisition timing can be obtained. That is, by adding an extra half-clock cycle delay to the transmitting clock TXC compared to TXD, thus constructing a signal timing difference of half a clock cycle between TXC' and TXD', data acquisition can be completed stably and reliably.
[0151] Therefore, clock deviation can be calculated and a reasonable delay duration can be obtained. The implementation is direct and reliable, with obvious advantages: it no longer strictly relies on the signal timing difference design of the PCB board, which can reduce the difficulty of PCB design; it no longer needs to traverse the delay duration and indirectly verify the feasibility of the delay duration by whether the message can be correctly received, reducing debugging time; it is not affected by chip and PCB board manufacturing deviations or characteristic deviations, and can stably obtain a usable delay duration; it can be used for the initial delay duration acquisition, or it can replace the PCB trace design process by adjusting the delay value, forming an adaptive dynamic adjustment during chip use, without user intervention, making it more flexible; after the delay duration is modified, the signal timing difference can be obtained again to intuitively verify whether the current parameter is usable, and the method is more reliable for delay chains whose delay duration is affected by PVT; traditional implementations often only set the delay chain in the clock signal path, that is, require the delays of 8 groups of data signals to be close, while this implementation can optionally set the delay chain on the RXD side, further reducing the requirements for data signal chip and PCB board design.
[0152] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0153] Based on the same inventive concept, this application also provides a delay duration calibration device for implementing the delay duration calibration method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more delay duration calibration device embodiments provided below can be found in the limitations of the delay duration calibration method described above, and will not be repeated here.
[0154] In one exemplary embodiment, such as Figure 7 As shown, a delay duration calibration device is provided, comprising:
[0155] Signal acquisition module 702 is used to acquire the initial clock signal and the initial data signal;
[0156] The delay processing module 704 is used to perform delay processing on the initial clock signal and the initial data signal according to the initial delay duration to obtain the adjusted clock signal and the adjusted data signal.
[0157] Timing module 706 is used to calculate the difference between the detection times of the adjusted clock signal and the adjusted data signal to obtain the signal timing difference;
[0158] The delay duration update module 708 is used to determine the delay adjustment value based on the signal timing difference and the reference timing difference, and to obtain the calibrated delay duration according to the delay adjustment value and the initial delay duration.
[0159] In one embodiment, the delay duration update module 708 is used to:
[0160] If the signal timing difference is less than the reference timing difference, a delay adjustment value for increasing the signal timing difference is determined;
[0161] If the signal timing difference is greater than the reference timing difference, a delay adjustment value for reducing the signal timing difference is determined;
[0162] The magnitude of the delay adjustment value is positively correlated with the difference between the signal timing difference and the reference timing difference.
[0163] In one embodiment, the initial delay duration includes the delay duration of the initial clock signal;
[0164] The delay duration update module 708 is used for:
[0165] Determine the delay adjustment value used to increase the delay duration of the initial clock signal;
[0166] Determine a delay adjustment value for reducing the initial delay duration.
[0167] In one embodiment, the initial delay duration further includes the delay duration of the initial data signal; the delay duration update module 708 is configured to:
[0168] Determine the delay adjustment value used to reduce the delay duration of the initial data signal;
[0169] Determine the delay adjustment value used to increase the delay duration of the initial data signal.
[0170] In one embodiment, the reference timing difference is matched with half a clock cycle used by the target chip.
[0171] In one embodiment, after determining the delay adjustment value based on the signal timing difference and the reference timing difference, if the difference between the delay adjustment value and the delay adjustment value threshold satisfies the adjustment condition, the delay duration update module 708 is used to perform the step of obtaining the calibrated delay duration; if the difference between the delay adjustment value and the delay adjustment value threshold does not satisfy the adjustment condition, the device returns to the step of obtaining the initial clock signal and the initial data signal; the difference value that satisfies the adjustment condition is greater than the difference value that does not satisfy the adjustment condition.
[0172] In one embodiment, the timing module 706 is used for:
[0173] When the transition edges of the adjusted clock signal and the adjusted data signal are detected, the detection time of each of the adjusted clock signal and the adjusted data signal is determined.
[0174] The difference between the detection times of the adjusted clock signal and the adjusted data signal is calculated to obtain the signal timing difference.
[0175] In one embodiment, the delay duration update module 708 is used to:
[0176] The delay adjustment value of the first time granularity is determined based on the signal timing difference and the reference timing difference, and the initial delay time granularity is adjusted based on the delay adjustment value of the first time granularity to obtain the calibrated delay duration of the first time granularity.
[0177] The initial delay duration of the second time granularity is determined based on the calibrated delay time granularity of the second time granularity; the first time granularity is greater than the second time granularity;
[0178] The steps of obtaining the adjusted clock signal and adjusted data signal are repeated based on the initial delay duration of the second time granularity until the calibrated delay duration of the second time granularity is obtained.
[0179] In one embodiment, when the initial clock signal and the initial data signal are sent by the MAC chip, the target chip is a PHY chip; when the initial clock signal and the initial data signal are sent by the PHY chip, the target chip is a MAC chip.
[0180] The main functional modules of this embodiment are: a delay processing module including a rising edge acquisition module, a timing module including a timestamp acquisition module, and a clock data signal timing difference calculation module; and a calculation module including an adjustment delay duration calculation module and a programmable delay unit.
[0181] like Figure 8 As shown, the transition edge acquisition module refers to the receiving side performing delay processing on the input TXC and TXD signals and then acquiring the signal transition edge (rising or falling edge); however, the rising edge should be preferred because data acquisition is performed on the rising edge, and more attention should be paid to the signal timing difference on the rising edge.
[0182] The timestamp acquisition module refers to maintaining a timestamp timer and acquiring the timestamps Ttxc and Ttxd corresponding to the rising edges of the adjusted clock signal and the adjusted data signal.
[0183] The clock data signal timing difference calculation module is used to calculate the timing difference of the rising edge signals TXC and TXD.
[0184] The delay duration calculation module is used to determine the delay adjustment value for delay based on the signal timing difference between the clock signal and the data signal.
[0185] Programmable delay unit, used for delay units with configurable and adjustable delay duration.
[0186] like Figure 9As shown, the programmable delay unit can be placed in the following ways: 1) Placed only on the TXC side: This requires that the MAC / PHY chip be inside the PCB design and that the 8-bit TXD trace length be approximately equal. 2) Placed on both the TXC and TXD sides: This can further reduce the PCB design requirements for multi-bit wide TXD data signals: Before adjusting the timing difference between the TXC and TXD signals to half a clock cycle, the delay duration of the delay unit between the 8-bit TXDs can be adjusted first to achieve 8-bit TXD data alignment, with only the timing difference between the 8-bit TXD signals approaching 0. The adjustment method is similar to the steps described above.
[0187] The programmable delay unit can be: the delay level is optional, and it is selected based on the delay chain of the stdcell in the process library: it can realize coarse adjustment based on the obtained delay adjustment value (the accuracy is the clock cycle value of the working clock of the timestamp timer, i.e., the on-chip high-frequency clock). And fine adjustment within a small range (single delay cell delay). The delay duration level is optional, and the time granularity is selected based on the delay chain of the stdcell in the process library. For example, the first time granularity is the working clock of the timestamp timer, that is, the clock cycle value of the on-chip high-frequency clock, while the second time granularity is the delay duration of a single delay cell within a small range. The timestamp timer is implemented based on the on-chip high-frequency clock. For example, when the high-frequency clock is 1GHz, the calibrated delay time granularity of the first time granularity, that is, the measurement accuracy is 1ns, and the delay duration adjustment value accuracy is also 1ns. However, the delay duration value of a single delay cell implemented based on the stdcell in the process library can often be at the ps level. Therefore, based on the calibrated delay duration of the first time granularity, ps-level fine-tuning is continued to obtain the calibrated delay duration of the second time granularity.
[0188] The above embodiments can also be used only to determine coarse adjustment parameters, i.e., the first time-granularity processing, followed by fine-tuning through a small range, i.e., the second time-granularity processing. Specifically, the method of using a high-frequency clock to time the data RXC / RXD can achieve different delays with different number of times, and the adjustment accuracy is related to the clock cycle value of the high-frequency clock.
[0189] Each module in the aforementioned delay duration calibration device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0190] In one exemplary embodiment, an electronic device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and databases. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media to run. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a delay duration calibration method.
[0191] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0192] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0193] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0194] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0195] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A delay duration calibration method, characterized in that, Applied to a target chip, the method includes: Acquire the initial clock signal and the initial data signal; Based on the initial delay duration, the initial clock signal and the initial data signal are delayed to obtain the adjusted clock signal and the adjusted data signal. The signal timing difference is obtained by calculating the difference between the detection times of the adjusted clock signal and the adjusted data signal. The adjustment delay value is determined based on the signal timing difference and the reference timing difference, and the calibrated delay duration is obtained based on the delay adjustment value and the initial delay duration.
2. The method according to claim 1, characterized in that, The step of determining the delay adjustment value based on the signal timing difference and the reference timing difference includes: If the signal timing difference is less than the reference timing difference, a delay adjustment value for increasing the signal timing difference is determined; If the signal timing difference is greater than the reference timing difference, a delay adjustment value for reducing the signal timing difference is determined; The magnitude of the delay adjustment value is positively correlated with the difference between the signal timing difference and the reference timing difference.
3. The method according to claim 2, characterized in that, The initial delay duration includes the delay duration of the initial clock signal; Determining the delay adjustment value used to increase the signal timing difference includes: Determine the delay adjustment value used to increase the delay duration of the initial clock signal; Determining the delay adjustment value for reducing the signal timing difference includes: Determine a delay adjustment value for reducing the initial delay duration.
4. The method according to claim 3, characterized in that, The initial delay duration also includes the delay duration of the initial data signal; determining the delay adjustment value for increasing the signal timing difference further includes: Determine the delay adjustment value used to reduce the delay duration of the initial data signal; Determining the delay adjustment value for reducing the signal timing difference includes: Determine the delay adjustment value used to increase the delay duration of the initial data signal.
5. The method according to claim 1, characterized in that, The reference timing difference is matched with half a sampling clock cycle used by the target chip; the sampling clock cycle is the clock cycle of the initial clock signal and the adjusted clock signal.
6. The method according to claim 1, characterized in that, After determining the delay adjustment value based on the signal timing difference and the reference timing difference, the method further includes: If the difference between the delay adjustment value and the delay adjustment value threshold satisfies the adjustment condition, the step of obtaining the calibrated delay duration is performed. If the difference between the delay adjustment value and the delay adjustment value threshold does not meet the adjustment condition, return to the step of obtaining the initial clock signal and the initial data signal; the difference value that meets the adjustment condition is greater than the difference value that does not meet the adjustment condition.
7. The method according to claim 1, characterized in that, The signal timing difference is obtained by calculating the difference between the detection times of the adjusted clock signal and the adjusted data signal, including: Determine the detection time corresponding to the transition edge of each of the adjusted clock signal and the adjusted data signal; The timing difference is obtained by calculating the difference between the detection times corresponding to the transition edges of the clock signal and the data signal.
8. The method according to claim 1, characterized in that, The step of determining the delay adjustment value based on the signal timing difference and the reference timing difference, and obtaining the calibrated delay duration based on the delay adjustment value and the initial delay duration, includes: The delay adjustment value of the first time granularity is determined based on the signal timing difference and the reference timing difference, and the initial delay time granularity is adjusted based on the delay adjustment value of the first time granularity to obtain the calibrated delay duration of the first time granularity. The initial delay duration of the second time granularity is determined based on the calibrated delay time granularity of the second time granularity; the first time granularity is greater than the second time granularity; The steps of obtaining the adjusted clock signal and adjusted data signal are repeated based on the initial delay duration of the second time granularity until the calibrated delay duration of the second time granularity is obtained.
9. The method according to claim 1, characterized in that, When the initial clock signal and the initial data signal are sent by the MAC chip, the target chip is the PHY chip; when the initial clock signal and the initial data signal are sent by the PHY chip, the target chip is the MAC chip.
10. A delay duration calibration device, characterized in that, The device includes: The signal acquisition module is used to acquire the initial clock signal and the initial data signal; The delay processing module is used to perform delay processing on the initial clock signal and the initial data signal according to the initial delay duration to obtain the adjusted clock signal and the adjusted data signal. The timing module is used to calculate the difference between the detection times of the adjusted clock signal and the adjusted data signal to obtain the signal timing difference. The delay duration update module is used to determine the adjustment delay value based on the signal timing difference and the reference timing difference, and to obtain the calibrated delay duration according to the delay adjustment value and the initial delay duration.
