[libre-riscv-dev] [Bug 173] dynamic partitioned "shift"

bugzilla-daemon at libre-riscv.org bugzilla-daemon at libre-riscv.org
Fri Feb 14 15:49:37 GMT 2020


http://bugs.libre-riscv.org/show_bug.cgi?id=173

--- Comment #25 from Michael Nolan <mtnolan2640 at gmail.com> ---
I did something similar (I think?) to your description/python code, but broken
up into a couple parts

I first created a table of n partial results like so:

# calculate shift amounts - 
s[0] = b[i]
s[i] = Mux(gates[i-1], b[i], s[i-1]) 

r[i] = a[i] << s[i] for i in range(n)

Then I calculated the results by:

o[0] = r[0]
o[1] = r[1] | Mux(gates[0], 0, r[0])
o[2] = r[2] | Mux(gates[1], 0, Mux(gates[0], 0, r[0]))
etc.

This reduced the gate count from 8k gates for a 64x8 shifter, to 1.7k, and I
think I can do a bit better.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-riscv-dev mailing list