Huaqi Fang 587b4db9b1 SoC/evalsoc: Add ECLIC version selection option in npk.yml 2 недель назад
..
Board b53ce1d5dd SoC/evalsoc: add debug configuration support for nuclei cpu model in npk 2 месяцев назад
Common 587b4db9b1 SoC/evalsoc: Add ECLIC version selection option in npk.yml 2 недель назад
README.md 0f6d664fa3 SoC/evalsoc: add quick porting guide to README.md for custom SoC integration 8 месяцев назад
build.mk 7cc25809d3 SoC/evalsoc: Add ECLICv2 support with hardware context auto-save feature 2 недель назад
cpufeature.mk 49e522659f SoC/evalsoc: mention about -mstrict-align for 200 series without unalign memory access 1 год назад
runmode.mk 7cc25809d3 SoC/evalsoc: Add ECLICv2 support with hardware context auto-save feature 2 недель назад

README.md

NMSIS Core Device Templates

The evalsoc implementation in Nuclei SDK serves as a latest reference implementation of the NMSIS Core Device Templates.

Device templates located in https://github.com/Nuclei-Software/NMSIS/tree/master/Device/_Template_Vendor will not be updated anymore.

We support the following toolchains in this evalsoc implementation:

Quick Porting Guide

To quickly port this SDK to your custom SoC (designed with Nuclei 200/300/600/900/1000 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
    • openocd_xlspike.cfg: Nuclei internal use only. OpenOCD configuration for xlspike simulation, not for general use
  • 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
    • Support for multiple download modes in GCC/Clang toolchain:
    • gcc_evalsoc_ilm.ld: code placed in ilm, data placed in dlm
    • gcc_evalsoc_flash.ld: code and data in flash, but code will be copied to ilm, data will be copied to dlm when running
    • gcc_evalsoc_flashxip.ld: code and data in flash, but code will still in flash, data will be copied to dlm when running
    • gcc_evalsoc_ddr.ld: code and data all placed in ddr
    • gcc_evalsoc_sram.ld: code and data all placed in sram
    • Support for multiple run modes in IAR toolchain:
    • flash download mode is not supported

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(ECLIC/PLIC/CLINT) 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, S-Mode -> GCC/intexc_evalsoc_s.S
    • IAR version: M-Mode -> IAR/intexc_evalsoc.S, S-Mode -> IAR/intexc_evalsoc_s.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, smp bringup, cache 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