10-07-2015 01:52 PM
Hello,
I'm using an sbRIO-9651 (Zynq) which has the ability to process float (SGL) data type. We have developped an IP which uses float (SGL) as inputs and outputs. Why when it comes to define the I/O's datatype of the CLIP node we don't have the choice of selecting "SGL" datatype?
How should I pass my "SGL" values to my CLIP?
Thanks,
Michel
10-07-2015 02:03 PM
You can try using a fixed point data type then once you've pulled it into LV as a fixed point number, convert it to the SGL precsion value that it actually represents. You may need to go through a few intermediary steps to convert it (like converting the FXP to a boolean array then converting the boolean array back to a SGL), but it seems like that should work.
10-07-2015 02:03 PM
There is not a direct way to do this. Instead, you'll need to set the input to I32 or U32 (or some other 32-bit type) and cast the Single value to/from that integer type on each side (and inside your IP).
You'll find an example of doing the cast here, http://forums.ni.com/t5/LabVIEW/Flatten-floating-point-on-FPGA-for-multichannel-DMA/m-p/2576179#M776..., since there are no cast operations on Single supported by LabVIEW FPGA yet.
10-07-2015 02:06 PM
Is this something planned in future LabVIEW FPGA version?
I don't think I need to typecast on the IP side. I will post a simple example shortly.
Michel
10-08-2015 07:10 AM
Here's an example we did to demonstrate the use of SGL inside an IP we made with Vivado HLS. Passing in data and out data as U32 and no need to typecast on the IP side. Again, it would be nice to have the SGL available in the CLIP configuration.
Vivado HLS code
#include "inc/HLSLaviewIntegration.hpp" void HLSLaviewIntegration(float inFirstOperand, float inSecondOperand, float* outResult) { #pragma HLS INTERFACE ap_vld port=inFirstOperand #pragma HLS INTERFACE ap_vld port=inSecondOperand #pragma HLS INTERFACE ap_vld port=outResult
*outResult = inFirstOperand*inSecondOperand; }
LabVIEW FPGA code:
If we typecast the inFirstOperand and inSecondOperand to U32 and typecast the outResult to SGL, the result is valid so no need to typecast in the IP.
Best regards,
Michel