Skip to content

Commit

Permalink
Merge pull request #990 from riscv/tdata1
Browse files Browse the repository at this point in the history
Fix tdata1 having duplicate register diagrams
  • Loading branch information
rtwfroody authored Mar 22, 2024
2 parents 252be0b + c6b2a62 commit a054e56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 25 deletions.
9 changes: 5 additions & 4 deletions registers.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,9 +989,7 @@ def write_adoc( fd, registers ):
fd.write(remove_indent(r.description))
fd.write("\n\n")

if r.diagram:
fd.write(f"{remove_indent(r.diagram)}\n")
if r.fields:
if r.fields or r.diagram:
if registers.prefix == "CSR_":
if int(r.address, 0) >= 0xc00:
fd.write("This CSR is read-only.\n")
Expand All @@ -1002,7 +1000,10 @@ def write_adoc( fd, registers ):
elif all(f.access in ('R', '0') for f in r.fields):
fd.write("This entire register is read-only.\n")

write_bytefield( fd, r )
if r.diagram:
fd.write(f"{remove_indent(r.diagram)}\n")
else:
write_bytefield( fd, r )

columns = [("<2", "Field", lambda f: f"(({f.name}))")]
columns += [("<6", "Description", lambda f: f.latex_description())]
Expand Down
21 changes: 0 additions & 21 deletions xml/hwbp_registers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,6 @@ same project unless stated otherwise.
If this trigger supports multiple types, then the hardware should
disable it by changing {tdata1-type} to 15.

<!-- Just an example of how <diagram> works. This is exactly what is
auto-generated, so doesn't actually change the net output. -->
<diagram>
[bytefield]
----
(defattrs :plain [:plain {:font-family "M+ 1p Fallback"}])
(def row-height 45)
(def row-header-fn nil)
(def boxes-per-row 24)
(draw-column-headers {:labels ["XLEN-1" "" "" "" "XLEN-4" "" "XLEN-5" "" "XLEN-6" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" ""]})
(draw-box "type" {:span 5})
(draw-box "dmode" {:span 3})
(draw-box "data" {:span 9})
(draw-box "" {:span 7 :borders {}})
(draw-box "4" {:span 5 :borders {}})
(draw-box "1" {:span 3 :borders {}})
(draw-box "XLEN - 5" {:span 9 :borders {}})
(draw-box "" {:span 7 :borders {}})
----
</diagram>

<field name="type" bits="XLEN-1:XLEN-4" access="WARL" reset="Preset">
<value v="0" name="none">
There is no trigger at this {csr-tselect}.
Expand Down

0 comments on commit a054e56

Please sign in to comment.