fhdl: len() for Constant
This commit is contained in:
parent
8c169a99df
commit
9cdc88eadf
|
@ -134,6 +134,9 @@ class Constant(Value):
|
||||||
self.bv = bv or BV(bits_for(n), n < 0)
|
self.bv = bv or BV(bits_for(n), n < 0)
|
||||||
self.n = n
|
self.n = n
|
||||||
|
|
||||||
|
def __len__(self):
|
||||||
|
return self.bv.width
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return str(self.bv) + str(self.n)
|
return str(self.bv) + str(self.n)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue