A multi-edge tapped delay line TDC encoder based on FPGA and its implementation method

By designing a multi-edge tap delay line-type TDC encoder in FPGA, using multi-hop edge detection and fuzzy area counting modules, the bubble problem caused by asynchronous signal flow in FPGA is solved, and high-precision time measurement is achieved, which improves the Measurement accuracy and performance.

CN118611677BActive Publication Date: 2024-11-26NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411068381.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-11-26
Estimated Expiration
2044-08-06

AI Technical Summary

Technical Problem

In FPGA, multi-edge tap delay line-type TDC has metastable state and bubble due to clock offset problems caused by asynchronous signal flow and physical delay, which affects measurement accuracy, and existing encoders cannot effectively correct edge position drift.

Method used

A multi-edge tap delay line-type TDC encoder based on FPGA is designed, including a multi-hop edge detection module, a separation module, a coarse position counting module, a fuzzy area counting module, an accumulation module and a data enable detection module, through unique heat Code conversion, shift processing, coarse position counting and fuzzy area counting realize accurate decoding of binary codes and avoid bubble problems.

Benefits of technology

It effectively avoids bubble problems, improves time measurement accuracy, improves measurement accuracy and performance of multi-edge tap delay line TDC, and is suitable for stable operation at high clock frequency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118611677B_ABST
    Figure CN118611677B_ABST
Patent Text Reader

Abstract

This invention proposes a multi-edge tapped delay line type TDC encoder based on FPGA and its implementation method, belonging to the field of time-to-digital conversion technology. The encoder includes: a multi-edge detection module, a separation module, a coarse position counting module, a fuzzy region counting module, an accumulation module, and a data enable detection module. The edge detection module converts the thermometer code into a one-hot code; the separation module shifts the one-hot code to generate a shifted one-hot code, and combines it with the thermometer code to generate discrete fuzzy region counts; the coarse position counting module calculates the coarse position count result based on the shifted one-hot code; the fuzzy region counting module calculates the fuzzy region count result based on the discrete fuzzy region counts; the accumulation module accumulates the coarse position count result and the fuzzy region count result; the data enable detection module obtains the decoding result from the accumulated result and determines the flag signal. This invention can effectively improve the accuracy of time measurement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of time-to-digital conversion, and in particular relates to a multi-edge tap delay line TDC encoder based on FPGA and a realization method thereof. Background Art

[0002] High-precision time-to-digital conversion technology is widely used in nuclear physics experiments, lidar detection, quantum communication, bioluminescence detection and other fields. The accuracy of TDC (time-to-digital conversion) will affect the accuracy of the entire system.

[0003] FPGA-based tapped delay line TDC is a common way to implement TDC. It uses the resources in the FPGA to build a tapped delay line TDL to achieve fine time measurement within one sampling clock cycle. Due to the physical delay limitation, a single delay unit in the FPGA cannot achieve higher time resolution and measurement accuracy. In order to break the limitation, multiple averaging methods can be used to achieve higher time resolution and measurement accuracy. The multiple averaging methods can be roughly divided into three categories: multi-chain averaging, WaveUnion B, and multi-edge tapped delay line (Wave Union A). The multi-chain averaging type consumes multiple logic resources to achieve averaging within one sampling clock cycle; the Wave Union B type does not consume more resources to achieve averaging within multiple sampling clock cycles; the multi-edge tapped delay line type does not consume more resources to achieve averaging within one sampling clock cycle. Compared with the three, the multi-edge tapped delay line type does not consume more resources to achieve averaging within a single cycle, and has the advantages of low dead time and low resource consumption.

[0004] Since the flow of signals in TDL in FPGA is asynchronous, there will be a timing problem of not meeting the setup and hold time each time the register is sampled at the rising edge of the sampling clock, which may cause metastable problems. At the same time, the sampling clock signals of different registers have clock offset problems due to physical delays. The metastable problem and the clock offset problem together cause the thermometer code output by TDL to be unsatisfactory, and there is a bubble problem. For example, the measurement result that should be "11110000" is displayed as "11101000". This bubble problem is more serious in the new generation of 20nm and 16nm process FPGAs and cannot be ignored. In a multi-edge tap delay line TDC, since multi-edge pulses are transmitted in TDL, signal jumps will occur multiple times, which multiplies the bubble phenomenon. How to convert the thermometer code of the multi-edge tap delay line TDC into binary code while avoiding the bubble problem has become the core of the encoder design.

