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)
|
||||
self.value = Constant(value, bits_sign)
|
||||
self.name = get_obj_var_name(name)
|
||||
self.constant = value
|
||||
if self.name is None:
|
||||
raise ValueError("Cannot extract CSR name from code, need to specify.")
|
||||
|
||||
def read(self):
|
||||
"""Read method for simulation."""
|
||||
yield
|
||||
return self.value.value
|
||||
return self.constant
|
||||
|
||||
# CSR ----------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
Loading…
Reference in New Issue