Skip to content

Commit 604bfb5

Browse files
committed
1.0.0_rc37: Page breaks added (waiting for Freeze)
1 parent 7d56581 commit 604bfb5

File tree

3 files changed

+83
-53
lines changed

3 files changed

+83
-53
lines changed

docs/RISC-V-N-Trace.adoc

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
:description: RISC-V N-Trace (Nexus-based Trace)
33
:company: RISC-V.org
44
:revdate: June 06, 2024
5-
:revnumber: 1.0.0_rc36
6-
:revremark: Stable state (ready for Freeze)
5+
:revnumber: 1.0.0_rc37
6+
:revremark: Stable state (waiting for Freeze)
77
:url-riscv: http://riscv.org
88
:doctype: book
99
:preface-title: Preamble
@@ -52,9 +52,9 @@ Change is extremely unlikely.
5252

5353
PDF generated on: {localdatetime}
5454

55-
=== Version 1.0.0_rc36
55+
=== Version 1.0.0_rc37
5656
* 2024-06-06
57-
** Clarified EVCODE=4 (email discussion on TG).
57+
** Waiting for official Freeze
5858

5959
[Preface]
6060
== Copyright and license information
@@ -752,7 +752,7 @@ segments associated with various programs. Activation of this feature requires e
752752

753753
Reporting of this information occurs under one of the following three conditions:
754754

755-
* Upon the retirement of an instruction that writes to the *scontext/hcontext* CSR (as reported via `priv` and `context`` field on an ingress port).
755+
* Upon the retirement of an instruction that writes to the *scontext/hcontext* CSR (as reported via `priv` and `context` field on an ingress port).
756756
* In the event of a trap or trap return that results in a change in privilege mode (including *ECALL* and *EBREAK* instructions).
757757
* Following any trace <<Synchronizing Messages,synchronizing message>>.
758758

@@ -804,6 +804,7 @@ Examples:
804804
PROCESS=0x3B2 = 0b11101_1_00_10 => scontext=0x1D,V=1,PRV[1:0]=00 (VU-mode)
805805
PROCESS=0xC 0b0_11_00 => V=0,PRV[1:0]=11 (M-mode)
806806

807+
<<<
807808
[[msg2_DirectBranch]]
808809
=== DirectBranch Message
809810

@@ -830,6 +831,7 @@ Next PC is determined by decoding the conditional branch insruction opcode to de
830831
NOTE: Not-taken direct conditional branches and direct unconditional jumps increment I-CNT but do not generate any trace.
831832
Direct unconditional jumps change the PC to the destination address of such jumps. The I-CNT enables determination of the PC of the last instruction in the code block(s).
832833

834+
<<<
833835
[[msg2_IndirectBranch]]
834836
=== IndirectBranch Message
835837

@@ -863,6 +865,7 @@ NOTE: Not-taken conditional branches and direct unconditional jumps do not gener
863865
Additionally, direct unconditional jumps modify the PC to the destination address specified in the instruction.
864866
Consequently, the PC of the last instruction in a code block(s) can be determined.
865867

868+
<<<
866869
[[msg2_Error]]
867870
=== Error Message
868871

@@ -912,6 +915,7 @@ This message *is required* as otherwise decoder (despite the fact that restart a
912915
In above case, Error Message will be the last message in trace stream.
913916
====
914917

918+
<<<
915919
[[msg2_ProgTraceSync]]
916920
=== ProgTraceSync Message
917921

@@ -931,10 +935,11 @@ In above case, Error Message will be the last message in trace stream.
931935
*Explanations and Notes*
932936

933937
This message is produced at the start or restart of trace. In such instances, the I-CNT field is required to be set to 0. However, under certain conditions
934-
associated with the SYNC parameter (e.g., `External Trace Trigger``), the I-CNT field may not be zero.
938+
associated with the SYNC parameter (e.g., `External Trace Trigger`), the I-CNT field may not be zero.
935939
Instead, it serves to pinpoint the precise Program Counter (PC) location at which the specified trigger or event occurred.
936940
Additionally, the F-ADDR field provides the complete PC address at the moment the trigger was activated.
937941

942+
<<<
938943
[[msg2_DirectBranchSync]]
939944
=== DirectBranchSync Message
940945

@@ -956,6 +961,7 @@ Additionally, the F-ADDR field provides the complete PC address at the moment th
956961
This message is produced under the same conditions as the <<msg2_DirectBranch,DirectBranch>> message.
957962
However, it further includes details on the reason for synchronization via the SYNC field, as well as the full Program Counter (PC) address through the F-ADDR field.
958963

964+
<<<
959965
[[msg2_IndirectBranchSync]]
960966
=== IndirectBranchSync Message
961967

@@ -977,6 +983,7 @@ However, it further includes details on the reason for synchronization via the S
977983

978984
This message is generated in the same conditions as <<msg2_IndirectBranch,IndirectBranch>> message, but additionally provides a reason for synchronization (SYNC field) and full PC (F-ADDR field).
979985

