How google-coral/coralnpu works
Coral NPU is a RISC-V machine-learning accelerator IP, with scalar, vector, and matrix processing, on-chip memories, and AXI integration. Its principal runtime path is software issuing ML work to the processor, which accesses memory and system buses; the tree also shows a distinct DMA subsystem, optimized LiteRT Micro kernels, FPGA boot support, simulation, and verification utilities. The excerpts establish selected DMA behavior, FPGA loading, and simulation helpers, but not the complete processor-to-software execution wiring, so those links are omitted rather than inferred.
Main entry points: tflite_runner.cc LiteRT Micro runner · SCore.scala Scalar core · CoralNPUChiselSubsystem.scala SoC subsystem · DmaEngine.scala DMA engine
Components 25
NPU compute
- Scalar core
hdl/chisel/src/coralnpu/scalar/SCore.scala - Vector core
hdl/chisel/src/coralnpu/rvv/RvvCore.scala - Floating-point core
hdl/chisel/src/coralnpu/float/FloatCore.scala
Memory and fabric
- Tightly-coupled memories
hdl/chisel/src/coralnpu/TCM.scala - AXI interfaces
hdl/chisel/src/coralnpu/CoreAxi.scala - SoC subsystem
hdl/chisel/src/soc/CoralNPUChiselSubsystem.scala - DMA engine
hdl/chisel/src/bus/DmaEngine.scala - DMA fill engine
hdl/chisel/src/dma/DmaFillEngine.scala - DMA drain engine
hdl/chisel/src/dma/DmaDrainEngine.scala
ML software
- LiteRT Micro runner
sw/utils/tflite_runner/tflite_runner.cc - Convolution kernels
sw/opt/litert-micro/conv.cc - Other optimized kernels
sw/opt/litert-micro
FPGA platform
- FPGA simulation host
fpga/main.cc - ROM boot loader
fpga/sw/rom_boot/main.c - SPI flash driver
fpga/sw/spi_flash.c - FTDI Nexus loader
sw/utils/nexus_loader/main.cc - Loader SPI master
sw/utils/nexus_loader/spi_master.cc
Simulation and verification
- Spike simulator
sw/coralnpu_sim/spike_simulator.cc - Core simulator
hw_sim/core_mini_axi_simulator.cc - Simulator interface
coralnpu_test_utils/core_mini_axi_interface.py - Memory backdoor
coralnpu_test_utils/backdoor.py - Dispatch verifier
coralnpu_test_utils/dispatch_verifier/monitor.py
Other components
- Software integrator
- SPI flash device
- Simulation host
Connections 18
- Software integrator → LiteRT Micro runner: runs inference
- Scalar core → Vector core: dispatches work
- Scalar core → Floating-point core: uses operations
- SoC subsystem → Tightly-coupled memories: integrates memories
- SoC subsystem → AXI interfaces: exposes interfaces
- DMA engine → DMA fill engine: coordinates fill
- DMA engine → DMA drain engine: coordinates drain
- LiteRT Micro runner → Convolution kernels: uses kernels
sw/utils/tflite_runner/tflite_runner.cc - LiteRT Micro runner → Other optimized kernels: uses kernels
sw/utils/tflite_runner/tflite_runner.cc - Core simulator → Simulator interface: drives simulation
- Simulator interface → Memory backdoor: uses backdoor
coralnpu_test_utils/core_mini_axi_interface.py - Simulation host → Dispatch verifier: checks dispatch
- FPGA simulation host → Memory backdoor: loads ELF through
fpga/main.cc - ROM boot loader → SPI flash driver: reads flash
fpga/sw/rom_boot/main.c - SPI flash device → ROM boot loader: provides image
- FTDI Nexus loader → Loader SPI master: transfers via
sw/utils/nexus_loader/main.cc - Loader SPI master → SPI flash device: programs device
- Spike simulator → Scalar core: models execution