fhdl: cleanup value bv
This commit is contained in:
parent
0e8d894a35
commit
82f77180d5
|
@ -19,9 +19,6 @@ class BV:
|
||||||
return r
|
return r
|
||||||
|
|
||||||
class Value:
|
class Value:
|
||||||
def __init__(self, bv):
|
|
||||||
self.bv = bv
|
|
||||||
|
|
||||||
def __add__(self, other):
|
def __add__(self, other):
|
||||||
return Operator("+", [self, other])
|
return Operator("+", [self, other])
|
||||||
def __radd__(self, other):
|
def __radd__(self, other):
|
||||||
|
@ -98,10 +95,7 @@ class Cat(Value):
|
||||||
|
|
||||||
class Constant(Value):
|
class Constant(Value):
|
||||||
def __init__(self, n, bv=None):
|
def __init__(self, n, bv=None):
|
||||||
if bv == None:
|
self.bv = bv or BV(BitsFor(n))
|
||||||
Value.__init__(self, BV(BitsFor(n)))
|
|
||||||
else:
|
|
||||||
Value.__init__(self, bv)
|
|
||||||
self.n = n
|
self.n = n
|
||||||
|
|
||||||
def _cst(x):
|
def _cst(x):
|
||||||
|
@ -112,7 +106,6 @@ def _cst(x):
|
||||||
|
|
||||||
class Signal(Value):
|
class Signal(Value):
|
||||||
def __init__(self, bv=BV(), name="anonymous", variable=False, reset=0):
|
def __init__(self, bv=BV(), name="anonymous", variable=False, reset=0):
|
||||||
Value.__init__(self, bv)
|
|
||||||
self.bv = bv
|
self.bv = bv
|
||||||
self.variable = variable
|
self.variable = variable
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
Loading…
Reference in New Issue