Self-adaptive carry delay chain coefficient adjusting system and method based on FPGA (field programmable Gate array) test

文档序号:1845176 发布日期:2021-11-16 浏览:21次 中文

阅读说明:本技术 基于fpga测试自适应进位延时链系数调节系统及方法 (Self-adaptive carry delay chain coefficient adjusting system and method based on FPGA (field programmable Gate array) test ) 是由 廖阳阳 李全任 于 2021-10-20 设计创作,主要内容包括:本发明公开了一种基于FPGA测试自适应进位延时链系数调节系统及方法,包括模数信号转换与信号展宽电路、FPGA单元、数据处理模块,所述FPGA单元包括边缘检测模块、满时钟进位链模块、粗时钟计数模块、进位链计数模块,模数信号转换与信号展宽电路是为了适应各种电信号形式和为了适应不同的信号宽度。边缘检测模块用于对数据边缘定位,粗时钟计数模块用于对信号粗精度计数。满时钟进位链模块用于实时传输满时钟在同一条进位链传输的进位链数量,用于实时校准进位链精度数据,本发明降低了进位链测试系统中,温度以及电压对测时精度的影响,提高进位链测时精度。(The invention discloses an adaptive carry time delay chain coefficient adjusting system and method based on FPGA (field programmable gate array) test, which comprises an analog-digital signal conversion and signal broadening circuit, an FPGA unit and a data processing module, wherein the FPGA unit comprises an edge detection module, a full clock carry chain module, a coarse clock counting module and a carry chain counting module, and the analog-digital signal conversion and signal broadening circuit is used for adapting to various electric signal forms and different signal widths. The edge detection module is used for positioning data edges, and the coarse clock counting module is used for counting the coarse precision of signals. The full clock carry chain module is used for transmitting the carry chain quantity transmitted by a full clock in the same carry chain in real time and is used for calibrating carry chain precision data in real time.)

1. The utility model provides a test self-adaptation carry time delay chain coefficient governing system based on FPGA which characterized in that: including analog-to-digital signal conversion and signal stretching circuit, FPGA unit, data processing module, the FPGA unit includes edge detection module, full clock carry chain module, coarse clock count module, carry chain count module, wherein:

the analog-to-digital signal conversion and signal broadening circuit is used for performing digital-to-analog signal conversion on the initial analog signal, broadening the converted signal to obtain an initial TTL level signal, and sending the obtained initial TTL level signal to the FPGA unit; the FPGA unit is used for carrying out digital-to-analog signal conversion on the ending analog signal, widening the converted signal to obtain an ending TTL level signal and sending the obtained ending TTL level signal to the FPGA unit;

the edge detection module is used for carrying out edge positioning on the initial TTL level signal to obtain initial carry chain edge positioning delay data and sending the initial carry chain edge positioning delay data to the carry chain counting module; the edge positioning module is used for carrying out edge positioning on the finished TTL level signal to obtain finished carry chain edge positioning delay data and sending the finished carry chain edge positioning delay data to the carry chain counting module;

the full-clock carry chain module is used for processing the initial TTL level signal to obtain a full-clock initial TTL level signal when the edge signal detection is finished, and sending the obtained full-clock initial TTL level signal to the carry chain counting module for full-clock detection counting;

the carry chain counting module is used for carrying out edge detection counting according to the initial carry chain edge positioning delay data to obtain a final edge clock number T0 and sending the final edge clock number T0 to the data processing module; the full clock carry chain counting module is used for detecting and counting according to the full clock initial TTL level signal to obtain a full clock carry chain count Tz and sending the full clock carry chain count Tz to the data processing module; the edge detection and counting module is used for carrying out edge detection and counting according to the ending carry chain edge positioning delay data to obtain an ending carry chain edge count T1 and sending the ending carry chain edge count T1 to the data processing module;

the coarse clock counting module is used for counting the initial TTL level signals when the edge detection module starts to process the initial TTL level signals, stopping counting the finished TTL level signals when the carry chain counting module stops edge detection counting on the finished carry chain edge positioning delay data to obtain coarse clock counting N, and sending the coarse clock counting N to the data processing module;

the data processing module is used for receiving the uploaded final edge clock number T0, the whole clock carry chain count Tz, the end carry chain edge count T1 and the rough clock count N, and calculating the high-precision test time through the following formula:

