You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)) and equate 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 like with m.If(en): comb+= make_signed_copy(n)<10, generator will not be able to generate wire[31:0] signed_n = n, instead it will create register 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.
The text was updated successfully, but these errors were encountered:
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 writtenThere's implicit conversion: I can use
-(-n)
, and rely on optimizers down the road, but it feels hacky.The text was updated successfully, but these errors were encountered: