How to enable ASCII tracing when running on the simulator
version
1.1.1
scope
Example.
This code is provided as example code for a user to base their code on.
description
How to enable ASCII tracing when running on the simulator
boards
Unless otherwise specified, this example runs on the SliceKIT Core Board, but can easily be run on any XMOS device by using a different XN file.
The simulator optionally provides a textual instruction trace.
For example, compile the following code:
#include <xs1.h> port p = XS1_PORT_1A; int main() { int x; p :> x; return 0; }
When enabled, the input from the port ‘p’ into variable ‘x’ will produce the corresponding line in the trace file:
tile[0]@0- -A-.----000100cc (main + 8) : in r0(0x0), res[r0(0x10200)] @2127
See the xTIMEcomposer User Guide (Tracing Table) for further information on the trace format.
To enable tracing from within xTIMEcomposer Studio
The ASCII simulator trace can be enabled via:
Run -> Run Configurations -> Simulator -> Dump simulator trace
This will send the trace directly to the console view.
Note: If required, the trace can be redirected to a file via:
Run -> Run Configurations -> Simulator -> Trace to file
To enable tracing from the command line
The ASCII simulator trace can be enabled via the -t xsim command line option:
xsim -t a.xe
If tracing of fetch no-ops (FNOPS) is required, it can be enabled via the –enable-fnop-tracing xsim command line option:
xsim -t --enable-fnop-tracing a.xe
This will insert the lines of the following format into the trace at the relevant locations:
tile[0]@0 FNOP @2655