Permalink
Browse files

fhdl: support len() on signals

  • Loading branch information...
1 parent b9c533b commit 6a52e44d09afeadc7727f9a0cc9ebe405469360e @sbourdeauducq sbourdeauducq committed Apr 8, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 migen/fhdl/structure.py
View
@@ -157,6 +157,9 @@ def __init__(self, bv=BV(), name=None, variable=False, reset=0, name_override=No
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)

0 comments on commit 6a52e44

Please sign in to comment.