Skip to content

Commit f75e3fc

Browse files
committed
cmderr.busy: Improvements per review comments
1 parent f199ac8 commit f75e3fc

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

debug_module.adoc

+7-6
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ While the reset is on-going, harts are either in the running state,
8484
indicating it's possible to perform some abstract commands during this
8585
time, or in the unavailable state, indicating it's not possible to
8686
perform any abstract commands during this time. Once a hart's reset is
87-
complete, `havereset` becomes set. When a hart comes out of reset and {dmcontrol-haltreq} or `resethaltreq`
87+
complete, `havereset` becomes set. When a hart comes out of reset and {dmcontrol-haltreq} or `resethaltreq`
8888
are set, the hart will immediately enter Debug Mode (halted state).
8989
Otherwise, if the hart was initially running it will execute normally
9090
(running state) and if the hart was initially halted it should now be
@@ -331,12 +331,13 @@ Debuggers execute abstract commands by writing them to {dm-command}. They can
331331
determine whether an abstract command is complete by reading {abstractcs-busy} in {dm-abstractcs}. After
332332
completion, {abstractcs-cmderr} indicates whether the command was successful or not.
333333
Commands may fail because a hart is not halted, not running,
334-
unavailable, because they encounter an error during execution.
334+
unavailable, or because they encounter an error during execution.
335335

336336
If the debugger attempts to start a new command while {abstractcs-busy} is set,
337337
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.
338+
gets to run to completion. After the command finishes, {abstractcs-cmderr}
339+
will contain 1 (busy), and any error generated by the completed command will
340+
be lost.
340341

341342
If the command takes arguments, the debugger must write them to the
342343
`data` registers before writing to {dm-command}. If a command returns results, the
@@ -396,7 +397,7 @@ determines the kind of command. <<tab:cmdtype>> lists all commands.
396397
.Meaning of {command-cmdtype}
397398
[%autowidth,float="center",align="center",cols=">,<",options="header"]
398399
|===
399-
| {command-cmdtype} | Command
400+
| {command-cmdtype} | Command
400401
| 0 | <<ac-accessregister, Access Register Command>>
401402
| 1 | <<ac-quickaccess, Quick Access>>
402403
| 2 | <<ac-accessmemory, Access Memory Command>>
@@ -558,7 +559,7 @@ effects, use the following procedure:
558559
.. Read {dm-dmcontrol} until {dmcontrol-dmactive} is high.
559560
. Read {dm-dmstatus}, which contains {dmstatus-version}.
560561

561-
If it was necessary to clear {dmcontrol-ndmreset}, this might have the following
562+
If it was necessary to clear {dmcontrol-ndmreset}, this might have the following
562563
side effects:
563564

564565
. {dmcontrol-haltreq} is cleared, potentially preventing a halt request made by a previous debugger from taking effect.

xml/dm_registers.xml

+5-11
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,7 @@ same project unless stated otherwise.
470470

471471
<register name="Abstract Control and Status" short="abstractcs" address="0x16">
472472
Writing this register while an abstract command is executing causes
473-
{abstractcs-cmderr} to become 1 (busy) once the command completes
474-
(once {abstractcs-busy} becomes 0).
473+
{abstractcs-cmderr} to contain 1 (busy) once the command completes.
475474

476475
[NOTE]
477476
====
@@ -527,7 +526,6 @@ same project unless stated otherwise.
527526
An abstract command was executing while {dm-command},
528527
{dm-abstractcs}, or {dm-abstractauto} was written, or when one
529528
of the `data` or `progbuf` registers was read or written.
530-
This status is only written if {abstractcs-cmderr} contains 0.
531529
</value>
532530

533531
<value v="2" name="not supported">
@@ -572,8 +570,7 @@ same project unless stated otherwise.
572570
executed.
573571

574572
Writing this register while an abstract command is executing causes
575-
{abstractcs-cmderr} to become 1 (busy) once the command completes
576-
(once {abstractcs-busy} becomes 0).
573+
{abstractcs-cmderr} to contain 1 (busy) once the command completes.
577574

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

@@ -608,8 +605,7 @@ same project unless stated otherwise.
608605

609606
If this register is written while an abstract command is executing
610607
then the write is ignored and
611-
{abstractcs-cmderr} becomes 1 (busy) once the command completes
612-
(once {abstractcs-busy} becomes 0).
608+
{abstractcs-cmderr} will contain 1 (busy) once the command completes.
613609

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

679675
Accessing these registers while an abstract command is executing causes
680-
{abstractcs-cmderr} to become 1 (busy) once the command completes
681-
(once {abstractcs-busy} becomes 0).
676+
{abstractcs-cmderr} to contain 1 (busy) once the command completes.
682677

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

@@ -713,8 +708,7 @@ same project unless stated otherwise.
713708
implemented starting at {dm-progbuf0}, counting up.
714709

715710
Accessing these registers while an abstract command is executing causes
716-
{abstractcs-cmderr} to become 1 (busy) once the command completes
717-
(once {abstractcs-busy} becomes 0).
711+
{abstractcs-cmderr} to contain 1 (busy) once the command completes.
718712

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

0 commit comments

Comments
 (0)