mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
fhdl: forbid zero-length signals
This commit is contained in:
parent
86f852a5f1
commit
29ed3918cc
1 changed files with 2 additions and 1 deletions
|
@ -262,7 +262,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
|
||||||
assert(isinstance(self.nbits, int))
|
if not isinstance(self.nbits, int) or self.nbits <= 0:
|
||||||
|
raise ValueError("Signal width must be a strictly positive integer")
|
||||||
|
|
||||||
self.variable = variable # deprecated
|
self.variable = variable # deprecated
|
||||||
self.reset = reset
|
self.reset = reset
|
||||||
|
|
Loading…
Reference in a new issue