[0005] The commonly used encoder design method is to identify the end jump edge through a multi-bit comparator, and then obtain and accumulate the positions of multiple jump edges, and finally realize the binary code conversion of the multi-edge tap delay line TDC. Although this method eliminates multiple adjacent jump edges caused by the bubble problem, the edge position drift caused by the bubble problem cannot be corrected, thus affecting the measurement accuracy. Summary of the invention

[0006] In order to solve the above technical problems, the present invention proposes a multi-edge tapped delay line TDC encoder solution based on FPGA.

[0007] The first aspect of the present invention discloses a multi-edge tapped delay line TDC encoder based on FPGA. The encoder comprises: a multi-jump edge detection module, a separation module, a coarse position counting module, a fuzzy area counting module, an accumulation module and a data enable detection module; wherein:

[0008] The multi-jump edge detection module is configured to: convert the thermometer code into a one-hot code; wherein the thermometer code and the one-hot code are respectively input into the separation module;

[0009] The separation module is configured to: perform shift processing on the one-hot code to generate a shifted one-hot code, and generate a discrete fuzzy region count in combination with the thermometer code; wherein the shifted one-hot code is input to the coarse position counting module, and the discrete fuzzy region count is input to the fuzzy region counting module;

[0010] The coarse position counting module is configured to: count coarse position counting results according to the shifted one-hot code; wherein the coarse position counting results are input into the accumulation module;

[0011] The fuzzy region counting module is configured to: count fuzzy region counting results according to the discrete fuzzy region counting statistics; wherein the fuzzy region counting results are input into the accumulation module;

[0012] The accumulation module is configured to: accumulate the coarse position counting result and the fuzzy area counting result, and output the accumulation result; wherein the accumulation result is input into the data enable detection module;

[0013] The data enable detection module is configured to: obtain a decoding result from the accumulation result and determine a flag signal, and output the decoding result and the flag signal.

[0014] According to the above encoder, the thermometer code is a multi-edge thermometer code; the multi-jump edge detection module is specifically configured to: receive the multi-edge thermometer code output by the tapped delay line TDL, and convert the multi-edge thermometer code into the one-hot code by reading the positions of the multiple edges.

[0015] According to the above encoder, the separation module is specifically configured as follows: shifting the one-hot code, shifting all bit values ​​in the one-hot code by 6 bits to the lower bits, and padding the upper 6 bits with zeros to generate the shifted one-hot code; adding the first 6 bits of the thermometer code corresponding to the positions of all 1s in the one-hot code, adding the data less than 6 bits in the lower bits according to the actual number of bits, and obtaining the discrete fuzzy area count based on the addition result.

[0016] According to the above encoder, the coarse position counting module is specifically configured to: convert the shifted one-hot code into a binary code, and sum the positions of all 1s in the shifted one-hot code based on their binary codes to obtain the coarse position counting result.

[0017] According to the above encoder: the coarse position counting module is composed of 6 Class I sub-parts, each Class I sub-part has 48 input ports, the binary code is obtained by edge position and offset index analysis, the outputs of the 6 Class I sub-parts are accumulated in the form of a pipeline addition tree, and the pipeline level of the accumulation process is 4; each Class I sub-part is composed of 12 Class II sub-parts, each Class II sub-part takes 4-bit shifted unique hot code data as input, and the output of each Class II sub-part includes: the edge position sum obtained by adding the corresponding correlation coefficient to each input port, and the edge number sum of all input ports.

[0018] According to the above encoder, the fuzzy region counting module is specifically configured to: receive the discrete fuzzy region counts, accumulate the discrete fuzzy region counts in a pipeline adder tree manner to obtain the number of 1s in all fuzzy regions as the fuzzy region counting result.

[0019] According to the above encoder, the accumulation module is specifically configured to accumulate the coarse position counting result and the fuzzy area counting result in a pipeline adder tree manner.

[0020] According to the above-mentioned encoder, the data enable detection module is composed of a comparator and a register, and the data enable detection module is specifically configured as follows: obtaining a set of binary codes of the decoding result from the accumulation module in each cycle, performing a beat operation through the register, delaying one cycle for each beat, and using the comparator to compare the binary codes before and after the beat to determine the binary decoding result and the corresponding flag signal.

