Skip to content

Commit 8a5764c

Browse files
committed
Improve description of cmderr "busy"
- Improve the wording of what happens if another abstract command is started while the previous one still executes. Make the order of events very clear. - Unify the wording of cmderr "busy" requirement for all concerned DM registers. Make it clearer to the reader that the prescribed behavior is the same in all the cases.
1 parent bcd05b7 commit 8a5764c

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

debug_module.adoc

+7-4
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,15 @@ that case, the command will return "not supported".
328328
====
329329

330330
Debuggers execute abstract commands by writing them to {dm-command}. They can
331-
determine whether an abstract command is complete by reading {abstractcs-busy} in {dm-abstractcs}. If the debugger starts a new command while {abstractcs-busy} is set, {abstractcs-cmderr} becomes 1 (busy), the
332-
currently executing command still gets to run to completion, but any
333-
error generated by the currently executing command is lost. After
331+
determine whether an abstract command is complete by reading {abstractcs-busy} in {dm-abstractcs}. After
334332
completion, {abstractcs-cmderr} indicates whether the command was successful or not.
335333
Commands may fail because a hart is not halted, not running,
336-
unavailable, or because they encounter an error during execution.
334+
unavailable, because they encounter an error during execution.
335+
336+
If the debugger attempts to start a new command while {abstractcs-busy} is set,
337+
the new command will not get started and the currently executing command still
338+
gets to run to completion. After that, {abstractcs-cmderr} becomes 1 (busy),
339+
and any error generated by the completed command is lost.
337340

338341
If the command takes arguments, the debugger must write them to the
339342
`data` registers before writing to {dm-command}. If a command returns results, the

xml/dm_registers.xml

+7-5
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ same project unless stated otherwise.
471471
<register name="Abstract Control and Status" short="abstractcs" address="0x16">
472472
Writing this register while an abstract command is executing causes
473473
{abstractcs-cmderr} to become 1 (busy) once the command completes
474-
({abstractcs-busy} becomes 0).
474+
(once {abstractcs-busy} becomes 0).
475475

476476
[NOTE]
477477
====
@@ -573,7 +573,7 @@ same project unless stated otherwise.
573573

574574
Writing this register while an abstract command is executing causes
575575
{abstractcs-cmderr} to become 1 (busy) once the command completes
576-
(busy becomes 0).
576+
(once {abstractcs-busy} becomes 0).
577577

578578
If {abstractcs-cmderr} is non-zero, writes to this register are ignored.
579579

@@ -609,7 +609,7 @@ same project unless stated otherwise.
609609
If this register is written while an abstract command is executing
610610
then the write is ignored and
611611
{abstractcs-cmderr} becomes 1 (busy) once the command completes
612-
(busy becomes 0).
612+
(once {abstractcs-busy} becomes 0).
613613

614614
<field name="autoexecprogbuf" bits="31:16" access="WARL" reset="0">
615615
When a bit in this field is 1, read or write accesses to the
@@ -677,7 +677,8 @@ same project unless stated otherwise.
677677
registers.
678678

679679
Accessing these registers while an abstract command is executing causes
680-
{abstractcs-cmderr} to be set to 1 (busy) if it is 0.
680+
{abstractcs-cmderr} to become 1 (busy) once the command completes
681+
(once {abstractcs-busy} becomes 0).
681682

682683
Attempts to write them while {abstractcs-busy} is set does not change their value.
683684

@@ -712,7 +713,8 @@ same project unless stated otherwise.
712713
implemented starting at {dm-progbuf0}, counting up.
713714

714715
Accessing these registers while an abstract command is executing causes
715-
{abstractcs-cmderr} to be set to 1 (busy) if it is 0.
716+
{abstractcs-cmderr} to become 1 (busy) once the command completes
717+
(once {abstractcs-busy} becomes 0).
716718

717719
Attempts to write them while {abstractcs-busy} is set does not change their value.
718720

0 commit comments

Comments
 (0)