riscv-non-isa / riscv-trace-spec

RISC-V Processor Trace Specification
https://jira.riscv.org/browse/RVG-88
Creative Commons Attribution 4.0 International
165 stars 47 forks source link

Clarify When Support Packet Must be Sent #153

Open IainCRobertson opened 1 month ago

IainCRobertson commented 1 month ago

The current explanation of when to sent a format 3 support packet (in section 7.5) is not wrong, but it could be clarified to better explain the intent.

Before any trace packets are output, a support packet must be issued to provide the encoder configuration to the decoder. Sending it any time before the first sync packet is acceptable, but the recommended time is when the encoder is enabled (TrTeEnable changes from 0 to 1). This avoids having to generate two packets (support and sync-start), at the point tracing actually starts.

To inform the decoder that tracing has ceased, a support packet must also be sent when tracing stops for any reason (e.g. trace is disabled by setting TrTeEnable to 0, trace is stopped by a trace-off trigger, or because it no longer qualifies after applying any filtering, tracing ends due to halt or reset, etc.).

IainCRobertson commented 1 month ago

@pdonahue-ventana are you happy with this: https://github.com/riscv-non-isa/riscv-trace-spec/pull/164?