riscv-non-isa / riscv-trace-spec

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

Counter start condition of resynchronisation timer #125

Closed zhangdujiao closed 4 months ago

zhangdujiao commented 4 months ago

We can configure the resync timer mode by trTeControl.trTeInstSyncMode, and the max value by trTeControl.trTeInstSyncMax. If we choose the inst. half word count. What is the time to start the Counter? When the trace start? and the qualified of filter should be 1 also right?

IainCRobertson commented 4 months ago

It should start counting from the instruction which causes the 1st Sync-Start message, and should reset each time a sync-start or sync-trap is generated. Same is true for any of the sync modes (it's just what you count that differs).

Iain

From: zhangdujiao @.> Sent: 26 June 2024 10:32 To: riscv-non-isa/riscv-trace-spec @.> Cc: Subscribed @.***> Subject: [riscv-non-isa/riscv-trace-spec] Counter start condition of resynchronisation timer (Issue #125)

We can configure the resync timer mode by trTeControl.trTeInstSyncMode, and the max value by trTeControl.trTeInstSyncMax. If we choose the inst. half word count. What is the time to start the Counter? When the trace start? and the qualified of filter should be 1 also right?

- Reply to this email directly, view it on GitHubhttps://github.com/riscv-non-isa/riscv-trace-spec/issues/125, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALQOPSTMMFY6RS4CJNIYR63ZJJ4AJAVCNFSM6AAAAABJ5MGKZCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM3TINZRGEYTCMI. You are receiving this because you are subscribed to this thread.Message ID: @.**@.>>

zhangdujiao commented 4 months ago

sync-start or sync-trap

what about sync-context and sync-support, they are both sync packet. resync counter shouldn't work when trace is off, right?

zhangdujiao commented 4 months ago

For unqualified instructions, whether to start the counter? For example, whether to start the clk counter for unqualified inst.

IainCRobertson commented 4 months ago

The point of the resync timer is to ensure that the decoder can find a starting point in the trace stream, and trace decoding can only start from sync-start or sync-trap.

An example of why the resync timer is required is when trace is written continuously to a circular buffer, over-writing the oldest data. The buffer contents are only output when some triggering condition occurs, and in general the oldest packet in the buffer will not be a sync packet. The decoder has to parse forward through the packets until it finds a sync-start or sync-trap packet in order to start decoding, and the resync timer puts an upper bound on how much trace the decoder will have to skip over before finding this.

Iain

From: zhangdujiao @.> Sent: 26 June 2024 11:02 To: riscv-non-isa/riscv-trace-spec @.> Cc: Robertson, Iain (DI SW ICS TST RD EAH) @.>; Comment @.> Subject: Re: [riscv-non-isa/riscv-trace-spec] Counter start condition of resynchronisation timer (Issue #125)

sync-start or sync-trap

what about sync-context and sync-support, they are both sync packet. resync counter shouldn't work when trace is off, right?

- Reply to this email directly, view it on GitHubhttps://github.com/riscv-non-isa/riscv-trace-spec/issues/125#issuecomment-2191184395, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALQOPSWJIXN2G7SNPNV5BFLZJJ7QPAVCNFSM6AAAAABJ5MGKZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJRGE4DIMZZGU. You are receiving this because you commented.Message ID: @.**@.>>

IainCRobertson commented 4 months ago

No, as unqualified instructions don't generate any trace. Hopefully my answer to your previous question will give a bit more context.

Iain

From: zhangdujiao @.> Sent: 26 June 2024 11:26 To: riscv-non-isa/riscv-trace-spec @.> Cc: Robertson, Iain (DI SW ICS TST RD EAH) @.>; Comment @.> Subject: Re: [riscv-non-isa/riscv-trace-spec] Counter start condition of resynchronisation timer (Issue #125)

For unqualified instructions, whether to start the counter? For example, whether to start the clk counter for unqualified inst.

- Reply to this email directly, view it on GitHubhttps://github.com/riscv-non-isa/riscv-trace-spec/issues/125#issuecomment-2191232471, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALQOPSUE6VHKTNWNOIL7ERDZJKCJTAVCNFSM6AAAAABJ5MGKZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJRGIZTENBXGE. You are receiving this because you commented.Message ID: @.**@.>>

zhangdujiao commented 4 months ago

That helps a lot! thanks!