[0021] The second aspect of the present invention discloses a method for implementing a multi-edge tapped delay line TDC encoder based on FPGA. The encoder comprises: a multi-jump edge detection module, a separation module, a coarse position counting module, a fuzzy area counting module, an accumulation module and a data enable detection module. The method comprises:

[0022] Calling the multi-jump edge detection module: converting the thermometer code into a one-hot code; wherein the thermometer code and the one-hot code are respectively input into the separation module;

[0023] Calling the separation module: shifting the one-hot code to generate a shifted one-hot code, and combining it with the thermometer code to generate a discrete fuzzy region count; wherein the shifted one-hot code is input to the coarse position counting module, and the discrete fuzzy region count is input to the fuzzy region counting module;

[0024] Calling the coarse position counting module: counting the coarse position counting result according to the shifted one-hot code; wherein the coarse position counting result is input into the accumulation module;

[0025] Calling the fuzzy area counting module: counting the fuzzy area counting results according to the discrete fuzzy area counting statistics; wherein the fuzzy area counting results are input into the accumulation module;

[0026] Calling the accumulation module: accumulating the coarse position counting result and the fuzzy area counting result, and outputting the accumulation result; wherein the accumulation result is input into the data enable detection module;

[0027] The data enable detection module is called to obtain a decoding result from the accumulation result and determine a flag signal, and output the decoding result and the flag signal.

[0028] The third aspect of the present invention discloses a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for realizing a multi-edge-tapped delay line TDC encoder based on FPGA described in the first aspect is implemented.

[0029] In summary, the technical solution of the present invention can avoid the bubbling problem, and has the advantages of high precision and good performance, can effectively improve the time measurement accuracy, and can be widely used in the decoder design of multi-edge tapped delay line TDC. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0031] Figure 1 is a structural diagram of an encoder according to an embodiment of the present invention;

[0032] Figure 2 A schematic diagram of an encoding process according to an embodiment of the present invention;

[0033] Figure 3 is an RTL schematic diagram of a coarse position counting module according to an embodiment of the present invention;

[0034] Figure 4 is an RTL schematic diagram of a class I sub-part in a coarse position counting module according to an embodiment of the present invention;

[0035] Figure 5 4 is an RTL schematic diagram of a fuzzy region counting module according to an embodiment of the present invention. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0037] In view of the technical defects of the current multi-edge tap delay line TDC encoding, the present invention proposes a multi-edge tap delay line TDC encoder solution based on FPGA. The encoder is a coarse and fine combined encoder that can avoid the bubble problem.

[0038] The first aspect of the present invention discloses a multi-edge tapped delay line TDC encoder based on FPGA. The encoder comprises: a multi-jump edge detection module, a separation module, a coarse position counting module, a fuzzy area counting module, an accumulation module and a data enable detection module; wherein:

[0039] The multi-jump edge detection module is configured to: convert the thermometer code into a one-hot code; wherein the thermometer code and the one-hot code are respectively input into the separation module;

[0040] The separation module is configured to: perform shift processing on the one-hot code to generate a shifted one-hot code, and generate a discrete fuzzy region count in combination with the thermometer code; wherein the shifted one-hot code is input to the coarse position counting module, and the discrete fuzzy region count is input to the fuzzy region counting module;

[0041] The coarse position counting module is configured to: count coarse position counting results according to the shifted one-hot code; wherein the coarse position counting results are input into the accumulation module;

[0042] The fuzzy region counting module is configured to: count fuzzy region counting results according to the discrete fuzzy region counting statistics; wherein the fuzzy region counting results are input into the accumulation module;

[0043] The accumulation module is configured to: accumulate the coarse position counting result and the fuzzy area counting result, and output the accumulation result; wherein the accumulation result is input into the data enable detection module;

[0044] The data enable detection module is configured to: obtain a decoding result from the accumulation result and determine a flag signal, and output the decoding result and the flag signal.

[0045] According to the above encoder, the thermometer code is a multi-edge thermometer code; the multi-jump edge detection module is specifically configured to: receive the multi-edge thermometer code output by the tapped delay line TDL, and convert the multi-edge thermometer code into the one-hot code by reading the positions of the multiple edges.

[0046] According to the above encoder, the separation module is specifically configured as follows:

[0047] Performing a shift process on the one-hot code, shifting all bit values ​​in the one-hot code by 6 bits to the lower bits, and performing a zero padding process on the upper 6 bits, so as to generate the shifted one-hot code;

