Sunday, November 22, 2026

What is inside of a NPU?

Freeing the 3.0 TOPS NPU on the Allwinner A733: How an On-Die Neural Accelerator Works, Mainline Linux etnaviv + Mesa Teflon Bring-Up, and Zero-Copy Video Processing

By Tim Michals
Featured for Hackster.io — Open-Source Edge AI, Mainline Linux & Embedded Vision


Introduction: What Does It Actually Take to Accelerate AI at the Edge?

Pick up almost any modern single-board computer and the headline spec jumps right off the box: “Octa-Core CPU + 3.0 TOPS AI NPU!” For robotics, smart cameras, and edge-vision projects, that promise sounds simple—plug in a camera, run a neural network, and detect objects in real time without needing a desktop GPU or sending video to the cloud.

Before diving into Linux drivers or silicon registers, it helps to step back and ask a simpler question: what is an AI accelerator actually doing, and why does a normal CPU struggle with it?

1. Why AI Needs So Much Math (and What “Convolution” Means)

When a computer vision model looks at a camera frame—say, a 1920×1080 image—it doesn’t “see” a person or a stop sign all at once. Instead, it passes the image through dozens of layers of convolution (CONV_2D).

A convolution is surprisingly simple: imagine taking a tiny 3×3 magnifying glass (called a kernel or filter) and sliding it across every single pixel of the image. At each stop, the computer multiplies those 9 pixel values by 9 learned weights and adds them up into one output number. Early layers look for simple things like vertical edges or bright spots; deeper layers combine those patterns into wheels, faces, or text. A single modern vision model might perform billions of these tiny multiply-and-add steps on every single frame—30 times a second. A general-purpose CPU is built for complex logic and branching, not doing billions of repetitive multiplies per second, so it quickly gets hot, burns power, and drops frames.

2. Why “8-Bit Quantization” Is the Secret Behind TOPS

Models are usually trained on big server GPUs using 32-bit floating-point numbers (FP32—high-precision decimals). On a tiny embedded board, you don’t need 32 bits of decimal precision just to tell a cat from a coffee mug. Quantization converts those FP32 weights and pixel values into compact 8-bit whole numbers (INT8 or UINT8, from -128..127 or 0..255).

Shrinking from 32-bit decimals to 8-bit integers makes each multiply-add circuit roughly 15–20× smaller and more power-efficient, and cuts memory traffic by 4×. When a chip advertises “3.0 TOPS” (Tera Operations Per Second), it means 3 trillion 8-bit integer operations per second—not 32-bit desktop floating point.

3. Fixed-Function NN Cores vs. Programmable Shaders (and Why You Need Both)

An NPU (Neural Processing Unit) isn’t just one giant calculator. Real AI pipelines do more than convolutions: you also have to resize/normalize camera pixels before inference, or run custom math, activations, and image filters afterward. Inside modern NPUs like the Vivante VIP9000 on Allwinner’s A733, the silicon is split into two complementary helpers: - NN (Neural Network) Cores: Fixed-function hardware arrays packed with hundreds of 8-bit multipliers. They are unbeatable at convolutions, but they cannot run arbitrary if/else code or general math. - PPU / Shader Core: A small programmable parallel processor (like a mini compute GPU) that runs short parallel programs (shaders) across hundreds of pixels or tensor elements at once—handling custom math, image pre/post-processing, and ops the fixed-function NN cores don’t support.

4. Why “Zero-Copy” Memory Matters for Live Video

Even with a fast NPU, copying a 1080p camera frame from the camera driver into CPU memory, converting it, and copying it back to the NPU wastes huge amounts of memory bandwidth. On Linux, dma-buf lets the camera hardware, video encoder, and NPU share the exact same physical memory buffer—so frames move from camera to NPU with zero CPU copies.

Breaking Out of the Vendor BSP Trap

Most SBCs lock this NPU hardware inside an old vendor kernel (5.15), closed-source userspace libraries (libVIPlite.so), and proprietary offline .nb model compilers. On the Radxa Cubie A7A (Allwinner A733) and Cubie A5E (Allwinner T527), we set out to unlock this stack on 100% open-source mainline Linux 7.1 using the upstream etnaviv DRM driver (/dev/dri/renderD128), Mesa 26.1.8 Teflon (libteflon.so, which runs standard .tflite models directly), and V4L2 dma-buf zero-copy camera pipelines.

Real silicon bring-up is messy, and this article shares the whole journey—what already works on live Cubie A7A hardware (PPU shader compute at 0.059–0.396 ms, zero-copy V4L2 /dev/video0 and CMA dma-buf -> NPU PRIME at 0.401–0.487 ms, and ov5647 CSI + Cedrus H.265 video), as well as the open HW_V83 NN conv2d DRAM-read investigation still underway.

Why Edge AI Matters (and CPU vs. GPU vs. NPU at a Glance)

Running AI locally on the board (“at the edge”) instead of in the cloud delivers sub-millisecond latency (critical for robotics and drones), privacy (camera feeds never leave the device), offline reliability, and high performance per watt: - CPU: Great for operating systems, networking, and branching logic (if/else); poor at billions of repetitive matrix multiplies. - GPU: Built for 32-bit floating-point graphics and parallel math, but power-hungry and absent or small on many headless embedded SoCs. - NPU: Purpose-built for quantized 8-bit neural network math and on-chip SRAM dataflow at a fraction of the power.

Companion Articles, Guides & How You Can Help

If you want to go deeper—or help crack the remaining open HW_V83 NN bring-up items—these companion guides cover each layer of the stack: - Use Cases & Workload Mapping: Inside an Edge AI Chip: NN Cores, Shaders, and Why You Need Both — plain-English guide to matching workloads across NPU, PPU shaders, Arm NEON, ISP/VE, and the on-die XuanTie E902 RISC-V core. - Silicon Debugging War Stories: Freeing the Allwinner A733 NPU on Mainline Linux 7.1: The 8 Real-World Problems We Solved — deep dive into 0x9003 vs. 0x9202, TP_ENGINE=0, MMUv2 PDMODE, and the ongoing HW_V83 NN DRAM-read investigation. - Copy-Pasteable Build, C++, PPU & Video Examples: Allwinner T527 & A733 Mainline NPU Guide — complete build instructions and verified npu-ppu-test / npu-v4l2-dmabuf-test commands. - Camera & Hardware Video Encoding: Camera / ISP 602 V4L2 Guide and A733 Cedrus H.264/H.265 Encoder Guide. - Upstream References: Mesa Teflon Documentation and Linux kernel drivers/gpu/drm/etnaviv/. - Want to pitch in? Community kernel/Mesa hackers are especially welcome to help test or trace the two remaining open items: the HW_V83 (0x9202) NN conv2d DRAM-read bug and etnaviv.ko rmmod/insmod PD_NPU re-probe (GC0 after power-domain cycle).


๐Ÿš€ 1. Silicon Architecture: How the A733 & T527 NPUs Work Under the Hood

If you have ever deployed a computer vision model (like YOLOv8, MobileNetV2, or PoseNet) on an embedded Linux single-board computer, you have felt the wall that general-purpose CPU cores hit when processing real-time 1080p video.

Even on a modern octa-core processor like the Allwinner A733 (2× Arm Cortex-A76 @ 2.0 GHz + 6× Cortex-A55 @ 1.8 GHz, powering the Radxa Cubie A7A) or the Allwinner T527 (8× Cortex-A55 @ 1.8 GHz, powering the Radxa Cubie A5E), running millions of multiply-accumulate operations per frame on the CPU means: - Burning 3–5 Watts of CPU thermal budget on matrix math instead of application logic. - Saturating the CPU’s L1/L2 caches and external DRAM bus by repeatedly fetching weights and writing intermediate feature maps. - Dropping frames whenever the CPU also has to handle camera capture, H.264/H.265 video encoding, or network streaming.

To solve this, silicon designers place a dedicated Neural Processing Unit (NPU) right on the SoC die. On the Allwinner A733 (verified on live Radxa Cubie A7A silicon), that NPU is a 3.0 TOPS-class VeriSilicon Vivante VIP9000Nano-DI (npu@3600000, model 0x9000, rev 0x9202, HW_V83); on the Allwinner T527, it is a 2.0 TOPS VeriSilicon Vivante VIP9000Nano-SI+ (npu@7120000, rev 0x9003).

How Does an NPU Work Compared to a CPU or GPU?

Unlike a CPU (which fetches scalar or small SIMD instructions one by one) or a GPU (which runs general-purpose 32-bit floating-point shaders), a neural network accelerator is a spatial dataflow engine purpose-built around four hardware principles:

  1. 8-Bit Quantized Tensor Math (INT8 / UINT8): Neural networks trained in 32-bit floating point (FP32) are quantized to 8-bit integers (INT8 or UINT8) using per-tensor or per-channel scale and zero-point parameters. An 8-bit integer multiply-accumulate (MAC) circuit takes roughly 15–20× less silicon area and switching energy than an FP32 fused multiply-add, allowing the A733 NPU to pack 8 parallel NN cores × 64 MADs/core (with ZDP3 spatial reuse, delivering up to 3.0 TOPS marketed peak at high OPP clocks) into a compact silicon footprint.
  2. Spatial Weight & Activation Broadcast Across 8 NN Cores: In a 2D convolution (3×3 or 1×1), the exact same kernel weights slide across thousands of (x, y) pixel locations, while the same input pixel patch is multiplied against dozens of output channels. Instead of reading weights from DRAM over and over, the NPU loads weights and input tiles once into 512 KB of ultra-wide on-chip VIP SRAM (128 bytes / 1024 bits per cycle physical width on the A733) and broadcasts them simultaneously across its 8 Neural Network (NN) cores.
  3. On-the-Fly Hardware Weight Decompression (Huffman + ZRL): Neural network weights contain large runs of zeros and clustered small integer values. When a model is loaded, its weights are compressed using Huffman coding and Zero-Run-Length (ZRL) encoding. Inside the NPU, a dedicated hardware bitstream decoder decompresses weights as DMA streams them from LPDDR5—cutting external memory bandwidth by 2–4× with zero CPU overhead.
  4. Fused Hardware Pooling, Activation & Requantization: Before a partial sum ever leaves an NN core, dedicated inline stages apply 32-bit bias addition, non-linear activation (ReLU, ReLU6, Clamp), 2×2 max or average pooling, and 8-bit requantization in a single pass. On SoCs with a dedicated Tensor Processor (TP) (such as the T527), layout transposes and LUT activations run on TP cores; on the A733 0x9202 (TP_ENGINE = 0), non-NN ops fall to the companion Programmable Shader / PPU core (NumShaderCores = 1) or CPU.

NN Cores vs. PPU Shaders vs. Missing TP Engine: Why Both Paths Matter (and Best Use Cases)

A common misconception is that an “NPU” is one single black-box circuit. On the Allwinner A733 (VIP9000Nano-DI, rev 0x9202), the block at 0x03600000 is actually a two-engine heterogeneous compute cluster sharing one Front-End DMA parser and MMUv2:

  • 8× NN Cores (Fixed-Function Convolution Arrays): Ultra-dense INT8 multiply-accumulate hardware (512 MACs/cycle). Blazing fast for CONV_2D, DEPTHWISE_CONV_2D, and FULLY_CONNECTED (90%+ of a YOLO or MobileNet backbone), but unable to run general-purpose code (if/else, float32 math, FFTs, image filters, or bounding-box NMS).
  • 1× PPU / Shader Core (Programmable Processing Unit, 256 Hardware Threads): A shader is simply a small parallel program (OpenCL / SIMD vector kernel) that executes across hundreds of pixels or tensor elements simultaneously—like a mini compute GPU bolted onto the NPU die. It handles everything fixed-function NN cores cannot: float32/fp16 math, image pre/post-processing, optical flow, custom activations, and tensor layout shuffles.
  • No Dedicated TP Engine (TP_ENGINE = 0): Older Vivante NPUs (T527 0x9003, i.MX8MP 0x8002) included a third dedicated Tensor Processor (TP) to transpose tensors (NHWC ↔︎ NCHW) and run LUT activations. On A733 0x9202, Vivante removed the TP hardware to save die area—making software support for both the NN engine (Path A) and PPU/CPU ops (Path B) essential.

Real edge-vision and robotics pipelines are never 100% convolutions. Matching each stage to the right silicon block on the A733 is why this dual-path mainline stack matters:

Allwinner A733 Heterogeneous AI & Vision Workload Mapping

Allwinner A733 (0x9202) vs. Allwinner T527 / A527 (0x9003): What Live Silicon Revealed

