Skip to content

Commit c22228e

Browse files
Merge main to branch
2 parents e651d11 + b57b090 commit c22228e

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

src/hti.adoc

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,17 @@ The following information is mandatory:
1313

1414
* The number of instructions that are being retired;
1515
* Whether there has been an exception or interrupt, and if so the cause
16-
(from the *_scause/vscause/mcause_* etc. CSR) and trap value (from the
17-
*_stval/vstval/mtval_* etc. CSR).
16+
(from the `scause`/`vscause`/`mcause` etc. CSR) and trap value (from the `stval`/`vstval`/`mtval` etc. CSR).
1817
+
1918
The register set to output should be the set that is updated as a result
2019
of the exception (i.e. the set associated with the privilege level
2120
immediately following the exception);
2221
* The current privilege level of the RISC-V hart;
23-
* The _instruction_type_ of retired instructions for:
22+
* The instruction type of retired instructions for:
2423
** Jumps with a target that cannot be inferred from the source code;
2524
** Taken and non-taken branches;
2625
** Return from exception or interrupt (*_*ret_* instructions).
27-
* The _instruction_address_ for:
26+
* The instruction address for:
2827
** Jumps with a target that _cannot_ be inferred from the source code;
2928
** The instruction retired immediately after a jump with a target that
3029
_cannot_ be inferred from the source code (also referred to as the
@@ -77,7 +76,7 @@ instruction which loads the target into a register have been traced.
7776
[[JumpClasses]]
7877
==== Jump classification and target inference
7978

80-
Jumps are classified as _inferrable_, or _uninferrable_. An _inferrable_
79+
Jumps are classified as _inferrable_ or _uninferrable_. An _inferrable_
8180
jump has a target which can be deduced from the binary executable or
8281
representation thereof (e.g. ELF). For the purposes of this
8382
specification, the following strict definition applies:
@@ -164,10 +163,10 @@ BR group signals instead.
164163
|*itype*[_itype_width_p_-1:0] | MR | Termination type of the instruction
165164
block. Encoding given in <<tab:itype3>> and <<tab:itype4>>.
166165
|*cause*[_ecause_width_p_-1:0] | M | Exception or interrupt cause
167-
(*_scause/ vscause/mcause_*). Ignored unless **itype**=1 or 2.
166+
(`scause`/ `vscause`/`mcause`). Ignored unless **itype**=1 or 2.
168167
|*tval*[_iaddress_width_p_-1:0] | M | The associated trap value, e.g. the
169168
faulting virtual address for address exceptions, as would be written to
170-
the *stval/vstval/mtval* CSR. Future optional extensions may
169+
the `stval`/`vstval`/`mtval` CSR. Future optional extensions may
171170
define *tval* to provide ancillary information in cases where it
172171
currently supplies zero. Ignored unless **itype**=1.
173172
|*priv*[_privilege_width_p_-1:0] | M | Privilege level for all
@@ -267,7 +266,7 @@ retired instruction
267266
|9 | Inferrable call | JAL rd +
268267
C.JAL +
269268
CM.JALT| rd = `link` +
270-
Expands to `JAL x1, offset` +
269+
Expands to: JAL x1, offset +
271270
Defined by <<zcmt,Zcmt>> extension
272271
|10 | Uninferrable jump +
273272
(without linkage) | JALR rd, rs +
@@ -276,7 +275,7 @@ retired instruction
276275
|11 | Inferrable jump | JAL rd +
277276
C.J +
278277
CM.JT| rd = *x0* +
279-
Expands to `JAL x0, offset` +
278+
Expands to: JAL x0, offset +
280279
Defined by <<zcmt,Zcmt>> extension
281280
|12 | Co-routine swap | JALR rd, rs +
282281
C.JALR rs| rd = `link` and rs = `link` and rd != rs +
@@ -496,14 +495,13 @@ infrastructure).
496495
==== Using trigger outputs from the Debug Module
497496