[0048] The first 6 bits of the thermometer code corresponding to the positions of all 1s in the one-hot code are added, and the data less than 6 bits in the low bits are added according to the actual number of bits, and the discrete fuzzy area count is obtained based on the addition result.

[0049] According to the above encoder, the coarse position counting module is specifically configured to: convert the shifted one-hot code into a binary code, and sum the positions of all 1s in the shifted one-hot code based on their binary codes to obtain the coarse position counting result.

[0050] According to the above encoder:

[0051] The coarse position counting module is composed of 6 Class I sub-parts, each Class I sub-part has 48 input ports, the binary code is obtained by edge position and offset index analysis, the outputs of the 6 Class I sub-parts are accumulated in a pipeline addition tree, and the number of pipeline stages of the accumulation process is 4;

[0052] Each class I sub-section is composed of 12 class II sub-sections. Each class II sub-section takes 4-bit shifted one-hot coded data as input. The output of each class II sub-section includes: the edge position sum obtained by adding the corresponding correlation coefficient to each input port, and the edge number sum of all input ports.

[0053] According to the above encoder, the fuzzy region counting module is specifically configured to: receive the discrete fuzzy region counts, accumulate the discrete fuzzy region counts in a pipeline adder tree manner to obtain the number of 1s in all fuzzy regions as the fuzzy region counting result.

[0054] According to the above encoder, the accumulation module is specifically configured to accumulate the coarse position counting result and the fuzzy area counting result in a pipeline adder tree manner.

[0055] According to the above-mentioned encoder, the data enable detection module is composed of a comparator and a register, and the data enable detection module is specifically configured as follows: obtaining a set of binary codes of the decoding result from the accumulation module in each cycle, performing a beat operation through the register, delaying one cycle for each beat, and using the comparator to compare the binary codes before and after the beat to determine the binary decoding result and the corresponding flag signal.

[0056] Example 1

[0057] like Figure 1 As shown, the encoder includes a multi-jump edge detection module, a separation module, a coarse position counting module, a fuzzy area counting module, an accumulation module and a data enable detection module.

[0058] The multi-edge thermometer code output by TDL is converted into a one-hot code by the multi-jump edge detection module. The position of "1" in the one-hot code may drift due to the existence of the bubbling problem.

[0059] In order to eliminate the influence of the bubble problem, the separation module advances the positions of all "1"s in the one-hot code by 6 bits on the one hand, and saves the first 6 bits of the thermometer code corresponding to all "1" positions on the other hand.

[0060] The coarse position counting module obtains the position sum of all “1”s in the shifted one-hot code.

[0061] At the same time, the fuzzy area counting module continues to accumulate and count the first 6 bits of data of all "1" positions.

[0062] The accumulation module accumulates the results of the coarse position counting module and the fuzzy area counting module to obtain an accumulation result.

[0063] The data enable detection module makes a judgment based on the accumulated results (decoding results) of different sampling clock cycles to obtain the decoding result and flag signal after the arrival of the Hit signal (impulse signal).

[0064] The present invention can avoid the bubbling problem, has the advantages of high precision, good performance, etc., can effectively improve the time measurement accuracy, and can be widely used in the decoder design of multi-edge tap delay line type TDC.

[0065] Example 2

[0066] The FPGA-based multi-edge tapped delay line TDC encoder structure includes a multi-jump edge detection module, a separation module, a coarse position counting module, a fuzzy area counting module, an accumulation module and a data enable detection module.

[0067] The multi-edge detection module can read the position of multiple edges and convert them into one-hot codes. A common problem in design is how to avoid the bubble problem, which causes multiple adjacent edges and edge position drift. For example, ideally, the transition from 0 to 1 is a clean thermometer code, such as "00000000" to "11110000". However, due to the bubble problem, "00000000" to "11101000" will appear. It is of great significance to design a suitable multi-edge detection module to solve the problem of multiple adjacent edges.

[0068] The circuit principle of multi-jump edge detection is realized by multiple four-input AND gate recognition. It recognizes the transition "1000" instead of "10" to prevent multiple adjacent jump edges. The first two and last two bits of the one-hot code are not sufficient for judgment, so in order to avoid uncertainty, their output is directly grounded.

[0069] The separation module separates the obtained unique hot codes in order to eliminate the edge position drift caused by the bubble problem, such as Figure 2 shown.