A common pitfall when reading vendor headers is guessing which gc_feature_database.h row matches an SoC without checking silicon. Before booting the A7A, it was easy to assume the A733 carried Allwinner’s 12-core 0x9113 (VIP9000UL-DI+) block—live hardware readback on the Radxa Cubie A7A (/sys/kernel/debug/dri/0/gpu) proved the A733 silicon is actually model 0x9000, revision 0x9202 (product_id 0x05090009, customer_id 0x1000003b, eco_id 0x08000000, chip date 2023-05-18) — VeriSilicon VIP9000Nano-DI (HW_V83, VIP_VERSION 0x398).

Live silicon register readbacks and VeriSilicon’s hardware feature database (allwinner/gc_feature_database.h) highlight the exact architectural differences between the A733 and T527:

Allwinner A733 (0x9202) vs. T527 / A527 (0x9003) NPU Silicon Comparison

๐Ÿ”“ 2. Breaking Out of the Proprietary Vendor Trap: Why Mainline etnaviv + Mesa Teflon?

Traditionally, using a Vivante VIP9000 NPU on an Allwinner SoC meant accepting a locked-down vendor BSP stack: * Kernel Space: A ~44,000-line out-of-tree kernel module (vipcore.ko or galcore.ko exposing /dev/vipcore or /dev/galcore) that breaks on every minor Linux kernel upgrade (EXTRA_CFLAGS removal, in_irq() deprecation, MAX_ORDER rename, platform_driver .remove signature changes). * Userspace: Precompiled closed-source shared libraries (libVIPlite.so, libVIPuser.so, or TIM-VX) tied to a specific glibc/Android ABI. * Offline Model Lock-In: You cannot load a standard .tflite model directly. Instead, you must run a proprietary x86 offline compiler (acuity-toolkit / pegasus) to convert your model into a locked .nb (network_binary.nb) blob tailored to a single chip revision.

To run on mainline Linux 7.1 with zero binary blobs, we replaced the entire vendor stack with upstream open-source components:

Legacy Vendor NPU Stack vs. Mainline Open-Source Stack

Proprietary ACUITY / libVIPlite / awnn vs. Mainline etnaviv + Teflon: Honest Trade-Offs

To be fair to the vendor stack, Allwinner and VeriSilicon’s proprietary tools (ACUITY + .nb + libVIPlite.so / libNBGlinker.so + Allwinner awnn) exist for a reason and do offer real advantages today when running on the vendor 5.15 BSP: * Ahead-of-Time Whole-Graph Optimization (.nb): ACUITY compiles ONNX, PyTorch, or TFLite models offline on an x86 PC into a pre-scheduled .nb binary—eliminating runtime graph compilation overhead and fusing Conv + Bias + ReLU + Pool aggressively. * Hardware Weight Compression & VIP SRAM Tiling: ACUITY emits Huffman + Zero-Run-Length (ZRL) compressed weights (2–4× less LPDDR5 traffic) and statically tiles intermediate feature maps inside the 512 KB on-chip VIP SRAM across consecutive layers so tensors stay on-die instead of bouncing through external DRAM. * Broader Operator & Precision Coverage: Supports INT8, UINT8, and INT16, custom OpenVX/PPU kernels, and turnkey Allwinner awnn / vpm_run demos (YOLOv5, YOLOv8, face/pose) out of the box.

Can we use libVIPlite.so, ACUITY, or awnn inside our open-source mainline stack? No — not directly. libVIPlite.so, libNBGlinker.so, awnn, and the ACUITY compiler are closed-source proprietary binaries tied to the out-of-tree /dev/vipcore ioctl ABI (not Linux DRM /dev/dri/renderD128), and vipcore.ko cannot be upstreamed into mainline Linux.

Wait—doesn’t ACUITY need an x86 PC? Can open source actually match its speed on the board? VeriSilicon ships ACUITY as an x86-only offline tool largely for convenience and IP protection, not because the Arm SoC can’t do the graph compilation. Compressing quantized weights (Huffman/ZRL), planning 512 KB VIP SRAM tiles, and building the command stream take a fraction of a second once at model-load time on the A733’s Cortex-A76/A55 cores (and can be cached to disk so subsequent runs load in milliseconds)—no x86 Docker container required.

Because all of the underlying capabilities (Huffman/ZRL weight compression, VIP SRAM tiling, multi-layer batching, and PPU shaders) are hardware features of the VIP9000 die, we are still resolving the HW_V83 NN DRAM-read issue first, and our next steps are to bring those exact optimizations clean-room into MIT-licensed Mesa etnaviv / Teflon so the open-source stack can match proprietary .nb performance without binary blobs or kernel lock-in.


๐Ÿ”ฌ 3. Inside the Chip: How the A733 NPU Works (Clocks, MMUv2, DMA & 8 NN Cores)

To understand what happens inside the silicon at 0x03600000 when an AI inference job runs—and why specific clock, reset, and MMUv2 registers had to be unlocked for the Allwinner A733—let’s trace the internal hardware blocks from the power rail down to the 8 NN cores.

Allwinner A733 3.0 TOPS NPU Silicon Architecture & DMA Dataflow

3.1 Power Domain, 4-Clock CCU Hierarchy & Triple Reset Lines

Before a single register at 0x03600000 responds to CPU reads, three hardware prerequisites must be satisfied in strict order:

  1. Power Supply & Silicon Island (AXP8191 dcdc2 + PCK-600 PD_NPU):
    • The external vdd-gpu-npu power rail is driven by the AXP8191 PMIC dcdc2 buck converter (800 mV at 492–852 MHz boot nominal, scaling up to 960–1080 mV at 1008–1120 MHz OPP bins).
    • Inside the A733 SoC, the PCK-600 Power Controller (7060000.power-controller) controls power isolation for the NPU island via domain PD_NPU (id 4, pstate=0x8, on). When etnaviv calls pm_runtime_resume_and_get(), Linux genpd powers on PD_NPU and releases isolation clamps.
  2. The 4-Clock Tree in Mainline ccu-sun60i-a733.c:
    • CLK_NPU (0x0b00, "core"): The high-speed compute clock driving the 8 NN cores and 512 KB VIP SRAM (840 MHz default from pll-npu, muxable across pll-npu, pll-periph0-800M/600M/480M, pll-ve0, pll-ve1, pll-de-3x) with a 5-bit divider (M) and gate BIT(31).
    • CLK_AHB_NPU (0x05c0 bit 6) → CLK_BUS_NPU (0x0b04 bit 0, "reg", 200 MHz): On the A733, CPU register reads/writes to 0x03600000 traverse two series AHB clock gates: the top-level NPU AHB master gate (0x05c0 bit 6) and the NPU module bus gate (0x0b04 bit 0). In drivers/clk/sunxi-ng/ccu-sun60i-a733.c, we parented bus_npu_clk (CLK_BUS_NPU) directly to ahb_npu_clk (CLK_AHB_NPU). That way, when etnaviv enables its "reg" clock, the Linux Common Clock Framework automatically enables both 0x05c0[6] and 0x0b04[0].
    • CLK_MBUS_NPU (0x05e0 bit 18, "bus", 600 MHz): Gates the 128-bit AXI/MBUS DMA master port, parented to mbus_clk (600 MHz, synced with Junhui Liu’s upstream A733 CCU v7 patch series). If CLK_MBUS_NPU is left gated, MMIO register reads work fine, but the NPU’s DMA engine stalls forever the moment it tries to fetch its first command buffer from LPDDR5!
  3. Triple Reset Lines (0x0b04 bits 16, 17, 18):
    • Unlike the T527 (which has a single RST_BUS_NPU bit), A733 register 0x0b04 splits the NPU reset into active-low lines: RST_BUS_NPU_CORE (BIT(16)), RST_BUS_NPU_AXI (BIT(17)), RST_BUS_NPU_AHB (BIT(18)) (plus RST_BUS_NPU_SRAM at BIT(19), read back as 0x000F0000 deasserted on silicon).
    • Mainline etnaviv previously called devm_reset_control_get_optional(), which only supports a single reset line. By switching etnaviv_gpu_platform_probe() to devm_reset_control_array_get_optional_exclusive(&pdev->dev) (and updating vivante,gc.yaml to maxItems: 3), etnaviv cleanly asserts and deasserts all three reset lines as a unit.

How does the NPU execute a multi-layer neural network without CPU intervention between layers?

At the front of the NPU sits the Front-End (FE) Command Parser. It is a dedicated DMA state machine that reads 64-bit instructions (LOAD_STATE, END, NOP, WAIT, LINK, STALL) directly from system memory:

  • Wait-Link Ring Buffer: The kernel maintains a small circular ring buffer in DMA memory ending in a 16-byte WAIT (200 cycles) → LINK (back to WAIT) loop. While the NPU is idle or finishing a job, the FE parser continuously loops between those two instructions.
  • Dynamic Job Chaining: When userspace submits an inference command stream, the kernel writes a LINK instruction at the end of the user buffer pointing back to the kernel’s new WAIT -> LINK tail, and then overwrites the previous LINK target in the active ring to jump into the user’s command stream. The FE seamlessly follows the new link on its very next cycle without ever stopping.
  • Why ETNA_SEC_KERNEL (0x003A4) Is Mandatory: The VIP9000Nano-DI (0x9202) implements Vivante’s Security AHB feature (MINOR_FEATURES7_BIT_SECURITY + MINOR_FEATURES10_SECURITY_AHB). On this hardware, the legacy VIVS_FE_COMMAND_CONTROL (0x00658) kick register is a no-op. By adding the Allwinner 0x9000 NPU entries (0x8303, 0x9003, 0x9113, 0x9202) to the kernel’s etnaviv_hwdb.c, etnaviv enables gpu->sec_mode = ETNA_SEC_KERNEL: it unlocks non-secure register writes at 0x003A8, writes the command buffer address to VIVS_FE_COMMAND_ADDR (0x00654), and starts the FE via VIVS_MMUv2_SEC_COMMAND_CONTROL (0x003A4).

3.3 MMUv2 Virtual Memory & The A733 0x003B4 Page Descriptor Handshake

Every memory address inside an NPU job—the command buffer, compressed weights, bias tables, input feature maps, and output tensors—is a 32-bit NPU Virtual Address (NPU_VA).

  1. Two-Level Page Walk (PTA → MTLB → STLB):
    • The NPU’s internal MMUv2 translates every 32-bit NPU_VA into a 40-bit LPDDR5 Physical Address (PA) using a Page Table Array (PTA at 0x0038C/0x00390), a 1024-entry Master TLB (MTLB, bits [31:22]), and 1024-entry Slave TLB page tables (STLB, bits [21:12], 4 KB pages).
    • Because the MMU translates scatter-gather physical pages into a contiguous virtual range, large neural network weight buffers do not need physically contiguous CMA memory—standard paged Linux GEM buffers work out of the box.
  2. The Revision 0x9202 MMU_PAGE_DESCRIPTOR (PDMODE) Architecture (0x003B4, 0x00388, 0x00184):
    • On older Vivante cores like the T527 (0x9003), etnaviv_iommuv2_restore_sec() initializes MMUv2 via a Page Table Array (PTA at 0x0038C/0x00390/0x00394), runs a physical-mode FE command buffer (load_state(VIVS_MMUv2_PTA_CONFIG)), and writes 0x00388 = 0x01.
    • On the A733 (0x9202), VeriSilicon enabled MMU_PAGE_DESCRIPTOR = 1 (mmu_pd_mode = 1 in Allwinner’s vip_drv_hardware.c). Instead of PTA indirection, the kernel writes the 4 KB Master TLB physical frame directly to 0x003B4 = ((mtlb_dma >> 12) << 4) | MODE4_K (bit 0 = 0 for etnaviv’s 4 KB MTLB / 4 MB per-MTLB layout, vs 1 for 1 KB / 16 MB MODE1_K), skips PTA_CONTROL, configures 0x0055C = 0x00FFFFFF (MC_L2_CACHE_CONFIG) and 0x00090 |= BIT(6) (bypass_reorder), and enables PDMODE via 0x00388 = 0x21 (BIT(5) | ENABLE).
    • Subtle TLB Flush Trap in etnaviv_buffer.c: Mainline etnaviv flushes the MMUv2 TLB by writing 0x00000018 (MODE_MASK | FLUSH) to VIVS_MMUv2_CONFIGURATION (0x00184)—which leaves bit 8 (ADDRESS_MASK) as 0, zeroing the MTLB base address under PDMODE! Matching Allwinner’s vip_drv_mmu.c, PDMODE flushes must write 0xffffff7f (ADDRESS_MASK = 1, MODE_MASK = 1, FLUSH_MASK = 0, FLUSH = 1) so dynamic BO mappings flush the TLB without clobbering the page-table base.

