16 #ifndef ONE_HOT_TO_BIN_H
17 #define ONE_HOT_TO_BIN_H
19 #include <nvhls_types.h>
46 template <
unsigned OneHotLen,
unsigned BinLen>
50 #pragma hls_unroll yes
51 for (
unsigned bin = 0; bin < BinLen; bin++) {
55 #pragma hls_unroll yes
56 for (
unsigned bit = 0; bit < OneHotLen; bit++) {
61 tmp = (tmp & one_hot_in);
65 #pragma hls_unroll yes
66 for (
unsigned i = 0; i < OneHotLen; i++) {
67 bit_tmp = bit_tmp | tmp[i];
71 bin_out[bin] = bit_tmp;
NVUINTW(Wrapped< T >::width) TypeToNVUINT(T in)
Convert Type to NVUINT.
void one_hot_to_bin(const NVUINTW(OneHotLen) &one_hot_in, NVUINTW(BinLen) &bin_out)
One hot to binary conversion.