[0070] On the one hand, the separation module shifts all the bit values ​​in the one-hot code to the lower position by 6 bits, in order to avoid the fuzzy area where the "1" position is easily offset. The highest 6 bits of the shift result are padded with zeros, and then the shift result is sent to the coarse position counting module for rough counting.

[0071] On the other hand, the separation module saves the sum of the first 6 bits of the original thermometer code of all "1" positions through the judgment assignment operation, and the bits less than 6 bits in the low position are added according to the actual number of bits. Then all the sums are sent to the fuzzy area counting module for continued accumulation counting.

[0072] The coarse position counting module receives the shifted one-hot code and converts it into binary code. In the multi-edge tapped delay line TDC, it is necessary to sum the positions of all "1". The coarse position counting module encodes the position of each "1" in the input data and adds them up to get the total result.

[0073] like Figure 3As shown in FIG. 1 , the coarse position counting module consists of 6 type I sub-parts, each with 48 input ports, and the binary code of the coarse position counting is obtained by analyzing the edge position and offset index. The outputs of the 6 type I sub-parts are accumulated together through a pipeline addition tree. The number of pipeline stages in the accumulation process is 4.

[0074] like Figure 4 As shown, each type I sub-part is composed of 12 type II sub-parts. Each type II sub-part inputs 4-bit shifted one-hot code data, outputs the sum of edge positions obtained by adding correlation coefficients to different output ports, and outputs the sum of edge numbers added to all input ports.

[0075] like Figure 5 As shown, the fuzzy region counting module receives the sum of all fuzzy positions, accumulates them together through a pipelined addition tree, and obtains the number of "1"s in the total fuzzy region. The bubble problem can be effectively avoided by directly calculating the number of 1s in the thermometer code.

[0076] The accumulation module accumulates the output results of the coarse position counting module and the fuzzy area counting module together through a pipeline addition tree to obtain an accumulation result.

[0077] The data enable detection module consists of a comparator and a register. Each cycle obtains a set of binary codes from the accumulation module, and implements the beat operation through the register. The beat delays one cycle. By comparing the binary codes before and after the beat, the binary decoding result and the corresponding flag signal after the arrival of the Hit signal (impulse signal) are obtained.

[0078] The second aspect of the present invention discloses a method for implementing a multi-edge tapped delay line TDC encoder based on FPGA. The encoder comprises: a multi-jump edge detection module, a separation module, a coarse position counting module, a fuzzy area counting module, an accumulation module and a data enable detection module. The method comprises:

[0079] Calling the multi-jump edge detection module: converting the thermometer code into a one-hot code; wherein the thermometer code and the one-hot code are respectively input into the separation module;

[0080] Calling the separation module: shifting the one-hot code to generate a shifted one-hot code, and combining it with the thermometer code to generate a discrete fuzzy region count; wherein the shifted one-hot code is input to the coarse position counting module, and the discrete fuzzy region count is input to the fuzzy region counting module;

[0081] Calling the coarse position counting module: counting the coarse position counting result according to the shifted one-hot code; wherein the coarse position counting result is input into the accumulation module;

[0082] Calling the fuzzy area counting module: counting the fuzzy area counting results according to the discrete fuzzy area counting statistics; wherein the fuzzy area counting results are input into the accumulation module;

[0083] Calling the accumulation module: accumulating the coarse position counting result and the fuzzy area counting result, and outputting the accumulation result; wherein the accumulation result is input into the data enable detection module;

[0084] The data enable detection module is called to obtain a decoding result from the accumulation result and determine a flag signal, and output the decoding result and the flag signal.

[0085] Example 3

[0086] The multi-edge thermometer code output by TDL is converted into a one-hot code by the multi-jump edge detection module. The position of "1" in the one-hot code may drift due to the existence of the bubble problem. In order to eliminate the influence of the bubble problem, the separation module advances the position of all "1" in the one-hot code by 6 bits on the one hand, and saves the first 6 bits of the thermometer code corresponding to all "1" positions on the other hand. The coarse position counting module obtains the position sum of all "1" in the shifted one-hot code, and the fuzzy area counting module continues to accumulate and count the first 6 bits of the position of all "1". The accumulation module accumulates the results of the coarse position counting module and the fuzzy area counting module to obtain the final decoding result. The data enable detection module makes judgments based on the decoding results of different sampling clock cycles to obtain the decoding results and flag signals after the arrival of the Hit signal (impulse signal).

