Let's take a look at the Zynq SoC PS/PL interface introduced in the previous section. I created a very simple peripheral using the DSP48E1 DSP logic, which relies on the control word in the first register of this peripheral to perform multiplication. Addition or subtraction. Suppose we need to perform more complex calculations within Zynq for an industrial control system. Typically, these systems will generate multiple analog inputs (via the ADC) through thermistors, thermocouples, pressure sensors, platinum resistance thermometers (PRTs), and more.
Data from these sensors needs to be processed through multiple conversion functions to convert raw data values ​​from the ADC into data that can be calculated in the next step. The best example of this is the use of the Zynq XADC, which contains some internal functions/macro in the XADCPS.h file that converts the raw XADC values ​​into voltage or temperature. However, these conversions are very simple. The more complex the conversion, the longer Zynq will take. If the Zynq SoC's Programmable Logic (PL) is used to perform calculations, the computational speed can be greatly accelerated. Another benefit is that the processor frees up space and can perform other software tasks, which significantly improves processing bandwidth when using PL for calculations.
The more complex the transfer function, the longer the processor spends calculating results. For example, convert atmospheric pressure (in mbar) to altitude (in meters) (see my blog post on Xcell Journal Issue 80 - "FPGA Mathematical Basis"). The following conversion functions list the altitudes in 0-10 mbar (in meters):
Using the Zynq SoC processing system (PS) Zynq, according to the following line of code, it is very simple to execute this conversion function, where the "result" is a floating point number; the a, b, and c defined in the conversion function are constants; and i is the input value:
In this example I will use the above nested code to simulate the input values ​​in a "for" loop statement. The code outputs the result through STDOUT. Since I want to calculate the time to perform this calculation, I will use a dedicated timer to determine the calculation time, turn on the timer when starting the calculation, and turn off the timer when the calculation is finished:
While this code may not provide the most accurate time benchmark, it is enough to illustrate the subject we will study in the next few blogs. Running the above code on a Zynq MicroZed board, I get the following results in a terminal window. Note: Since I have formatted the STDOUT results, I can extract this output into Microsoft Excel as a comma-separated variable (CSV) file:
A simple analysis of the output shows that the calculation results require an average of 25 CPU_3x2x clock cycles. The result is not bad. Using a 666 MHz processor clock, this calculation took 76 nanoseconds. I believe many people find that the ADC output is not a floating point number, it is a fixed number of points. Rewriting the function code with an integer function yields a similar average number of clock cycles. But I think in this example, floating point numbers are easier to use and avoid explaining the subject behind the fixed point system.
Determine a reference time, how long does it take for Zynq PS to perform a moderately complex conversion function, and then we can look at the time it takes to calculate the same function when we offload this calculation to the PL side of the device.
Zro2 Ceramics,Zro2 Ceramic Rod,Zro2 Ceramic Plate,Ceramic Parts
Yixing Guangming Special Ceramics Co.,Ltd , https://www.yxgmtc.com