986+
<<<
980987
[[msg2_ResourceFull]]
981988
=== ResourceFull Message
982989

@@ -1015,6 +1022,7 @@ this field, with the range extending from a minimum of 2 bits up to the maximum
10151022
Should the I-CNT counter and the HIST register simultaneously reach their respective capacity limits, it is mandatory to emit two successive ResourceFull
10161023
messages.
10171024

1025+
<<<
10181026
[[msg2_IndirectBranchHist]]
10191027
=== IndirectBranchHist Message
10201028

@@ -1038,6 +1046,7 @@ Last instruction in the code block (or blocks) (described by HIST and I-CNT fiel
10381046

10391047
Next PC is determine by applying the <<Address Compression,Address Compression>> rules using the U-ADDR field in this message.
10401048

1049+
<<<
10411050
[[msg2_IndirectBranchHistSync]]
10421051
=== IndirectBranchHistSync Message
10431052

@@ -1061,6 +1070,7 @@ Next PC is determine by applying the <<Address Compression,Address Compression>>
10611070
This message is generated in the same conditions as <<msg2_IndirectBranchHist,IndirectBranchHist>> message.
10621071
However, it further includes details on the reason for synchronization via the SYNC field, as well as the full Program Counter (PC) address through the F-ADDR field.
10631072

1073+
<<<
10641074
[[msg2_RepeatBranch]]
10651075
=== RepeatBranch Message
10661076

@@ -1081,6 +1091,7 @@ Number of times the previous branch message (without a <<field_SYNC,SYNC>> field
10811091

10821092
This message is reported when an identical (direct or indirect) branch message is encountered (just to save trace bandwidth). Trace decoder should just repeat handling of previous branch message B-CNT times.
10831093

1094+
<<<
10841095
[[msg2_ProgTraceCorrelation]]
10851096
=== ProgTraceCorrelation Message
10861097

@@ -1152,6 +1163,7 @@ Rules when generating addresses:
11521163
| | XOR =0000_0001_0010_0110_1000 | U-ADDR=1001_0011_0100=0x934 | 0x3E100 |
11531164
==============================================================================================
11541165

1166+
<<<
11551167
=== HIST Field Generation
11561168

11571169
When operating in HTM mode, the encoder does not generate messages for conditional branches.
@@ -1199,6 +1211,7 @@ enabled. See <<Repeated History Optimization,Repeated History Optimization>> cha
11991211

12001212
NOTE: Trace decoders do not have to be aware about the actual size of the HIST field implemented by the encoder, however in order to allow efficient implementation of trace encoders (and also allowing HIST pattern detection) this N-Trace specification limits HIST field size to max 32-bits. Longer HIST fields would not provide much of a gain and would make repeated HIST field detection more costly (in terms of hardware resources).
12011213

1214+
<<<
12021215
=== I-CNT Details
12031216

12041217
The I-CNT field, present in most messages, transmits the value of the I-CNT counter, which counts the number of halfwords used to encode retired instructions.
@@ -1342,6 +1355,7 @@ Trace with *SYNC=Sequential Instruction Counter* (BTM mode only):
13421355
* Using *SYNC=Sequential Instruction Counter* generates bigger trace (as potentially long F-ADDR field is reported).
13431356
====
13441357

1358+
<<<
13451359
=== Synchronizing Messages
13461360

13471361
Synchronizing messages are messages with a <<field_SYNC,SYNC>> field.
@@ -1389,9 +1403,7 @@ NOTE: Periodic Synchronization (SYNC=2) messages may not be precise and may be d
13891403

13901404
==== Examples of Synchronizing Messages
13911405

1392-
The following cases are created to help illustrate the type of N-trace <<Synchronizing Messages,synchronizing message>> generated for different scenarios.
1393-
1394-
*Events which may occur while a hart is running:*
1406+
The following cases are created to help illustrate the type of N-trace <<Synchronizing Messages,synchronizing message>> generated for different scenarios. Events which may occur while a hart is running or halted:
13951407

13961408
image:./images/example_key.PNG[image]
13971409

@@ -1403,6 +1415,7 @@ image:./images/case1_enable_disable_debug_while_tracing.PNG[image]
14031415

14041416
image:./images/case2_enable_trace_while_in_debug.PNG[image]
14051417

1418+
<<<
14061419
*Case3: Disable trace while in debug:*
14071420

14081421
image:./images/case3_disable_trace_while_in_debug.PNG[image]
@@ -1418,16 +1431,17 @@ image:./images/case5_enable_disable_while_in_debug.PNG[image]
14181431
*Case6: Periodic synchronization:*
14191432

14201433
* First possibility provides choice of messages generated at exact periodic synchronization event `P`.
1421-
* Second scenario provides choice of messages which may be generated delayed after the periodic event `P`.
1434+
* Second provides a choice of messages which may be generated delayed after the periodic event `P`.
14221435

14231436
image:./images/case6_periodic.PNG[image]
14241437

14251438
*Superscript notes:*
14261439

14271440
. ProgramTraceSync message may be replaced with DirectBranchSync, IndirectBranchHistSync, IndirectBranchHistSync.
1428-
. ProgramTraceSync message may be generated for a SYNC trigger event, however, HIST information will not be reported. For HTM mode, the IndirectBranchHistSync or IndirectBranchSync message with SYNC=6 (Trace Event) should be used to ensure no trace data is lost.
1441+
. ProgramTraceSync message may be generated for a SYNC event, however, HIST information will not be reported. For HTM mode, the IndirectBranchHistSync or IndirectBranchSync message with SYNC=6 (Trace Event) should be used to ensure no trace data is lost.
14291442
. Next available *...Branch...* message upgraded to *...Branch...Sync* counterpart, so SYNC code is reported.
14301443

1444+
<<<
14311445
=== Timestamp Reporting
14321446

14331447
Timestamp reporting must be enabled by <<trTsEnable,trTsEnable>> trace control bit.
@@ -1454,6 +1468,7 @@ If the above is not feasible, timestamps should be at least reported consistentl
14541468
It is necessary to assure that the time reported at exceptions/interrupt handlers reflects the moment when exception or interrupt was observed.
14551469
====
14561470

1471+
<<<
14571472
=== Corner Cases and Sequences
14581473

14591474
Normal program flow generates a sequence of messages with I-CNT>0 (reporting at least 1 instruction retired), some HIST fields (to report direct conditional branches) and F-ADDR/U-ADDR fields (to report uninferable unconditional flow changes).
@@ -1510,6 +1525,7 @@ that the instructions must be retired consecutively is necessary in order to min
15101525
signals needed between the hart and the encoder, and should have a minimal impact on trace
15111526
efficiency as it is anticipated that consecutive execution will be the norm.
15121527

1528+
<<<
15131529
=== Implicit Return Optimization
15141530

15151531
This optimization must be enabled by the <<trTeInstImplicitReturnMode,trTeInstImplicitReturnMode>> control field different than 0.
@@ -1546,6 +1562,7 @@ Call stack maintained by encoder may not include all addresses, but only keep so
15461562

15471563
IMPORTANT: Decoder does not need to know what is actual depth of the call stack implemented by encoder but for efficiency reasons it should assume max depth. N-Trace implementation should never implement call stack deeper than 32 levels. Such deep calls will be most likely interrupted by other events/messages (like periodic SYNC).
15481564

1565+
<<<
15491566
=== Repeated History Optimization
15501567

15511568
This optimization must be enabled by the <<trTeInstEnRepeatedHistory,trTeInstEnRepeatedHistory>> control bit.
@@ -1611,14 +1628,15 @@ NOTE: When number of repeated branches is bigger than max HREPEAT counter value
16111628

16121629
NOTE: HREPEAT counter should not have too many bits as it is not desired to not generate any trace messages for longer periods of time. Bigger HREPEAT will not make compression better but will produce timestamp rarelly.
16131630

1631+
<<<
16141632
=== Virtual Addresses Optimization
16151633

16161634
This optimization must be enabled by <<trTeInstExtendAddrMSB,trTeInstExtendAddrMSB>> control bit.
16171635

16181636
NOTE: Normally (without the above bit enabled or implemented), addresses with many
16191637
most significant bits set to 1 will be sent as long messages (as variable size
1620-
fields skip only the most significant 0-s). The following address,
1621-
*0xFFFF_FFFF_8000_31F4* (a real address from the Linux kernel), will be encoded
1638+
fields skip only the most significant 0-s). An address,
1639+
*0xFFFF_FFFF_8000_31F4*, a real address from the Linux kernel, will be encoded
16221640
as F-ADDR = *0x7FFF_FFFF_C000_18FA* (with the least significant 0-bit skipped).
16231641
Such a 63-bit variable field value will require 11 bytes to be sent (as we
16241642
have 6 MDO bits in each byte).

docs/RISC-V-Trace-Connectors.adoc

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[[header]]
22
:description: RISC-V Trace Connectors
33
:company: RISC-V.org
4-
:revdate: May 23, 2024
5-
:revnumber: 1.0.0_rc34
6-
:revremark: Stable state (ready for Freeze)
4+
:revdate: June 06, 2024
5+
:revnumber: 1.0.0_rc37
6+
:revremark: Stable state (waiting for Freeze)
77
:url-riscv: http://riscv.org
88
:doctype: book
99
:preface-title: Preamble
@@ -52,11 +52,9 @@ Change is extremely unlikely.
5252

5353
PDF generated on: {localdatetime}
5454

55-
=== Version 1.0.0_rc34
56-
* 2024-05-23
57-
** PDF theme from ISA Manual ADOC.
58-
** Adjusted column widths in tables.
59-
** Accepted by ARC.
55+
=== Version 1.0.0_rc37
56+
* 2024-06-06
57+
** Waiting for official Freeze
6058

6159
[Preface]
6260
== Copyright and license information

0 commit comments

Comments
 (0)