IDELAY-based ADC adaptive sampling delay calibration method and system

By using an IDELAY-based adaptive sampling delay calibration method, the clock and data delays are scanned separately to automatically determine the optimal delay scheme. This solves the problem of the ADC's accompanying clock and data line being out of sync, achieving stability and accuracy of the sampling points, adapting to calibration under different boards and conditions, and reducing hardware costs.

CN123074497APending Publication Date: 2026-11-10CHINA ORDNANCE EQUIP GRP AUTOMATION RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611275658.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-21
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

In existing technologies, when the ADC's on-line clock and data line are out of sync, the delay needs to be manually adjusted, and adaptive calibration is not possible. The coverage of single-direction delay calibration is insufficient, causing the sampling time to deviate from the effective window, which affects the accuracy and stability of data sampling.

Method used

An adaptive sampling delay calibration method based on IDELAY is adopted. By using the IDELAY primitive in the FPGA, the clock delay and data delay are scanned in steps to generate statistical results and automatically determine the optimal delay direction and value to ensure that the sampling point is within the effective window.

Benefits of technology

It achieves fully automatic delay calibration without manual intervention, adapts to different boards and working conditions, ensures the accuracy and stability of sampling data, reduces debugging workload, adapts to individual differences in multi-channel systems, and reduces hardware costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123074497A_ABST
    Figure CN123074497A_ABST
Patent Text Reader

Abstract

This invention relates to the field of high-speed data acquisition technology and discloses an IDELAY-based ADC adaptive sampling delay calibration method and system. The method includes: configuring the ADC chip to test mode, causing the ADC chip to output a fixed data code; performing step scans on the clock delay and data delay of the sampling channel; comparing the sampled actual data with the fixed data code at each delay value; recording whether the sampled data is correct at that delay value based on the comparison result; generating clock delay statistics and data delay statistics; determining the optimal delay direction and optimal delay value based on the clock delay statistics and data delay statistics; and writing the optimal delay value into the corresponding IDELAY configuration register to complete the calibration. This invention ensures that the data acquired by the ADC chip is always optimally sampled, effectively avoiding glitches or bit errors in data sampling, and providing high-quality data assurance for subsequent signal processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of high-speed data acquisition technology, specifically to an IDELAY-based ADC adaptive sampling delay calibration method and system, which is particularly suitable for interface timing calibration between high-speed ADC chips and FPGAs that transmit data via LVDS bus. Background Technology

[0002] In high-speed data acquisition systems, LVDS (Low Voltage Differential Signaling) buses are widely used for data transmission between ADCs (Analog-to-Digital Converters) and FPGAs (Field-Programmable Gate Arrays). The ADC chip sends its accompanying clock and data signals to the FPGA, which then uses this clock to sample and latch the data. As the ADC sampling rate continues to increase, the timing margin between the clock and data is continuously compressed. The sampling time must precisely fall within the effective window of the data signal to ensure the accuracy of the sampled data.

[0003] However, in practical engineering applications, differences in transmission delay between the clock and data lines are unavoidable. Factors causing this difference include, but are not limited to: propagation delay deviations due to inconsistent PCB trace lengths, output delay dispersion caused by chip manufacturing process variations, changes in device transmission characteristics due to power supply voltage fluctuations, and signal transmission delay drift caused by ambient temperature changes. When these factors are combined, the clock edge often fails to align with the center of the effective data window, causing the sampling time to deviate from the optimal position, and in severe cases, directly resulting in incorrect sampled data.

[0004] Currently, the existing solutions to the aforementioned timing mismatch problem can be mainly divided into the following three categories:

[0005] Option 1: Manual Incremental Delay Method. Engineers manually adjust the delay value of the IDELAY primitive using FPGA online debugging tools (such as Xilinx ChipScope or Intel SignalTap). Each adjustment is followed by observation of the sampled data's accuracy, gradually approaching a delay value that ensures correct data sampling. This value is then fixed as a constant in the FPGA code. The drawbacks of this method are: firstly, it relies entirely on manual operation, requiring repeated debugging for each board, resulting in low efficiency; secondly, the fixed delay value cannot adaptively adjust to differences in boards, voltage fluctuations, or temperature drift. When operating conditions change, the calibrated sampling points may deviate from the effective window again, leading to intermittent sampling errors in batch products in the field environment.