3.4 Inside the Compute Engines: 8 NN Cores, 1 PPU Shader Core & 512 KB VIP SRAM

Once the FE parses a layer kick (VIVS_PS_NN_INST_ADDR at 0x010A0 + VIVS_PS_UNK10A4 at 0x010A4), the actual tensor math runs across the internal blocks wired to the 512 KB on-chip VIP SRAM:

  • 8 Parallel NN Cores (HW_V83, VIP_VERSION = 0x398): The NN cluster fetches a 128-byte descriptor from VIVS_PS_NN_INST_ADDR, streams compressed weights from LPDDR5 into the 512 KB VIP SRAM (128-byte physical width, mapped via VIVS_GL_OCB_REMAP_START/END), and executes 64 MADs/core across all 8 NN cores in parallel (32 lanes/output cycle). On 0x9202, VeriSilicon enabled HW_V83, NN_SMALL_BATCH_PHASE2 = 1, NN_TENSOR_ADD_FIELD_MOVE_TO_EXT_CMD = 1, and ZRL_8BIT = 0.
  • 1 Programmable Shader / PPU Core (No Dedicated TP Block): Unlike the T527 (2 TP cores), the A733’s 0x9202 silicon sets TP_ENGINE = 0 and TPEngine_CoreCount = 0. All non-NN tensor manipulation (such as NHWC ↔︎ NCHW layout transpose, padding, or custom elementwise activations) must execute on the single USC / PPU Shader core (256 threads, 64 temp regs, 512 instructions) or the Arm CPU—a key architectural difference that surfaced immediately during our live Mesa Teflon bring-up below.

๐Ÿงฉ 4. How It Interfaces: The 4-Layer Open-Source Driver & AI Stack

How does a Python script or C/C++ application loading a standard .tflite file end up driving 8 NN cores through /dev/dri/renderD128? The software stack is cleanly split into four layers.

Open-Source NPU Software Stack: TFLite C API -> Mesa Teflon -> Etnaviv Gallium -> Linux DRM

4.1 Layer 1: Application & TensorFlow Lite Runtime (libtensorflow-lite.so)

Your application uses the standard TensorFlow Lite C API (<tensorflow/lite/c/c_api.h>) or Python tflite_runtime. You do not link against any proprietary NPU SDK. Instead, you load Mesa’s /usr/lib/libteflon.so as a standard TFLite external delegate plugin (tflite_plugin_create_delegate):

#include <dlfcn.h>
#include <tensorflow/lite/c/c_api.h>

typedef TfLiteDelegate* (*create_delegate_fn)(char**, char**, size_t,
                                              void (*)(const char*));
typedef void (*destroy_delegate_fn)(TfLiteDelegate*);

void run_npu_inference(const char *model_path) {
    /* 1. Dynamically load Mesa's open-source Teflon TFLite delegate */
    void *teflon_so = dlopen("/usr/lib/libteflon.so", RTLD_LAZY);
    create_delegate_fn create_delegate =
        (create_delegate_fn)dlsym(teflon_so, "tflite_plugin_create_delegate");
    destroy_delegate_fn destroy_delegate =
        (destroy_delegate_fn)dlsym(teflon_so, "tflite_plugin_destroy_delegate");

    TfLiteDelegate *npu_delegate = create_delegate(NULL, NULL, 0, NULL);

    /* 2. Attach the NPU delegate to TFLite InterpreterOptions */
    TfLiteModel *model = TfLiteModelCreateFromFile(model_path);
    TfLiteInterpreterOptions *opts = TfLiteInterpreterOptionsCreate();
    TfLiteInterpreterOptionsAddDelegate(opts, npu_delegate);

    /* 3. Create interpreter: Teflon partitions supported INT8/UINT8 subgraphs */
    TfLiteInterpreter *interp = TfLiteInterpreterCreate(model, opts);
    TfLiteInterpreterAllocateTensors(interp);

    /* 4. Fill input tensor, run on the 3.0 TOPS NPU, read output tensor */
    TfLiteInterpreterInvoke(interp);

    TfLiteInterpreterDelete(interp);
    TfLiteInterpreterOptionsDelete(opts);
    TfLiteModelDelete(model);
    destroy_delegate(npu_delegate);
    dlclose(teflon_so);
}

Or in Python (ctypes or tflite_runtime):

# Or run our built-in zero-dependency verification & benchmark utility:
#   npu-smoke-test /path/to/model_quant.tflite 50

4.2 Layer 2: Mesa Teflon Delegate Frontend (src/gallium/frontends/teflon/)

When TfLiteInterpreterCreate() and TfLiteInterpreterAllocateTensors() execute: 1. DRM Render Node Discovery: Teflon opens /dev/dri/renderD128 via pipe_loader_drm_probe_fd() and instantiates a Gallium pipe_screen and pipe_context backed by etnaviv. 2. Automatic Graph Partitioning (Prepare): Teflon walks every node in the .tflite flatbuffer graph. Supported quantized (INT8 / UINT8) operators—CONV_2D, DEPTHWISE_CONV_2D, FULLY_CONNECTED (lowered to 1×1 convolution), ADD, AVERAGE_POOL_2D, MAX_POOL_2D, PAD, LOGISTIC, and fused RELU / RELU6—are claimed by the Teflon delegate and merged into contiguous NPU subgraphs. Any unsupported operator (such as a final SOFTMAX dequantization node) automatically remains on the Arm CPU. 3. Lowering to Gallium ML: Teflon converts the partitioned TFLite subgraph into an array of hardware-agnostic Gallium struct pipe_ml_operation descriptors and hands them to context->ml_subgraph_create().

4.3 Layer 3: Mesa Etnaviv Gallium ML Backend (src/gallium/drivers/etnaviv/)

Inside Mesa’s etnaviv driver, the neural network subgraph is compiled directly into VIP9000 hardware descriptors, compressed weight bitstreams, and FE command buffers:

  1. Silicon Feature Database Lookup (allwinner/gc_feature_database.h):
    • At screen creation, Mesa queries the kernel via DRM_IOCTL_ETNAVIV_GET_PARAM for MODEL (0x9000), REVISION (0x9202), PRODUCT_ID (0x05090009), CUSTOMER_ID (0x1000003b), and ECO_ID (0x08000000).
    • etna_query_feature_db() in src/etnaviv/hwdb/etna_hwdb.c looks up the exact silicon row in src/etnaviv/hwdb/allwinner/gc_feature_database.h and configures the compiler for the A733’s nn_core_count = 8, nn_mad_per_core = 64, on_chip_sram_size = 524288 (512 KB), physical_vip_sram_width = 128 (128 bytes/cycle), nn_zdp3 = true, and nn_lanes_per_out_cycle = 32.
    • The TP_ENGINE = 0 Discovery on Live 0x9202 Silicon: Earlier Mesa patches forced info->npu.tp_core_count = db->TPEngine_CoreCount ? db->TPEngine_CoreCount : 1; assuming a single TP unit existed whenever TPEngine_CoreCount was 0. Live silicon testing on the A7A (0x9202, where gcFEATURE_BIT_TP_ENGINE = 0 and TPEngine_CoreCount = 0) proved that the hardware truly has no TP engine—TP transpose/detranspose ops become silent no-ops, leaving intermediate and final buffers zeroed unless lowered to the PPU shader core or CPU!
  2. One-Time Compilation During AllocateTensors() (etna_ml_subgraph_create):
    • Hardware Transpose & Channel Reshuffle Insertion (etnaviv_ml_tp.c): Whenever an input or output tensor layout requires realignment between TFLite’s NHWC and the NN engine’s NCHW, Mesa wraps the graph with transpose/detranspose stages (which use hardware TP cores on T527 0x9003, and need a PPU shader / CPU fallback on A733 0x9202).
    • V8 Superblock Tiling & Weight Compression (etnaviv_ml_nn_v8.c): Filter weights and biases are tiled into V8 superblocks matched to 8 NN cores and the 512 KB VIP SRAM, compressed into a bitstream, and uploaded into a write-combined GEM buffer object (coefficients).
    • Command Stream Generation (etnaviv_ml.c): Mesa records the entire sequence of FE register writes (VIVS_GL_OCB_REMAP_START/END, VIVS_GL_NN_CONFIG, VIVS_PS_NN_INST_ADDR, VIVS_PS_UNK10A4, and VIVS_GL_FLUSH_CACHE barriers).
  3. Zero-Recompile Inference During Invoke() (etna_ml_subgraph_invoke):
    • Every call to TfLiteInterpreterInvoke() simply updates the input tensor BO, submits the pre-compiled command stream via DRM_IOCTL_ETNAVIV_GEM_SUBMIT, and waits on the hardware fence via DRM_IOCTL_ETNAVIV_WAIT_FENCE.

4.4 Layer 4: Mainline Linux 7.1 etnaviv DRM Kernel Driver (drivers/gpu/drm/etnaviv/)

In kernel space, etnaviv provides: * Unprivileged Compute Access (/dev/dri/renderD128): AI applications run as normal non-root users via the DRM render node. * Per-Process MMUv2 Isolation & dma-buf PRIME Import: Every process gets isolated MMUv2 page tables, and camera/video buffers from V4L2 or G2D can be imported directly into NPU virtual memory via DRM_IOCTL_PRIME_FD_TO_HANDLE. * DRM GPU Scheduler (drm_gpu_scheduler) & Runtime PM: Fair job scheduling, hardware hang detection with automatic triple-reset recovery, and runtime power gating of PD_NPU when idle.


๐ŸŽฅ 5. Zero-Copy Video Processing: Connecting MIPI CSI-2, ISP 602, Hardware H.264/H.265 VE, and the 3.0 TOPS NPU

In a real vision application—an autonomous drone, agricultural sprayer, security camera, or industrial inspection rig—the NPU does not live in isolation. It consumes live video frames from a camera while a video encoder simultaneously records or streams those frames over RTSP/WebRTC.

If the CPU had to copy every 1080p (1920 × 1088) NV12 frame (3.13 MB/frame, or ~94 MB/s at 30 fps) between the camera driver, the H.265 video encoder, and the NPU preprocessor, memcpy() and cache flushes alone would saturate an entire CPU core.

On the Allwinner A733 (Radxa Cubie A7A), we eliminate CPU frame copies by passing Linux dma-buf file descriptors allocated in shared LPDDR5 CMA memory directly across all hardware engines:

Allwinner A733 Zero-Copy Heterogeneous Vision, NPU Inference & Video Encoding Pipeline

5.1 Stage 1: Photon to Shared NV12 dma-buf (0% CPU Pixel Math)

  1. MIPI CSI-2 Sensor (OV5647) & D-PHY (0x05800000): The camera sensor streams 10-bit Raw Bayer (SRGGB10_1X10) at 1920 × 1080 @ 30 fps over a 2-lane MIPI CSI-2 link into the A733 combo D-PHY and CSI0 receiver (0x05811000).
  2. In-Line Hardware ISP 602 (0x05809400, sun60i-isp): Running in on-the-fly (online) mode directly from the CSI parser FIFO at ~148.5 Mpixels/s, the Hardware ISP 602 performs black-level correction, lens shading, 2D noise reduction, Bayer demosaicing, color correction (CCM), gamma, and RGB-to-NV12 color space conversion in dedicated silicon (0% CPU). Userspace aw-isp-2a runs only once per frame (30 Hz) to read compact 3A histogram statistics and update sensor exposure/gain over I²C.
  3. CSI DMA0 (0x05813000, /dev/video0): Writes stride-aligned 1920 × 1088 planar NV12 frames (Y luma + interleaved UV chroma) directly into contiguous LPDDR5 CMA ring buffers (vb2-dma-contig) and exports each buffer as a dma-buf PRIME file descriptor via VIDIOC_EXPBUF.

5.2 Stage 2: Parallel Zero-Copy Fan-Out to Hardware Video Encoder, 3.0 TOPS NPU & RISC-V

