From: Sebastien Bourdeauducq Date: Fri, 18 Apr 2014 13:01:50 +0000 (+0200) Subject: fhdl: forbid zero-length signals X-Git-Tag: 24jan2021_ls180~2099^2~361 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=29ed3918cce98bb1a53536f0f452f0944be7edba;p=litex.git fhdl: forbid zero-length signals --- diff --git a/migen/fhdl/structure.py b/migen/fhdl/structure.py index c2268428..7ab42545 100644 --- a/migen/fhdl/structure.py +++ b/migen/fhdl/structure.py @@ -262,7 +262,8 @@ class Signal(Value): self.nbits, self.signed = bits_sign else: 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.reset = reset