[0006] Option 2: Perform delay calibration only on the data lines. This option fixes the clock delay and improves sampling timing solely by adjusting the data line delay. Its limitation is that when the correct sampling window for the data lines is too narrow or the data line delay adjustment is close to the upper limit of IDELAY (Input Delay), a single-dimensional adjustment cannot bring the sampling points to the optimal position, posing a significant risk to timing convergence.

[0007] Option 3: Clock line delay calibration only. This option fixes the data delay and improves sampling timing solely by adjusting the clock line delay. Its limitations are similar to Option 2: when clock line delay adjustment fails to meet timing requirements, there are few alternative adjustment options, making it difficult to ensure the sampling point is at the optimal sampling position.

[0008] When sampling high-speed AD chips transmitting data via LVDS bus, if the accompanying clock and data lines become out of sync, the IDELAY primitive in FPGA development is typically used to implement data delay, thereby calibrating the accompanying clock and data. However, data delay is not always the optimal solution, such as... Figure 2 As shown, the associated clock AD_CLK (AD sampling clock) and DATA 1 have an optimal sampling relationship and do not require delay; AD_CLK and DATA 2 do not have an optimal sampling relationship, and a delay is needed to achieve the optimal sampling relationship; AD_CLK and DATA 3 do not have an optimal sampling relationship, and a delay is needed to achieve the optimal sampling relationship. Therefore, delay calibration in one direction cannot cover all timing scenarios.

[0009] In summary, existing technologies have not achieved bidirectional adaptive delay calibration for both the clock and data, making it difficult to stably lock the sampling point at the optimal position within the effective data window under different boards and operating conditions. When the sampling point deviates from the center of the effective window, even if the sampled data is occasionally correct under static testing, insufficient setup or hold time margins may still occur under actual operating conditions such as noise and temperature drift, leading to glitches or bit errors in data sampling and affecting the reliability of subsequent signal processing.

[0010] Therefore, there is an urgent need in this field for a sampling delay calibration method that can automatically adapt to differences in different boards and changes in working conditions, so as to ensure that the sampling time always converges to the center of the effective window without increasing hardware costs, thus ensuring the correctness and stability of ADC sampling data. Summary of the Invention

[0011] This invention addresses the technical problems in existing technologies where manual adjustment of delay is required when the ADC's accompanying clock and data lines are out of sync, and where adaptive calibration is impossible, as well as the technical deficiency of insufficient coverage in single-direction delay calibration. It provides an IDELAY-based adaptive sampling delay calibration method and system for ADCs, aiming to achieve the following objectives: fully automatic adaptive calibration of the ADC chip's accompanying clock and data delay without manual intervention, reducing debugging workload; delay scanning is performed from both the delayed data and delayed clock directions, and the optimal delay scheme and value are determined by combining the calibration statistical results from both directions, ensuring that the sampling point is located at the position with the largest margin within the effective window, avoiding glitches or bit errors in data sampling, and providing high-quality data assurance for subsequent signal processing.

[0012] This invention is achieved through the following technical solution:

[0013] An IDELAY-based adaptive sampling delay calibration method for ADCs includes:

[0014] Configure the ADC chip to test mode so that the ADC chip outputs a fixed data code;

[0015] The clock delay and data delay of the sampling channel are scanned in steps. At each delay value, the actual data sampled is compared with the fixed data code. Based on the comparison result, the correctness of the sampled data at the delay value is recorded, and clock delay statistics and data delay statistics are generated respectively.

[0016] Based on the clock delay statistics and the data delay statistics, determine the optimal delay direction and the optimal delay value;

[0017] Write the optimal delay value into the corresponding IDELAY configuration register to complete the calibration.

[0018] As an optimization, the clock delay and data delay of the sampling channel are scanned in steps, specifically including:

[0019] The clock delay value of the sampling channel is fixed at the initial value, and the data delay value is incremented sequentially from 0 to the maximum step value. At each data delay value, it is determined whether the sampled data is correct, and the data delay statistics result is generated.

[0020] The data delay value of the sampling channel is fixed at the initial value, and the clock delay value is incremented sequentially from 0 to the maximum step value. At each clock delay value, it is determined whether the sampled data is correct, and the clock delay statistics result is generated.

[0021] As an optimization, the correctness of the sampled data is determined as follows:

[0022] A preset number of sampled data are continuously received at each delay value. If all of the preset number of sampled data are consistent with the fixed data code, it is determined that the sampling at the current delay value is correct; otherwise, it is determined that the sampling is incorrect.

[0023] As an optimization, both the data delay statistics and the clock delay statistics are N-bit registers, where N is the total number of delay steps; the i-th bit corresponds to the statistics when the delay value is i, and is set to 1 when the sampling is correct and to 0 when the sampling is incorrect.

[0024] As an optimization, the optimal delay direction and optimal delay value are determined, specifically including:

[0025] Read the 0th bit of the data delay statistics result and the 0th bit of the clock delay statistics result;

[0026] If all 0th bits are valid values, then compare the total number of valid values ​​in the data delay statistics with the total number of valid values ​​in the clock delay statistics, select the side with more valid values ​​as the optimal delay direction, take the center of the correct sampling window in the optimal delay direction as the optimal sampling position, and calculate the optimal delay value required for the current sampling point to move to the optimal sampling position based on the difference in the total number of valid values ​​on both sides.

[0027] As an optimization, the optimal delay value is calculated based on the difference in the total number of valid values ​​on both sides, using the following method:

[0028] When selecting the data delay direction, the optimal delay value = (total number of valid values ​​in the data delay statistics - total number of valid values ​​in the clock delay statistics / 2);

[0029] When selecting the clock delay direction, the optimal delay value = (total number of valid values ​​in the clock delay statistics - total number of valid values ​​in the data delay statistics / 2).

[0030] As an optimization, the optimal delay direction and optimal delay value are determined, specifically including:

[0031] Read the 0th bit of the data delay statistics result and the 0th bit of the clock delay statistics result;

[0032] If all values ​​in the 0th position are invalid, then find the position of the valid value closest to the 0th position in the data delay statistics and the clock delay statistics respectively, and select the side with smaller distance as the optimal delay direction. Based on the valid value position corresponding to the optimal delay direction, and using the period of the accompanying clock as the standard, calculate the optimal sampling position and the corresponding optimal delay value.

[0033] As an optimization, the optimal delay value is calculated based on the effective value position corresponding to this direction and the setup time parameters of the ADC chip, using the following method:

[0034] Optimal delay value = effective value position + (ADC sampling period / 2 − setup time) / (reference clock period / (2 × N)), where N is the total number of delay steps, the setup time is the data setup time in the ADC chip manual, and the reference clock is the reference clock of the IDELAY primitive.

[0035] As an optimization, it also includes:

[0036] After all sampling channels have been calibrated, the ADC chip is exited from test mode and enters normal working mode. In normal working mode, the IDELAY is configured to perform sampling according to the optimal delay value obtained from calibration, so that the sampling point falls at the optimal sampling position.

[0037] This invention also discloses an IDELAY-based ADC adaptive sampling delay calibration system for performing the aforementioned IDELAY-based ADC adaptive sampling delay calibration method, comprising:

[0038] The ADC chip is used to output a fixed data code in test mode and exit test mode to enter normal working mode after calibration is completed.

[0039] An FPGA chip is connected to the ADC chip via an LVDS bus. The FPGA chip includes:

[0040] The IDELAY delay module is used to configure the delay of the clock signal and data signal of the sampling channel respectively;

[0041] The scanning statistics module is used to perform step scanning on clock delay and data delay respectively. At each delay value, the sampled actual data is compared with the fixed data code, and the correctness of the sampled data at that delay value is recorded. Clock delay statistics and data delay statistics are generated respectively.