[0087] Example 4

[0088] like Figure 1 As shown, the multi-jump edge detection module receives the thermometer code and outputs a one-hot code; the separation module receives the thermometer code and the one-hot code and outputs a shifted one-hot code and a plurality of discrete fuzzy area counts; the coarse position counting module receives the shifted one-hot code and outputs a coarse position counting result; the fuzzy area counting module receives a plurality of discrete fuzzy area counts and outputs a fuzzy area counting result; the accumulation module receives the coarse position counting result and the fuzzy area counting result and outputs the accumulation result; the data enable detection module receives the accumulation result and outputs the encoding and flag result.

[0089] The one-hot code with edge position drift including the bubble problem is detected by a multi-bit comparator, in which the rising edge or falling edge can be identified according to the actual design requirements. Next, on the one hand, the one-hot code is advanced by 6 bits to stay away from the fuzzy area involved in the bubble problem, and the result of the shift is used for rough position counting; on the other hand, the sum of the first 6 bits of the original thermometer code corresponding to the "1" position of all the one-hot codes is saved through the judgment assignment operation, and the fuzzy area count is obtained by the accumulation operation of multiple sums. Finally, the results of the two parts are accumulated to obtain the final decoding result. The whole process is as follows Figure 2 shown.

[0090] The technical solution of the present invention is implemented in an FPGA chip, which is based on a 16nm advanced process. The circuit principle of the multi-jump edge detection module is implemented by multiple four-input AND gate judgments. In the traditional edge recognition scheme, only "10" is usually recognized, but there is a bubble problem in the actual thermometer code. In order to reduce the multiple adjacent jump edges caused by the bubble problem, a scheme for identifying the transition "1000" is adopted. In the actual implementation process inside the FPGA, the corresponding circuit cannot be directly implemented. It is mapped to multiple LUT4 circuits in the FPGA through EDA tools. The separation module receives the thermometer code and the unique hot code and outputs the shifted unique hot code and multiple discrete fuzzy area counts. The shifted unique hot code and the multiple discrete fuzzy area counts need to be converted into corresponding counting results through a special counting module, and the counting module design is the core of the encoder design.

[0091] The coarse position counting module receives the shifted one-hot code and outputs the coarse position binary code counting result, such as Figure 3 As shown, it is necessary to sum the positions of all "1"s in the shifted one-hot code, specifically, to encode the position of each "1" in the input data and perform an addition operation. In this module, the 288-bit shifted one-hot code data is divided into 6 groups of 48 bits, and is input into 6 Class I sub-part modules respectively. The Class I sub-part module can analyze the 48-bit shifted one-hot code to obtain its edge number and edge position. Next, the binary code of the rough position count of the Class I sub-part module is obtained by summing the edge position and the offset index. Next, the binary codes of the 6 Class I sub-parts are accumulated together by pipeline addition. The implementation in FPGA is mainly based on recursive calls of modules, which greatly reduces resource usage.

[0092] like Figure 4As shown in the figure, the 48-bit input of each Class I sub-part module is divided into 12 groups of 4 bits each, and is input into 12 Class II sub-part modules respectively. The Class II sub-part module inputs 4-bit shifted one-hot code data, and outputs the edge position sum obtained by adding correlation coefficients to different output ports on the one hand, and the edge number sum of all input ports on the other hand. Assuming that the input of the 1st and 4th bits is 1, then 0 is added to the 1st bit, 3 is added to the 4th bit, and then their results are added to obtain the sum of all edge positions. At the same time, the edge number sum output is 2. Considering the output characteristics of input 1 in FPGA, designing a Class II sub-part module corresponding to the display look-up table (LUT) input can effectively reduce the logic depth and improve resource utilization.

[0093] The fuzzy region counting module receives multiple discrete fuzzy region counts and obtains the total number of "1"s in them through a pipelined addition tree. It has the ability to globally correct errors for bubbling problems, making the design simple. Figure 5 As shown in Figure 1, the input of multiple three-bit input values ​​is closely related to the edge position and whether the bubble problem occurs. The key to the implementation of pipeline addition in FPGA is the recursive call of the module, which greatly reduces the resource usage.