When V4L2 dequeues a completed camera frame (VIDIOC_DQBUF), userspace hands the dma-buf FD to three hardware blocks in parallel without copying the 3.13 MB frame on the CPU:

  1. Branch A — Hardware H.264 / H.265 Video Encoding (ve@1c10000, < 1.6% CPU):
    • The V4L2 dma-buf FD is imported directly into the Allwinner A733 Video Engine (ve@1c10000, VE300 / V3102_0016) with VE_BUFFER_FLAG_DMA_BUF.
    • The VE’s internal hardware CSI / ISP preprocessor (+0xA00) and AVC (+0xB00) / HEVC (+0xC00) encoder sub-engines read the Y and UV planes directly from the camera CMA buffer over the 128-bit MBUS DMA port (CLK_MBUS_VE at 600 MHz).
    • Measured Hardware Performance on Radxa Cubie A7A:
      • 1080p30 H.264 (AVC) Hardware Encoding: 3.09 ms/frame (323.5 fps max throughput), 0.89% total system CPU usage.
      • 1080p30 H.265 (HEVC) Hardware Encoding: 6.34 ms/frame (157.8 fps max throughput), 1.55% total system CPU usage.
  2. Branch B — 3.0 TOPS-Class VIP9000Nano-DI NPU Inference (npu@3600000):
    • Simultaneously, the NPU processes the detection tensor (e.g. 640 × 640 × 3 or 320 × 320 × 3 UINT8/INT8).
    • Using Allwinner’s G2D 2D hardware blitter (g2d@1480000 — hardware YUV-to-RGB color conversion + bilinear downscaler accepting the source V4L2 dma-buf FD and writing directly into an etnaviv GEM dma-buf BO via drmPrimeFDToHandle()), or a fast NEON stride-gather into the write-combined Teflon input BO, the input tensor is mapped into the NPU’s MMUv2 (0x00388) page table.
    • Calling TfLiteInterpreterInvoke() runs the pre-compiled Teflon command stream across the 8 NN cores and 512 KB VIP SRAM, outputting bounding boxes, class IDs, and confidence scores while the Arm cores remain largely idle.
  3. Branch C — Hard Real-Time Actuation on the On-Die 200 MHz RISC-V Core (rproc@7032000):
    • When the NPU detects a target (ฮ”x, ฮ”y, class, confidence), Linux writes a 16-byte setpoint into System SRAM A2 (0x00044000) and rings the Hardware MSGBOX0 (0x07033000) doorbell.
    • Within 14.47 ยตs, the on-die 200 MHz XuanTie E902 RISC-V coprocessor updates its bare-metal PID / motor control loop with zero Linux scheduling jitter (see our companion Hackster.io guide on Unlocking the On-Die 200 MHz XuanTie RISC-V Core).

๐Ÿ› ️ 6. Step-by-Step Implementation & Board Verification

Here is the exact Device Tree, Kernel, Buildroot, and verification setup used on the Radxa Cubie A7A (Allwinner A733) in this repository.

6.1 Device Tree Node (sun60i-a733-cubie-a7a.dts)

In arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7a.dts, we define the NPU node at 0x03600000 with its 3 clocks (bus, core, reg), 3 reset lines (core, axi, ahb), PCK-600 power domain (PD_NPU), and the AXP8191 dcdc2 (vdd-gpu-npu) regulator:

npu: npu@3600000 {
    compatible = "vivante,gc";
    reg = <0x03600000 0x1000>;
    interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
    clocks = <&ccu CLK_MBUS_NPU>,
             <&ccu CLK_NPU>,
             <&ccu CLK_BUS_NPU>;
    clock-names = "bus", "core", "reg";
    resets = <&ccu RST_BUS_NPU_CORE>,
             <&ccu RST_BUS_NPU_AXI>,
             <&ccu RST_BUS_NPU_AHB>;
    reset-names = "core", "axi", "ahb";
    power-domains = <&pck600 PD_NPU>;
    #cooling-cells = <2>;
};

6.2 Summary of the 6 Mainline Kernel & Mesa Fixes for Allwinner A733 (0x9202)

Summary of the 6 Mainline Kernel & Mesa Fixes for Allwinner A733 (0x9202)

6.3 Live Silicon Verification on Radxa Cubie A7A (Two Complementary Compute Paths)

Because the VIP9000Nano-DI (0x9202) combines a programmable Vivante PPU (OpenCL/Shader) core with an 8-core HW_V83 Neural Network (NN) engine, we validate and expose both compute paths on /dev/dri/renderD128 for different workloads:

  • Path A — Neural Network Inference (Mesa 26.1.8 Teflon + 8× NN Cores): Zero-compile TFLite delegation for quantized CNNs (CONV_2D, DEPTHWISE_CONV_2D, FULLY_CONNECTED).
  • Path B — General-Purpose Compute (etnaviv DRM + Vivante PPU Shader Core): Low-latency custom kernels (npu_ppu_compute_test.c) for image pre/post-processing, DSP math, or custom non-CNN algorithms.

Booting our mainline Linux 7.1.0 PREEMPT_RT Buildroot image on the Radxa Cubie A7A confirmed full kernel bring-up and live PPU + NN execution:

# 1. Verified live kernel boot log on Radxa Cubie A7A:
dmesg | grep -iE "etnaviv|npu"
#   [    0.111755] sunxi-pck-600 7060000.power-controller: domain "NPU" (id 4) pstate=0x8, on
#   [    0.125867] etnaviv etnaviv: bound 3600000.npu (ops gpu_ops)
#   [    0.125975] etnaviv-gpu 3600000.npu: model: GC9000, revision: 9202
#   [    0.125986] etnaviv-gpu 3600000.npu: etnaviv has been instantiated on a NPU, for which the UAPI is still experimental
#   [    0.126585] [drm] Initialized etnaviv 1.4.0 for etnaviv on minor 0

# 2. Verified live silicon identity, clocks, power & thermals:
cat /sys/kernel/debug/dri/0/gpu
#   model: 0x9000 | revision: 0x9202 | product_id: 0x5090009
#   customer_id: 0x1000003b | eco_id: 0x8000000
#   shader_core_count: 1 | nn_core_count: 8 | thread_count: 256
#   pll-npu / npu = 840 MHz | mbus-npu = 600 MHz | bus-npu = 200 MHz
#   vdd-gpu-npu (AXP8191 dcdc2) = 800 mV (in spec for SID vf0500/vf0501) | NPU temp = 35.9 C

✅ Verified Live on A733 Silicon

  1. Path B — Vivante PPU Compute Shader (npu_ppu_compute_test.c): Executing a 28-DWORD cold-boot-deterministic Vivante PPU compute shader (img_load.u8 → lshift.s32 → rshift.s32 → i2f.s32 → mov t2, u2 → mul → img_store.u8) directly on 3600000.npu via DRM_IOCTL_ETNAVIV_GEM_SUBMIT completed in 0.052–0.950 ms per dispatch across 10/10 consecutive runs with 0 MMU faults, 0 hangs, clean GIC_SPI 65 interrupts, and bit-exact IEEE-754 float32 outputs across all tested inputs:
    • fill = 1 → 0x3d808000 (0.062744)
    • fill = 2 → 0x3e008000 (0.125488)
    • fill = 3 → 0x3e40c000 (0.188232)
    • fill = 5 → 0x3ea0a000 (0.313721)
    • fill = 7 → 0x3ee0e000 (0.439209)
  2. Zero-Copy V4L2 / CMA dma-buf PRIME → NPU PPU Shader (npu_v4l2_dmabuf_test.c): Exporting a V4L2 capture buffer via VIDIOC_EXPBUF (/dev/video0, 0.206 ms) or allocating a CMA dma-heap buffer (/dev/dma_heap/default_cma_region, 0.220 ms) and importing it into etnaviv via DRM_IOCTL_PRIME_FD_TO_HANDLE executed the PPU compute shader directly on the video buffer with bit-exact IEEE-754 float32 output (0x3ea0a000) and zero CPU memcpy.
  3. Path A — Live Silicon Reverse-Engineering of HW_V83 (0x9202) NN Descriptors (WIP): Comparing 0x9202 against every other NPU in Mesa’s HWDB revealed that Allwinner A733 is the first chip in Mesa combining four new Vivante HW_V83 features. Live register and descriptor sweeps on the Cubie A7A proved every single bitfield on silicon:
    • FP_INIMAGE_POST_SCALE = 1 (NN_INT8_SCALE = 0): On earlier V8 chips (e.g. Amlogic 0x8302), Mesa wrote shift = 127 - exp (e.g. 8) into post_shift. On 0x9202, HW_V83 interprets post_shift (w2[31:27] + w15[29:28] + w15[30]) as the raw IEEE-754 biased exponent (scale_bits >> 23, e.g. 119/120), paired with the 23-bit mantissa in post_multiplier* (w22[25:18], w17[31:24], w15[27:22], w2[26]) and sign bit in w27[28]. Writing 8 multiplied every accumulator by 2^(8-127) ≈ 0 (producing 0 + out_zero_point = 128 everywhere); switching to the raw IEEE-754 exponent immediately produced real spatially-structured 3×3 SAME-padded Conv2D feature maps on silicon (0.11 ms per dispatch).
    • NN_CMD_SUPPORT_SLICE = 1: w8[31:16] (out_image_y_stride) and w16[31:16] (in_image_y_stride) are channel-slice byte strides (x * y), not row counts (y). Programming out_image_y_stride = 64 (8 * 8) immediately wrote all 4 output channels cleanly (256/256 bytes, TotalWrites = 0x20).
    • TP_ENGINE = 0 (TPEngine_CoreCount = 0): Vivante removed the hardware TP block on 0x9202 (replacing it with a Stream Processor, SP_VECTOR_DEPTH = 0x400). Our Mesa patch (0002-etnaviv-teflon-add-hw-v83-and-no-tp-support.patch) reports tp_core_count = 0 and executes internal NHWC ↔︎ NCHW layout transposes and strided reshuffles on CPU with GPU batch synchronization.
    • MMU_PAGE_DESCRIPTOR = 1 (mmu_pd_mode = 1) & Current WIP Status: Controlled live probes showed that under legacy PTA mode (0x003B4 = 0x1, 0x00388 = 0x01), NN descriptor and output writes hit DRAM while NN input/coefficient DMA streams read 0xFF. Cross-checking Allwinner’s vendor vip_drv_hardware.c and vip_drv_mmu.c confirmed 0x9202 requires native MODE4_K MMUv2 PDMODE (0x003B4 = ((mtlb_dma >> 12) << 4) | 0x0, 0x00388 = 0x21, skipping PTA_CONTROL, plus 0xffffff7f TLB flushes). On live /usr/bin/npu-smoke-test, quantized_add_8x8x3 matches CPU 192/192 (0.002 ms), and quantized_conv2d_8x8x3x4 dispatches cleanly (0.105 ms), but still hits an open NN engine DRAM-read issue (max_abs_diff = 31, constant per-channel output [104,104,104,104,92,92,92,92]; run_lenet0 on official lenet_v3.nb returns constant 62). Testing vendor #[initial states kernel] + 0x038C0=0, 0x038C4=1, 0x03818=1 confirmed it does not yet resolve this remaining NN DRAM-read bug.

๐Ÿ’ฌ 7. Community Questions, Common Allwinner A733 NPU Issues & How We Addressed Them

Developers on the Radxa Forums, Armbian Forums, and GitHub (Cubie A7A / A7Z / A7S, Orange Pi 4 Pro, Frigate NVR, and YOLOv8/YOLO11 projects) repeatedly run into the same set of A733 NPU roadblocks. Below is each real-world issue, its silicon root cause, and how our mainline etnaviv + Mesa Teflon stack resolves it:

Common Allwinner A733 NPU Issues & How Mainline etnaviv + Teflon Solves Them

Sunday, November 15, 2026

Allwinner A733 Mainline Camera & Cedrus VPU: 1% CPU 1080p30 H.264/H.265 + libcamera ISP Pipeline

Big progress on mainline Linux 7.1 (PREEMPT_RT) for the Radxa Cubie A7A (Allwinner A733): we now have a working, zero-copy camera-to-encoder pipeline running on mainline drivers without any vendor 5.10 BSP blobs.

Highlights: Hardware H.264 & H.265 (HEVC) encoding via Cedrus VE at 1080p30 using ~0.89%–1.55% of one CPU core, hardware ISP 602 (sun60i-isp) with AE/AWB/CCM/Gamma/BLC, and a dedicated rkisp1-style libcamera pipeline handler & IPA.

1. Zero-Copy Camera → Hardware Video Encoder (H.264 & H.265)

Using the mainline sun6i-mipi-csi2 → sun6i-csi capture path with an OV5647 sensor (1080p30, NV12), CMA dma-bufs are passed zero-copy directly into the Allwinner A733 Cedrus Video Engine V4L2 stateful M2M encoder:

Codec Mode / Verification Throughput / CPU Load Decode Quality
H.264 1080p30 zero-copy CSI → VE_ENC, dynamic CAPTURE buffer sizing, EOS drain 30.02 fps live (~0.89% of 1 CPU core); 78.3 fps standalone 0 decode errors
H.265 (HEVC) Fixed-QP (cu_qp_delta_enabled_flag=0) + frame-level CBR/VBR rate control (verified at 1 Mbps & 4 Mbps CBR), v4l2-compliance 49/49 1080p30 (~1.55% of 1 CPU core) 0 decode errors or warnings in avdec_h265 & libde265dec