[0042] The optimal value calculation module is used to determine the optimal delay direction and the optimal delay value based on the clock delay statistics and the data delay statistics, and write the optimal delay value into the configuration register of the IDELAY delay module.

[0043] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0044] This invention enables the delay calibration process to be completed entirely autonomously by the hardware logic through automatic scanning and calculation in ADC test mode, without the need for engineering personnel to intervene in debugging. Compared with the existing technology that relies on manual adjustment and fixing of IDELAY delay values ​​step by step, this invention significantly reduces the amount of debugging work, and the calibration results are not affected by the operator's experience, resulting in higher consistency and repeatability.

[0045] This invention performs step scanning from both delayed data and delayed clock directions. Under the condition that sampling can be completed in both directions, it compares the effective sampling window widths of the two directions and selects the direction with the larger margin as the final solution. In contrast, existing technologies only perform unidirectional scanning of the data line and take the intermediate value, without considering the possibility of clock delay adjustment, and cannot guarantee that the selected solution is globally optimal in both data delay and clock delay dimensions.

[0046] This invention divides calibration into two scenarios based on whether correct sampling has been achieved in the no-delay state: Scenario 1 involves shifting the sampling point to the center of the window based on correct sampling; Scenario 2 involves finding the nearest correct window entry and then compensating for the establishment time margin in the completely unlocked state. Existing technologies only provide a unified "take the middle value of the window" strategy, which cannot determine the window center position when completely unlocked. However, the dual-scenario logic of this invention ensures that calibration convergence can be completed regardless of the initial delay state.

[0047] Existing technologies typically use "whether the sampled data is correct" as the sole criterion, ignoring the constraints of physical timing parameters such as setup time specified in the chip datasheet. When a sampling point is within the correct window but too close to the edge of data change, static testing may still show correctness, but under actual operating conditions such as temperature drift and voltage fluctuations, insufficient margin may lead to bit errors. This invention introduces a setup time parameter into the calculation formula for scenario two, allowing the sampling point to move further towards the center of the window after entering the correct window by a setup time margin. This ensures that the sampling point is at the maximum margin position while meeting the chip's physical timing constraints.

[0048] The PCB trace delays differ between channels of a multi-channel ADC. Existing technologies typically use the same set of fixed delay values ​​for all channels, which cannot accommodate individual differences between channels. This invention performs a complete bidirectional scan and calculates the optimal delay value independently for each sampling channel, providing each channel with an independent delay configuration to accommodate trace differences and timing deviations in multi-channel systems.

[0049] This invention implements delay control entirely based on the existing IDELAY primitives within the FPGA, without adding any external devices or extra hardware resources. Adaptive calibration capability is achieved through logic design on the existing hardware platform, resulting in high cost-effectiveness. Attached Figure Description

[0050] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be considered as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings:

[0051] Figure 1 This is a flowchart of an IDELAY-based ADC adaptive sampling delay calibration method according to the present invention;

[0052] Figure 2 This diagram illustrates the timing relationship between the ADC chip's accompanying clock and data, showing the timing relationship between the accompanying clock AD_CLK and three types of data: DATA 1 (no delay required), DATA 2 (data requiring delay), and DATA 3 (clock requiring delay).

[0053] Figure 3 This is a flowchart of the data delay scanning process of the present invention;

[0054] Figure 4 This is a flowchart of the clock delay scan of the present invention;

[0055] Figure 5 This is a flowchart illustrating the optimal delay calculation process of this invention. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention.

[0057] Example 1 discloses an IDELAY-based adaptive sampling delay calibration method for ADCs, such as... Figure 1 As shown, it includes the following steps:

[0058] S1. Configure the ADC chip to test mode so that the ADC chip outputs a fixed data code.

[0059] After powering on, configuring, and resetting the ADC chip, it first enters test mode. In test mode, the ADC chip alternately outputs data according to an internally preset fixed data code pattern, serving as a reference signal for the calibration phase. In one embodiment of the invention, this fixed data code pattern is an alternating output of AAAA and 5555. The FPGA receiving port correspondingly receives this fixed data code alternately.

