Commit 8a1081ed authored by Ben Reynwar's avatar Ben Reynwar Committed by Sébastien Bourdeauducq
Browse files

Set the width and signedness of the reset value.

parent e8803c99
...@@ -334,6 +334,8 @@ class Signal(_Value): ...@@ -334,6 +334,8 @@ class Signal(_Value):
self.nbits, self.signed = bits_sign self.nbits, self.signed = bits_sign
else: else:
self.nbits, self.signed = bits_sign, False self.nbits, self.signed = bits_sign, False
if isinstance(reset, (bool, int)):
reset = Constant(reset, (self.nbits, self.signed))
if not isinstance(self.nbits, int) or self.nbits <= 0: if not isinstance(self.nbits, int) or self.nbits <= 0:
raise ValueError("Signal width must be a strictly positive integer") raise ValueError("Signal width must be a strictly positive integer")
if attr is None: if attr is None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment