LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is myRIO high throughput math used for?

Hello all,

 

I've been learning myRIO, and I've come upon the "High Throughput Math" template within the "FPGA Math and Analysis" template, but I am confused at what it is for. Am I correct that since the FPGA struggles with floating point mathematics, then by converting your numeric data into fixed-point data beforehand the FPGA can more-easily handle the numbers?

 

Even if I'm correct about what is above, I'm still unsure about when I should use these math functions. And on a slightly different note, what does writing a To Fixed Point converter to have a Type equal to 0 imply?

 

- Thank you

 

0 Kudos
Message 1 of 10
(1,885 Views)

The divide primitive does not run in the SCTL. High throughput divide does. Do you use single cycle timed loops? What are your throughput requirements? 

 

FPGAs do not struggle with floating point, there is a floating point library for LabVIEW FPGA. All are digital integrated circuits with the same restrictions. From another perspective, CPUs struggle with flexibility in datatypes which are not 8, 16, 32, or 64 bits. Depends on your perspective. If I have a 24 bit number CPUs and GPUs will round it up and waste logic and energy. FPGAs will use 24 bits to get the job done with the resources needed.

 

Given the above, fixed point is like integer math in terms of timing, resources, and energy. 


Certified LabVIEW Architect, Certified Professional Instructor
ALE Consultants

Introduction to LabVIEW FPGA for RF, Radar, and Electronic Warfare Applications
0 Kudos
Message 2 of 10
(1,850 Views)

Writing a To Fixed Point converter is for converting to a fixed point number. The constant has to be set a specific fixed point number. I recommend reading more about the help for this function. 


Certified LabVIEW Architect, Certified Professional Instructor
ALE Consultants

Introduction to LabVIEW FPGA for RF, Radar, and Electronic Warfare Applications
0 Kudos
Message 3 of 10
(1,846 Views)

Hello Terry,

 

Thank you for the information regarding the divide primitive and High Throughput. After further research, I saw that High Throughput documentation stated Universal single-cycle Timed Loop support, but I the light bulb didn't go off. I do use some single cycle timed loops, but I am unsure of my throughput requirements at the moment. Does it refer to a constraint of the SCTL, such as the FPGA Clock Rate?

 

As for the floating points, that was my mistake. Thank you for correcting me on it. The information about fixed-point being like integer math in terms of computational effort is a great thing to remember.

 

0 Kudos
Message 4 of 10
(1,787 Views)

What is the input data rate?  That should help figure out throughput requirements.  Once you know that you can check samples per cycle where if it is 1 then your clock cycle equals the throughput samples per second.  If samples per cycle is 2 then clock rate can be 1/2 of the throughput.


Certified LabVIEW Architect, Certified Professional Instructor
ALE Consultants

Introduction to LabVIEW FPGA for RF, Radar, and Electronic Warfare Applications
0 Kudos
Message 5 of 10
(1,782 Views)

A SCTL is indeed tied to the configured clock rate for this loop. Everything inside the SCTL must be able to execute within a single clock cycle and the FPGA compiler will check that that is the case.

Each logic function has some delay as the electrical signal passes from the input to the output an the combination of all the logic circuits that form a path inside the loop have a combined execution time that is the sum of all those delays in the longest path. The compiler knows what delay each logic function has, calculates all the delays for each individual path and makes sure that the longest such path takes less time than a single cycle has. If it finds that even one single logic path violates this timing constraint by as much as a fraction of a nano second, the compilation fails with a timing constraint error.

 

The normal math functions are not programmed to have a constant execution time, and especially floating point math requires the use of internal loops whose execution time can vary depending on the values to process. Such code cannot be precalculate in terms of exact execution time, since it will depend on the actual numeric value at runtime, how long the calculation will take. Therefore inclusion of these nodes in a SCTL is not allowed as the timing constraint of the SCTL might be violated at runtime without a sure and reasonable way to determine that at compile time.

 

The high throughput math functions are implemented in a way that is efficient to include in the FPGA fabric and deterministic too, and their execution time is short although they often use pipelining to perform the operation in a very short timeslot. Pipelining however does require the loop to execute several times before the result from one input arrives at the output, but it still processes one new value in every iteration, there simply is an inherent delay for the reaction to a specific input stimulus.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 10
(1,761 Views)

The data is obtained through a DMA FIFO, so I believe that the input data rate is 1. Is this the correct logic? I'm assuming that there is a single Read from the FIFO each Cycle.

0 Kudos
Message 7 of 10
(1,746 Views)

Hello rolfk,

 

This explanation of the High Throughput Math functions in regards to the delays associated with their computations makes sense.

 

It seems to me that the High Throughput Math functions are able to convey to the FPGA SCTL how long they will take to compute beforehand. Thus, the FPGA knows whether it will be able to fit it in the clock cycle. For normal math functions, however, different inputs can result in different computation times, and the FPGA SCTL doesn't like that ambiguity. Is this correct?

0 Kudos
Message 8 of 10
(1,744 Views)

@ExactPlace441 wrote:

Hello rolfk,

 

This explanation of the High Throughput Math functions in regards to the delays associated with their computations makes sense.

 

It seems to me that the High Throughput Math functions are able to convey to the FPGA SCTL how long they will take to compute beforehand. Thus, the FPGA knows whether it will be able to fit it in the clock cycle. For normal math functions, however, different inputs can result in different computation times, and the FPGA SCTL doesn't like that ambiguity. Is this correct?


For a technical discussion this is a bit a vague definition but for the purpose of explaining it to a non-technician this is  fairly accurate.

 

As to your other question you asked before, I really don't understand what you try to say there. It doesn't depend if the data comes from a DMA FIFO or a digital or analog IO. The data rate, if you take one sample per iteration (this isn't a strict requirement I have loops that run at a higher rate and only process one sample every 4th iteration for instance, and other loops that process two or more samples in parallel per iteration) is whatever the loop interval produces. A loop running at 40MHz and processing one sample per iteration will obviously have a datarate of 40M Samples per second, not 1 (what?) as you state.

Rolf Kalbermatter
My Blog
0 Kudos
Message 9 of 10
(1,736 Views)

Me saying 1 was simply me misunderstanding the context. I thought that since the data was read once in the SCTL, that that was a rate of 1 per SCTL, thus 1. The reason that I brought up the DMA FIFO specifically is that I thought that since it is first-in, first-out, that there would be a single value read from it.

 

I'm still learning the ideas, so you catching this misunderstanding that I had helps. Thank you.

0 Kudos
Message 10 of 10
(1,686 Views)