[0060] S2. Perform step scans on the clock delay and data delay of the sampling channel respectively. Under each delay value, compare the actual data obtained by sampling with the fixed data code. Record whether the sampled data under the delay value is correct according to the comparison result, and generate clock delay statistics and data delay statistics respectively.

[0061] In some embodiments, the clock delay and data delay of the sampling channel are scanned in steps, specifically including:

[0062] S2.1 Fix the clock delay value (i.e., clock IDELAY value) of the sampling channel to the initial value, and increment the data delay value (i.e., data IDELAY value) from 0 to the maximum step value. Determine whether the sampled data is correct at each data delay value, and generate the data delay statistics result.

[0063] S2.2 Fix the data delay value of the sampling channel to the initial value, and increment the clock delay value from 0 to the maximum step value. Determine whether the sampled data is correct at each clock delay value, and generate the clock delay statistics result.

[0064] In some embodiments, determining whether the sampled data is correct specifically involves:

[0065] A preset number of sampled data are continuously received at each delay value. If all of the preset number of sampled data are consistent with the fixed data code, it is determined that the sampling at the current delay value is correct; otherwise, it is determined that the sampling is incorrect.

[0066] In some embodiments, both the data delay statistics and the clock delay statistics are N-bit registers, where N is the total number of delay steps; the i-th bit corresponds to the statistics when the delay value is i, and is set to 1 when the sampling is correct and to 0 when the sampling is incorrect.

[0067] In one specific embodiment of the present invention, such as Figure 3 As shown, the clock IDELAY value of the sampling channel is fixed at 0, and the data IDELAY values ​​are sequentially set to 0, 1, 2, ..., 31, with a step of 1. Under each data IDELAY value, the FPGA continuously receives 15,000 sampled data and compares them with the expected fixed data code AAAA / 5555. If all 15,000 data are consistent with the expectation, the current delay value is determined to be correctly sampled, and the corresponding bit in the check_data_result[31:0] register is set to 1; if any data is inconsistent with the expectation, the sampling is determined to be incorrect, and the corresponding bit is set to 0. After the scan is completed, check_data_result[31:0] records all scan results of data delay from 0 to 31. Here, check_data_result[31:0] is the data delay statistics result.

[0068] like Figure 4 As shown, the IDELAY value of the sampling channel is fixed at 0, and the clock IDELAY value is set sequentially to 0, 1, 2, ..., 31, with a step of 1. At each clock IDELAY value, the sampling is checked for correctness in the same way as described above, and the result is recorded in the check_clk_result[31:0] register. The execution order of steps S2.1 and S2.2 can be interchanged or executed in parallel without affecting the final calibration result. check_clk_result[31:0] contains the clock delay statistics.

[0069] S3. Based on the clock delay statistics and the data delay statistics, determine the optimal delay direction and the optimal delay value, such as... Figure 5 As shown.

[0070] In some embodiments, determining the optimal delay direction and the optimal delay value specifically includes:

[0071] S3.1 Read the 0th bit of the data delay statistics result and the 0th bit of the clock delay statistics result;

[0072] If all 0th bits are valid values, the current sampling is considered correct, and S3.2A is executed; if all 0th bits are invalid values, the current sampling is considered incorrect, and S3.2B is executed.

[0073] S3.2A. Compare the total number of valid values ​​in the data delay statistics with the total number of valid values ​​in the clock delay statistics. Select the side with more valid values ​​as the optimal delay direction. Take the center of the correct sampling window in the optimal delay direction as the optimal sampling position. Calculate the optimal delay value required for the current sampling point to move to the optimal sampling position based on the difference between the total number of valid values ​​on both sides.

[0074] In some embodiments, the optimal delay value is calculated in S3.2A based on the difference in the total number of valid values ​​on both sides, in the following manner:

[0075] When selecting the data delay direction, the optimal delay value = (total number of valid values ​​in the data delay statistics - total number of valid values ​​in the clock delay statistics / 2);

[0076] When selecting the clock delay direction, the optimal delay value = (total number of valid values ​​in the clock delay statistics - total number of valid values ​​in the data delay statistics) / 2.

