> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# XMOS

> Find supported XMOS boards and set up XTC Tools, INLAY.md, and .inlay/xmos.json to build, run, simulate, and debug xcore applications.

Select your XMOS board during project setup, or the generic `xcore.ai` entry for other xcore.ai hardware. Inlay then runs, flashes, simulates, and debugs your application with XMOS XTC Tools and reads its output over xSCOPE.

> [!NOTE]
>
> Check the project setup picker for current availability. Flashing and debugging also depend on your xTAG, its connection to the board, and your installed XTC Tools.

## Prepare your project and tools

1. Install [XMOS XTC Tools](https://www.xmos.com/software-tools). Inlay finds them on your `PATH`, through `XMOS_TOOL_PATH`, or in the standard install folder. For another location, see [Where Inlay finds XTC Tools](/docs/debug-mode/xmos-debugging.md#where-inlay-finds-xtc-tools).
2. For hardware, connect the xTAG (or the board's integrated xTAG) and power the board. To run without a board, use the [xsim simulator](/docs/debug-mode/xsim.md).
3. In `INLAY.md`, set `Debug Interface = xgdb` and record your build command. See [Configure INLAY.md](/docs/core-concepts/inlay-md.md).
4. Put the application, target, and other XMOS settings in [`.inlay/xmos.json`](#configure-inlay/xmos-json).

## Choose a workflow

* [xSCOPE](/docs/debug-mode/xscope.md) for console output, probes, and host input.
* [XMOS debugging](/docs/debug-mode/xmos-debugging.md) for xTAG and xgdb sessions.
* [XMOS xsim](/docs/debug-mode/xsim.md) for simulation, virtual pins, and instruction traces.
* [Flashing firmware](/docs/debug-mode/flashing.md) for programming and boot checks.
* The [XMOS migration guide](/docs/solutions/sigmastudio-to-xmos.md) for porting a SigmaStudio DSP project or other firmware with Migration mode.

## Catalog platforms

| Family | Platforms |
| - | - |
| xcore.ai | `xcore.ai` |
| xcore.ai boards | `XD-SWDAC-316`, `XK-AUDIO-316-MC-AB`, `XK-ETH-316-DUAL`, `XK-EVK-XU316`, `XK-EVK-XU316-AIV`, `XK-VOICE-L71`, `XK-VOICE-SQ66` |

## Board-specific skills

When the project's platform matches a board below, Inlay loads that board's reference skill. It covers the physical board: pinout, power, clocks, peripherals, boot, and xTAG connections. The generic `xcore.ai` entry has no board skill. If your board isn't in the picker, see [board-skill setup](/docs/supported-hardware/overview.md#use-a-board-specific-skill).

Every XMOS project also gets the general `xmos` skill. In Debug mode, Inlay adds `debug-xmos` when XTC Tools are installed and either an xTAG is attached or `.inlay/xmos.json` sets `"target": "simulator"`.

| Board | Auto-load platforms | What the skill covers |
| - | - | - |
| XK-EVK-XU316 | `XK-EVK-XU316`, `xcore.ai Explorer`, `xcore.ai Evaluation Kit` | xcore.ai Explorer/Evaluation Kit (JGB0070 2V0). |
| XK-EVK-XU316-AIV | `XK-EVK-XU316-AIV`, `XK-EVK-XU316-AI` | xcore.ai Vision Development Kit with `lib_camera`. Flags the differences between the AI and AIV variants that aren't yet confirmed. |
| XK-AUDIO-316-MC-AB | `XK-AUDIO-316-MC-AB`, `XK-AUDIO-316-MC` | xcore.ai Multichannel Audio Board 1V1 with integrated xTAG. |
| XK-ETH-316-DUAL | `XK-ETH-316-DUAL` | xcore.ai Ethernet Development Kit, dual RMII PHYs. |
| XK-VOICE-L71 | `XK-VOICE-L71` | Voice board with two PDM mics, TLV320DAC3101, and Raspberry Pi HAT connector. |
| XK-VOICE-SQ66 | `XK-VOICE-SQ66` | Four-microphone voice kit running XVF3800, with linear and square array variants. |
| XD-SWDAC-316 | `XD-SWDAC-316` | Software DAC USB headphone example design. |

Each skill names the board revision it describes. Check the PCB marking before you rely on a connector table. Boards that share a package or firmware family aren't automatically interchangeable.

For work on DSP storage layouts, shared buffers or memory pools, scratch-buffer reuse, or channel and phase counts, Inlay loads the `xmos-shared-memory` skill when it's needed. It also applies when data corrupts after a memory or assembly optimization, or when failures vary with channel or thread count. The skill covers byte-level capacity, ownership and lifetime, publication and reuse, cross-core synchronization, and boundary checks. It loads automatically in [Migration mode](#migrate-to-xmos). Name it in chat to use it directly:

```text theme={"theme":"css-variables"}
Use xmos-shared-memory to review the scratch buffer reuse in the new filter bank.
```

## Configure `.inlay/xmos.json`

Keep all XMOS project settings in `.inlay/xmos.json` at the project root. Every field is optional, and a missing file means the defaults. The file must be plain JSON, with no comments:

```json .inlay/xmos.json theme={"theme":"css-variables"}
{
  "xe": "bin/app.xe",
  "target": "hardware",
  "adapterId": "YOUR_XTAG_ID",
  "xscope": "auto",
  "xscopePort": 10101,
  "launchCommand": "xrun --xscope {xe}",
  "clientCommand": "my-decoder --connect {host}:{port}",
  "flash": {
    "targetFile": "board.xn",
    "bootPartitionSize": 1048576
  },
  "sim": {
    "args": ["--max-cycles", "20000000"],
    "pins": ["X0D49", "X0D50"],
    "sampleMhz": 25,
    "vcd": false,
    "jobs": 4
  }
}
```

| Field | Effect |
| - | - |
| `xe` | The `.xe` to run, relative to the project root. If it's unset or the file doesn't exist, Inlay uses the newest `.xe` in the project. Set it whenever the project builds several applications, so an old image never runs. |
| `target` | `simulator` uses xsim even when an xTAG is attached. `hardware` uses an xTAG. |
| `adapterId` | The xTAG to use. Compare it with the IDs from `xrun -l`. |
| `xscope` | `true` starts realtime xSCOPE, which host input and shared Trace recordings need. `false` turns xSCOPE off for images built without it. `"auto"`, the default, lets each workflow choose. See [xSCOPE](/docs/debug-mode/xscope.md). |
| `xscopePort`, `launchCommand`, `clientCommand` | Advanced xSCOPE overrides. Commands can use `{xe}`, `{host}`, `{port}`, and `{endpoint}`. |
| `flash.targetFile`, `flash.bootPartitionSize` | Board-specific settings for [programming boot flash](/docs/debug-mode/xmos-debugging.md#program-persistent-boot-flash). |
| `sim.*` | Simulator settings. See [XMOS xsim](/docs/debug-mode/xsim.md#project-settings). |

Selections you make in the Monitor's XMOS controls, such as the port and **App (.xe)**, are saved to this file. An explicit `.xe` in a request or script takes precedence over `xe`.

If the file contains an unknown field or an invalid value, Inlay ignores the whole file and uses the defaults. Check the field names and values when your settings don't seem to apply.

Inlay doesn't read XMOS settings such as `xmos_xe`, `xscope_*`, `xmos_adapter_id`, or `xmos_sim` from `INLAY.md`; only `Debug Interface = xgdb` belongs there. If Inlay finds those keys, it shows a notice asking you to move them to `.inlay/xmos.json`.

### Hardware or simulator

Every XMOS request picks the target the same way:

1. A target or adapter you name in the request or script, such as `simulator=True` or an adapter ID.
2. `target` and `adapterId` in `.inlay/xmos.json`, including selections saved from the Monitor.
3. Automatic detection: exactly one usable xTAG selects hardware.

Nothing falls back silently:

* Several xTAGs attached and no `adapterId` set: the request fails and lists the adapter IDs.
* No xTAG attached and no simulator choice: the request fails and suggests plugging in an xTAG, setting `"target": "simulator"`, or passing `simulator=True`.
* XTC Tools missing: the request fails and points you to the XTC Tools download page.

`"target": "simulator"` uses the simulator even when an xTAG is attached.

## Profile a session

Profile a debug or simulator session to see where your application spends its time. Inlay records xgprof data from the moment the session starts until you stop the profile, then reports it by function, source line, or address.

Hardware sessions produce sampled xgprof data. Simulator sessions produce execution counts. Don't compare the two as equivalent numbers.

Turn profiling on with `profile=True` when you start the session from a [hardware script](/docs/debug-mode/hardware-scripts.md), with `gdb.xmos_connect(...)` or `xsim.start(...)`. Close any XMOS debug session or simulation that's already running first. Otherwise the request fails with `Close the existing XMOS session before enabling profiling` or `Close the existing simulator before enabling profiling`.

```python .inlay/hardware/profile_bench.py theme={"theme":"css-variables"}
started = xsim.start(xe="bin/benchmark.xe", profile=True, xscope=False)
profile_id = started["profile_id"]
try:
    xsim.wait_for_output("BENCH_DONE", timeout_seconds=30)
finally:
    final = xsim.profile_stop(profile_id)

for level in ("function", "line", "address"):
    print(level, xsim.profile_report(profile_id, level=level, tile=0, limit=20))
```

| Helper | Use |
| - | - |
| `xsim.profile_stop(profile_id)`, `gdb.xmos_profile_stop(profile_id)` | Stop recording. Reports are available only after the profile stops. |
| `xsim.profile_report(profile_id, level="function", tile=None, core=None, limit=50)`, `gdb.xmos_profile_report(...)` | Read a report at the `function`, `line`, or `address` level, optionally for one tile or logical core. |
| `xsim.profile_status(profile_id)`, `gdb.xmos_profile_status(profile_id)` | Check whether the profile is `recording`, `complete`, or `incomplete`. |

Use the `xsim.*` helpers for a simulation started with `xsim.start()`, and the `gdb.*` helpers for a session started with `gdb.xmos_connect()`. A profile belongs to the script that started it, and Inlay stops it when that script ends.

Reports have one row per tile and logical core, in xgprof's units. A missing value means the data isn't available, not zero. If part of the capture fails, the profile is marked `incomplete`, and the reports it did capture are still readable.

Inlay keeps each profile in `.inlay/artifacts/xmos-profiles/<profile_id>/`, with its own copy of the `.xe` and the raw xgprof output, so its reports stay readable after you rebuild.

The profile covers startup as well as your workload, so use a fixed, repeatable workload for before-and-after comparisons. Keep the input, iteration count, target, clocks, optimization, and dependency revisions the same across runs.

## Migrate to XMOS

Migration mode ports an existing design to the XMOS board selected for your project. Use it for a SigmaStudio DSP project (`.dspproj`), or for MCU, DSP, FPGA, or older XMOS firmware. It appears in projects that target an XMOS platform.

See the [XMOS migration guide](/docs/solutions/sigmastudio-to-xmos.md) for how to start a migration, the export files to provide, how to read the converted design, and the migration's limits.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.