Loading...

Getting Started

Getting Started

The Axon Peripheral example code provides sample gateware and software implementations of a simple BroadbandSource peripheral, which has configurable sample rate and channel count. The example streams synthetic neural data, generated directly on the FPGA, consisting of action potentials and noise riding over a sinusoidal LFP.

The example carries peripheral ID 0xF001. The driver is the axon_test_source plugin — a RecordPluginWithLimits that configures the data generator and unpacks each frame into samples — and the gateware module is the matching state machine that synthesizes neural-like data and streams it over an AXI interface to the Axon Controller. You will build both modules into one package and install it on the device.

Prerequisites

You will need:

  • A Science headstage connected to an SDK-supported probe, reachable on your network.
  • synapsectl installed on your machine — pip install science-synapse.
  • Docker running locally. The build runs Lattice Radiant and a cross-compiler inside containers, so you do not install either yourself.
  • A Lattice Radiant license — please follow the instructions on how to get one here. Set the local environment variable LM_LICENSE_FILE to a license file path or a port@host server (e.g. export LM_LICENSE_FILE=7788@your-license-host). Gateware builds will abort immediately if it is unset.
export LM_LICENSE_FILE=7788@your-license-host

Clone, build and deploy

Clone

First, clone the repository and its submodules. The vcpkg submodule supplies the driver's C++ dependencies, so the --recursive step is not optional.

git clone https://github.com/sciencecorp/axon-peripheral-example.git
cd axon-peripheral-example
git submodule update --init --recursive

Build

Once installed, you can build both components of the peripheral with a single command:

synapsectl peripherals build both .

This does two independent builds and merges the results into a single .deb:

  1. The gateware container regenerates the board wiring from peripheral.yaml (axon-peripheral-sdk generate), then runs Radiant (axon-peripheral-sdk build) to produce an FPGA bitstream (.bit).
  2. The driver container cross-compiles the C++ plugin to aarch64 against scifi-peripheral-sdk, producing a shared object (.so).

The resulting .deb lands in dist/.

Note: The first build is slow. Docker pulls the Radiant and cross-compile images, and vcpkg compiles the C++ dependencies from source. Later builds reuse both caches.

If you only want to build one of the two modules during development, use the driver or gateware argument in place of both.

Deploy

After building the peripheral, load it onto your headstage:

synapsectl -u "your-device-identifier" peripherals deploy both . --package dist/scifi-axon-test-source_0.1.0_arm64.deb

Without --package, deploy will rebuild the peripheral. So, a single command can be used for both build and deploy:

synapsectl -u "your-device-identifier" peripherals deploy both .

Verify

Confirm the peripheral is loaded:

synapsectl -u "your-device-identifier" info

The Axon Test Source peripheral appears in the device's peripheral list with its name and ID (0xF001). If it does not, you may need to power cycle your probe.

Stream

Using synapsectl or the Headstage GUI, configure your peripheral with 16-bit data at a sample rate and number of channels of your choosing. By streaming data over the Broadband Source tap, you should see the neural signal.

Troubleshooting

To debug, watch logs on your headstage:"

synapsectl -u "your-device-identifier" logs

Note: A gateware build that exits immediately with a license error almost always means LM_LICENSE_FILE is unset or points at an unreachable server. Set it before retrying — see Prerequisites.

Note: If your driver code fails to find its C++ dependencies, the vcpkg submodule was not initialized. Run git submodule update --init --recursive and rebuild.

Moving On

To begin developing your own Axon Peripheral, see Gateware and Driver.