projects
/
litex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4adac90
)
soc/doc/csr: allow CSRField.reset to be a Migen Constant.
author
Florent Kermarrec
<florent@enjoy-digital.fr>
Mon, 23 Mar 2020 17:47:41 +0000
(18:47 +0100)
committer
Florent Kermarrec
<florent@enjoy-digital.fr>
Mon, 23 Mar 2020 17:47:41 +0000
(18:47 +0100)
litex/soc/doc/csr.py
patch
|
blob
|
history
diff --git
a/litex/soc/doc/csr.py
b/litex/soc/doc/csr.py
index 2e7a1bc2b078782cf87fbabc584287528374f2ac..22e14963a4d99fb546f92ab0e86d612ad818fac5 100644
(file)
--- 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, "