2. Mainline Hardware ISP 602 (sun60i-isp)

Instead of burning CPU cycles on Software ISP debayering, the A733's inline ISP 602 is driven directly in the media graph:

ov5647 (RAW10) → sun6i-mipi-csi2 → sun6i-csi-bridge → sun60i-isp → sun6i-csi-capture (NV12 /dev/video0)
                                                        ↑ sun60i-isp-params (/dev/video1)
                                                        ↓ sun60i-isp-stats  (/dev/video2)
  • UAPI & Hardware Blocks: Versioned parameter buffer (sun60i_isp_params_cfg) supporting Black Level Correction (BLC), White Balance (WB), Color Correction Matrix (CCM), Gamma, plus AE/AWB/Histogram statistics readout.
  • Dedicated libcamera Pipeline Handler & IPA: Built an rkisp1-style sun60i-isp pipeline handler and IPA module (ipa_sun60i_isp.so + sun60i_isp_ipa_proxy) rather than hacking SoftISP into simple — giving a clean, upstreamable userspace counterpart for a future linux-media RFC.

3. What's Next

  • Finish silicon verification of the sun60i-isp libcamera AE/AWB closed loop on 1080p30 captures.
  • Prepare an upstream RFC for sun60i-isp with the open libcamera pipeline handler as userspace proof.
  • Continue A7A bring-up: cpufreq OPP tables, stress_rpmsg on the E902 RISC-V co-processor, and GMAC210 TX DMA fix.

Source, Buildroot external configs, and test logs are tracked in github.com/tcmichals/cubie-a5e.

Saturday, October 31, 2026

Micropython on E906

Experiment First, Compile Later: Python on Both Processors of the Allwinner T527

Part 5 of Bringing Up Heterogeneous RISC-V on Allwinner SoCs (Radxa Cubie A5E)

One Cubie A5E, two kinds of processor, Python on both: check out new hardware and run experiments in seconds, with no compile in the loop.

The Radxa Cubie A5E is a small board with a surprise inside. Its Allwinner T527 runs Linux on eight ARM Cortex-A55 cores, and next to them sits a 200 MHz XuanTie E906 RISC-V core that Linux never uses. In this part we put MicroPython on that RISC-V core and drive it from Python on Linux. You type a line, the E906 reads a compass over I²C or a GPS over a UART, and the answer comes back over the link between the two processors. No firmware rebuild, no reflash, no reboot between experiments. While it runs, AbstractX Studio—our native desktop engineering workbench running on your PC—provides real-time visibility into the coprocessor: CPU utilization, per-interrupt microsecond costs, line-by-line source profiling, and an interactive prompt, all without stalling hard real-time execution.

AbstractX Studio’s CPU tab, live: busy percentage, the coroutine table and per-interrupt costs updating once a second from the E906

Live from the board: AbstractX Studio displays the E906’s real-time heartbeat. Once a second it updates CPU load, per-task execution percentages, and exact per-interrupt microsecond costs using sub-microsecond non-intrusive binary telemetry.

In short

  1. One chip, two worlds. Eight Cortex-A55 cores run Linux: networking, files, a full Python. One small RISC-V core, the E906, is free for real-time work: sensors, timing, control loops.
  2. The device tree decides who owns which pins. A one-line setting in /boot/config.txt makes U-Boot hand the GPS UART, the compass I²C bus and some DMA channels to the E906 instead of Linux.
  3. Linux starts the E906 by loading a firmware file, and the two talk by passing messages through shared memory, with a hardware doorbell to say “look now”. That message system is called RPMsg.
  4. AbstractX is the firmware on the E906: a small event loop with interrupt-driven drivers. MicroPython runs inside it, so the E906 can run Python you send it.
  5. Python on Linux talks to Python on the E906. A 20-line Linux script can run code on the E906 or read its CPU load. AbstractX Studio, a dedicated desktop engineering workbench running on your PC, gives you an interactive REPL and live silicon observability instruments (bare-metal top, perf, and a software logic analyzer timeline).
  6. The point is speed of learning: try the hardware in Python, measure what it costs, and only then write the fast version in C++ on the same drivers.

Where this fits in the series

Allwinner T527 RISC-V Firmware & MicroPython Series

You do not need the earlier parts to follow this one: each section below starts from what you need to know and points back to the part that goes deeper.


1. The board and what we hang on it

The Cubie A5E’s Allwinner T527 combines:

Hardware Execution Domains & Peripheral Partitioning

On our test bench two sensors are wired to the 40-pin header:

  • a u-blox NEO-M8N GPS on UART3 (pins PI11 / PI12), and
  • an HMC5883L compass on I²C1, also called TWI1 (pins PB4 / PB5).

Part 1 explains why a core like the E906 is worth having next to Linux: deterministic timing, offloading the A55s, and isolating real-time work from everything Linux does. This part is about making that core quick to experiment with.

2. Who owns which pins: the device tree and U-Boot

Linux does not probe the hardware to find out what is on the board; it reads a device tree, a data file that lists every peripheral, its registers, its interrupt, its clock and which driver should use it. The board’s base device tree gives everything to Linux.

To give UART3 and I²C1 to the E906 instead, we do not edit that base file. We apply an overlay: a small patch file (.dtbo) that changes a few nodes. The device-tree overlay article explains the mechanism in depth. In short:

  1. The boot partition holds a plain text file, /boot/config.txt.
  2. U-Boot runs a boot script (boot.scr, compiled from boot.cmd) that reads config.txt, loads the base device tree into RAM, and applies every overlay listed on the dtoverlay= line, one after another.
  3. Linux boots with the merged tree and never knows overlays were involved.

On our board config.txt contains:

dtoverlay=cubie-a5e-flight-stack-e906

That overlay (cubie-a5e-flight-stack-e906.dtso) does four things:

  • UART3, I²C1 and SPI1 go to generic-uio. Linux still sets the pin multiplexing, turns on the clocks and releases the resets, but it attaches no driver, so the E906 has the registers to itself.
  • The message box and remoteproc are enabled, with the firmware name riscv-firmware.elf and the memory region for the shared rings.
  • The DMA controller is split: dma-channels = <8> tells Linux it has only channels 0-7, so channels 8-15 are free for the E906 (section 10).
  • Pins are documented in the file, header pin by header pin.

Changing the hardware split is therefore an edit, a compile and a reboot:

# PC: compile the overlay (dtc from a kernel build tree)
dtc -@ -I dts -O dtb -o cubie-a5e-flight-stack-e906.dtbo cubie-a5e-flight-stack-e906.dtso
# Board: install it and reboot
scp -O cubie-a5e-flight-stack-e906.dtbo root@192.168.3.3:/boot/
ssh root@192.168.3.3 reboot

This week’s DMA change was exactly that: one line, dma-channels = <8>, and after the reboot /proc/device-tree/soc/dma-controller@3002000/dma-channels read 8 instead of 16. There is also a cubie-a5e-flight-stack-linux overlay that gives the same pins back to Linux drivers (/dev/ttyAS3, /dev/i2c-1), so you can switch between “Linux owns the sensors” and “the E906 owns the sensors” with one line in config.txt.

3. Starting the E906 from Linux: remoteproc

The E906 has no flash of its own. Linux loads its firmware into the on-chip SRAM and starts it, using the kernel’s remoteproc framework (built and explained in Part 2). The firmware is an ordinary ELF file:

ls -l /lib/firmware/riscv-firmware.elf          # a link to the firmware you want
echo stop  > /sys/class/remoteproc/remoteproc0/state
echo start > /sys/class/remoteproc/remoteproc0/state
cat /sys/class/remoteproc/remoteproc0/state     # running
cat /sys/kernel/debug/remoteproc/remoteproc0/trace0   # the E906's boot log

Inside the ELF is a small resource table that tells Linux what the firmware needs: where its boot log lives (trace0) and that it wants an RPMsg link. Swapping firmware is a copy and a stop/start; Linux keeps running the whole time. On our board an init script starts the E906 at boot.

4. How Linux and the E906 talk: RPMsg from the ground up

Two processors that share memory still need rules to exchange data. RPMsg is built in layers, and each layer solves one problem:

  1. Shared memory. Both processors can read and write the upper 128 KB of SRAM Space 1. That is where messages live. But shared memory alone cannot tell the other side that something new arrived.
  2. A doorbell. The message box is a small hardware mailbox: writing to it raises an interrupt on the other processor (on the E906, interrupt line 17). Now nobody has to poll memory; the doorbell says “look now”. Part 3 measures this layer on its own.
  3. Rings of buffers. Shared memory is organised as two VirtIO rings (vrings), one per direction. Each ring holds a fixed number of 512-byte buffers. The sender takes a free buffer, fills it, puts it in the ring and rings the doorbell; the receiver takes it, uses it, and hands it back.
  4. Messages with addresses. Each buffer starts with a 16-byte RPMsg header (source address, destination address, length) followed by up to 496 bytes of data. One buffer is one message.
  5. Endpoints with names. The destination address picks an endpoint on the other side, like a port number. When the E906 firmware starts, it announces its endpoints by name, and Linux creates a channel for each.
  6. Files on Linux. Linux’s rpmsg_char driver gives each endpoint a device file, /dev/rpmsgN. To your program the E906 is now a file: write() sends one message, read() returns one message.
How one RPMsg message travels: a Python write() on Linux fills a 512-byte buffer in shared SRAM, the message box doorbell interrupts the E906, and AbstractX delivers the message to endpoint 1026, 1024 or 1025

Follow the numbers: (1) your write fills a buffer in ring 1, (2) the message box rings the E906’s doorbell, (3) the E906 takes the buffer and hands it to the endpoint named in the header, (4) replies come back the same way in ring 2.

Three streams on top of messages

RPMsg carries messages, not a continuous byte stream. Each message is at most 496 bytes and arrives whole. Our firmware builds three different streams on top of that, one per endpoint, so the three kinds of traffic never mix:

Shared SRAM Virtual Endpoints & Wire Protocols

Linux creates the /dev/rpmsgN file for an endpoint when a program asks for it, through /dev/rpmsg_ctrl0. The numbers depend on the order, so tools find “their” endpoint by name rather than by number.

Buffers are a shared, limited resource, and Linux never tells the E906 that a reader went away. Two rules came out of that (the story is in section 12):

  • The trace stream needs a lease. The E906 sends trace packets only while a reader has said hello in the last 3 seconds. Readers send a 4-byte hello when they open the endpoint and then once a second.
  • Long-running scripts need a heartbeat. A streaming script expects a PING line at least once a second and stops itself after 3 seconds without one, so a closed PC tool never leaves the E906 talking to nobody.

Try it: read the E906’s CPU load from Linux in Python

This script runs on the board, under Linux, next to two files from the repo: e906_rpmsg_bridge.py (finds or creates an endpoint) and runtime_stats.py (decodes the status report). It opens the trace endpoint, keeps the lease alive and prints the E906’s once-a-second report:

# e906_load.py: the E906's CPU load, read from Linux
import os, time
from e906_rpmsg_bridge import ENDPOINTS, HELLO, create_endpoint
import runtime_stats as rs

ep = ENDPOINTS["trace"]                                   # 'abstractx-trace', 1025
fd = os.open(create_endpoint("/dev/rpmsg_ctrl0", ep["name"], ep["addr"]), os.O_RDWR)
os.write(fd, HELLO)                      # "I'm listening": starts the 3 s lease
prev, last_hello = None, time.monotonic()
while True:
    msg = os.read(fd, 512)               # one RPMsg message per read
    if time.monotonic() - last_hello > 1:
        os.write(fd, HELLO); last_hello = time.monotonic()
    report = rs.decode(msg)              # None unless it is a status report
    if report:
        r = rs.rates(prev, report) if prev else None
        if r:
            print(f"busy {r['busy_pct']:.1f}%",
                  {t['name']: round(t['cpu_pct'], 1) for t in r['tasks']},
                  {d['name']: round(d['irq_per_s']) for d in r['drivers']})
        prev = report

On our board, with the E906 idle and the GPS sending:

busy 0.3% {'rpmsg_rx': 0.0, 'repl_rx': 0.0, 'repl_tx': 0.0} {'timer': 1001, 'uart3': 30, 'msgbox': 1, 'twi1': 0, 'irq88': 0}
busy 0.4% {'rpmsg_rx': 0.0, 'repl_rx': 0.0, 'repl_tx': 0.0} {'timer': 1001, 'uart3': 30, 'msgbox': 1, 'twi1': 0, 'irq88': 0}

