Closed
Description
Issue by Maykeye
Friday Jan 03, 2020 at 07:19 GMT
Originally opened as m-labs/nmigen#292
I have an unsigned signal. I want to compare it as signed for a change and now there are no good explicit way to do it.
-
I can make new
Signal(signed(old.width))
andeq
uate it to the old one, but in order to do so, I must place all such signals in the beginning of elaborate: if I create a copy somewhere in the middle likewith m.If(en): comb+= make_signed_copy(n)<10
, generator will not be able to generatewire[31:0] signed_n = n
, instead it will createreg
ister because if if-branch is not executed, signed_n is not being written -
There's implicit conversion: I can use
-(-n)
, and rely on optimizers down the road, but it feels hacky.