How to use realtime xSCOPE on the XMOS 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 use realtime xSCOPE on the XMOS 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.

Compile the following code:

#include <stdlib.h>
#include <xscope.h>
int main() {
    while (1) {
        xscope_int(VALUE, rand() * 100);
    }
    return 0;
}

Note: The probe used in the above example is defined in the config.xscope file.

To run using the xTIMEcomposer studio

Select Run -> Run Configurations, and double click on the xCORE Application option. This will create a new Run configuration. In the Device options group, check the simulator box. Realtime xSCOPE can be enabled via the checkbox in the xSCOPE tab. Running this example will open the Real-Time Scope view and display the corresponding values.

To run from the command line

xsim bin/Debug/realtime_Debug.xe –xscope ‘-realtime localhost:12345’

Run the above. To visualise the output open the xTIMEcomposer studio and select Tools->XRTScope. In the Real-Time Scope view, click the Connect button in the view toolbar. Select the IP address/port pair that matches the above command line, check the is simulation box, then click Connect.