mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
fhdl: len() for Constant
This commit is contained in:
parent
8c169a99df
commit
9cdc88eadf
1 changed files with 3 additions and 0 deletions
|
@ -134,6 +134,9 @@ class Constant(Value):
|
|||
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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue