back.rtlil: explicitly pad constants with zeroes.
I'm not sure what exactly RTLIL does when a constant isn't as long as its bit width, and there's no reason to keep the ambiguity.
This commit is contained in:
parent
221f108fbe
commit
6672ab2e3f
|
@ -353,7 +353,7 @@ class _RHSValueCompiler(_ValueCompiler):
|
||||||
if isinstance(value.value, str):
|
if isinstance(value.value, str):
|
||||||
return "{}'{}".format(value.nbits, value.value)
|
return "{}'{}".format(value.nbits, value.value)
|
||||||
else:
|
else:
|
||||||
return "{}'{:b}".format(value.nbits, value.value)
|
return "{}'{:0{}b}".format(value.nbits, value.value, value.nbits)
|
||||||
|
|
||||||
def on_Signal(self, value):
|
def on_Signal(self, value):
|
||||||
wire_curr, wire_next = self.s.resolve(value)
|
wire_curr, wire_next = self.s.resolve(value)
|
||||||
|
|
Loading…
Reference in a new issue