Programming guide#
Programming models
The logical cores of an XCore multicore processor can be programmed in extremely flexible ways:
- “Hardware as Software”
Individual logical cores, or collaborations thereof, can respond within a few clock cycles to specific hardware events. Once activated, each logical core is given a gauranteed share of the processor cycles. With this programming model, parts of the XCore can be thought of as software-defined hardware peripherals.
- “Vector accelerator”
Logical cores may act as a team operating on the same vector. This approach, combined with VPU acceleration, allows the greatest utilisation of the available compute.
- “Application processor”
As well as responding to events, logical cores can respond to interrupts. This allows a logical core to behave like a traditional MCU running an RTOS.
These application architecture approaches may be combined and may even be chosen as appropriate at runtime. The multicore programming model explores these concepts in more depth.
Languages
XCore processors are, in the main, programmed using the C (or C++) language with special hardware features being accessed through system libraries. See Programming an XCORE tile with C and lib_xcore for more details.
Where a particularly performant piece of code is required, a developer might chose to program in assembly.