fhdl/structure: binary constant builder
This commit is contained in:
parent
504a169afb
commit
629e771fc0
|
@ -127,6 +127,9 @@ class Constant(Value):
|
|||
def __eq__(self, other):
|
||||
return self.bv == other.bv and self.n == other.n
|
||||
|
||||
def binc(x, signed=False):
|
||||
return Constant(int(x, 2), BV(len(x), signed))
|
||||
|
||||
def _cst(x):
|
||||
if isinstance(x, int):
|
||||
return Constant(x)
|
||||
|
|
Loading…
Reference in New Issue