The E906 is 0.3 % busy, the timer interrupts 1,001 times a second (the profiler’s sample clock, section 7), and UART3 takes about 30 interrupts a second from the GPS. No compile happened anywhere: a Python script on Linux is reading the E906 firmware’s own counters, live, from the other processor.

5. MicroPython on the E906, with AbstractX underneath

What runs where: Studio on the PC, bridges on Linux, the AbstractX event loop with MicroPython as one coroutine on the E906

The three columns are three separate machines as far as software is concerned: a PC running AbstractX Studio, Linux on the Cortex-A55 cores, and the E906 coprocessor.

Notice how the three tiers divide the engineering labor: 1. The Development PC: Runs AbstractX Studio, rendering rich 60 FPS Dear ImGui observability instruments, decoding binary telemetry, and parsing DWARF ELF symbols so the embedded silicon never wastes compute or SRAM on GUI rendering or string formatting. 2. The Cortex-A55 Linux Cores: Act as a transparent high-bandwidth bridge, routing RPMsg message streams and binary trace buffers over SSH or network sockets to your PC. 3. The XuanTie E906 RISC-V Core: Runs the lightweight, freestanding AbstractX event loop and MicroPython, driving I²C and UART hardware peripherals in real time.

The firmware on the E906 is AbstractX: an event loop that runs small cooperative tasks (C++20 coroutines, Part 4) and interrupt-driven drivers, with no heap. This firmware (apps/e906_repl_app) runs three tasks:

  • rpmsg_rx: receives RPMsg messages from Linux,
  • repl_rx: MicroPython, which runs whatever you send it, and
  • repl_tx: sends MicroPython’s output back.

MicroPython is not the firmware; it is one task inside it. That has three consequences you will see in the experiments:

  • Interrupts keep running under Python. The GPS UART and the compass I²C bus are handled by AbstractX interrupt handlers. When Python waits for the bus, the E906 sleeps (wfi) until the interrupt wakes it; it never spins.
  • Python cannot break the firmware’s memory. MicroPython’s heap lives in the RAM of the chip’s unused HiFi4 DSP (128 KB), separate from the firmware.
  • Python’s cost can be measured. AbstractX counts CPU time per task and per interrupt, so the price of running Python shows up as the repl_rx task.

Scripts reach the hardware through one built-in module, abstractx (modabstractx.c):

Hardware Peripheral & Telemetry C-Binding Functions

The board’s MicroPython is a minimal build: bytes.decode and bytes.fromhex do not exist (use str(b, "ascii") and int(h, 16)), and there is no filesystem, so scripts arrive over RPMsg and are compiled in memory.

5.1 Concurrency in Python: Why AbstractX Coroutines Instead of uasyncio?

A natural question when looking at concurrent I/O in Python is: “Python has asyncio (and MicroPython has uasyncio), so why aren’t we using that? Is asyncio flawed? Or did uasyncio miss what microcontrollers actually need?”

Is Python’s asyncio Flawed?

No, asyncio is not flawed for its intended domain.

Python’s asyncio was designed for network applications—web servers (FastAPI, aiohttp), database connection pools, and microservices on Linux and cloud servers with gigabytes of RAM. In that domain: - Waiting 10–50 ms for an HTTP response or a database query over TCP is typical. - Allocating 500 bytes of memory per Task is completely unnoticeable. - A 50-microsecond garbage collection pause causes no issues whatsoever.

The Historical Mismatch: Why uasyncio Should Have Been Built Differently

MicroPython is called MICROPython. Yet when uasyncio was created, the project prioritized desktop CPython compatibility over microcontroller physics: - “If someone writes asyncio code on their PC, it should copy-paste onto an ESP32 or PyBoard.”

By mimicking CPython’s desktop API, uasyncio inherited all of its desktop assumptions: 1. Dynamic Heap Allocation on Every Step: Every async def, Task, Future, and await asyncio.sleep() in MicroPython allocates objects on the Python heap. 2. The 10 ms Garbage Collection Freeze: MicroPython uses a mark-and-sweep Garbage Collector. When the heap fragments or fills up, gc.collect() freezes CPU execution for 5 to 15 milliseconds. On an embedded drone or robot balancing an 8 kHz gyroscope and 200 Hz compass, a 15 ms freeze means lost sensor packets, missed attitude corrections, and flight instability. 3. ROM & Symbol Table Footprint: Supporting full async/await syntax requires enabling MICROPY_PY_ASYNC_AWAIT = 1 and large QSTR symbol tables (__aiter__, __anext__, StopAsyncIteration), which exceed the lean 192 KB SRAM_FAST budget.

An embedded coroutine engine should never have been a desktop socket scheduler. It should have been designed for silicon: static channels, zero allocation in the loop pass, and direct hardware interrupt sleep.

What an Embedded Coroutine Engine Actually Looks Like (abstractx_coro.py)

Desktop Python vs MicroPython vs AbstractX Coroutines

Rather than relying on heap-allocating task wrappers, AbstractX brings the exact C++20 coroutine model into MicroPython:

# The AbstractX Coroutine Pattern: 0 Heap Allocations in Steady State
import abstractx
import abstractx_coro

mag_channel = abstractx_coro.AsyncQueue(16)  # Pre-allocated fixed ring buffer
buf = bytearray(6)                           # Reusable zero-copy buffer

def compass_task(channel):
    while True:
        # Hardware interrupt reads into pre-allocated buffer
        n = abstractx.i2c_read_into(0x1E, 0x03, buf)
        if n == 6:
            channel.try_push(bytes(buf))
        # Yields execution; E906 enters wfi sleep (0.01% CPU)
        yield abstractx_coro.sleep_ms(20)
  • 0 bytes allocated during steady-state execution → 0 Garbage Collection pauses.
  • Wakes on hardware interrupts: abstractx.sleep_ms() calls wfi, letting the core sleep while UART DMA and I2C hardware state machines run in parallel.
  • Direct 1:1 Mapping to C++20: When the prototype is proven, running the micropython-to-cpp skill translates the Python generator coroutine directly into a native C++20 coro::Task<void> with zero conceptual friction.

6. Experiments without compiling

Everything in this section is Python. The firmware stays loaded the whole time.

6.1 Python on Linux runs Python on the E906

The board tests include a helper, repl_exec(), that sends a script to the E906’s REPL endpoint and returns its output. Here it checks out the compass from a Linux Python script:

# e906_run.py: run Python on the E906 from Python on Linux
from e906_link import repl_exec

code = """
import abstractx
abstractx.i2c_init(400000)
print('found', abstractx.i2c_scan())
print('id', bytes(abstractx.i2c_read(0x1E, 0x0A, 3)))
"""
out, err = repl_exec(code, 10.0)
print(out, err)

Output on our board:

found [30]
id b'H43'

30 is 0x1E, and H43 is the identification string of an HMC5883L. That one experiment settled a real question: the board had been assumed to carry a QMC5883L at 0x0D, and every earlier script read the wrong registers. e906_link.py and the trace example above are all it takes to build your own Linux-side test programs around the E906.

6.2 An interactive prompt

For poking around by hand, open the REPL endpoint on the board:

grep -l abstractx-repl /sys/class/rpmsg/rpmsg*/name   # which /dev/rpmsgN is the REPL
microcom -p /dev/rpmsgN
>>> import abstractx
>>> abstractx.version()
'AbstractX 1.0.0 (E906 MicroPython REPL)'
>>> abstractx.irq_stats()       # which interrupt lines have fired, and how often

From the PC, e906_workbench.py does the same over ssh, including one-shot commands (-c "..."). Only one program can hold the REPL at a time.

6.3 Check out the compass

>>> abstractx.i2c_init(400000)
>>> bytes(abstractx.i2c_read(0x1E, 0x0A, 3))      # b'H43'
>>> abstractx.i2c_write(0x1E, 0x00, b"\x70")      # 8-sample average, 15 Hz
>>> abstractx.i2c_write(0x1E, 0x01, b"\x20")      # +-1.3 gauss range
>>> abstractx.i2c_write(0x1E, 0x02, b"\x00")      # continuous measurement
>>> abstractx.i2c_read(0x1E, 0x03, 6)             # X, Z, Y, 16-bit big-endian each

Turn the board and read again: the numbers change. The decoder used by the sensor streamer is mag_xyz() in raw_sensor_streamer.py.

6.4 Check out the GPS

The u-blox powers up at 9600 baud:

>>> abstractx.uart_init(9600)
>>> abstractx.sleep_ms(500)                       # sleeps; UART interrupts fill a buffer
>>> print(str(abstractx.uart_read(512), "ascii")) # NMEA sentences

You can also enable the autonomous 16×64-byte circular DMA ring in .sram_c:

>>> abstractx.uart_dma(True)                      # activates circular DMA on UART3
>>> buf = bytearray(512)
>>> n = abstractx.uart_read_into(buf)             # zero-copy drain from DMA ring
>>> print(str(buf[:n], "ascii"))

Switching the GPS to 115,200 baud is a binary configuration message to the GPS followed by uart_init(115200); the streamer shows the exact bytes. At 115,200 baud, circular DMA absorbs bursts without dropping a byte.

6.5 Time things, then put it in a file

>>> t0 = abstractx.cycles()
>>> d = abstractx.i2c_read(0x1E, 0x03, 6)
>>> (abstractx.cycles() - t0) / 200               # microseconds, including Python's own work

When the experiment grows past a few lines, write it into a file on the PC, copy it over and run it:

scp -O my_probe.py root@192.168.3.3:/root/
ssh root@192.168.3.3 python3 run_e906_script.py my_probe.py 30   # stop after 30 s

run_e906_script.py sends the file in chunks, prints what it prints, and Ctrl-C stops the script on the E906. Edit, copy, run: a few seconds per try. The equivalent C++ change would be a cross-compile, a firmware copy and a remoteproc restart.

6.6 Python beside a running stream: Meet AbstractX Studio’s CLI

While command-line scripts like run_e906_script.py are convenient for batch runs, real-time embedded work is vastly more productive with a dedicated engineering workbench. This brings us to AbstractX Studio (tools/visualizer), our native cross-platform desktop cockpit.

Connecting to the Cubie A5E over SSH, Studio provides an interactive CLI tab. It allows you to inject Python statements directly into the E906’s MicroPython engine while the compass and GPS streaming tasks continue running concurrently in the background:

Studio’s CLI tab running Python on the E906 while the compass and GPS stream continues

Captured from the live board: ps and drivers answer from the E906’s status report (here repl_rx at 7.6 % while the 100 ms sensor streamer runs), and abstractx.version() and i2c_read(0x1E, 0x0A, 3) were executed by MicroPython on the E906; [72, 52, 51] is b"H43".

A command travels from Studio over ssh to a bridge script on Linux, then over the REPL stream to the E906; the answer comes back the same way in about 55 ms. Variables are kept between commands, and an exception is reported without stopping the stream.

6.7 Parallel Multi-Rate Sensor Ingestion (The Coroutine Way)

Instead of sequential polling scripts that waste bus time, the AbstractX Coroutine Pattern lets developers orchestrate multiple sensors running at different rates concurrently:

# parallel_sensor_coros.py: Multi-rate concurrent sensor ingestion on the E906
import abstractx
import abstractx_coro

# 1. Initialize hardware buses & circular DMA
abstractx.i2c_init(400000)
abstractx.i2c_write(0x1E, 0x00, b"\x70")      # CRA: 8-sample average, 15 Hz
abstractx.i2c_write(0x1E, 0x01, b"\x20")      # CRB: +-1.3 gauss
abstractx.i2c_write(0x1E, 0x02, b"\x00")      # MR: continuous measurement
abstractx.uart_init(115200)
abstractx.uart_dma(True)                      # activate 16x64B circular DMA

# 2. Channels matching AbstractX C++ AsyncQueue<T, N>
mag_channel = abstractx_coro.AsyncQueue(16)
gps_channel = abstractx_coro.AsyncQueue(16)

# 3. Dedicated Sensor Producers
def compass_producer(channel):
    buf = bytearray(6)
    while True:
        # Hardware interrupt reads into pre-allocated buffer
        n = abstractx.i2c_read_into(0x1E, 0x03, buf)
        if n == 6:
            channel.try_push(bytes(buf))
        # Yields for 20 ms; E906 enters wfi sleep (0.01% CPU)
        yield abstractx_coro.sleep_ms(20)

def gps_producer(channel):
    buf = bytearray(512)
    while True:
        # Autonomous DMA ring drained in zero heap allocations
        n = abstractx.uart_read_into(buf)
        if n > 0:
            channel.try_push(bytes(buf[:n]))
        yield abstractx_coro.sleep_ms(100)

# 4. Primary-Paced Consumer Loop
def flight_fusion_task(primary_q, aux_q):
    last_gps = None
    epoch = 0
    while True:
        # Await next compass sample (acts as the physical pacing clock)
        mag_sample = yield primary_q.pop()

        # Non-blockingly drain auxiliary lower-rate sensor (GPS)
        while True:
            gps = aux_q.try_pop()
            if gps is None:
                break
            last_gps = gps

        epoch += 1
        # Decode 16-bit big-endian X, Z, Y
        x = (mag_sample[0] << 8) | mag_sample[1]
        z = (mag_sample[2] << 8) | mag_sample[3]
        y = (mag_sample[4] << 8) | mag_sample[5]
        if epoch % 10 == 0:  # Print every 10th epoch (5 Hz output rate)
            print("Epoch", epoch, "Mag:", (x, y, z), "GPS bytes:", len(last_gps) if last_gps else 0)

# 5. Cooperative Dispatcher
dispatcher = abstractx_coro.Dispatcher()
dispatcher.spawn(compass_producer(mag_channel))
dispatcher.spawn(gps_producer(gps_channel))
dispatcher.spawn(flight_fusion_task(mag_channel, gps_channel))

# Runs the event loop with hardware wfi idle sleep
dispatcher.run(timeout_ms=10000)

Running this on the board gives sub-millisecond epoch accuracy, 0% CPU waste during bus phases, and 0 dropped GPS sentences.


7. Watching the E906 Work: Inside AbstractX Studio

When developing software for an asymmetric multi-core processor (AMP)—where Linux runs on high-performance application cores while a bare-metal coprocessor handles real-time I/O—the single biggest obstacle is observability.

On Linux, developers take a rich suite of diagnostic tools for granted: top, htop, perf, ftrace, gdb, core dumps, and syslog. But on a bare-metal RISC-V coprocessor, developers are usually flying blind: - No OS means no top: Without an operating system scheduler slicing threads, there is no built-in way to know whether your coprocessor is 5% busy or 99% busy, or how much CPU time MicroPython’s garbage collector is consuming relative to hardware drivers. - The printf trap & Heisenbugs: Inserting debug printf() calls over a serial port stalls execution. At 115,200 baud, printing a single 100-character line takes 8.7 milliseconds. In a 1 kHz sensor loop, that delay is fatal—it causes I²C arbitration timeouts, overflows UART FIFOs, and completely distorts the timing you were attempting to measure. The bug disappears or mutates the moment you try to observe it. - JTAG halts break real-time physics: Halting the CPU with a traditional JTAG hardware breakpoint stops the core, but external hardware (the compass, GPS, and DMA controllers) keeps running. Registers overflow and communication interfaces time out, making live debugging impossible.

To eliminate this blindness, AbstractX includes AbstractX Studio (tools/visualizer): a unified desktop engineering workbench and observability cockpit designed specifically for bare-metal and heterogeneous systems.

7.1 What is AbstractX Studio?

AbstractX Studio is a native desktop application written in modern C++20 using Dear ImGui and HelloImGui. It runs on your development PC (Linux, macOS, or Windows) at a silky 60 FPS and connects to the Cubie A5E over a standard SSH connection or network socket.

The workbench is fully customizable: developers can drag, re-dock, split horizontally or vertically, and stack tabs anywhere on the canvas. With multi-viewport docking enabled by default, any tool can be torn off into its own independent OS window on a second monitor with a 1-click Pop In button to re-dock. Crucially, Studio is not a fixed dashboard—it allows developers to embed their own custom tabs and instruments directly into the workbench using an open Python plugin architecture.

Instead of heavy text logging or intrusive polling, Studio relies on zero-copy Common Trace Format (CTF 1.8) binary telemetry. The E906 firmware writes compact 64-byte binary Transaction Layer Packets (TLPs) into lock-free shared SRAM rings (.sram_c).

Emitting a binary trace packet takes only 4 to 12 RISC-V instructions (~20 to 60 nanoseconds). The coprocessor spends less than 0.4% CPU overhead reporting its internal state, completely eliminating the probe effect.

Linux on the Cortex-A55 cores simply forwards the raw binary ring buffers over SSH to your workstation. AbstractX Studio on the PC does all the heavy lifting: unpacking binary frames, reading the firmware’s ELF DWARF debug symbols to resolve addresses to source lines, and rendering real-time graphs and swimlanes.

7.2 The Four Studio Instruments

Studio translates this binary stream into four real-time observability instruments, giving bare-metal developers the same visibility Linux developers expect:

1. CPU & Driver Telemetry (Bare-Metal top)

Studio’s CPU tab updates once a second, displaying: - A real-time CPU busy meter and rolling history graph. - A task table (rpmsg_rx, repl_rx, repl_tx) showing exact cycle percentages consumed by MicroPython versus message routing. - An interrupt driver table covering every physical CLIC interrupt line (Timer 92, UART3 90, TWI1 91, Msgbox 88), displaying its trigger frequency (Hz), exact execution cost per interrupt in microseconds (e.g. 1.5 ยตs for I²C, 25 ยตs for UART byte handler, 2.1 ยตs for circular DMA), and hardware error counters. - Memory pool high-water marks, verifying zero memory leaks in steady state.

Studio’s CPU tab: busy percentage over time, the task table, the driver table with uart3 and twi1, and pool usage

Captured from the live board with the sensor streamer running: the E906 is about 8 % busy; the timer line takes about 1,000 interrupts a second (the profiler’s samples), UART3 costs about 25 ยตs per interrupt and TWI1 about 1.5 ยตs. In DMA mode (abstractx.uart_dma(True)), UART3 drops 0 bytes even during continuous 115200-baud GPS streaming bursts (section 10).

2. Live Statistical Source-Line Profiler (Bare-Metal perf)

To find performance bottlenecks without modifying code: - A 1,000 Hz hardware timer interrupt samples the E906 Program Counter (PC). - If the core is sleeping in wfi, the ISR samples the idle loop and returns immediately to sleep, preserving the low-power idle state without waking up the event loop. - On the PC, Studio cross-references the sampled addresses against the firmware ELF binary’s DWARF symbol table, displaying a live sorted table of hot functions and source lines. - You can instantly see where CPU cycles go: e.g. 92% in wfi idle sleep, 4% in MicroPython’s bytecode dispatch (mp_execute_bytecode), 2% in garbage collection (gc_alloc), and <1% in hardware drivers. Clicking any line links directly to source code.

Studio’s hot-function table from the live profiler

Captured from the live board, 5 seconds of samples. The top line (92 %) is the E906 sleeping in its idle wfi; it is listed under now_cycles() because the lookup reports the innermost inlined function at that address. The rest is MicroPython’s interpreter (qstr_find_strn, gc_alloc, mp_execute_bytecode), each line clickable to its source.

3. Software Logic Analyzer Timeline (Microsecond Swimlanes)

Like an oscilloscope or logic analyzer for software execution: - Displays synchronized horizontal swimlanes on a shared 200 MHz CPU cycle clock. - Shows when tasks run, when each physical interrupt line fires (as microsecond-accurate tick marks), and when the core sleeps in wfi. - Allows sub-microsecond inspection of bus events (e.g. seeing the 11 individual CLIC interrupt pulses of an I²C transaction unfold over time while UART DMA packets arrive in parallel).

Studio’s timeline, animated: swimlanes for idle and each interrupt line on the E906 cycle clock, 100 ms window

Captured from the live board, last 100 ms: the long grey bar is the E906 idle, each tick is one interrupt (the timer and UART3 here); a task gets its own lane when it runs inside the window.

4. Interactive REPL & System CLI (Live Command & Inspection)

Studio includes a dedicated terminal tab connected directly to the E906 over RPMsg (shown in Section 6.6): - Allows developers to execute Python one-liners, inspect global variables, and query system diagnostics (ps, drivers, irq_stats, mem) live on the coprocessor. - Operates concurrently with ongoing sensor streaming and control loops—you can poke registers and inspect state without stopping or restarting the stream. - Commands travel over SSH and RPMsg, returning output in approximately 55 ms with variables preserved between statements.

7.3 How Studio is Programmed: Declarative JSON Schemas & Python Plugins

A common limitation of embedded diagnostic GUIs is rigidity: they are compiled binary monoliths with hardcoded packet parsers and static layouts. If an engineer adds a magnetometer axis, swaps an IMU, or changes a telemetry rate, someone has to modify C++ GUI parsing code and recompile the desktop application.

AbstractX Studio takes a completely different approach: it is declarative and programmable.

1. Dynamic barectf & CTF 1.8 Telemetry Schemas (trace_schema.json & barectf_config.yaml)

Telemetry streams in AbstractX are governed by barectf—an open-source generator that produces ultra-fast, zero-allocation ANSI C tracers emitting the standardized Common Trace Format (CTF 1.8).

Instead of burning cycles on string formatting or JSON serialization on the microcontroller, the E906 firmware bit-packs trace events directly into shared SRAM rings in 4 to 12 instructions. Furthermore, MicroPython scripts on the E906 can call abstractx.trace(task_id, state, "msg") to emit structured barectf binary events into this exact same stream!

On the host PC, Python tools and AbstractX Studio decode these binary streams dynamically using external schemas rather than hardcoded struct offsets:

{
  "application": "gps_imu_app",
  "wire_protocol": { "frame_size_bytes": 64, "header_size_bytes": 20, "payload_size_bytes": 40 },
  "streams": {
    "1": {
      "name": "telemetry",
      "events": {
        "1": {
          "name": "imu_sample",
          "rate_hz": 8000,
          "source_device": "ICM-42688-P (SPI1)",
          "unpack_format": "<i6h",
          "fields": [
            { "name": "sample_seq", "type": "int32", "scale": 1.0, "display_name": "Sequence" },
            { "name": "accel_x_mg", "type": "int16", "unit": "g", "scale": 0.001, "widget": "oscilloscope" },
            { "name": "gyro_z_dps", "type": "int16", "unit": "deg/s", "scale": 0.1, "widget": "oscilloscope" }
          ]
        },
        "2": {
          "name": "mag_sample",
          "rate_hz": 50,
          "source_device": "HMC5883L (I2C1)",
          "unpack_format": "<3hH",
          "fields": [
            { "name": "mag_x_mgauss", "type": "int16", "unit": "mG", "scale": 1.0 },
            { "name": "heading_cdeg", "type": "uint16", "unit": "deg", "scale": 0.01, "widget": "compass" }
          ]
        }
      }
    }
  }
}

When Studio or a Python tool connects to a stream: 1. Dynamic barectf Unpack Compilation: Studio’s CtfSchemaLoader (tools/visualizer/ctf_schema_loader.py) reads the barectf YAML or JSON configuration and compiles the unpack_format (e.g. <i6h or <3hH) into native Python struct.unpack byte decoders on the fly. 2. Automatic Unit Scaling: Raw integer values from hardware ADCs are automatically scaled into human-readable engineering units using the "scale" multiplier (e.g. 0.001 converts milligauss or milli-g to g, and 0.01 converts centidegrees to degrees). 3. Automatic UI Widget Binding: The "widget" tag binds decoded signals directly to Studio’s visualization components—routing high-rate accelerometer and gyroscope data to the 8 kHz oscilloscope, magnetic heading to the vector compass dial, or altitude to the altimeter—without writing any UI wiring code.

