From 59f1bf4e7b665027f1afa92c876255e6395876af Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Wed, 27 Mar 2024 09:58:42 -0700 Subject: [PATCH 1/3] Fix debugger implementation tables. Sometimes they would wrap "Write", as pointed out in #993. --- debugger_implementation.adoc | 49 ++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/debugger_implementation.adoc b/debugger_implementation.adoc index 2f8dd7ea..7fdb701a 100644 --- a/debugger_implementation.adoc +++ b/debugger_implementation.adoc @@ -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` @@ -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 | @@ -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`} | @@ -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 @@ -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 @@ -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)` | @@ -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)` | @@ -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 | @@ -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 @@ -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 @@ -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 @@ -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)` | @@ -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)` | @@ -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 | @@ -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 | @@ -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` @@ -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` From 3e112448dbd4ca4b225838677fca2d60d1845d6c Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Wed, 27 Mar 2024 09:59:38 -0700 Subject: [PATCH 2/3] Give more space for field name in tables. Fixes alignment of the field name within the tables, as pointed out in --- registers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/registers.py b/registers.py index 9ff2eb80..4ca029f2 100755 --- a/registers.py +++ b/registers.py @@ -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) From 54961293d0cc8a5e154b51459e0a35edd5b79db3 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Wed, 27 Mar 2024 10:01:54 -0700 Subject: [PATCH 3/3] Left align numbers in abstract commands table. Still doesn't look quite right, but right aligning makes no sense for a range. --- xml/abstract_commands.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/abstract_commands.xml b/xml/abstract_commands.xml index 0bb55ddf..0833aea0 100644 --- a/xml/abstract_commands.xml +++ b/xml/abstract_commands.xml @@ -54,7 +54,7 @@ same project unless stated otherwise. [[tab:regno]] .Abstract Register Numbers - [%autowidth,align="center",float="center",cols=">,<",options="header"] + [%autowidth,align="center",float="center",cols="<,<",options="header"] |=== | Numbers | Group Description | 0x0000 -- 0x0fff | CSRs. The ``PC'' can be accessed here through {csr-dpc}.