xmos / xscope_fileio

FileIO interface over xscope
Other
2 stars 10 forks source link

Out of order probes #52

Closed keithm-xmos closed 1 year ago

keithm-xmos commented 1 year ago

It is possible to receive XSCOPE probes out of order. For example, using we have observed the XSCOPE_ID_WRITE_SETUP sometimes arrive at the host after the first XSCOPE_ID_WRITE_BYTES of a xscope_fwrite(). This causes this assertion on the host side:

https://github.com/xmos/xscope_fileio/blob/master/host/xscope_io_host.c#L184

This is a known issue with xscope host IO, however, I am not sure why sometimes it happens more frequently than others. It certainly seems timing related. My recollection of a conversation with @MarkPhillips-xmos is that the contract with the host does not require the send order of probes with different IDs to be preserved. Only the order within a probe ID is preserved. For example, this is a legal received ordering:

Probe1 timestamp 1 Probe2 timestamp 3 Probe1 timestamp 2

This is not a legal received order:

Probe1 timestamp 2 Probe1 timestamp 1 Probe2 timestamp 3

The Probe1s will always be in order, so will the Probe2s. But, the union of all probes will not necessarily be in order.

Before addressing this issue, be sure to verify with @MarkPhillips-xmos.

keithm-xmos commented 1 year ago

Note, this issue has also been observed in the Tracealyzer xscope host application. In that application a workaround was implemented to re-order the probes in the host app to match the device's send order. @jcarrier-xmos is the author of that application.

mbanth commented 1 year ago

This issue is now tracked in Jira AP-140.