You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -830,6 +831,7 @@ Next PC is determined by decoding the conditional branch insruction opcode to de
830
831
NOTE: Not-taken direct conditional branches and direct unconditional jumps increment I-CNT but do not generate any trace.
831
832
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).
832
833
834
+
<<<
833
835
[[msg2_IndirectBranch]]
834
836
=== IndirectBranch Message
835
837
@@ -863,6 +865,7 @@ NOTE: Not-taken conditional branches and direct unconditional jumps do not gener
863
865
Additionally, direct unconditional jumps modify the PC to the destination address specified in the instruction.
864
866
Consequently, the PC of the last instruction in a code block(s) can be determined.
865
867
868
+
<<<
866
869
[[msg2_Error]]
867
870
=== Error Message
868
871
@@ -912,6 +915,7 @@ This message *is required* as otherwise decoder (despite the fact that restart a
912
915
In above case, Error Message will be the last message in trace stream.
913
916
====
914
917
918
+
<<<
915
919
[[msg2_ProgTraceSync]]
916
920
=== ProgTraceSync Message
917
921
@@ -931,10 +935,11 @@ In above case, Error Message will be the last message in trace stream.
931
935
*Explanations and Notes*
932
936
933
937
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.
935
939
Instead, it serves to pinpoint the precise Program Counter (PC) location at which the specified trigger or event occurred.
936
940
Additionally, the F-ADDR field provides the complete PC address at the moment the trigger was activated.
937
941
942
+
<<<
938
943
[[msg2_DirectBranchSync]]
939
944
=== DirectBranchSync Message
940
945
@@ -956,6 +961,7 @@ Additionally, the F-ADDR field provides the complete PC address at the moment th
956
961
This message is produced under the same conditions as the <<msg2_DirectBranch,DirectBranch>> message.
957
962
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.
958
963
964
+
<<<
959
965
[[msg2_IndirectBranchSync]]
960
966
=== IndirectBranchSync Message
961
967
@@ -977,6 +983,7 @@ However, it further includes details on the reason for synchronization via the S
977
983
978
984
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).
979
985
986
+
<<<
980
987
[[msg2_ResourceFull]]
981
988
=== ResourceFull Message
982
989
@@ -1015,6 +1022,7 @@ this field, with the range extending from a minimum of 2 bits up to the maximum
1015
1022
Should the I-CNT counter and the HIST register simultaneously reach their respective capacity limits, it is mandatory to emit two successive ResourceFull
1016
1023
messages.
1017
1024
1025
+
<<<
1018
1026
[[msg2_IndirectBranchHist]]
1019
1027
=== IndirectBranchHist Message
1020
1028
@@ -1038,6 +1046,7 @@ Last instruction in the code block (or blocks) (described by HIST and I-CNT fiel
1038
1046
1039
1047
Next PC is determine by applying the <<Address Compression,Address Compression>> rules using the U-ADDR field in this message.
1040
1048
1049
+
<<<
1041
1050
[[msg2_IndirectBranchHistSync]]
1042
1051
=== IndirectBranchHistSync Message
1043
1052
@@ -1061,6 +1070,7 @@ Next PC is determine by applying the <<Address Compression,Address Compression>>
1061
1070
This message is generated in the same conditions as <<msg2_IndirectBranchHist,IndirectBranchHist>> message.
1062
1071
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.
1063
1072
1073
+
<<<
1064
1074
[[msg2_RepeatBranch]]
1065
1075
=== RepeatBranch Message
1066
1076
@@ -1081,6 +1091,7 @@ Number of times the previous branch message (without a <<field_SYNC,SYNC>> field
1081
1091
1082
1092
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.
1083
1093
1094
+
<<<
1084
1095
[[msg2_ProgTraceCorrelation]]
1085
1096
=== ProgTraceCorrelation Message
1086
1097
@@ -1152,6 +1163,7 @@ Rules when generating addresses:
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
1199
1211
1200
1212
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).
1201
1213
1214
+
<<<
1202
1215
=== I-CNT Details
1203
1216
1204
1217
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.
* Using *SYNC=Sequential Instruction Counter* generates bigger trace (as potentially long F-ADDR field is reported).
1343
1356
====
1344
1357
1358
+
<<<
1345
1359
=== Synchronizing Messages
1346
1360
1347
1361
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
1389
1403
1390
1404
==== Examples of Synchronizing Messages
1391
1405
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:
* 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`.
1422
1435
1423
1436
image:./images/case6_periodic.PNG[image]
1424
1437
1425
1438
*Superscript notes:*
1426
1439
1427
1440
. 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.
1429
1442
. Next available *...Branch...* message upgraded to *...Branch...Sync* counterpart, so SYNC code is reported.
1430
1443
1444
+
<<<
1431
1445
=== Timestamp Reporting
1432
1446
1433
1447
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
1454
1468
It is necessary to assure that the time reported at exceptions/interrupt handlers reflects the moment when exception or interrupt was observed.
1455
1469
====
1456
1470
1471
+
<<<
1457
1472
=== Corner Cases and Sequences
1458
1473
1459
1474
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
1510
1525
signals needed between the hart and the encoder, and should have a minimal impact on trace
1511
1526
efficiency as it is anticipated that consecutive execution will be the norm.
1512
1527
1528
+
<<<
1513
1529
=== Implicit Return Optimization
1514
1530
1515
1531
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
1546
1562
1547
1563
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).
1548
1564
1565
+
<<<
1549
1566
=== Repeated History Optimization
1550
1567
1551
1568
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
1611
1628
1612
1629
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.
1613
1630
1631
+
<<<
1614
1632
=== Virtual Addresses Optimization
1615
1633
1616
1634
This optimization must be enabled by <<trTeInstExtendAddrMSB,trTeInstExtendAddrMSB>> control bit.
1617
1635
1618
1636
NOTE: Normally (without the above bit enabled or implemented), addresses with many
1619
1637
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
1622
1640
as F-ADDR = *0x7FFF_FFFF_C000_18FA* (with the least significant 0-bit skipped).
1623
1641
Such a 63-bit variable field value will require 11 bytes to be sent (as we
0 commit comments