where Ttof denotes the test time and Tclk denotes the clock interval after the PLL has multiplied.

2. The FPGA-based test adaptive carry delay chain coefficient adjustment system of claim 1, wherein: the multi-stage carry-in chain cascade connection device comprises a carry-in chain cascade connection module, a carry-in chain module, a D trigger unit and a register, wherein the carry-in chain module comprises more than one carry-in chain, the D trigger unit comprises more than one D trigger, the carry-in chain cascade connection module is used for carrying out cascade connection on the carry-in chain, each carry-in chain is connected with one D trigger, and the D triggers are respectively connected with the register.

3. The FPGA-based test adaptive carry delay chain coefficient adjustment system of claim 2, wherein: the carry chain corresponds to the D triggers one by one.

4. The FPGA-based test adaptive carry delay chain coefficient adjustment system of claim 3, wherein: the data processing module is an FPGA board or an upper computer.

5. The FPGA-based test adaptive carry delay chain coefficient adjustment system of claim 4, wherein: the network port module is used for sending the final edge clock number T0, the whole clock carry chain count Tz, the finish carry chain edge count T1 and the coarse clock count N to the upper computer when the data processing module is the upper computer.

6. The adjusting method for testing the adaptive carry delay chain coefficient adjusting system based on the FPGA according to claim 1, comprising the following steps of:

step 1, when a level threshold of an initial analog signal exceeds a set level threshold, judging that the initial analog signal is effective, widening the initial analog signal, inputting the widened signal to an FPGA unit for initial edge carry chain detection, wherein the widened signal is an initial TTL level signal;

when the FPGA unit detects that the initial analog signal is valid, the edge detection module starts to process the initial TTL level signal, and meanwhile, the coarse clock counting starts to count the initial TTL level signal; after the edge detection module finishes detection, outputting initial carry chain edge positioning delay data, storing the initial carry chain edge positioning delay data in a register, sending the initial carry chain edge positioning delay data to a carry chain counting module for edge detection counting to obtain a final edge clock number T0, and sending the final edge clock number T0 to an upper computer;

and 2, when the edge signal detection is finished, starting to perform full clock counting detection: the full clock carry chain module starts to process the initial TTL level signal, sends the processed initial TTL level signal to a carry chain counting module for full clock detection counting to obtain a full clock carry chain count Tz, and sends the full clock carry chain count Tz to an upper computer;

step 3, when the level threshold of the end analog signal exceeds the set level threshold II, judging that the end analog signal is valid, widening the end analog signal, wherein the widened signal is the end TTL level signal, and inputting the end TTL level signal to the FPGA unit for detecting an end edge carry chain;

the FPGA unit detects that the end analog signal is effective, and the edge detection module starts to process the end TTL level signal; outputting end carry chain edge positioning delay data after the edge detection module finishes detecting, storing the end carry chain edge positioning delay data in a register, sending the end carry chain edge positioning delay data to a carry chain counting module for edge detection counting to obtain an end carry chain edge count T1, and stopping counting by coarse clock counting to obtain a coarse clock count N; sending the end carry chain edge count T1 and the coarse clock count N to an upper computer;

step 4, the upper computer receives the uploaded final edge clock number T0, the whole clock carry chain count Tz, the finish carry chain edge count T1 and the rough clock count N, and calculates the high-precision test time through the following formula:

where Ttof denotes the test time and Tclk denotes the clock interval after the PLL has multiplied.

7. The method of adjusting of claim 6, wherein: the network port module is used for sending the final edge clock number T0, the whole clock carry chain count Tz, the end carry chain edge count T1 and the coarse clock count N to an upper computer.

Technical Field

The invention relates to a high-precision signal time interval testing system and method based on an FPGA (field programmable gate array), belonging to the technical field of electronics.

Background

A modern high-precision time measurement system relates to a plurality of application scenes, and mainly comprises TOF (time of flight) cameras, laser ranging and waveform signal testing in the IC field. The test method has two schemes of time measurement based on a special ASIC chip and time measurement based on FPGA, and compared with the two schemes, the special ASIC chip has the characteristics of less channels, high test precision, larger individual difference of the test chip, high chip cost and need of a peripheral input and output circuit, and the test method based on FPGA has the characteristics of low price cost, more support channels, no need of an additional circuit and slightly lower test precision compared with the ASIC chip. In most commercial occasions with low requirements on time testing at the middle and low ends, the FPGA-based time measurement system is widely applied. The main testing method based on FPAG time measurement comprises the steps of time measurement based on high-speed clock number counting, clock counting + PLL phase detection, and clock counting + carry delay chain time measurement. The carry chain is a basic element of the minimum unit at the bottom layer of the FPGA, has the advantages of wide distribution and short scale time, and is widely applied to a time measurement system. When the electric signal is transmitted in the circuit, the influence of temperature change and voltage change is large.

Disclosure of Invention

The purpose of the invention is as follows: in order to solve the problem that the time-measuring delay chain precision is influenced by the environment temperature and the voltage in the prior art, the invention provides the self-adaptive carry delay chain coefficient adjusting system and method based on the FPGA test, which can optimize the influence of the temperature and the voltage on test data in the carry chain test, so that the influence of the temperature and the voltage in the carry chain test system on the time-measuring precision is reduced, and the time-measuring precision of the carry chain is improved.

The technical scheme is as follows: in order to achieve the purpose, the invention adopts the technical scheme that:

the utility model provides a based on FPGA test self-adaptation carry time delay chain coefficient governing system, includes analog-to-digital signal conversion and signal stretching circuit, FPGA unit, data processing module, the FPGA unit includes edge detection module, full clock carry chain module, coarse clock count module, carry chain count module, wherein:

the analog-to-digital signal conversion and signal broadening circuit is used for performing digital-to-analog signal conversion on the initial analog signal, broadening the converted signal to obtain an initial TTL level signal, and sending the obtained initial TTL level signal to the FPGA unit. And the digital-to-analog conversion unit is used for performing digital-to-analog signal conversion on the ending analog signal, widening the converted signal to obtain an ending TTL level signal, and sending the obtained ending TTL level signal to the FPGA unit.

The edge detection module is used for carrying out edge positioning on the initial TTL level signal to obtain initial carry chain edge positioning delay data and sending the initial carry chain edge positioning delay data to the carry chain counting module. And the edge positioning module is used for performing edge positioning on the finished TTL level signal to obtain finished carry chain edge positioning delay data and sending the finished carry chain edge positioning delay data to the carry chain counting module.

And the full-clock carry chain module is used for processing the initial TTL level signal to obtain a full-clock initial TTL level signal when the edge signal detection is finished, and sending the obtained full-clock initial TTL level signal to the carry chain counting module for full-clock detection counting.

The carry chain counting module is used for carrying out edge detection counting according to the initial carry chain edge positioning delay data to obtain a final edge clock number T0, and sending the final edge clock number T0 to the data processing module. And the full clock carry chain counting module is used for carrying out detection counting according to the full clock initial TTL level signal to obtain a full clock carry chain counting Tz and sending the full clock carry chain counting Tz to the data processing module. And the edge detection module is used for performing edge detection counting according to the ending carry chain edge positioning delay data to obtain an ending carry chain edge count T1, and sending the ending carry chain edge count T1 to the data processing module.

And the coarse clock counting module is used for counting the initial TTL level signals when the edge detection module starts to process the initial TTL level signals, stopping counting the finished TTL level signals when the carry chain counting module stops edge detection counting on the finished carry chain edge positioning delay data to obtain a coarse clock count N, and sending the coarse clock count N to the data processing module.

The data processing module is used for receiving the uploaded final edge clock number T0, the whole clock carry chain count Tz, the end carry chain edge count T1 and the rough clock count N, and calculating the high-precision test time through the following formula:

where Ttof denotes the test time and Tclk denotes the clock interval after the PLL has multiplied.

Preferably: the multi-stage carry-in chain cascade connection device comprises a carry-in chain cascade connection module, a carry-in chain module, a D trigger unit and a register, wherein the carry-in chain module comprises more than one carry-in chain, the D trigger unit comprises more than one D trigger, the carry-in chain cascade connection module is used for carrying out cascade connection on the carry-in chain, each carry-in chain is connected with one D trigger, and the D triggers are respectively connected with the register.

