diff --git a/litex/soc/doc/csr.py b/litex/soc/doc/csr.py index 2e7a1bc2b..22e14963a 100644 --- a/litex/soc/doc/csr.py +++ b/litex/soc/doc/csr.py @@ -242,8 +242,12 @@ class DocumentedCSRRegion: for field in reg.fields: field_name = field.name attr_str = "" - if field.reset_value != 0: - attr_str = "\"attr\": '" + str(field.reset_value) + "', " + if isinstance(field.reset_value, Constant): + 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 = "" if field.pulse: type_str = "\"type\": 4, "