From 6a52e44d09afeadc7727f9a0cc9ebe405469360e Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 8 Apr 2012 18:06:22 +0200 Subject: [PATCH] fhdl: support len() on signals --- migen/fhdl/structure.py | 3 +++ 1 file changed, 3 insertions(+) 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) -- 2.30.2