[0077] S3.2B. Find the position of the effective value closest to the 0th bit in the data delay statistics result and the clock delay statistics result respectively, select the side with smaller distance as the optimal delay direction, and calculate the optimal sampling position and the corresponding optimal delay value based on the effective value position corresponding to the optimal delay direction and the ADC sampling period as the standard.

[0078] In some embodiments, the optimal delay value is calculated in S3.2B based on the effective value position corresponding to the direction and the setup time parameter of the ADC chip, in the following manner:

[0079] Optimal delay value = effective value position (delayed correct result) + (ADC sampling period / 2 − setup time) / (reference clock period / (2 × N)), where N is the total number of delay steps, the setup time is the data setup time in the ADC chip manual, and the reference clock is the reference clock of the IDELAY primitive.

[0080] For example, if the current result satisfies that both check_data_result[0] and check_clk_result[0] are 0, and the distance between the data delay and the correct result is less than the clock delay of the correct result, the optimal sampling selection is to configure the data IDELAY, and the value is set with a 250M clock reference to ensure that there is no overflow. The calculation formula is: number of data delay IDELAYs = data delay correct result + (AD sampling period / 2 - setup time) / (reference clock period / (2 * 32)).

[0081] Here, "correct data delay result" refers to the number of taps required to adjust the data delay to the first correct result; AD sampling period / 2 - setup time: represents the optimal sampling time being exactly in the middle of the current sampling period, hence divided by 2, but this unit is time; reference clock period / (2 * 32) represents the time of one TAP. Overall, it calculates the number of TAPs required to shift the data to ensure the optimal sampling time.

[0082] If the clock delay is less than the distance to the correct result than the data delay, then the calculation steps are the same as above, except that the data is replaced with the clock.

[0083] In a specific embodiment of the present invention, based on the calculation results of check_data_result[31:0] and check_clk_result[31:0], the optimal delay direction and value are determined for two scenarios:

[0084] Scenario 1: check_data_result[0]=1 and check_clk_result[0]=1

[0085] This scenario demonstrates that correct sampling can be achieved without delay, but the sampling point may not be in the optimal position.

[0086] Calculate the number of 1s in the data delay statistics (denoted as data_cnt) and the number of 1s in the clock delay statistics (denoted as clk_cnt). data_cnt and clk_cnt reflect the width of the correct sampling window in the data delay direction and the clock delay direction, respectively; a larger value indicates a larger sampling margin in that direction. Compare data_cnt and clk_cnt:

[0087] If data_cnt > clk_cnt, it indicates that the correct sampling window in the data delay direction is wider. Select the delayed data, and take the center of the correct sampling window in the data delay direction as the optimal sampling position. The optimal data delay value = (data_cnt - clk_cnt) / 2, and write it into delay_wdata[4:0]. delay_wdata[4:0] is the actual data IDELAY configuration value after calibration calculation. Write the delay value in the data IDELAY primitive, and finally write the optimal delay value after calibration.

[0088] If clk_cnt > data_cnt, it indicates that the correct sampling window in the clock delay direction is wider. Select a delayed clock, and use the center of the correct sampling window in the clock delay direction as the optimal sampling position. The optimal clock delay value = (clk_cnt - data_cnt) / 2, written to delay_clk_wdata[4:0]. delay_clk_wdata[4:0] is the actual clock IDELAY configuration value after calibration calculation. The delay value is written in the clock IDELAY primitive, followed by the optimal delay value after calibration.

[0089] If data_cnt=clk_cnt, both are equivalent, and either one can be chosen or the default delayed data can be selected.

[0090] Scenario 2: check_data_result[0]=0 and check_clk_result[0]=0

[0091] This scenario indicates that sampling cannot be performed correctly in a no-delay state, and the current state is one of unlocking.

