Commit 629e771f authored by Sebastien Bourdeauducq's avatar Sebastien Bourdeauducq
Browse files

fhdl/structure: binary constant builder

parent 504a169a
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment