From: Sebastien Bourdeauducq Date: Sun, 8 Apr 2012 16:06:22 +0000 (+0200) Subject: fhdl: support len() on signals X-Git-Tag: 24jan2021_ls180~2099^2~951 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6a52e44d09afeadc7727f9a0cc9ebe405469360e;p=litex.git fhdl: support len() on signals --- diff --git a/migen/fhdl/structure.py b/migen/fhdl/structure.py index c8517270..b4fb44af 100644 --- a/migen/fhdl/structure.py +++ b/migen/fhdl/structure.py @@ -157,6 +157,9 @@ class Signal(Value): self.reset = Constant(reset, bv) self.name_override = name_override self.backtrace = tracer.trace_back(name) + + def __len__(self): + return self.bv.width def __hash__(self): return id(self)