LabVIEW FPGA Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
crossrulz

Allow Type Cast in FPGA

Status: New

We need a way to simply reinterpret the bits in our FPGAs.  I currently have a situation where I need to change my SGL values into U32 for the sake of sending data up to the host.  Currently, the only way is to make an IP node.  That is just silly.  We should be able to use the Type Cast simply for the purpose of reinterpreting the bits.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
13 Comments
Intaris
Proven Zealot

Never mind, just re-read the OP. Move along, nothing to see here.

raphschru
Active Participant

An incredibly useful case of application for this "FPGA Type Cast" would be to flatten/unflatten a complex cluster into/from a fixed-size byte array for sending via TargetToHost/HostToTarget DMA FIFO. Currently this has to be done manually with lots of primitives.

 

Also, the argument that "high-level implementations are often inefficient, this would consume FPGA space at the expense of coding convenience." is false because reinterpreting the bits is purely a wiring operation and thus consumes no FPGA resource.

j_medland_css
Member

I am just dropping by to say that for the specific example of converting a SGL to a unsigned 32-bit value is available in the NI Floating Point Toolkit.

NI LabVIEW FPGA Floating-Point Library Toolkit for LabVIEW - Download - VIPM by JKI

Being able to cast between numeric types of equal numbers of bits would still be handy generally and why is this toolkit not just installed with LabVIEW FPGA nowadays (only checked up to 2023 Q3 so maybe it is now in the FPGA module)