Skip to content

Commit

Permalink
Merge pull request #996 from riscv/tables
Browse files Browse the repository at this point in the history
Minor fixes to table layout.
  • Loading branch information
rtwfroody authored Mar 28, 2024
2 parents a054e56 + 5496129 commit 6ef54b6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 30 deletions.
49 changes: 24 additions & 25 deletions debugger_implementation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ instruction before re-entering Debug Mode.
===== Using Abstract Command
Read `s0` using abstract command:

[%autowidth,align="center",float="center",cols="^,^,^,^",options="header"]
[align="center",float="center",cols="^3,^3,^10,<10",options="header"]
|===
| Op | Address | Value | Comment
| Write | {dm-command} | {accessregister-aarsize}latexmath:[$=2$], {accessregister-transfer}, {accessregister-regno} = 0x1008 | Read `s0`
Expand All @@ -91,7 +91,7 @@ Read `s0` using abstract command:

Write `mstatus` using abstract command:

[%autowidth,align="center",float="center",cols="^,^,^,^",options="header"]
[align="center",float="center",cols="^3,^3,^10,<10",options="header"]
|===
| Op | Address | Value | Comment
| Write | {dm-data0} | new value |
Expand All @@ -107,19 +107,18 @@ into/out of GPRs.

Write `mstatus` using program buffer:

[%autowidth,align="center",float="center",cols="^,^,^,^",options="header"]
|===
|Op | Address | Value | Comment
|Write | {dm-progbuf0} | `csrw s0, MSTATUS` &|
|Write | `progbuf1` | `ebreak` |
|Write | {dm-data0} | new value |
|Write |{dm-command}| {accessregister-aarsize}latexmath:[$=2$], {accessregister-postexec}, {accessregister-transfer}, {accessregister-write}, {accessregister-regno} = 0x1008 |
Write `s0`, then execute program buffer
[align="center",float="center",cols="^3,^3,^10,<10",options="header"]
|===
| Op | Address | Value | Comment
| Write | {dm-progbuf0} | `csrw s0, MSTATUS` |
| Write | `progbuf1` | `ebreak` |
| Write | {dm-data0} | new value |
| Write | {dm-command} | {accessregister-aarsize}latexmath:[$=2$], {accessregister-postexec}, {accessregister-transfer}, {accessregister-write}, {accessregister-regno} = 0x1008 | Write `s0`, then execute program buffer
|===

Read `f1` using program buffer:

[%autowidth,align="center",float="center",cols="^,^,^,^",options="header"]
[align="center",float="center",cols="^3,^3,^10,<10",options="header"]
|===
| Op | Address | Value | Comment
| Write | {dm-progbuf0} | {`fmv.x.s s0, f1`} |
Expand All @@ -138,7 +137,7 @@ With system bus access, addresses are physical system bus addresses.

Read a word from memory using system bus access:

[%autowidth,align="center",float="center",cols="^,^,^,^",options="header"]
[align="center",float="center",cols="^3,^3,^10,<10",options="header"]
|===
| Op | Address | Value | Comment
| Write | {dm-sbcs} | {sbcs-sbaccess}latexmath:[$=2$], {sbcs-sbreadonaddr} | Setup
Expand All @@ -148,7 +147,7 @@ Read a word from memory using system bus access:

Read block of memory using system bus access:

[%autowidth,align="center",float="center",cols="^,^,^,^",options="header"]
[align="center",float="center",cols="^3,^3,^10,<10",options="header"]
|===
| Op | Address | Value | Comment
| Write | {dm-sbcs} | {sbcs-sbaccess}latexmath:[$=2$], {sbcs-sbreadonaddr}, {sbcs-sbreadondata}, {sbcs-sbautoincrement} | Turn on autoread and autoincrement
Expand All @@ -169,7 +168,7 @@ configuration).

Read a word from memory using program buffer:

[%autowidth,align="center",float="center",cols="^,^,^,^",options="header"]
[align="center",float="center",cols="^3,^3,^10,<10",options="header"]
|===
| Op | Address | Value | Comment
| Write | {dm-progbuf0} | `lw s0, 0(s0)` |
Expand All @@ -182,7 +181,7 @@ Read a word from memory using program buffer:

Read block of memory using program buffer:

[%autowidth,align="center",float="center",cols="^,^,^,^",options="header"]
[align="center",float="center",cols="^3,^3,^10,<10",options="header"]
|===
| Op | Address | Value | Comment
| Write | {dm-progbuf0} | `lw s1, 0(s0)` |
Expand All @@ -207,7 +206,7 @@ although the actual implementation may differ.

Read a word from memory using abstract memory access:

[%autowidth,align="center",float="center",cols="^,^,^,^",options="header"]
[align="center",float="center",cols="^3,^3,^10,<10",options="header"]
|===
| Op | Address | Value | Comment
| Write | `data1` | address |
Expand All @@ -217,7 +216,7 @@ Read a word from memory using abstract memory access:

Read block of memory using abstract memory access:

[%autowidth,align="center",float="center",cols="^,^,^,^",options="header"]
[align="center",float="center",cols="^3,^3,^10,<10",options="header"]
|===
| Op | Address | Value | Comment
| Write | {dm-abstractauto} | 1 | Re-execute the command when {dm-data0} is accessed
Expand All @@ -239,7 +238,7 @@ With system bus access, addresses are physical system bus addresses.

Write a word to memory using system bus access:

[%autowidth,align="center",float="center",cols="^,^,^,^",options="header"]
[align="center",float="center",cols="^3,^3,^10,<10",options="header"]
|===
| Op | Address | Value | Comment
| Write | {dm-sbcs} | {sbcs-sbaccess}latexmath:[$=2$] | Configure access size
Expand All @@ -249,7 +248,7 @@ Write a word to memory using system bus access:

Write a block of memory using system bus access:

[%autowidth,align="center",float="center",cols="^,^,^,^",options="header"]
[align="center",float="center",cols="^3,^3,^10,<10",options="header"]
|===
| Op | Address | Value | Comment
| Write | {dm-sbcs} | {sbcs-sbaccess}latexmath:[$=2$], {sbcs-sbautoincrement} | Turn on autoincrement
Expand All @@ -269,7 +268,7 @@ configuration).

Write a word to memory using program buffer:

[%autowidth,align="center",float="center",cols="^,^,^,^",options="header"]
[align="center",float="center",cols="^3,^3,^10,<10",options="header"]
|===
| Op | Address | Value | Comment
| Write | {dm-progbuf0} | `sw s1, 0(s0)` |
Expand All @@ -282,7 +281,7 @@ Write a word to memory using program buffer:

Write block of memory using program buffer:

[%autowidth,align="center",float="center",cols="^,^,^,^",options="header"]
[align="center",float="center",cols="^3,^3,^10,<10",options="header"]
|===
| Op | Address | Value | Comment
| Write | {dm-progbuf0} | `sw s1, 0(s0)` |
Expand All @@ -307,7 +306,7 @@ although the actual implementation may differ.

Write a word to memory using abstract memory access:

[%autowidth,align="center",float="center",cols="^,^,^,^",options="header"]
[align="center",float="center",cols="^3,^3,^10,<10",options="header"]
|===
| Op | Address | Value | Comment
| Write | `data1` | address |
Expand All @@ -317,7 +316,7 @@ Write a word to memory using abstract memory access:

Write a block of memory using abstract memory access:

[%autowidth,align="center",float="center",cols="^,^,^,^",options="header"]
[align="center",float="center",cols="^3,^3,^10,<10",options="header"]
|===
| Op | Address | Value | Comment
| Write | `data1` | address |
Expand Down Expand Up @@ -416,7 +415,7 @@ these options.
Halt the hart for a minimum amount of time to perform a single memory
write:

[%autowidth,align="center",float="center",cols="^,^,^,^",options="header"]
[align="center",float="center",cols="^3,^3,^10,<10",options="header"]
|===
| Op | Address | Value | Comment
| Write | {dm-progbuf0} | `transfer arg2, s0` | Save `s0`
Expand All @@ -436,7 +435,7 @@ This shows an example of setting the {mcontrol-m} bit in to enable a hardware
breakpoint in M-mode. Similar quick access instructions could have been
used previously to configure the trigger that is being enabled here:

[%autowidth,align="center",float="center",cols="^,^,^,^",options="header"]
[align="center",float="center",cols="^3,^3,^10,<10",options="header"]
|===
| Op | Address | Value | Comment
| Write | {dm-progbuf0} | `transfer arg0, s0` | Save `s0`
Expand Down
8 changes: 4 additions & 4 deletions registers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,12 +1005,12 @@ def write_adoc( fd, registers ):
else:
write_bytefield( fd, r )

columns = [("<2", "Field", lambda f: f"(({f.name}))")]
columns += [("<6", "Description", lambda f: f.latex_description())]
columns = [("<23", "Field", lambda f: f"(({f.name}))")]
columns += [("<61", "Description", lambda f: f.latex_description())]
if not registers.skip_access:
columns += [("^1", "Access", lambda f: f"*{f.access}*")]
columns += [("^10", "Access", lambda f: f"*{f.access}*")]
if not registers.skip_reset:
columns += [("^1", "Reset", lambda f: f.reset)]
columns += [("^10", "Reset", lambda f: f.reset)]

if any( f.description for f in r.fields ):
cols = ",".join(c[0] for c in columns)
Expand Down
2 changes: 1 addition & 1 deletion xml/abstract_commands.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ same project unless stated otherwise.

[[tab:regno]]
.Abstract Register Numbers
[%autowidth,align="center",float="center",cols="&gt;,&lt;",options="header"]
[%autowidth,align="center",float="center",cols="&lt;,&lt;",options="header"]
|===
| Numbers | Group Description
| 0x0000 -- 0x0fff | CSRs. The ``PC'' can be accessed here through {csr-dpc}.
Expand Down

0 comments on commit 6ef54b6

Please sign in to comment.