LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA: When defining CLIP I/O data type SGL not available?

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?

 

DefineClipIOType.jpg

 

Thanks,

 

Michel

0 Kudos
Message 1 of 5
(3,598 Views)

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. 

0 Kudos
Message 2 of 5
(3,585 Views)

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.

0 Kudos
Message 3 of 5
(3,583 Views)

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

0 Kudos
Message 4 of 5
(3,572 Views)

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.

HlsLabVIEW.png

 

Best regards,

 

Michel

0 Kudos
Message 5 of 5
(3,531 Views)