02-03-2021 01:25 PM
Hello Community,
I used FPGA C API generator to export a header file, but it didn't show any message about the function called
(FPGA VI NAME)_IndiciatorCluster_UnpackCluster
(FPGA VI NAME)_IndiciatorCluster_PackCluster
what would those functions do and how would they be different?
Solved! Go to Solution.
02-04-2021 11:25 PM
When a cluster is instantiated on the FPGA it is "packed". There are no padding bits because alignment doesn't matter on the FPGA.
We choose to represent clusters in C as structs. Structs are padded and alignment of members can differ on different architectures.
The unpack and pack functions let you convert between the FPGA representation and the C representation. When reading a cluster indicator from the FPGA you'll read it as the FPGA representation and convert it to a C struct to access the data in it.
C -> packCluster -> FPGA
FPGA -> unpackCluster -> C