[0092] Search for the first position where the value is 1 in check_data_result[31:0] and check_clk_result[31:0] respectively from the lower bit to the higher bit, and denote them as data_first_valid and clk_first_valid. data_first_valid and clk_first_valid respectively represent the minimum delay steps required to enter the correct sampling window from the current sampling point in the data delay direction and the clock delay direction, and a smaller value indicates that the direction can enter the correct sampling window faster. Compare the magnitudes of the two:

[0093] If data_first_valid<clk_first_valid, it indicates that the data delay direction can enter the correct sampling window faster, the delayed data is selected, and the position calculated based on the accompanying clock cycle after entering the correct sampling window in this direction is confirmed as the optimal sampling position. The optimal delay value is calculated according to the formula data_first_valid+(T_AD / 2-tSU) / (T_REF / (2×32)), where T_AD is the ADC sampling period, tSU is the setup time of the ADC chip, and T_REF is the IDELAY reference clock period (200 MHz in this embodiment, that is, 5 ns).

[0094] If clk_first_valid<data_first_valid, it indicates that the clock delay direction can enter the correct sampling window faster, the delayed clock is selected, and the position that meets the setup time requirement after entering the correct sampling window in this direction is taken as the optimal sampling position. The optimal delay value is calculated according to a similar formula and then written to delay_clk_wdata[4:0].

[0095] If no valid value can be found in both directions (that is, both check_data_result[31:0] and check_clk_result[31:0] are all 0), it indicates that correct sampling cannot be performed under all delay values, the hardware link is faulty, and an error is reported to exit.

[0096] S4. Write the optimal delay value into the corresponding IDELAY configuration register to complete the calibration.

[0097] S5. After all sampling channels are calibrated, the ADC chip is exited from the test mode and enters the normal working mode. In the normal working mode, sampling is performed by configuring the IDELAY according to the optimal delay value obtained by calibration, so that the sampling point falls at the optimal sampling position.

[0098] Example 2 discloses an IDELAY-based ADC adaptive sampling delay calibration system for executing the IDELAY-based ADC adaptive sampling delay calibration method described in Example 1, comprising:

[0099] The ADC chip is used to output a fixed data code in test mode and exit test mode to enter normal working mode after calibration is completed.

[0100] An FPGA chip is connected to the ADC chip via an LVDS bus. The FPGA chip includes:

[0101] The IDELAY delay module is used to configure the delay of the clock signal and data signal of the sampling channel respectively;

[0102] The scanning statistics module is used to perform step scanning on clock delay and data delay respectively. At each delay value, the sampled actual data is compared with the fixed data code, and the correctness of the sampled data at that delay value is recorded. Clock delay statistics and data delay statistics are generated respectively.

[0103] The optimal value calculation module is used to determine the optimal delay direction and the optimal delay value based on the clock delay statistics and the data delay statistics, and write the optimal delay value into the configuration register of the IDELAY delay module.

[0104] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for adaptive sampling delay calibration of an ADC based on IDELAY, characterized in that, include: Configure the ADC chip to test mode so that the ADC chip outputs a fixed data code; The clock delay and data delay of the sampling channel are scanned in steps. At each delay value, the actual data sampled is compared with the fixed data code. Based on the comparison result, the correctness of the sampled data at the delay value is recorded, and clock delay statistics and data delay statistics are generated respectively. Based on the clock delay statistics and the data delay statistics, determine the optimal delay direction and the optimal delay value; Write the optimal delay value into the corresponding IDELAY configuration register to complete the calibration.

2. The IDELAY-based ADC adaptive sampling delay calibration method according to claim 1, characterized in that, The clock delay and data delay of the sampling channel are scanned in steps, specifically including: The clock delay value of the sampling channel is fixed at the initial value, and the data delay value is incremented sequentially from 0 to the maximum step value. At each data delay value, it is determined whether the sampled data is correct, and the data delay statistics result is generated. The data delay value of the sampling channel is fixed at the initial value, and the clock delay value is incremented sequentially from 0 to the maximum step value. At each clock delay value, it is determined whether the sampled data is correct, and the clock delay statistics result is generated.

