soc/interconnect/csr/CSRConstant: Add constant attribute.
This commit is contained in:
parent
4a5ce77d40
commit
be23a059ff
|
@ -63,13 +63,14 @@ class CSRConstant(DUID):
|
||||||
DUID.__init__(self)
|
DUID.__init__(self)
|
||||||
self.value = Constant(value, bits_sign)
|
self.value = Constant(value, bits_sign)
|
||||||
self.name = get_obj_var_name(name)
|
self.name = get_obj_var_name(name)
|
||||||
|
self.constant = value
|
||||||
if self.name is None:
|
if self.name is None:
|
||||||
raise ValueError("Cannot extract CSR name from code, need to specify.")
|
raise ValueError("Cannot extract CSR name from code, need to specify.")
|
||||||
|
|
||||||
def read(self):
|
def read(self):
|
||||||
"""Read method for simulation."""
|
"""Read method for simulation."""
|
||||||
yield
|
yield
|
||||||
return self.value.value
|
return self.constant
|
||||||
|
|
||||||
# CSR ----------------------------------------------------------------------------------------------
|
# CSR ----------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue