How to run an executable 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 run an executable 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 <print.h>

int main() {
  printstr("Hello World!\n");
  return 0;
}

To run using the simulator

From within 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.

Alternatively, to run from the command line:

xsim a.xe

This will execute the given program (a.xe) until completion, in this case displaying ‘Hello World! in the console.

To debug using the simulator

From within xTIMEcomposer Studio, select Run -> Debug Configurations, and double click on the xCORE Application option. This will create a new Debug configuration. In the Device options group, check the simulator box.

Alternatively, to debug from the command line:

xgdb a.xe

This will start the XMOS debugger. To tell the debugger to connect to the simulator use:

connect -s

Loading the program onto the target (xgdb command: load), and continuing (xgdb command: continue) will cause the program to run to completion and display ‘Hello World!’ on the console.