Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fhdl: len() for Constant

  • Loading branch information...
commit 9cdc88eadff3581b4685f99edc5f901f6cf15f77 1 parent 8c169a9
@sbourdeauducq sbourdeauducq authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  migen/fhdl/structure.py
View
3  migen/fhdl/structure.py
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.