Preferably: the carry chain corresponds to the D triggers one by one.

Preferably: the data processing module is an FPGA board or an upper computer.

Preferably: the network port module is used for sending the final edge clock number T0, the whole clock carry chain count Tz, the finish carry chain edge count T1 and the coarse clock count N to the upper computer when the data processing module is the upper computer.

An adaptive carry delay chain coefficient adjusting method based on FPGA test comprises the following steps:

step 1, when a level threshold of an initial analog signal exceeds a set level threshold, judging that the initial analog signal is valid, widening the initial analog signal, inputting the widened signal to an FPGA unit for initial edge carry chain detection, wherein the widened signal is an initial TTL level signal.

And when the FPGA unit detects that the initial analog signal is effective, the edge detection module starts to process the initial TTL level signal, and the coarse clock counting starts to count the initial TTL level signal. And after the edge detection module finishes detection, outputting initial carry chain edge positioning delay data, storing the initial carry chain edge positioning delay data in a register, sending the initial carry chain edge positioning delay data to a carry chain counting module for edge detection counting to obtain a final edge clock number T0, and sending the final edge clock number T0 to an upper computer.

And 2, when the edge signal detection is finished, starting to perform full clock counting detection: and the full-clock carry chain module starts to process the initial TTL level signal, sends the processed initial TTL level signal to the carry chain counting module for full-clock detection counting to obtain a full-clock carry chain count Tz, and sends the full-clock carry chain count Tz to the upper computer.

And 3, when the level threshold of the end analog signal exceeds the set level threshold II, judging that the end analog signal is valid, widening the end analog signal, inputting the widened signal to the FPGA unit to carry out end edge carry chain detection, wherein the widened signal is the end TTL level signal.

And when the FPGA unit detects that the end analog signal is valid, the edge detection module starts to process the end TTL level signal, and the coarse clock counting starts to count the end TTL level signal. And outputting ending carry chain edge positioning delay data after the edge detection module finishes detecting, storing the ending carry chain edge positioning delay data in a register, sending the ending carry chain edge positioning delay data to a carry chain counting module for edge detection counting to obtain ending carry chain edge counting T1, and stopping counting by coarse clock counting to obtain coarse clock counting N. And sending the end carry chain edge count T1 and the coarse clock count N to the upper computer.

Step 4, the upper computer receives the uploaded final edge clock number T0, the whole clock carry chain count Tz, the finish carry chain edge count T1 and the rough clock count N, and calculates the high-precision test time through the following formula:

where Ttof denotes the test time and Tclk denotes the clock interval after the PLL has multiplied.

Preferably: the network port module is used for sending the final edge clock number T0, the whole clock carry chain count Tz, the end carry chain edge count T1 and the coarse clock count N to an upper computer.

Compared with the prior art, the invention has the following beneficial effects:

1. the accuracy coefficient of the carry chain is dynamically adjusted in real time, the time measurement accuracy is greatly improved, and the effect is obviously improved compared with the time measurement system without the real-time measurement system under the scenes of large temperature change and unstable FPGA kernel voltage.

2. The system has low occupation rate of FPGA resources, and in the actual design process, the invention can embed a software module and a hardware minimum system into a system to be measured in a module form.

Drawings

FIG. 1 is a block diagram of a hardware system according to the present invention.

FIG. 2 is a block diagram of an FPGA cell design.

Fig. 3 shows the basic principle of carry chain measurement.

Fig. 4 is a basic design block diagram of the implementation of the carry chain module at the bottom layer.

Detailed Description

The present invention is further illustrated by the following description in conjunction with the accompanying drawings and the specific embodiments, it is to be understood that these examples are given solely for the purpose of illustration and are not intended as a definition of the limits of the invention, since various equivalent modifications will occur to those skilled in the art upon reading the present invention and fall within the limits of the appended claims.

An adaptive carry delay chain coefficient adjusting system based on FPGA test is disclosed, as shown in FIGS. 1 and 2: the device comprises an analog-digital signal conversion and signal broadening circuit, an FPGA unit, a network port module, an upper computer, a carry chain cascade connection module, a carry chain module, a D trigger unit and a register, wherein the FPGA unit comprises an edge detection module, a full clock carry chain module, a coarse clock counting module and a carry chain counting module, and is an FPGA minimum system board and used for realizing carry chain delay time measurement and data transmission. Wherein:

