I\'m trying to create a reusable barrel shifter; it takes an input array of bits and shifts them a certain number of positions (determined by another input). I want to parameter
You can use the math library to calculate log2 and ceil of the logarit result to declare the size of SHIFT_CNT.
use IEEE.math_real.all;
or specific functions
use IEEE.math_real."ceil";
use IEEE.math_real."log2";
For example you want to calculate clog2 of value a
result := integer(ceil(log2(real(a))));
If you just use these function to calculate paramater, your code is synthesizable (I did it).
If you don't want use it in entities, you can declare them in a library or generic with these functions.