498497
The debug module of the RISC-V hart may have a trigger unit. This
499-
defines a match control register (*_mcontrol_*) containing a 4-bit
500-
*action* field, and reserves codes 2 - 5 of this field for trace use.
498+
defines several trigger CSRs (for example `mcontrol6`, `icount`, etc.) that contain a 4-bit *action* field. Codes 2 - 5 of this field are for trace use.
501499
These action codes are hereby defined as shown in table
502500
<<tab:debugModuleTriggerSupport>>. If implemented, each action must generate a pulse on an output from the hart, on the same cycle as the instruction which caused the trigger is
503501
retired.
504502

505503
[[tab:debugModuleTriggerSupport]]
506-
.Debug Module trigger support (*_mcontrol_ action*)
504+
.Debug Module trigger support (*action*)
507505
[%autowidth,align="center",float="center",cols="<,<",options="header"]
508506
|===
509507
| *Value* | *Description*

src/intro.adoc

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ flow
1414
* *decoder*: a piece of software that takes the trace packets emitted by
1515
the encoder and reconstructs the execution flow of the code executed by
1616
the RISC-V hart
17-
* *discontinuity*: another name for ’delta’ (see above)
18-
* *E-Trace*: Abbreviation of _Efficient Trace for RISC-V_.
17+
* *discontinuity*: a change in the program counter that is anything other than an automatic increment to the next instruction located contiguously in memory
18+
- *inferrable discontinuity*: a discontinuity in the program counter resulting from a branch or *direct jump*
19+
- *uninferrable discontinuity*: a discontinuity in the program counter that is not inferrable (see above)
20+
- *updiscon*: contraction of ’uninferrable PC discontinuity’
21+
* *E-Trace*: Abbreviation of _Efficient Trace for RISC-V_
1922
* *ELF*: executable and linkable format
2023
* *encoder*: a piece of hardware that takes in instruction execution
2124
information from a RISC-V hart and transforms it into trace packets
@@ -29,13 +32,13 @@ hart to experience an unexpected transfer of control
2932
* *ISA*: instruction set architecture
3033
* *jump*: an instruction which unconditionally changes the execution
3134
flow
32-
* *direct jump*: an instruction which unconditionally changes the
35+
- *direct jump*: an instruction which unconditionally changes the
3336
execution flow by changing the PC by a constant value
34-
* *indirect jump*: an instruction which unconditionally changes the
37+
- *indirect jump*: an instruction which unconditionally changes the
3538
execution flow by changing the PC to a computed value
36-
* *inferable jump*: a jump where the target address is supplied via a
39+
- *inferrable jump*: a jump where the target address is supplied via a
3740
constant embedded within the jump opcode
38-
* *uninferable jump*: a jump which is not inferable (see above)
41+
- *uninferrable jump*: a jump which is not inferrable (see above)
3942
* *LSB*: least significant bit
4043
* *MSB*: most significant bit
4144
* *packet*: the atomic unit of encoded trace information emitted by the
@@ -49,15 +52,16 @@ machine state is updated (sometimes referred to as ’commit’ or
4952
* *RHTI* RISC-V Hart to Trace Encoder Interface (this specification)
5053
* *trap*: the transfer of control to a trap handler caused by either an
5154
exception or an interrupt
52-
* *updiscon*: contraction of ’uninferable PC discontinuity’
55+
5356

5457
=== Nomenclature
5558

5659
In the following sections items in *bold* are signals or fields within a
5760
packet.
5861

59-
Items in *_bold italics_* are mnemonics for instructions or CSRs defined
60-
in the RISC-V ISA
62+
Items in *_bold italics_* are mnemonics for instructions defined in the RISC-V ISA
63+
64+
Items `lowlighted` are CSRs or other registers defined in the RISC-V ISA
6165

6266
Items in _italics_ with names ending _’_p’_ refer to parameters either
6367
built into the hardware or configurable hardware values.

0 commit comments

Comments
 (0)