/ src / hal / components / bitslice.comp
bitslice.comp
 1  component bitslice "Converts an unsigned-32 input into individual bits";
 2  description """This component creates individual bit-outputs for each bit of an
 3  unsigned-32 input. The number of bits can be limited by the "personality"
 4  modparam.
 5  The inverse process can be performed by the weighted_sum HAL component.""";
 6  pin in u32 in "The input value";
 7  pin out bit out-##[32:personality];
 8  author "Andy Pugh";
 9  license "GPL2+";
10  function _ nofp;
11  option personality yes;
12  ;;
13  int i;
14  for (i = 0; i < personality ; i++){
15  out(i) = (in >> i)&1;
16  }