So here's my use-case. I want to replace some bits within an UInt. UInt's are immutable(which is good!), so I have to create a new UInt from the old UInt.
When I try to do this with UInt's that can't express zero width integers, I get iffy (lots of conditional code) code...
offset - offset of bits to replace. [0, width>
width - width of bits to replace. [1, width]
// not iffy, but it's a bit of an eyesore with the VecInit()...
val s = bits.asBools()
bits = VecInit(
(s.slice(0, offset) ++
data(i)
.asBools() ++
s.slice(offset + width, bits.getWidth))
).asUInt()
The above code is sloooow to elaborate... I tried with 1024 bits and it times out...