2. Declarative Hardware Profiles (profiles/*.json)

Hardware profiles describe the physical target board and its interconnect topology:

{
  "profile_id": "cubie_a5e_pure",
  "platform_name": "Allwinner Cubie A5E (Pure Silicon)",
  "board_ip": "192.168.3.3",
  "udp_port": 9870,
  "active_cores": [
    {"id": 0, "role": "Host Linux ARM64", "task": "Flight Supervisor & Telemetry", "clock_mhz": 1400},
    {"id": 1, "role": "XuanTie E906 RISC-V", "task": "Real-Time I/O Reactor & Sensors", "clock_mhz": 200}
  ],
  "hardware_accels": ["UART3 Circular DMA (GPS)", "TWI1 I2C (Compass)", "sun6i-msgbox"],
  "schema_file": "apps/gps_imu_app/trace_schema.json"
}

Switching Studio between targets—from the bare-metal XuanTie E906 on the Cubie A5E, to an ESP32-P4, a Raspberry Pi Pico 2 W, or a desktop SITL simulator—is simply a matter of passing --profile profiles/<target>.json. Studio automatically reconfigures its core topology views, network endpoints, and telemetry parsers.

3. Customizing Windows & Embedding Your Own Tabs (AbstractXStudioPlugin)

A hallmark of AbstractX Studio is that developers are never forced into a single pre-baked layout or rigid set of tools.

Every engineering project has unique telemetry needs—a robotics team needs motor demand bars and Joint PID curves; a drone project needs artificial horizons and compass roses; a battery management system needs cell voltage heatmaps.

Studio makes it trivial for users to customize their workspace and embed their own tabs directly into the workbench using the Python Plugin SDK (tools/visualizer/sdk/plugin.py):

from visualizer.sdk.plugin import AbstractXStudioPlugin
from imgui_bundle import imgui, implot

class CustomSensorDashboard(AbstractXStudioPlugin):
    def __init__(self):
        super().__init__("Custom Dashboard", "1.0")
        self.latest_heading = 0.0

    def on_tlp_packet(self, header, payload_dict):
        # Asynchronously invoked when relevant telemetry packets arrive
        if "heading_cdeg" in payload_dict:
            self.latest_heading = payload_dict["heading_cdeg"] * 0.01

    def render_ui(self, delta_time, state):
        # Rendered at 60 FPS inside Studio's dockable tab
        imgui.text_colored(imgui.ImVec4(0.3, 0.85, 1.0, 1.0), "Custom Flight Deck")
        imgui.text(f"Live Magnetic Heading: {self.latest_heading:.1f}°")
        
        # Interactive controls sending commands to E906 over RPMsg
        if imgui.button("Zero Compass Bias"):
            state.send_cli("abstractx.compass_calibrate()")

By subclassing AbstractXStudioPlugin, your custom tool becomes a first-class citizen on the workbench: - Automatic Docking & Layout Customization: Your tab can be dragged, nested into tab groups, or split side-by-side with CPU gauges, the timeline, or the memory inspector. - Multi-Monitor “Pop to Canvas”: Any embedded tab gets a native OS window tear-off button (๐Ÿ—– Pop to Canvas). You can pull your custom dashboard onto a second monitor, resize it, and dock it back with 1 click (๐Ÿ—— Pop In). - Direct Real-Time Target Interaction: Through state.send_cli(...), your custom tab can send Python expressions, calibrate sensors, or tweak control gains on the live E906 coprocessor while streaming continues uninterrupted. - Zero GUI Boilerplate: No OpenGL shaders, GLFW event loops, or thread synchronizers. You write high-level ImGui and ImPlot Python code, and Studio handles the rendering at 60 FPS.

8. Under the hood: how one call reaches the hardware

The path of abstractx.i2c_read(0x1E, 0x03, 6): Python in repl_rx, modabstractx.c, e906_periph.cpp starting the I²C transfer, a wfi wait loop, one TWI1 interrupt per bus step, and the measurement hooks along the way

Follow the left column top to bottom; the green box is what happens between the wfi and the wake; the amber box shows where Studio’s numbers come from.

One compass read, abstractx.i2c_read(0x1E, 0x03, 6), step by step:

  1. Python calls a built-in C function. Everything from here runs inside the repl_rx task, which is why its time is reported under that name.
  2. modabstractx.c converts the arguments and calls the I²C driver.
  3. e906_periph.cpp copies the request into a static record (so an interrupt can never write into a stack frame that a Ctrl-C has already unwound) and tells the I²C block to send START.
  4. The wait: arm a 20 ms timeout, let pending work run, then sleep in wfi. The loop never reads an I²C register.
  5. The interrupt: each bus step raises the I²C interrupt (CLIC line 91). The handler takes exactly one step: send the address, send the register, repeated START, address with the read bit, store a byte, or STOP. A 6-byte register read is 11 steps.
  6. Back in Python: the bytes come back as a bytes object. On a timeout the driver sends STOP, counts the error (it shows in Studio’s driver table) and Python gets b''.

uart_read() is simpler: it never waits; it takes what the UART interrupt handler (CLIC line 90) has already put in its buffer.

9. Where everything sits in memory

E906 memory: hot firmware in SRAM Space 0, cold compiler code and trace rings in the lower half of Space 1, Linux RPMsg rings in the upper half, MicroPython heap in DSP RAM

The E906 runs entirely from on-chip SRAM; nothing is in DRAM (Part 1 maps the windows):

SRAM Space Partitioning for RISC-V Firmware & MicroPython

Space 0 had filled to 99.3 %. Moving the MicroPython compiler (only needed while a script is being compiled) into Space 1 brought it to 85 %; with the profiler and DMA code added since, it is at 89.6 %.

10. DMA, shared with Linux

Reading a UART one byte at a time costs about 0.29 ยตs per register read on the E906 (measured, section 11). At high data rates that adds up, so the next step is DMA: hardware that copies data while the CPU does something else.

The T527 has one main DMA controller with 16 channels, normally all Linux’s. Sharing it takes three things:

  • Channels: the overlay’s dma-channels = <8> (section 2) leaves channels 8-15 to the E906.
  • Interrupts: two registers decide which processor sees each channel’s “done” interrupt. Both default to “everyone”. The E906 routes 8-15 to itself and away from Linux before using them; otherwise Linux would get interrupts it cannot clear.
  • Addresses: the DMA controller uses physical addresses, which differ from the E906’s view by a fixed offset; the driver converts them.

What it buys, measured with abstractx.dma_bench() (SRAM to SRAM):

Hardware DMA Engine vs XuanTie E906 CPU memcpy

DMA has a fixed cost of about 4.4 ยตs, and the CPU is free during the transfer: the “done” interrupt itself costs 1.33 ยตs. The rule we adopted: a transfer bigger than the peripheral’s hardware FIFO uses DMA; one that fits uses the FIFO.

UART receive streams are always bigger than the FIFO, so we implemented circular UART receive by DMA into a 16×64-byte ring buffer (1,024 B total in .sram_c) with hardware RX timeout triggers (IIR = 0x0C) to deliver partial NMEA frames immediately. At 115,200 baud, this 1,024-byte ring provides 88.8 ms of buffer headroom, completely absorbing any temporary MicroPython GC pauses without dropping a single byte or corrupting checksums. You can query or toggle it live from Python with abstractx.uart_dma(True).

11. Measured on the board

All on the Cubie A5E with the E906 at 200 MHz, 2026-10-21 to 2026-10-23:

Silicon Timings, Interrupt Latency & Resource Utilization

The two lessons: the interpreter, not the drivers, is where the time goes in Python; and register access from this core is expensive enough that DMA matters at high data rates.

12. What went wrong

The console flood. The first profiler firmware sent about 20 trace packets a second. After a reader on Linux closed the trace endpoint, the E906 kept sending, because Linux never tells the other side that a reader went away. Linux logged virtio_rpmsg_bus: msg received with no recipient for every packet on the serial console, the console became unusable and the board had to be rebooted twice. The older status report had the same flaw at one packet a second, which is why nobody had noticed. The fix is the 3-second hello lease from section 4, plus a board test that checks the kernel log stays quiet after the reader closes.

wfi + 4. A profiler sample that interrupts the idle wfi should return to the wfi. The first fix compared the saved return address with the wfi instruction, but this E906 saves the address of the next instruction. The check never matched and the idle loop still woke about 1,050 times a second. The firmware now accepts both addresses, and idle wakes dropped to about one a second.

The DMA bring-up & the “last byte” trap. Getting hardware DMA working across asymmetric processors took days of grueling bring-up. First, Linux claimed all 16 DMA channels by default, so we had to patch the device tree (dma-channels = <8>) and reprogram interrupt routing registers so the Linux kernel wouldn’t panic on unhandled coprocessor interrupts. Second, the E906 views SRAM through its local core addresses (0x3FFC0000 / 0x40000000), but the system DMA controller requires physical bus addresses (0x00020000); passing raw C++ pointers silently caused DMA bus errors. But the most insidious bug was the “last byte” issue: UART GPS sentences are variable in length (e.g. 73 bytes). If you configure DMA to transfer 64 or 512 bytes, the transfer only triggers when the block completes—leaving the trailing bytes of a sentence trapped in the hardware FIFO indefinitely until the next burst arrived! The fix was pairing circular DMA mode (a 16×64-byte ring buffer in shared SRAM) with the UART’s hardware character timeout interrupt (IIR = 0x0C, UART_DMA_REQ_EN bit 2). When the line goes idle for 4 character times, the timeout interrupt flushes the pipeline and delivers the trailing bytes to Python immediately.

Studio pop-outs, multi-viewports & the disappearing canvas. Giving AbstractX Studio multi-monitor pop-out capabilities took three iterations to get right. Our first attempt was a crude hack: clicking “Pop Out” spawned an external Python subprocess (flight_display.py). Clicking it repeatedly spawned an avalanche of rogue Python processes that didn’t share memory, and clicking “Pop In” was a broken no-op. When we moved to native Dear ImGui multi-viewports (enable_viewports = True), three subtle bugs hit: 1. The Auto-Merge Trap: ImGui’s default io.config_viewports_no_auto_merge = False automatically swallowed any floating window that overlapped the main workbench back into the main OS window, making pop-out look completely broken. 2. Pruned Dock Nodes: When a window was popped out, ImGui dynamically pruned its parent dock split. Calling dock_builder_dock_window() on a pruned node failed silently. A naive fallback called restore_default_layout(), which reset every window globally—inadvertently slamming the user’s flight instruments back into the main window and destroying their layout! We had to detect pruned nodes, re-split the parent node independently (dock_builder_split_node), and call dock_builder_finish() to stage and commit docking changes cleanly. 3. The Sizing Bar Minimum Width Clamp: Preset buttons (800×600, 1024×720) were chained on a single horizontal line measuring 1,345 pixels wide. Because ImGui windows can never shrink smaller than their content, clicking the 800×600 preset did nothing until the sizing bar was wrapped into multiple rows.

These problems did not show up in simulation or static analysis. They were found on the physical board and during real workbench testing, and are fully recorded in the engineering log.

13. Limits and what is not done yet

Several early bring-up friction points noted in previous drafts have now been fully resolved in the AbstractX tree:

  • UART Receive DMA is live: Circular DMA (abstractx.uart_dma(True)) is now fully operational on E906 with a 16×64-byte circular ring in shared SRAM and hardware character timeout interrupts (IIR = 0x0C), dropping CPU UART load to 0.4 %.
  • Dual-Mode SPI1 DMA Engine is live: Hardware SPI1 on Port B (PB11..PB14) is fully operational with Single-SPI 1-bit and Dual-SPI 2-bit burst (BCC[28]) streaming (abstractx.spi_init(), abstractx.spi_xfer(), abstractx.spi_xfer_into()). Transfers  ≤ 64 B use direct FIFO MMIO while bulk transfers use dual-channel DMA.
  • DMA Physical Address Translation & Firewall Handling: All bus drivers (spi.cpp, uart.cpp, i2c.cpp) translate E906 addresses through DmaController::pa() and stage descriptors in SRAM Space 1 (.sram_c). Channels 9 and 10 are identified as hardware-firewalled by SoC security policy, reserving channels 8 and 11..15 for autonomous coprocessor DMA.
  • Native Binary Telemetry & Trace are built: Scripts no longer rely solely on printing text over the console. abstractx.tlp_send(buf) streams raw 64-byte binary telemetry frames directly across RPMsg endpoint 1024, and abstractx.trace(task_id, state, msg) emits CTF 1.8 binary events directly over endpoint 1025.
  • Profiler Idle Attribution is fixed: The profiler classification was patched to accept both wfi and wfi + 4 return addresses (live_profile.py), correctly mapping idle CPU time to idle across Studio’s gauges and timeline swimlanes.

Remaining Boundaries & Next Horizons

  • UART APB1 Clock Ceiling: The UART clock (APB1) is fixed at 24 MHz on this board, limiting standard integer divisors to 1.5 Mbit/s. Pushing past this to 3.0 or 6.0 Mbit/s requires patching the Linux clock tree driver to reconfigure the parent APB1 PLL.
  • MicroPython in Tight Loops (The Interpreter Tax): Interpreted Python bytecode consumes ~90 % CPU when executing tight polling loops (e.g. busy-waiting on I2C/UART). MicroPython is designed for rapid interactive bring-up, peripheral prototyping, and scriptable instrumentation; flight-critical real-time control loops (such as 8 kHz IMU fusion) belong in freestanding C++20 coroutines on the exact same HAL drivers (< 1 % CPU).
  • Automated Script-to-Coro Migration: Tooling is being expanded (see the micropython-to-cpp workflow) to translate proven MicroPython async tasks directly into freestanding C++20 coroutines, bridging the gap between interactive REPL experimentation and hardened bare-metal deployment.
  • Full FPGA Switch Fabric Loopback: Exercising physical loopback tests between the E906 Dual-SPI burst DMA engine and the Tang Primer 20K FPGA crossbar (asp_router.sv) on real hardware headers.

14. Where to go next