3. The IDELAY-based ADC adaptive sampling delay calibration method according to claim 2, characterized in that, To determine whether the sampled data is correct, the following steps are taken: A preset number of sampled data are continuously received at each delay value. If all of the preset number of sampled data are consistent with the fixed data code, it is determined that the sampling at the current delay value is correct; otherwise, it is determined that the sampling is incorrect.

4. The IDELAY-based ADC adaptive sampling delay calibration method according to claim 2, characterized in that, Both the data delay statistics and the clock delay statistics are N-bit registers, where N is the total number of delay steps. The i-th bit corresponds to the statistics when the delay value is i. The corresponding bit is set to 1 when the sampling is correct and to 0 when the sampling is incorrect.

5. The IDELAY-based ADC adaptive sampling delay calibration method according to claim 1, characterized in that, Determining the optimal delay direction and optimal delay value specifically includes: Read the 0th bit of the data delay statistics result and the 0th bit of the clock delay statistics result; If all 0th bits are valid values, then compare the total number of valid values ​​in the data delay statistics with the total number of valid values ​​in the clock delay statistics, select the side with more valid values ​​as the optimal delay direction, take the center of the correct sampling window in the optimal delay direction as the optimal sampling position, and calculate the optimal delay value required for the current sampling point to move to the optimal sampling position based on the difference in the total number of valid values ​​on both sides.

6. The IDELAY-based ADC adaptive sampling delay calibration method according to claim 5, characterized in that, The optimal delay value is calculated based on the difference in the total number of effective values ​​on both sides, using the following method: When selecting the data delay direction, the optimal delay value = (total number of valid values ​​in the data delay statistics - total number of valid values ​​in the clock delay statistics / 2); When selecting the clock delay direction, the optimal delay value = (total number of valid values ​​in the clock delay statistics - total number of valid values ​​in the data delay statistics / 2).

7. The IDELAY-based ADC adaptive sampling delay calibration method according to claim 1, characterized in that, Determining the optimal delay direction and optimal delay value specifically includes: Read the 0th bit of the data delay statistics result and the 0th bit of the clock delay statistics result; If all values ​​in the 0th bit are invalid, then find the position of the valid value closest to the 0th bit in the data delay statistics and the clock delay statistics respectively, and select the side with the smaller distance as the optimal delay direction. Based on the valid value position corresponding to the optimal delay direction, and using the ADC sampling period as the standard, calculate the optimal sampling position and the corresponding optimal delay value.

8. The IDELAY-based ADC adaptive sampling delay calibration method according to claim 7, characterized in that, The optimal delay value is calculated based on the effective value position corresponding to this direction and the setup time parameters of the ADC chip, using the following method: Optimal delay value = effective value position + (ADC sampling period / 2 − setup time) / (reference clock period / (2 × N)), where N is the total number of delay steps, the setup time is the data setup time in the ADC chip manual, and the reference clock is the reference clock of the IDELAY primitive.

9. A method for adaptive sampling delay calibration of an ADC based on IDELAY according to any one of claims 1-8, characterized in that, Also includes: After all sampling channels have been calibrated, the ADC chip is exited from test mode and enters normal working mode. In normal working mode, the IDELAY is configured to perform sampling according to the optimal delay value obtained from calibration, so that the sampling point falls at the optimal sampling position.

10. An IDELAY-based ADC adaptive sampling delay calibration system, used to execute the IDELAY-based ADC adaptive sampling delay calibration method according to any one of claims 1-9, characterized in that, include: The ADC chip is used to output a fixed data code in test mode and exit test mode to enter normal working mode after calibration is completed. An FPGA chip is connected to the ADC chip via an LVDS bus. The FPGA chip includes: The IDELAY delay module is used to configure the delay of the clock signal and data signal of the sampling channel respectively; The scanning statistics module is used to perform step scanning on clock delay and data delay respectively. At each delay value, the sampled actual data is compared with the fixed data code, and the correctness of the sampled data at that delay value is recorded. Clock delay statistics and data delay statistics are generated respectively. The optimal value calculation module is used to determine the optimal delay direction and the optimal delay value based on the clock delay statistics and the data delay statistics, and write the optimal delay value into the configuration register of the IDELAY delay module.