[0094] The accumulation module receives the coarse position counting result and the fuzzy area counting result and outputs the accumulation result. The accumulation is realized by pipeline addition. The key to the realization of pipeline addition in FPGA lies in the recursive call of the module, which greatly reduces the resource occupation.

[0095] The data enable detection module obtains the binary code bin_final1 from the accumulation module. bin_final1 implements the beat operation through register FF to obtain the signal bin_final2 delayed by one cycle. It is determined when to output the binary code and the flag signal by judging whether the condition that bin_final2 is non-zero and bin_final1 is zero is met. When the judgment is met, the output binary code bin_final2 and the flag signal flag are obtained.

[0096] Example 5

[0097] The FPGA works at a sampling clock frequency of 450MHz, and an arbitrary waveform generator is used to generate two test pulse signals, with a fixed delay set between the two test signals. Then the RMS accuracy of the TDC system is evaluated. Under this test condition, the dual-channel RMS accuracy of the system is 10.7997ps, which is 7.6377ps when converted to a single channel, and the FWHM half-width is 25.4314ps. Its RMS accuracy is higher than that of the multi-edge tap delay line TDC without bubble correction, and has positive application value.

[0098] The third aspect of the present invention discloses a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for realizing a multi-edge-tapped delay line TDC encoder based on FPGA described in the first aspect is implemented.

[0099] In summary, the technical solution of the present invention can avoid the bubbling problem, and has the advantages of high precision and good performance, can effectively improve the time measurement accuracy, and can be widely used in the decoder design of multi-edge tapped delay line TDC.

[0100] The technical effects brought about by the present invention specifically include: First, in the multi-edge tap delay line TDC, all edge position drifts caused by the bubble problem are corrected, so that the measurement time accuracy is further improved. Second, in the multi-edge tap delay line TDC, the encoder designed by the present invention effectively separates the ideal area in the thermometer code and the fuzzy area caused by the bubble problem in structure, and realizes the coarse and fine combined encoder conversion. Third, the encoder structure and method designed by the present invention can work stably under the high clock frequency of FPGA. Fourth, as a TDC with low dead time occupancy and low resource consumption, the encoder designed by the present invention solves the accuracy problem caused by its bubble problem and provides a specific FPGA implementation structure and method, which has a certain positive effect.

[0101] Please note that the technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not 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 specification. The above-mentioned embodiments only express several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several variations and improvements can be made, which all belong to the scope of protection of the present application. Therefore, the scope of protection of the patent in this application shall be based on the attached claims.

Claims

1. A multi-edge tapped delay line TDC encoder based on FPGA, characterized in that: The encoder comprises: a multi-jump edge detection module, a separation module, a coarse position counting module, a fuzzy area counting module, an accumulation module and a data enable detection module; wherein: The multi-jump edge detection module is configured to: convert the thermometer code into a one-hot code; wherein the thermometer code and the one-hot code are respectively input into the separation module; The separation module is configured to: perform shift processing on the one-hot code to generate a shifted one-hot code, and generate a discrete fuzzy region count in combination with the thermometer code; wherein the shifted one-hot code is input to the coarse position counting module, and the discrete fuzzy region count is input to the fuzzy region counting module; The coarse position counting module is configured to: count coarse position counting results according to the shifted one-hot code; wherein the coarse position counting results are input into the accumulation module; The fuzzy region counting module is configured to: count fuzzy region counting results according to the discrete fuzzy region counting statistics; wherein the fuzzy region counting results are input into the accumulation module; The accumulation module is configured to: accumulate the coarse position counting result and the fuzzy area counting result, and output the accumulation result; wherein the accumulation result is input into the data enable detection module; The data enable detection module is configured to: obtain a decoding result from the accumulation result and determine a flag signal, and output the decoding result and the flag signal; Wherein, the separation module is specifically configured as follows: Performing a shift process on the one-hot code, shifting all bit values ​​in the one-hot code by 6 bits to the lower bits, and performing a zero padding process on the upper 6 bits, so as to generate the shifted one-hot code; The first 6 bits of the thermometer code corresponding to the positions of all 1s in the one-hot code are added, and the data less than 6 bits in the low bits are added according to the actual number of bits, and the discrete fuzzy area count is obtained based on the addition result; Wherein, the coarse position counting module is specifically configured as follows: Convert the shifted one-hot code into a binary code, and sum the positions of all 1s in the shifted one-hot code based on their binary codes to obtain the coarse position counting result; Wherein, the fuzzy area counting module is specifically configured as follows: The discrete fuzzy region count is received, and the discrete fuzzy region count is accumulated in a pipeline adder tree manner to obtain the number of 1s in all fuzzy regions as a fuzzy region counting result.

