PAIRV is a CLI-oriented application project for a custom Nuclei N307FD-based RISC-V platform.
The active build flow is defined by the local SDK-style tree in:
application/common/Build/NMSIS/OS/SoC/tests/third_party
Other directories in the repository are not part of the primary CLI build flow.
- A local Nuclei-style build system that can build applications directly from the command line
- Reusable common code for logging and NICE-related helpers
- Baremetal sample applications for bring-up, NICE/custom instruction validation, UART/SNN integration, NMSIS-NN smoke validation, debug logging, and EmbeddedProto flash assets
- FreeRTOS sample applications
- Baremetal test applications under
tests/ - Local SoC integration for the current platform, including startup code, linker scripts, and board configuration
PAIRV/
├── common/
│ ├── rv_debug.{h,c}
│ └── rv_nice/
├── application/
│ ├── baremetal/
│ │ ├── debug_demo/
│ │ ├── helloworld/
│ │ ├── nice/
│ │ ├── proto_flash/
│ │ ├── simple_nn/
│ │ └── uart/
│ ├── benchmark/
│ │ ├── coremark/
│ │ └── dhrystone/
│ └── freertos/
│ └── demo/
├── Build/
├── NMSIS/
│ ├── Core/Include/
│ ├── NN/Include/
│ ├── Library/NN/GCC/
│ ├── build.mk
│ └── manifest.json
├── OS/
├── SoC/
├── tests/
│ └── utils/
├── third_party/
│ └── EmbeddedProto/
│ └── NMSIS/
├── Makefile
├── setup.sh
└── setup_config.sh
Current effective defaults:
SOC=evalsocBOARD=nuclei_fpga_evalCORE=n307fdDOWNLOAD=ilmflashxip
Application-specific notes:
application/baremetal/niceonly supportsDOWNLOAD=ilmflashxiporDOWNLOAD=flashxipapplication/baremetal/uartonly supportsDOWNLOAD=ilmflashxiporDOWNLOAD=flashxipapplication/baremetal/proto_flashonly supportsDOWNLOAD=ilmflashxiporDOWNLOAD=flashxipapplication/baremetal/simple_nncan be built withDOWNLOAD=ilm- lightweight demos such as
helloworldanddebug_democan be built withDOWNLOAD=ilm
Before building, configure the toolchain path and export the SDK root.
Edit setup_config.sh and set NUCLEI_TOOL_ROOT to your local Nuclei toolchain directory.
Example:
NUCLEI_TOOL_ROOT=/path/to/nuclei/toolchainFrom the project root:
export NUCLEI_SDK_ROOT=$(pwd)source setup.shIf you want to build the EmbeddedProto demo, initialize the submodule first:
git submodule update --init --recursivePAIRV uses a two-layer NMSIS arrangement:
NMSIS/- repo-owned default consumption mirror used by ordinary application builds
- contains the shipped
Core/NNheaders,build.mk, and the prebuiltNNarchive forrv32imafdc
third_party/NMSIS/- pinned upstream source submodule
- used by developers when tracking upstream changes or rebuilding the shipped prebuilt library
The default build path remains simple:
export NUCLEI_SDK_ROOT=$(pwd)
source setup.shThat default path uses the top-level NMSIS/ mirror automatically.
If a developer wants to test directly against the upstream source tree instead of the shipped mirror, they can override:
make NUCLEI_SDK_NMSIS=$(pwd)/third_party/NMSIS/NMSIS ...To refresh the shipped prebuilt mirror from the upstream submodule:
export NUCLEI_TOOL_ROOT=/path/to/nuclei/toolchain
./scripts/refresh_nmsis_prebuilt.shThe root Makefile is the intended CLI entrypoint.
makeor
make helpmake CORE=n307fd DOWNLOAD=ilm PROGRAM=application/baremetal/helloworld all
make CORE=n307fd DOWNLOAD=ilm PROGRAM=application/baremetal/debug_demo all
make CORE=n307fd DOWNLOAD=ilmflashxip PROGRAM=application/baremetal/nice all
make CORE=n307fd DOWNLOAD=ilmflashxip PROGRAM=application/baremetal/uart all
make CORE=n307fd DOWNLOAD=ilmflashxip PROGRAM=application/baremetal/proto_flash all
make CORE=n307fd DOWNLOAD=ilm PROGRAM=application/baremetal/simple_nn all
make CORE=n307fd DOWNLOAD=ilm PROGRAM=application/freertos/demo allmake CORE=n307fd DOWNLOAD=ilm PROGRAM=application/baremetal/helloworld info
make CORE=n307fd DOWNLOAD=ilm PROGRAM=application/baremetal/helloworld showflagsmake CORE=n307fd DOWNLOAD=ilm PROGRAM=application/baremetal/helloworld bin
make CORE=n307fd DOWNLOAD=ilm PROGRAM=application/baremetal/helloworld dasm
make CORE=n307fd DOWNLOAD=ilm PROGRAM=application/baremetal/helloworld sizemake CORE=n307fd DOWNLOAD=ilm PROGRAM=application/baremetal/helloworld clean
make cleanallmake buildallbuildall and cleanall scan both application/ and tests/.
Examples:
make CORE=n307fd DOWNLOAD=ilm PROGRAM=application/baremetal/helloworld upload
make CORE=n307fd DOWNLOAD=ilm PROGRAM=application/baremetal/helloworld run_openocd
make CORE=n307fd DOWNLOAD=ilm PROGRAM=application/baremetal/helloworld run_gdb
make CORE=n307fd DOWNLOAD=ilm PROGRAM=application/baremetal/helloworld debugThese commands depend on:
- a valid toolchain environment
- board/OpenOCD configuration under
SoC/ - linker scripts under
SoC/
Simple bring-up example for startup, console output, and base platform verification.
Minimal demo for the shared common/rv_debug.{h,c} logging helper.
NICE/custom instruction example.
Constraints:
- links with
-lm - requires
DOWNLOAD=ilmflashxiporDOWNLOAD=flashxip
Board-integration-heavy application for UART, SNN-related register access, interrupts, FIFO handling, and command processing.
Constraints:
- requires
DOWNLOAD=ilmflashxiporDOWNLOAD=flashxip
EmbeddedProto-based demo that links a serialized protobuf asset into flash and uses the shared debug helper.
Constraints:
- requires
third_party/EmbeddedProto - requires
DOWNLOAD=ilmflashxiporDOWNLOAD=flashxip
Minimal NMSIS-NN validation application using a deterministic conv -> relu -> linear pipeline.
Constraints:
- links
nmsis_nn - default verification target for the shipped prebuilt
NNlibrary - can be built with
DOWNLOAD=ilm
Basic FreeRTOS demo for the current platform.