soc/doc/csr: allow CSRField.reset to be a Migen Constant.
This commit is contained in:
parent
4adac90d88
commit
d62ef38c4b
|
@ -242,8 +242,12 @@ class DocumentedCSRRegion:
|
||||||
for field in reg.fields:
|
for field in reg.fields:
|
||||||
field_name = field.name
|
field_name = field.name
|
||||||
attr_str = ""
|
attr_str = ""
|
||||||
if field.reset_value != 0:
|
if isinstance(field.reset_value, Constant):
|
||||||
attr_str = "\"attr\": '" + str(field.reset_value) + "', "
|
field_reset_value = field.reset_value.value
|
||||||
|
else:
|
||||||
|
field_reset_value = field.reset_value
|
||||||
|
if field_reset_value != 0:
|
||||||
|
attr_str = "\"attr\": '" + str(field_reset_value) + "', "
|
||||||
type_str = ""
|
type_str = ""
|
||||||
if field.pulse:
|
if field.pulse:
|
||||||
type_str = "\"type\": 4, "
|
type_str = "\"type\": 4, "
|
||||||
|
|
Loading…
Reference in New Issue