Permalink
Browse files

fhdl: len() for Constant

  • Loading branch information...
sbourdeauducq committed Jul 13, 2012
1 parent 8c169a9 commit 9cdc88eadff3581b4685f99edc5f901f6cf15f77
Showing with 3 additions and 0 deletions.
  1. +3 −0 migen/fhdl/structure.py
View
@@ -134,6 +134,9 @@ def __init__(self, n, bv=None):
self.bv = bv or BV(bits_for(n), n < 0)
self.n = n
+ def __len__(self):
+ return self.bv.width
+
def __repr__(self):
return str(self.bv) + str(self.n)

0 comments on commit 9cdc88e

Please sign in to comment.