Skip to main content

2 Encoder Control

The fields required to control a Trace Encoder are defined in the RISC-V Trace Control Interface Specification, which is intended to apply to any and all RISC-V trace encoders, regardless of encoding protocol. This chapter details which of those fields apply to E-Trace. To avoid replication, descriptions are not provided here; additional E-Trace specific context or clarification is provided only where required.

How fields are organized and accessed (e.g packet based or memory mapped) is outside the scope of this document. If a memory mapped approach is adopted, the 'Trace Component Register Map' from the RISC-V Trace Control Interface Specification should be used.

Note: Upto and including the E-Trace v2.0.0 specification, which predated the creation of the RISC-V Trace Control Interface Specification, the full field definitions were included in this chapter. For versions later than this, the field definitions have simply moved from this specification to the RISC-V Trace Control Interface Specification, without any change to their meaning. However, in order to create a more widely applicable protocol agnostic specification it has been necessary to change the field names in the process.

The applicability of fields for E-trace is categorized as follows:

  • N: Not applicable
  • M: Mandatory
  • O: Optional
  • MD: Mandatory if data trace is supported
  • OD: Optional for data trace

2.1 Basic Control

The following fields control basic encoding behavior.

Table 1. Basic Control

FieldApplicabilityE-Trace Specific Details
trTeActiveM
trTeEnableM
trTeInstTracingM
trTeDataTracingMD
trTeInstTrigEnableO
trTeDataTrigEnableOD
trTeInstStallOrOverflowO
trTeDataStallOrOverflowOD
trTeInstStallEnO
trTeDataStallEnOD
trTeEmptyORecommended if the trace datapath requires manual flushing when trace is disabled.
trTeDataDropOD
trTeDataDropEnOD
trTeInhibitSrcO
trTeInstSyncModeMIf hardcoded, must be to a non-zero value.
trTeInstSyncMaxMMay be hardcoded.
trTeFormatMMust be set to 0 (denoting E-Trace format).
trTeVerMajorM
trTeVerMinorM
trTeCompTypeM
trTeProtocolMajorMMust be 0 to indicate this version (2.0.x) of the E-Trace protocol.
trTeProtocolMinorMMust be 0.
trTeSrcIDO
trTeSrcBitsO

2.2 Optional Modes

See Section 3.2 for details of the modes covered in this section.

Table 2. Optional and run-time configurable modes.

FieldApplicabilityE-Trace Specific Details
trTeInstNoAddrDiffO
trTeInstNoTrapAddrO
trTeInstEnSequentialJumpO
trTeInstEnImplicitReturnO
trTeInstEnBranchPredictionO
trTeInstJumpTargetCacheO
trTeDataNoValueOD
trTeDataNoAddrOD
trTeDataAddrCompressOD
trTeContextNHardcode to 0.
trTeInstModeNHardcode to 7.
trTeInstImplicitReturnModeNHardcode to 0.
trTeInstEnRepeatedHistoryNHardcode to 0.
trTeInstEnAllJumpsNHardcode to 0.
trTeInstExtendAddrMSBNHardcode to 0.

2.3 Filtering

See Section 5 for details of the filtering capabilities covered in this section.

Table 3. Trace filtering selection

| Field | Applicability | E-Trace Specific Details | | trTeInstFilters | O | | | trTeDataFilters | OD | | | trTeFilter…​ | O | | | trTeComp…​ | O | | | trTeTrig…​ | N | Hardcode to 0. |