How to use xSCOPE I/O 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 xSCOPE I/O 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; }
Note: xSCOPE is enabled and the ioMode is set to basic 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. xSCOPE I/O can be enabled by checking the Offline box in the xSCOPE tab. Running this example will then display the output in the console view.
To run from the command line
xsim a.xe –xscope ‘-offline xscope.xmt’
It is worth noting however, that the handling of system calls by the XMOS simulator is instantaneous from the point of view of the target. Therefore, using xSCOPE for I/O redirection will make the target run slower, thus is of limited use in reality.