2. The FPGA-based multi-edge tapped delay line TDC encoder according to claim 1, characterized in that: The thermometer code is a multi-edge thermometer code; the multi-jump edge detection module is specifically configured to: receive the multi-edge thermometer code output by the tapped delay line TDL, and convert the multi-edge thermometer code into the one-hot code by reading the positions of the multiple edges.

3. The FPGA-based multi-edge tapped delay line TDC encoder according to claim 2, characterized in that: The coarse position counting module is composed of 6 Class I sub-parts, each Class I sub-part has 48 input ports, the binary code is obtained by edge position and offset index analysis, the outputs of the 6 Class I sub-parts are accumulated in a pipeline addition tree, and the number of pipeline stages of the accumulation process is 4; Each class I sub-section is composed of 12 class II sub-sections. Each class II sub-section takes 4-bit shifted one-hot coded data as input. The output of each class II sub-section includes: the edge position sum obtained by adding the corresponding correlation coefficient to each input port, and the edge number sum of all input ports.

4. The FPGA-based multi-edge tapped delay line TDC encoder according to claim 3, characterized in that: The accumulation module is specifically configured to accumulate the coarse position counting result and the fuzzy area counting result in a pipeline adder tree manner.

5. The FPGA-based multi-edge tapped delay line TDC encoder according to claim 4, characterized in that: The data enable detection module is composed of a comparator and a register. The data enable detection module is specifically configured as follows: obtaining a set of binary codes of the decoding result from the accumulation module in each cycle, performing a beat operation through the register, delaying one cycle for each beat, and using the comparator to compare the binary codes before and after the beat to determine the binary decoding result and the corresponding flag signal.

6. A method for implementing a multi-edge tapped delay line TDC encoder based on FPGA, characterized in that: The encoder comprises: a multi-jump edge detection module, a separation module, a coarse position counting module, a fuzzy area counting module, an accumulation module and a data enable detection module; the method comprises: Calling the multi-jump edge detection module: converting the thermometer code into a one-hot code; wherein the thermometer code and the one-hot code are respectively input into the separation module; Calling the separation module: shifting the one-hot code to generate a shifted one-hot code, and combining it with the thermometer code to generate a discrete fuzzy region count; wherein the shifted one-hot code is input to the coarse position counting module, and the discrete fuzzy region count is input to the fuzzy region counting module; Calling the coarse position counting module: counting the coarse position counting result according to the shifted one-hot code; wherein the coarse position counting result is input into the accumulation module; Calling the fuzzy area counting module: counting the fuzzy area counting results according to the discrete fuzzy area counting statistics; wherein the fuzzy area counting results are input into the accumulation module; Calling the accumulation module: accumulating the coarse position counting result and the fuzzy area counting result, and outputting the accumulation result; wherein the accumulation result is input into the data enable detection module; Calling the data enable detection module: obtaining a decoding result from the accumulation result and determining a flag signal, and outputting the decoding result and the flag signal; The separation module is called to specifically execute: Performing a shift process on the one-hot code, shifting all bit values ​​in the one-hot code by 6 bits to the lower bits, and performing a zero padding process on the upper 6 bits, so as to generate the shifted one-hot code; The first 6 bits of the thermometer code corresponding to the positions of all 1s in the one-hot code are added, and the data less than 6 bits in the low bits are added according to the actual number of bits, and the discrete fuzzy area count is obtained based on the addition result; The coarse position counting module is called to specifically execute: Convert the shifted one-hot code into a binary code, and sum the positions of all 1s in the shifted one-hot code based on their binary codes to obtain the coarse position counting result; The fuzzy area counting module is called to specifically execute: The discrete fuzzy region count is received, and the discrete fuzzy region count is accumulated in a pipeline adder tree manner to obtain the number of 1s in all fuzzy regions as a fuzzy region counting result.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the method for realizing a multi-edge-tapped delay line TDC encoder based on FPGA as described in claim 6 is implemented.

Citation Information

Cited By

  • High-energy-efficiency digital storage and calculation integrated RS (Reed-Solomon) coding and decoding accelerator supporting variable code length

    CN120653301A