the analog-to-digital signal conversion and signal broadening circuit is used for performing digital-to-analog signal conversion on the initial analog signal, broadening the converted signal to obtain an initial TTL level signal, and sending the obtained initial TTL level signal to the FPGA unit. And the digital-to-analog conversion unit is used for performing digital-to-analog signal conversion on the ending analog signal, widening the converted signal to obtain an ending TTL level signal, and sending the obtained ending TTL level signal to the FPGA unit. The analog-digital signal conversion and signal broadening circuit comprises an analog-digital signal conversion module and a signal broadening module, wherein the analog-digital signal conversion module is used for adapting to various electric signal forms, and the signal broadening module is used for adapting to different signal widths.

The edge detection module is used for carrying out edge positioning on the initial TTL level signal to obtain initial carry chain edge positioning delay data and sending the initial carry chain edge positioning delay data to the carry chain counting module. And the edge positioning module is used for performing edge positioning on the finished TTL level signal to obtain finished carry chain edge positioning delay data and sending the finished carry chain edge positioning delay data to the carry chain counting module.

And the full-clock carry chain module is used for processing the initial TTL level signal to obtain a full-clock initial TTL level signal when the edge signal detection is finished, and sending the obtained full-clock initial TTL level signal to the carry chain counting module for full-clock detection counting. The full clock carry chain module is used for transmitting the carry chain quantity transmitted by a full clock in the same carry chain in real time and calibrating carry chain precision data in real time.

The carry chain counting module is used for carrying out edge detection counting according to the initial carry chain edge positioning delay data to obtain a final edge clock number T0, and sending the final edge clock number T0 to the upper computer through the network port module. And the system is used for detecting and counting according to the full clock initial TTL level signal to obtain a full clock carry chain count Tz and sending the full clock carry chain count Tz to an upper computer through a network port module. And the edge detection and counting module is used for carrying out edge detection and counting according to the end carry chain edge positioning delay data to obtain an end carry chain edge count T1, and sending the end carry chain edge count T1 to the upper computer through the network port module.

And the coarse clock counting module is used for counting the initial TTL level signals when the edge detection module starts to process the initial TTL level signals, stopping counting the finished TTL level signals when the carry chain counting module stops carrying out edge detection counting on the finished carry chain edge positioning delay data to obtain coarse clock counting N, and sending the coarse clock counting N to an upper computer through the network port module.

And the network port transmission module is used for receiving the upper computer instruction and sending the received upper computer instruction to the FPGA unit. And the FPGA unit is used for receiving the delay chain data of the FPGA unit and sending the received delay chain data to the upper computer.

In the test system of the present invention:

time measurement = coarse accuracy time countClock interval + number of signal edge carry chainsPrecision of carry chain

Wherein the content of the first and second substances,

carry chain accuracy = clock interval ÷ number of full clock carry chains.

In order to simplify the FPGA unit design, the invention preferably puts two steps of calculation into the upper computer software, performs data processing by means of a strong and simple mode of the upper computer software, the FPGA is responsible for generating data and transmitting the data, and the FPGA can be realized in the FPGA under the condition of permission of FPGA logic resources if the FPGA has stronger real-time requirements in specific implementation.

The upper computer is used for receiving the final edge clock number T0, the whole clock carry chain count Tz, the end carry chain edge count T1 and the coarse clock count N uploaded by the network port module, and calculating the high-precision test time through the following formula:

where Ttof denotes the test time and Tclk denotes the clock interval after the PLL has multiplied.

And the PC upper computer is used for receiving carry chain time measurement data of the FPGA minimum system version and upper computer software is used for scene simulation and data processing.

As shown in fig. 3, the input signal mainly includes two parts, a start signal T _ start and an end signal T _ stop, the carry chain is to obtain a precise time between the start signal T _ start and the end signal T _ stop, and the amount of time to be measured mainly includes edge signals of the high-precision T _ start and T _ stop, respectively, and a clock interval between the coarse clocks T _ start and T _ stop.

