Transitioning from older tools releases#

Users of the XMOS xTIMEComposer Tools will notice some changes when using this XTC Tools release. This section aids users in migrating to the XTC Tools.

Programming language#

A noteable change within the XTC Tools is the move towards the use of the C language instead of XC as the preferred programming language for the xcore. The advantages of using C for xcore programming are:

  • ANSI/ISO compliance

  • Familiar to most embedded software developers

  • 3rd-party algortihms and routines may be deployed

  • There is an extensive support network

The xcore developer is encouraged to write communicating sequential processes (CSP) using tasks with their own private memory. This is largely enforced in XC and remains an excellent approach to parallel programming, and the same design pattern is recommended when programming in C. The move towards the use of C retains access to all of the unique benefits of the xcore architecture alongside benefits listed above.

For futher information on communicating sequential processes see References.

Existing applications using XC#

Existing source code using the XC language, (with or without C or C++), can be built using this XTC Tools release. The XC compiler itself will be maintained for existing applications and libraries.

For guidance on projects developed within older tools releases, see Migrating existing projects.

New applications#

New applications code should be written in C or a combination of C and C++.

The underlying hardware features of the xcore can be accessed through the C language using a new system library lib_xcore. Use of the new library is introduced in the guide: Programming an XCore tile with C and lib_xcore.

Where new C code is required to interact with existing XC code, existing guidance should be followed. See Calling between C/C++ and XC.

Writing multi-tile applications currently still requires the writing of a minimal declarative XC source file, often called multitile.xc as per the examples: Targeting multiple tiles and Communicating between tiles. The file should not contain any procedural code, and should contain only the bare minimum to:

  • Declare a C entry point on each tile

  • Declare the channels over which the tiles communicate

The C language does not include equivalents for XC’s [[combine]], [[combinable]] or [[distributable]] keywords. Combining tasks onto a single logical core must be done manually, using functions in lib_xcore to wait for an event from one of many sources, or by using an RTOS.

Similarly, the C language does not have an equivalent for XC interfaces which are accessed via the interface keyword. Implementation of interfaces and their underlying transport and protocol can now be performed by the application developer, allowing greater scope for chosing an implementation appropriate to the real-time requirements and any resource availabilty constraints.

Users who rely on the XC language protecting them against unsafe concurrent access to shared memory should take appropriate care when programming in the C language. Similarly, care should be taken to ensure that resources are correctly allocated and deallocated before/after use, since such allocation is not handled by the language itself. These are all normal considerations for a C programmer.

Experienced XC users transitioning to C/lib_xcore may find the following resources useful:

 

The following bookmarks provide a convenient access into the video for later reference:

The presentation used in the video may be downloaded: C_for_xCore_2021_02_08.pdf

In addition, an XC to C Cheat sheet is provided.

Graphical IDE#

The XTC Tools no longer contain a graphical IDE within the installation package. Instead, the tools are intended to be integrated with the user’s peferred IDE as per the examples in Configuring an IDE.

Viewing of offline XSCOPE output is similarly delegated to the user’s preferred VCD viewer. Use of GTKWave is demonstrated in Using XSCOPE for fast “printf debugging”, though other viewers are available.

Migrating existing projects#

Some very minor changes in configuration files and procedures are required when migrating to the XTC Tools from xTIMEComposer. The following changes may be required.

XTAG adapters#

The XTAG3 and XTAG4 adapters are supported by this release. The XTAG4 is a new-generation XTAG adapter. xcore.ai devices must use this adapter because it interfaces to them at lower voltages (1v8) which they require.

On Windows the XTAG drivers have been replaced, and a Windows Service is run when the host computer boots to manage connected XTAGs.