Forum Discussion
Altera_Forum
Honored Contributor
10 years ago --- Quote Start --- Quartus should implement multi-level logic with 2048:1024, 1024:512, 512:256 etc.. to get acceptable performance. I filled an SR. It seem that function right_shift isn't optimized to handle these large cases. Instantiating MUX manually with code like http://www.ece.ualberta.ca/~elliott/ee552/studentappnotes/2003_w/components/barrel_shifter/ works well and compile time is under 2 min with good performance (200 MHz on Stratix IV C2, 100 MHz on Cyclone V C8) --- Quote End --- Quartus implemented what is was told to ... The shift_right() function in ieee.numeric_std is rather naively 'straightforward' coded:
RESULT(ARG_L downto COUNT) := XARG(ARG_L-COUNT downto 0); This will probably expand in an exponential manner. For a 1024 shifter you will have 1024 * 1024 to 1' muxes, as Rysc hinted. If you want a barrel shifter, you will have to code one yourself. A 1024 barrel shifter will have 10 * 1024 * '2 to 1' muxes, which it evidently a lot less to handle by Quartus.