As shown in fig. 4, the carry chain module includes more than one carry chain, the D flip-flop unit includes more than one D flip-flop, the carry chain cascade connection module is configured to cascade-connect carry chains, each carry chain is connected to one D flip-flop, and the carry chains correspond to the D flip-flops one by one. The D flip-flops are respectively connected with the registers. The signal input is directly introduced into a feeding chain, wiring on a signal board is constrained to one chain, and each chain is connected with a primary D trigger and used for recording the state of the D trigger in each clock state.

An adaptive carry delay chain coefficient adjusting method based on FPGA test comprises the following steps:

step 1, when the level threshold of the initial analog signal exceeds a first predetermined level threshold (which can be adjusted by a digital-to-analog conversion module), the initial analog signal is judged to be valid, the initial analog signal is widened, the widening parameter can be adjusted by the circuit resistance-capacitance coefficient of the signal widening module, the widened signal is an initial TTL level signal, and the initial TTL level signal is input to the FPGA unit for initial edge carry chain detection.

And when the FPGA unit detects that the initial analog signal is effective, the edge detection module starts to process the initial TTL level signal, and the coarse clock counting starts to count the initial TTL level signal. And after the edge detection module finishes detection, outputting initial carry chain edge positioning delay data, storing the initial carry chain edge positioning delay data in a register, sending the initial carry chain edge positioning delay data to a carry chain counting module for edge detection counting to obtain a final edge clock number T0, and sending the final edge clock number T0 to an upper computer through a network port module.

Step 2, when the detection of the initial edge signal carry chain is finished, at this time, because the signal is widened, the widening period is far greater than the whole clock period, so when the detection of the edge signal is finished, the full clock counting detection is started: and the full-clock carry chain module starts to process the initial TTL level signal, sends the processed initial TTL level signal to the carry chain counting module for full-clock detection counting to obtain a full-clock carry chain count Tz, and sends the full-clock carry chain count Tz to the upper computer through the network port module. The full clock carry chain counting and the edge signal carry chain counting are the same module and are used at different times. The carry chain generation and detection method of full clock count detection is consistent with edge signal carry chain detection.

And 3, when the level threshold of the ending analog signal exceeds a second predetermined level threshold (the second predetermined level threshold can be adjusted by the digital-to-analog conversion module), judging that the ending analog signal is valid, widening the ending analog signal, adjusting the widening parameters by the circuit resistance-capacitance coefficient of the signal widening module, inputting the widened signal to the FPGA unit to perform ending edge carry chain detection, wherein the widened signal is an ending TTL level signal.

And when the FPGA unit detects that the end analog signal is effective, the edge detection module starts to process the end TTL level signal. And outputting ending carry chain edge positioning delay data after the edge detection module finishes detecting, storing the ending carry chain edge positioning delay data in a register, sending the ending carry chain edge positioning delay data to a carry chain counting module for edge detection counting to obtain ending carry chain edge counting T1, and stopping counting by coarse clock counting to obtain coarse clock counting N. And sending the ending carry chain edge count T1 and the coarse clock count N to an upper computer through the network port module.

Step 4, the upper computer receives the final edge clock number T0, the whole clock carry chain count Tz, the end carry chain edge count T1 and the coarse clock count N uploaded by the network port module, and the clock interval Tclk after the known FPGA software is subjected to PLL frequency multiplication, and calculates the high-precision test time through the following formula:

where Ttof denotes the test time and Tclk denotes the clock interval after the PLL has multiplied.

And the upper computer performs scene simulation according to the obtained result.

The carry time delay optimization method has a very obvious effect on improving the time test precision. Especially, in some scenes with severe environment, the effect is more obvious. The method is very suitable for scenes with high requirements on time precision. The carry chain is influenced by temperature and voltage variation fluctuation in the transmission process. In the conventional chain delay test, to obtain high-precision test data, the influence of temperature and voltage needs to be reduced, external heating control equipment is needed, and the design of a voltage stabilizing circuit needs to be more precise. Compared with the traditional method for testing the carry chain delay based on the FPGA, the method has the characteristics of higher precision time measurement, less increase of resource use, low dependence on an external environment, wider use scene and the like.

The above description is only of the preferred embodiments of the present invention, and it should be noted that: it will be apparent to those skilled in the art that various modifications and adaptations can be made without departing from the principles of the invention and these are intended to be within the scope of the invention.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:进行刻度指示的无指针式电子表装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!