currently to transmit a float, we convert float -> fixed -> int32_t when we receive the value, we convert int32_t -> fixed -> float. this is because Vivado HLS doesn't correctly support unions with float and int. this is bad because:
a) results in precision lost every time we convert between float/fixed
b) wasted DSPs + LUTs for the conversion
currently to transmit a float, we convert float -> fixed -> int32_t when we receive the value, we convert int32_t -> fixed -> float. this is because Vivado HLS doesn't correctly support unions with float and int. this is bad because: a) results in precision lost every time we convert between float/fixed b) wasted DSPs + LUTs for the conversion
there is a workaround: https://forums.xilinx.com/t5/High-Level-Synthesis-HLS/Vivado-HLS-2013-1-workaround-for-unsupported-pointer/td-p/330235
basically, we need to make it something like this void unicast_send(float f, hls::stream & out) {
pragma HLS INLINE
}
void unicast_recv(float &f, hls::stream & in) {
pragma HLS INLINE
}