README.md 4.7 KB

Nuclei 100 Series Core Device Templates

The evalsoc implementation in Nuclei N100 SDK serves as a latest reference implementation using Nuclei 100 series CPU.

We support the following toolchains in this evalsoc implementation:

Quick Porting Guide

To quickly port this SDK to your custom SoC (designed with Nuclei 100 series CPU), please refer to our comprehensive porting guide:

Porting Guide: From EvalSoC to Custom SoC

Directory Structure

Board Support (Board/nuclei_fpga_eval/)

  • Configuration Files

    • npk.yml: Board Support Package Configuration File for NPK
    • openocd_evalsoc.cfg: OpenOCD configuration for on-board debugging using HummingBird Debugger
  • Header Files (Include/)

    • nuclei_sdk_hal.h: Hardware abstraction layer interface
    • Defines debug UART (UART0)
    • Configures debug output or suppress debug output via NMSIS_DISABLE_DEBUG
    • board_nuclei_fpga_eval.h: Board specific header file for peripheral access if needed
  • Linker Scripts (Source/GCC/ and Source/IAR/)

    • Source/GCC: Linker Scripts for GCC/Clang toolchain
    • Source/IAR: Linker Scripts for IAR toolchain
    • Provide sample linker script in GCC/Clang toolchain:
    • gcc_evalsoc_sram.ld: code and data all placed in sram
    • Provide sample linker script in IAR toolchain:
    • iar_evalsoc_sram.icf: code and data all placed in sram

SoC Support (Common/)

Core Definition Files

  • evalsoc.svd: System View Description file, provided by SoC vendor

    • Peripheral register definitions
    • Interrupt configurations
    • Memory map details
  • npk.yml: SoC Support Package Configuration File for NPK

Include Files (Common/Include/)

  • cpufeature.h: Nuclei RISC-V CPU feature header file

    • This file is generated by nuclei_gen tool
    • Used by evalsoc.h to define CPU feature macros used in NMSIS Core header files
  • evalsoc.h: Core SoC definitions

    • Base addresses for peripherals
    • Interrupt definitions
    • Nuclei RISC-V CPU feature macros
    • You can customize this file to add more SoC definitions
  • evalsoc_uart.h: UART driver interface

  • system_evalsoc.h: System configuration

    • Clock initialization
    • Core initialization routines
    • System frequency setup
    • Interrupt(IRQC) and Exception API
  • nuclei_sdk_soc.h: SDK SoC common header file

    • Includes all peripheral headers
    • Common definitions for the SoC
    • Include evalsoc.h

Source Files (Common/Source/)

  • Startup/Interrupt and Exception Code

    • Startup Code:
    • GCC/Clang version: GCC/startup_evalsoc.S
    • IAR version: IAR/startup.S and IAR/startup_evalsoc.c
    • Interrupt and Exception Code:
    • GCC/Clang version: M-Mode -> GCC/intexc_evalsoc.S
    • IAR version: M-Mode -> IAR/intexc_evalsoc.S
  • System Configuration Code

    • evalsoc_common.c: get soc frequency via timer freq, and delay function and etc, which can be deleted if not needed
    • system_evalsoc.c: template code for system configuration, it will do premain initialization, interrupt and exception initialization, uart initialization and print banner, you can customize it as needed
  • Driver Implementations(Drivers)

    • UART driver: evalsoc_uart.c
  • Standard C Library Stub Code(Stubs)

    • Newlib stubs: Stubs/newlib
    • IAR DLib stubs: Stubs/iardlib
    • Nuclei C Runtime Library(libncrt) stubs: Stubs/libncrt
    • You only need one of them depending on your which c library you are using

Build Configuration