Jelajahi Sumber

Upgrade: New structure for Nuclei SDK

Now Board changed to SoC, in SoC folder, each board can be initialized
easily.

Signed-off-by: Huaqi Fang <578567190@qq.com>
Huaqi Fang 6 tahun lalu
induk
melakukan
d760f644d9
73 mengubah file dengan 248 tambahan dan 167 penghapusan
  1. 1 0
      .gitignore
  2. 4 4
      Build/Makefile.base
  3. 0 1
      Build/Makefile.board
  4. 0 11
      Build/Makefile.board.hbird
  5. 5 5
      Build/Makefile.conf
  6. 2 2
      Build/Makefile.files
  7. 13 0
      Build/Makefile.files.Nuclei
  8. 0 8
      Build/Makefile.files.hbird
  9. 0 7
      Build/Makefile.os
  10. 0 9
      Build/Makefile.os.FreeRTOS
  11. 0 6
      Build/Makefile.os.UCOSII
  12. 7 0
      Build/Makefile.rtos
  13. 9 0
      Build/Makefile.rtos.FreeRTOS
  14. 6 0
      Build/Makefile.rtos.UCOSII
  15. 1 0
      Build/Makefile.soc
  16. 15 0
      Build/Makefile.soc.Nuclei
  17. 0 1
      OS/FreeRTOS/Source/portable/GCC/port.c
  18. 1 1
      OS/FreeRTOS/Source/portable/GCC/portmacro.h
  19. 11 11
      OS/UCOSII/arch/os_cpu_c.c
  20. 2 2
      OS/UCOSII/arch/trap.c
  21. 3 3
      OS/UCOSII/cfg/os_cpu.h
  22. 57 15
      README.md
  23. 0 0
      SoC/Common/Stubs/close.c
  24. 0 0
      SoC/Common/Stubs/fstat.c
  25. 2 2
      SoC/Common/Stubs/gettimeofday.c
  26. 0 0
      SoC/Common/Stubs/isatty.c
  27. 0 0
      SoC/Common/Stubs/lseek.c
  28. 1 1
      SoC/Common/Stubs/read.c
  29. 0 0
      SoC/Common/Stubs/sbrk.c
  30. 0 0
      SoC/Common/Stubs/stub.h
  31. 1 1
      SoC/Common/Stubs/write.c
  32. 0 0
      SoC/Nuclei/Board/hbird/Include/.gitkeep
  33. 40 0
      SoC/Nuclei/Board/hbird/Include/board_hbird.h
  34. 3 6
      SoC/Nuclei/Board/hbird/Include/nuclei_sdk_hal.h
  35. 0 0
      SoC/Nuclei/Board/hbird/Source/.gitkeep
  36. 0 0
      SoC/Nuclei/Common/Include/gpio.h
  37. 0 0
      SoC/Nuclei/Common/Include/i2c.h
  38. 14 0
      SoC/Nuclei/Common/Include/nuclei_sdk_soc.h
  39. 0 21
      SoC/Nuclei/Common/Include/nuclei_soc.h
  40. 0 0
      SoC/Nuclei/Common/Include/pwm.h
  41. 0 0
      SoC/Nuclei/Common/Include/soc.h
  42. 0 0
      SoC/Nuclei/Common/Include/spi.h
  43. 0 0
      SoC/Nuclei/Common/Include/system_nuclei_soc.h
  44. 0 0
      SoC/Nuclei/Common/Include/uart.h
  45. 0 0
      SoC/Nuclei/Common/Source/Drivers/gpio.c
  46. 0 0
      SoC/Nuclei/Common/Source/Drivers/uart.c
  47. 0 0
      SoC/Nuclei/Common/Source/GCC/gcc_nuclei_soc_flash.ld
  48. 0 0
      SoC/Nuclei/Common/Source/GCC/gcc_nuclei_soc_flashxip.ld
  49. 0 0
      SoC/Nuclei/Common/Source/GCC/gcc_nuclei_soc_ilm.ld
  50. 0 0
      SoC/Nuclei/Common/Source/GCC/intexc_nuclei_soc.S
  51. 0 0
      SoC/Nuclei/Common/Source/GCC/startup_nuclei_soc.S
  52. 0 0
      SoC/Nuclei/Common/Source/nuclei_soc.c
  53. 22 22
      SoC/Nuclei/Common/Source/system_nuclei_soc.c
  54. 0 0
      SoC/Nuclei/Common/openocd_hbird.cfg
  55. 0 0
      SoC/Nuclei/Common/openocd_hbird_ilm.cfg
  56. 1 1
      application/baremetal/benchmark/coremark/core_portme.h
  57. 1 1
      application/baremetal/benchmark/dhrystone/dhry_stubs.c
  58. 1 1
      application/baremetal/benchmark/whetstone/cpuidc.c
  59. 4 4
      application/baremetal/benchmark/whetstone/whets.c
  60. 1 1
      application/baremetal/eclic_test/eclic_test.c
  61. 2 2
      application/baremetal/helloworld/hello_world.c
  62. 1 1
      application/baremetal/timer_test/timer_test.c
  63. 1 1
      application/freertos/demo/Makefile
  64. 3 3
      application/freertos/demo/main.c
  65. 1 1
      application/ucosii/demo/Makefile
  66. 2 2
      application/ucosii/demo/main.c
  67. 1 1
      test/core/test_atomic.c
  68. 1 1
      test/core/test_compiler.c
  69. 1 1
      test/core/test_csr.c
  70. 3 3
      test/core/test_eclic.c
  71. 2 2
      test/core/test_fpu.c
  72. 1 1
      test/core/test_pmp.c
  73. 1 1
      test/core/test_timer.c

+ 1 - 0
.gitignore

@@ -5,6 +5,7 @@
 *.diss
 *.map
 *.log
+.vscode
 
 software/*/*.s
 

+ 4 - 4
Build/Makefile.base

@@ -1,13 +1,13 @@
 CORE ?= n307fd
-BOARD ?= hbird
-OS ?=
+SOC ?= Nuclei
+RTOS ?=
 DOWNLOAD ?= ilm
 PFLOAT ?= 0
 NEWLIB ?= nano
 
 NUCLEI_SDK_BUILD = $(NUCLEI_SDK_ROOT)/Build
-NUCLEI_SDK_BOARD = $(NUCLEI_SDK_ROOT)/Board/$(BOARD)
-NUCLEI_SDK_OS = $(NUCLEI_SDK_ROOT)/OS/$(OS)
+NUCLEI_SDK_SOC = $(NUCLEI_SDK_ROOT)/SoC/$(SOC)
+NUCLEI_SDK_RTOS = $(NUCLEI_SDK_ROOT)/OS/$(RTOS)
 
 ## Include GNU Make Standard Library
 ## Website: http://gmsl.sourceforge.net/

+ 0 - 1
Build/Makefile.board

@@ -1 +0,0 @@
-include $(NUCLEI_SDK_BUILD)/Makefile.board.$(BOARD)

+ 0 - 11
Build/Makefile.board.hbird

@@ -1,11 +0,0 @@
-ifeq ($(DOWNLOAD),ilm)
-OPENOCD_CFG ?= $(NUCLEI_SDK_BOARD)/openocd_hbird_ilm.cfg
-LINKER_SCRIPT = $(NUCLEI_SDK_BOARD)/Source/GCC/gcc_nuclei_soc_ilm.ld
-else
-OPENOCD_CFG ?= $(NUCLEI_SDK_BOARD)/openocd_hbird.cfg
-ifeq ($(DOWNLOAD),flashxip)
-LINKER_SCRIPT = $(NUCLEI_SDK_BOARD)/Source/GCC/gcc_nuclei_soc_flashxip.ld
-else
-LINKER_SCRIPT = $(NUCLEI_SDK_BOARD)/Source/GCC/gcc_nuclei_soc_flash.ld
-endif
-endif

+ 5 - 5
Build/Makefile.conf

@@ -33,7 +33,7 @@ SIZE    := riscv-nuclei-elf-size
 OPENOCD := openocd
 endif
 
-include $(NUCLEI_SDK_BUILD)/Makefile.board
+include $(NUCLEI_SDK_BUILD)/Makefile.soc
 
 GDB_PORT ?= 3333
 GDB_UPLOAD_ARGS ?= --batch
@@ -57,7 +57,7 @@ VALID_DOWNLOAD = $(call check_item_exist, $(DOWNLOAD_UPPER), $(SUPPORT_DOWNLOAD_
 
 include $(NUCLEI_SDK_BUILD)/Makefile.core
 include $(NUCLEI_SDK_BUILD)/Makefile.files
-include $(NUCLEI_SDK_BUILD)/Makefile.os
+include $(NUCLEI_SDK_BUILD)/Makefile.rtos
 
 CORE_ARCH_ABI = $($(CORE_UPPER)_CORE_ARCH_ABI)
 ifneq ($(words $(CORE_ARCH_ABI)), 2)
@@ -109,12 +109,12 @@ LDFLAGS += -T $(LINKER_SCRIPT) -nostartfiles -Wl,-M,-Map=$(TARGET).map \
 
 # Prerequesties
 MAKEFILE_PREREQS += $(NUCLEI_SDK_BUILD)/Makefile.base
-MAKEFILE_PREREQS += $(NUCLEI_SDK_BUILD)/Makefile.board
-MAKEFILE_PREREQS += $(NUCLEI_SDK_BUILD)/Makefile.board.$(BOARD)
+MAKEFILE_PREREQS += $(NUCLEI_SDK_BUILD)/Makefile.soc
+MAKEFILE_PREREQS += $(NUCLEI_SDK_BUILD)/Makefile.soc.$(SOC)
 MAKEFILE_PREREQS += $(NUCLEI_SDK_BUILD)/Makefile.conf
 MAKEFILE_PREREQS += $(NUCLEI_SDK_BUILD)/Makefile.core
 MAKEFILE_PREREQS += $(NUCLEI_SDK_BUILD)/Makefile.files
-MAKEFILE_PREREQS += $(NUCLEI_SDK_BUILD)/Makefile.files.$(BOARD)
+MAKEFILE_PREREQS += $(NUCLEI_SDK_BUILD)/Makefile.files.$(SOC)
 MAKEFILE_PREREQS += $(NUCLEI_SDK_BUILD)/Makefile.misc
 MAKEFILE_PREREQS += $(NUCLEI_SDK_BUILD)/Makefile.rules
 MAKEFILE_PREREQS += Makefile

+ 2 - 2
Build/Makefile.files

@@ -4,7 +4,7 @@ CXX_INCDIRS +=
 ASM_INCDIRS +=
 
 SRCDIRS +=
-C_SRCDIRS +=
+C_SRCDIRS += $(NUCLEI_SDK_ROOT)/SoC/Common/Stubs
 CXX_SRCDIRS +=
 ASM_SRCDIRS +=
 
@@ -19,4 +19,4 @@ ASM_SRCS +=
 
 LIBDIRS +=
 
-include $(NUCLEI_SDK_BUILD)/Makefile.files.$(BOARD)
+include $(NUCLEI_SDK_BUILD)/Makefile.files.$(SOC)

+ 13 - 0
Build/Makefile.files.Nuclei

@@ -0,0 +1,13 @@
+INCDIRS += $(NUCLEI_SDK_SOC_COMMON)/Include
+
+C_SRCDIRS += $(NUCLEI_SDK_SOC_COMMON)/Source $(NUCLEI_SDK_SOC_COMMON)/Source/Drivers
+
+ASM_SRCS += $(NUCLEI_SDK_SOC_COMMON)/Source/GCC/startup_nuclei_soc.S \
+			$(NUCLEI_SDK_SOC_COMMON)/Source/GCC/intexc_nuclei_soc.S
+
+# Add extra board related source files and header files
+VALID_NUCLEI_SDK_SOC_BOARD=$(wildcard $(NUCLEI_SDK_SOC_BOARD))
+ifneq ($(VALID_NUCLEI_SDK_SOC_BOARD),)
+INCDIRS += $(VALID_NUCLEI_SDK_SOC_BOARD)/Include
+C_SRCDIRS += $(VALID_NUCLEI_SDK_SOC_BOARD)/Source
+endif

+ 0 - 8
Build/Makefile.files.hbird

@@ -1,8 +0,0 @@
-INCDIRS += $(NUCLEI_SDK_BOARD)/Include
-
-C_SRCDIRS += $(NUCLEI_SDK_BOARD)/Source $(NUCLEI_SDK_BOARD)/Source/Drivers \
-			 $(NUCLEI_SDK_BOARD)/Source/Stubs
-
-ASM_SRCS += $(NUCLEI_SDK_BOARD)/Source/GCC/startup_nuclei_soc.S \
-			$(NUCLEI_SDK_BOARD)/Source/GCC/intexc_nuclei_soc.S
-

+ 0 - 7
Build/Makefile.os

@@ -1,7 +0,0 @@
-ifneq ($(OS),)
-ifneq ($(OS),Windows_NT)
-MAKEFILE_PREREQS += $(NUCLEI_SDK_BUILD)/Makefile.os
-MAKEFILE_PREREQS += $(NUCLEI_SDK_BUILD)/Makefile.os.$(OS)
-include $(NUCLEI_SDK_BUILD)/Makefile.os.$(OS)
-endif
-endif

+ 0 - 9
Build/Makefile.os.FreeRTOS

@@ -1,9 +0,0 @@
-C_SRCDIRS += $(NUCLEI_SDK_OS)/Source $(NUCLEI_SDK_OS)/Source/portable/GCC
-# heap management selection, choose 1 from the portable/MemMang/heap_*.c
-C_SRCS += $(NUCLEI_SDK_OS)/Source/portable/MemMang/heap_4.c
-C_SRCS += $(NUCLEI_SDK_OS)/Source/portable/GCC/port.c
-
-ASM_SRCDIRS += $(NUCLEI_SDK_OS)/Source/portable/GCC
-
-INCDIRS += $(NUCLEI_SDK_OS)/Source/include \
-			$(NUCLEI_SDK_OS)/Source/portable/GCC

+ 0 - 6
Build/Makefile.os.UCOSII

@@ -1,6 +0,0 @@
-C_SRCDIRS += $(NUCLEI_SDK_OS)/source $(NUCLEI_SDK_OS)/arch
-ASM_SRCDIRS += $(NUCLEI_SDK_OS)/arch
-
-INCDIRS += $(NUCLEI_SDK_OS)/arch \
-			$(NUCLEI_SDK_OS)/cfg \
-			$(NUCLEI_SDK_OS)/source/

+ 7 - 0
Build/Makefile.rtos

@@ -0,0 +1,7 @@
+ifneq ($(RTOS),)
+ifneq ($(wildcard $(NUCLEI_SDK_RTOS)),)
+MAKEFILE_PREREQS += $(NUCLEI_SDK_BUILD)/Makefile.rtos
+MAKEFILE_PREREQS += $(NUCLEI_SDK_BUILD)/Makefile.rtos.$(RTOS)
+include $(NUCLEI_SDK_BUILD)/Makefile.rtos.$(RTOS)
+endif
+endif

+ 9 - 0
Build/Makefile.rtos.FreeRTOS

@@ -0,0 +1,9 @@
+C_SRCDIRS += $(NUCLEI_SDK_RTOS)/Source $(NUCLEI_SDK_RTOS)/Source/portable/GCC
+# heap management selection, choose 1 from the portable/MemMang/heap_*.c
+C_SRCS += $(NUCLEI_SDK_RTOS)/Source/portable/MemMang/heap_4.c
+C_SRCS += $(NUCLEI_SDK_RTOS)/Source/portable/GCC/port.c
+
+ASM_SRCDIRS += $(NUCLEI_SDK_RTOS)/Source/portable/GCC
+
+INCDIRS += $(NUCLEI_SDK_RTOS)/Source/include \
+			$(NUCLEI_SDK_RTOS)/Source/portable/GCC

+ 6 - 0
Build/Makefile.rtos.UCOSII

@@ -0,0 +1,6 @@
+C_SRCDIRS += $(NUCLEI_SDK_RTOS)/source $(NUCLEI_SDK_RTOS)/arch
+ASM_SRCDIRS += $(NUCLEI_SDK_RTOS)/arch
+
+INCDIRS += $(NUCLEI_SDK_RTOS)/arch \
+			$(NUCLEI_SDK_RTOS)/cfg \
+			$(NUCLEI_SDK_RTOS)/source/

+ 1 - 0
Build/Makefile.soc

@@ -0,0 +1 @@
+include $(NUCLEI_SDK_BUILD)/Makefile.soc.$(SOC)

+ 15 - 0
Build/Makefile.soc.Nuclei

@@ -0,0 +1,15 @@
+BOARD ?= hbird
+NUCLEI_SDK_SOC_BOARD=$(NUCLEI_SDK_SOC)/Board/$(BOARD)
+NUCLEI_SDK_SOC_COMMON=$(NUCLEI_SDK_SOC)/Common
+
+ifeq ($(DOWNLOAD),ilm)
+OPENOCD_CFG ?= $(NUCLEI_SDK_SOC_COMMON)/openocd_hbird_ilm.cfg
+LINKER_SCRIPT = $(NUCLEI_SDK_SOC_COMMON)/Source/GCC/gcc_nuclei_soc_ilm.ld
+else
+OPENOCD_CFG ?= $(NUCLEI_SDK_SOC_COMMON)/openocd_hbird.cfg
+ifeq ($(DOWNLOAD),flashxip)
+LINKER_SCRIPT = $(NUCLEI_SDK_SOC_COMMON)/Source/GCC/gcc_nuclei_soc_flashxip.ld
+else
+LINKER_SCRIPT = $(NUCLEI_SDK_SOC_COMMON)/Source/GCC/gcc_nuclei_soc_flash.ld
+endif
+endif

+ 0 - 1
OS/FreeRTOS/Source/portable/GCC/port.c

@@ -81,7 +81,6 @@
 #include <unistd.h>
 #include <stdio.h>
 
-#include "nuclei_hal.h"
 
 /* Each task maintains its own interrupt status in the critical nesting
 variable. */

+ 1 - 1
OS/FreeRTOS/Source/portable/GCC/portmacro.h

@@ -75,7 +75,7 @@
 extern "C" {
 #endif
 
-#include "nuclei_hal.h"
+#include "nuclei_sdk_soc.h"
 
 /*-----------------------------------------------------------
  * Port specific definitions.

+ 11 - 11
OS/UCOSII/arch/os_cpu_c.c

@@ -1,5 +1,5 @@
 #include <ucos_ii.h>
-#include "nuclei_hal.h"
+#include "nuclei_sdk_soc.h"
 
 #ifdef __riscv_flen
     unsigned long MSTATUS_INIT = (MSTATUS_MPP | MSTATUS_MPIE | MSTATUS_FS);
@@ -9,16 +9,16 @@
 
 OS_STK *OSTaskStkInit (void (*task)(void *pd), void *pdata, OS_STK *ptos, INT16U opt)
 {
-    
+
     //pdata should be restore in a0
-    
+
     OS_STK *stk;
-    (void)opt;         
-    
+    (void)opt;
+
     // Force stack 8byte align for double floating point case
     ptos = (OS_STK *)(((unsigned long)ptos) & (~(unsigned long)(0x0007)));
 
-    stk = ptos-32;  
+    stk = ptos-32;
     extern void halt(unsigned long a, unsigned long b);
     stk[0]=(OS_STK)halt; //ra,meaningless ,task shuldn't exit.
     stk[1]=MSTATUS_INIT;//mstatus.set 0x80 ,global interrupt will be set when task begin.
@@ -51,7 +51,7 @@ OS_STK *OSTaskStkInit (void (*task)(void *pd), void *pdata, OS_STK *ptos, INT16U
     stk[28]=0;
     stk[29]=0;
     stk[30]=0;
-    stk[31]=(OS_STK)task;//mepc                      
+    stk[31]=(OS_STK)task;//mepc
     return stk;
 }
 
@@ -333,12 +333,12 @@ void  OSTimeTickHook (void)
 }
 #endif
 
-#if OS_CPU_HOOKS_EN > 0u && OS_VERSION > 290u 
+#if OS_CPU_HOOKS_EN > 0u && OS_VERSION > 290u
 
 void OSTaskReturnHook(OS_TCB *ptcb)
-{ 
-    (void)ptcb; 
-} 
+{
+    (void)ptcb;
+}
 
 #endif
 

+ 2 - 2
OS/UCOSII/arch/trap.c

@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include <os_cpu.h>
 #include "ucos_ii.h"
-#include "nuclei_hal.h"
+#include "nuclei_sdk_soc.h"
 #include <trap.h>
 
 void syscall_handler(unsigned long sp[])
@@ -15,7 +15,7 @@ extern void task_switch(unsigned long sp[]);
 void time_handler(unsigned long sp[])
 {
     static uint64_t then = 0;
- 
+
     if (then == 0)  {
         then = SysTimer_GetLoadValue();
     }

+ 3 - 3
OS/UCOSII/cfg/os_cpu.h

@@ -48,7 +48,7 @@
 
 
 
-#include<stdint.h>
+#include <stdint.h>
 /*
 *********************************************************************************************************
 *                                     EXTERNAL C LANGUAGE LINKAGE
@@ -94,12 +94,12 @@ typedef  double                FP64;             /* Double precision floating po
 typedef  uint64_t         OS_STK;           /* Each stack entry is 64-bit wide                    */
 typedef  uint64_t         OS_CPU_SR;        /* Define size of Machine status register (64 bits)   */
 
-#else 
+#else
 
 typedef  uint32_t         OS_STK;           /* Each stack entry is 32-bit wide                    */
 typedef  uint32_t         OS_CPU_SR;        /* Define size of Machine status register (32 bits)   */
 
-#endif 
+#endif
 
 
 /*

+ 57 - 15
README.md

@@ -22,20 +22,22 @@ $NUCLEI_SDK_ROOT
 │   ├── baremetal
 │   ├── freertos
 │   └── ucosii
-├── Board
-│   └── hbird
+├── SoC
+│   └── Nuclei
+|       ├── Common
+|       └── Board
 ├── Build
 │   ├── Makefile.base
-│   ├── Makefile.board
-│   ├── Makefile.board.hbird
+│   ├── Makefile.soc
+│   ├── Makefile.soc.Nuclei
 │   ├── Makefile.conf
 │   ├── Makefile.core
 │   ├── Makefile.files
-│   ├── Makefile.files.hbird
+│   ├── Makefile.files.Nuclei
 │   ├── Makefile.misc
-│   ├── Makefile.os
-│   ├── Makefile.os.FreeRTOS
-│   ├── Makefile.os.UCOSII
+│   ├── Makefile.rtos
+│   ├── Makefile.rtos.FreeRTOS
+│   ├── Makefile.rtos.UCOSII
 │   └── Makefile.rules
 ├── NMSIS
 │   └── Include
@@ -56,11 +58,15 @@ $NUCLEI_SDK_ROOT
   - **FreeRTOS** applications, which will provide FreeRTOS applications using FreeRTOS RTOS, placed in *application/freertos/* folder.
   - **UCOSII** applications, which will provide UCOSII applications using UCOSII RTOS, placed in *application/ucosii/* folder.
 
-* **Board**
+* **SoC**
 
-  This directory contains all the supported boards for this Nuclei SDK.
+  This directory contains all the supported SoCs for this Nuclei SDK.
 
-  Here we mainly support Nuclei Hummingbird FPGA evaluation board, the support package placed in *Board/hbird/*.
+  Here we mainly support Nuclei N200, N300, N600, NX600 cores running in Hummingbird FPGA evaluation board, the support package placed in *SoC/Nuclei/*.
+
+  In each SoC's include directory, *nuclei_sdk_soc.h* must be provided, and include the soc header file, for example, *SoC/Nuclei/Common/Include/nuclei_sdk_soc.h*.
+
+  In each SoC Board's include directory, *nuclei_sdk_hal.h* must be provided, and include the board header file, for example, *SoC/Nuclei/Board/hbird/Include/nuclei_sdk_hal.h*.
 
 * **Build**
 
@@ -87,12 +93,13 @@ $NUCLEI_SDK_ROOT
 
 * **setup.sh**
 
-  Nuclei SDK environment setup script. You need to create your own `setup_config.sh`.
+  Nuclei SDK environment setup script for Linux. You need to create your own `setup_config.sh`.
   ~~~
   NUCLEI_TOOL_ROOT=/path/to/your_tool_root
+  NMSIS_ROOT=/path/to/your_nmsis_root
   ~~~
 
-  In the $NUCLEI_TOOL_ROOT, you need to have Nuclei RISC-V GNU GCC toolchain and OpenOCD installed as below.
+  In the **$NUCLEI_TOOL_ROOT**, you need to have Nuclei RISC-V GNU GCC toolchain and OpenOCD installed as below.
   ~~~
   $NUCLEI_TOOL_ROOT
   ├── gcc
@@ -111,9 +118,44 @@ $NUCLEI_SDK_ROOT
       └── share
   ~~~
 
+* **setup.bat**
+
+  Nuclei SDK environment setup script. You need to create your own `setup_config.bat`.
+  ~~~
+  set NUCLEI_TOOL_ROOT=\path\to\your_tool_root
+  set NMSIS_ROOT=\path\to\your_nmsis_root
+  ~~~
+
+  In the **%NUCLEI_TOOL_ROOT%**, you need to have Nuclei RISC-V GNU GCC toolchain, necessary build tools and OpenOCD installed as below.
+  ~~~
+  %NUCLEI_TOOL_ROOT%
+  ├── build-tools
+  │   ├── bin
+  │   ├── gnu-mcu-eclipse
+  │   └── licenses
+  ├── gcc
+  │   ├── bin
+  │   ├── include
+  │   ├── lib
+  │   ├── libexec
+  │   ├── riscv-nuclei-elf
+  │   └── share
+  └── openocd
+      ├── bin
+      ├── contrib
+      ├── distro-info
+      ├── OpenULINK
+      ├── scripts
+      └── share
+  ~~~
+
 ## How to use
-1. Create and modify your own setup config `setup_config.sh` in $NUCLEI_SDK_ROOT.
-2. Source the environment script: `source setup.sh`
+1. Create and modify your own setup config
+   * For linux, create `setup_config.sh` in **$NUCLEI_SDK_ROOT**.
+   * For windows, create `setup_config.bat` in **%NUCLEI_SDK_ROOT%**.
+2. Source the environment script
+   * For linux: `source setup.sh`
+   * For windows: `setup.bat`
 3. Build and run application.
    * Assume that you will run *application/baremetal/helloworld/*.
    * cd *application/baremetal/helloworld/*

+ 0 - 0
Board/hbird/Source/Stubs/close.c → SoC/Common/Stubs/close.c


+ 0 - 0
Board/hbird/Source/Stubs/fstat.c → SoC/Common/Stubs/fstat.c


+ 2 - 2
Board/hbird/Source/Stubs/gettimeofday.c → SoC/Common/Stubs/gettimeofday.c

@@ -1,13 +1,13 @@
 #include <errno.h>
 #include <sys/time.h>
-#include "nuclei_hal.h"
+#include "nuclei_sdk_soc.h"
 
 int _gettimeofday(struct timeval *tp, void *tzp)
 {
     uint64_t cycles;
 
     cycles = __get_rv_cycle();
- 
+
     tp->tv_sec = cycles / SystemCoreClock;
     tp->tv_usec = (cycles % SystemCoreClock) * 1000000 / SystemCoreClock;
     return 0;

+ 0 - 0
Board/hbird/Source/Stubs/isatty.c → SoC/Common/Stubs/isatty.c


+ 0 - 0
Board/hbird/Source/Stubs/lseek.c → SoC/Common/Stubs/lseek.c


+ 1 - 1
Board/hbird/Source/Stubs/read.c → SoC/Common/Stubs/read.c

@@ -2,7 +2,7 @@
 #include <errno.h>
 #include <unistd.h>
 #include <sys/types.h>
-#include "nuclei_hal.h"
+#include "nuclei_sdk_hal.h"
 
 ssize_t _read(int fd, void* ptr, size_t len)
 {

+ 0 - 0
Board/hbird/Source/Stubs/sbrk.c → SoC/Common/Stubs/sbrk.c


+ 0 - 0
Board/hbird/Source/Stubs/stub.h → SoC/Common/Stubs/stub.h


+ 1 - 1
Board/hbird/Source/Stubs/write.c → SoC/Common/Stubs/write.c

@@ -4,7 +4,7 @@
 #include <errno.h>
 #include <unistd.h>
 #include <sys/types.h>
-#include <nuclei_hal.h>
+#include <nuclei_sdk_hal.h>
 
 ssize_t _write(int fd, const void* ptr, size_t len)
 {

+ 0 - 0
SoC/Nuclei/Board/hbird/Include/.gitkeep


+ 40 - 0
SoC/Nuclei/Board/hbird/Include/board_hbird.h

@@ -0,0 +1,40 @@
+// See LICENSE for license details.
+#ifndef _BOARD_HBIRD_H_
+#define _BOARD_HBIRD_H_
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#include "nuclei_soc.h"
+#include "uart.h"
+#include "gpio.h"
+
+#define SOC_DEBUG_UART      UART0
+
+// Interrupt Numbers
+#define SOC_BUTTON_1_IRQn           SOC_INT49_IRQn
+#define SOC_BUTTON_2_IRQn           SOC_INT50_IRQn
+// Interrupt Handler Definitions
+#define SOC_BUTTON_1_HANDLER        eclic_irq49_handler
+#define SOC_BUTTON_2_HANDLER        eclic_irq50_handler
+// GPIO Bit Offset
+#define SOC_LED_RED_GPIO_OFS        19
+#define SOC_LED_GREEN_GPIO_OFS      21
+#define SOC_LED_BLUE_GPIO_OFS       22
+#define SOC_BUTTON_1_GPIO_OFS       30
+#define SOC_BUTTON_2_GPIO_OFS       31
+
+// GPIO Bit Mask
+#define SOC_LED_RED_GPIO_MASK       (1<<SOC_LED_RED_GPIO_OFS)
+#define SOC_LED_GREEN_GPIO_MASK     (1<<SOC_LED_GREEN_GPIO_OFS)
+#define SOC_LED_BLUE_GPIO_MASK      (1<<SOC_LED_BLUE_GPIO_OFS)
+#define SOC_BUTTON_1_GPIO_MASK      (1<<SOC_BUTTON_1_GPIO_OFS)
+#define SOC_BUTTON_2_GPIO_MASK      (1<<SOC_BUTTON_2_GPIO_OFS)
+#define SOC_BUTTON_GPIO_MASK        (SOC_BUTTON_1_GPIO_MASK | SOC_BUTTON_2_GPIO_MASK)
+#define SOC_LED_GPIO_MASK           (SOC_LED_RED_GPIO_MASK | SOC_LED_GREEN_GPIO_MASK | SOC_LED_BLUE_GPIO_MASK)
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 3 - 6
Board/hbird/Include/nuclei_hal.h → SoC/Nuclei/Board/hbird/Include/nuclei_sdk_hal.h

@@ -1,16 +1,13 @@
 // See LICENSE for license details.
-#ifndef _NUCLEI_HAL_H
-#define _NUCLEI_HAL_H
+#ifndef _NUCLEI_SDK_HAL_H
+#define _NUCLEI_SDK_HAL_H
 
 #ifdef __cplusplus
  extern "C" {
 #endif
 
-#include "nuclei_soc.h"
-#include "uart.h"
-#include "gpio.h"
+#include "board_hbird.h"
 
-#define SOC_DEBUG_UART      UART0
 #define NUCLEI_BANNER       1
 
 #ifdef __cplusplus

+ 0 - 0
SoC/Nuclei/Board/hbird/Source/.gitkeep


+ 0 - 0
Board/hbird/Include/gpio.h → SoC/Nuclei/Common/Include/gpio.h


+ 0 - 0
Board/hbird/Include/i2c.h → SoC/Nuclei/Common/Include/i2c.h


+ 14 - 0
SoC/Nuclei/Common/Include/nuclei_sdk_soc.h

@@ -0,0 +1,14 @@
+// See LICENSE for license details.
+#ifndef _NUCLEI_SDK_SOC_H
+#define _NUCLEI_SDK_SOC_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#include "nuclei_soc.h"
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 0 - 21
Board/hbird/Include/nuclei_soc.h → SoC/Nuclei/Common/Include/nuclei_soc.h

@@ -264,30 +264,9 @@ typedef enum EXCn {
 #define SOC_ECLIC_NUM_INTERRUPTS    32
 #define SOC_ECLIC_INT_GPIO_BASE     19
 
-#define SOC_BUTTON_1_IRQn           SOC_INT49_IRQn
-#define SOC_BUTTON_2_IRQn           SOC_INT50_IRQn
-
 // Interrupt Handler Definitions
 #define SOC_MTIMER_HANDLER          eclic_mtip_handler
 #define SOC_SOFTINT_HANDLER         eclic_msip_handler
-#define SOC_BUTTON_1_HANDLER        eclic_irq49_handler
-#define SOC_BUTTON_2_HANDLER        eclic_irq50_handler
-
-// GPIO Bit Offset
-#define SOC_LED_RED_GPIO_OFS        19
-#define SOC_LED_GREEN_GPIO_OFS      21
-#define SOC_LED_BLUE_GPIO_OFS       22
-#define SOC_BUTTON_1_GPIO_OFS       30
-#define SOC_BUTTON_2_GPIO_OFS       31
-
-// GPIO Bit Mask
-#define SOC_LED_RED_GPIO_MASK       (1<<SOC_LED_RED_GPIO_OFS)
-#define SOC_LED_GREEN_GPIO_MASK     (1<<SOC_LED_GREEN_GPIO_OFS)
-#define SOC_LED_BLUE_GPIO_MASK      (1<<SOC_LED_BLUE_GPIO_OFS)
-#define SOC_BUTTON_1_GPIO_MASK      (1<<SOC_BUTTON_1_GPIO_OFS)
-#define SOC_BUTTON_2_GPIO_MASK      (1<<SOC_BUTTON_2_GPIO_OFS)
-#define SOC_BUTTON_GPIO_MASK        (SOC_BUTTON_1_GPIO_MASK | SOC_BUTTON_2_GPIO_MASK)
-#define SOC_LED_GPIO_MASK           (SOC_LED_RED_GPIO_MASK | SOC_LED_GREEN_GPIO_MASK | SOC_LED_BLUE_GPIO_MASK)
 
 #define GPIO_BIT_ALL_ZERO           (0x0)
 #define GPIO_BIT_ALL_ONE            (0xFFFFFFFF)

+ 0 - 0
Board/hbird/Include/pwm.h → SoC/Nuclei/Common/Include/pwm.h


+ 0 - 0
Board/hbird/Include/soc.h → SoC/Nuclei/Common/Include/soc.h


+ 0 - 0
Board/hbird/Include/spi.h → SoC/Nuclei/Common/Include/spi.h


+ 0 - 0
Board/hbird/Include/system_nuclei_soc.h → SoC/Nuclei/Common/Include/system_nuclei_soc.h


+ 0 - 0
Board/hbird/Include/uart.h → SoC/Nuclei/Common/Include/uart.h


+ 0 - 0
Board/hbird/Source/Drivers/gpio.c → SoC/Nuclei/Common/Source/Drivers/gpio.c


+ 0 - 0
Board/hbird/Source/Drivers/uart.c → SoC/Nuclei/Common/Source/Drivers/uart.c


+ 0 - 0
Board/hbird/Source/GCC/gcc_nuclei_soc_flash.ld → SoC/Nuclei/Common/Source/GCC/gcc_nuclei_soc_flash.ld


+ 0 - 0
Board/hbird/Source/GCC/gcc_nuclei_soc_flashxip.ld → SoC/Nuclei/Common/Source/GCC/gcc_nuclei_soc_flashxip.ld


+ 0 - 0
Board/hbird/Source/GCC/gcc_nuclei_soc_ilm.ld → SoC/Nuclei/Common/Source/GCC/gcc_nuclei_soc_ilm.ld


+ 0 - 0
Board/hbird/Source/GCC/intexc_nuclei_soc.S → SoC/Nuclei/Common/Source/GCC/intexc_nuclei_soc.S


+ 0 - 0
Board/hbird/Source/GCC/startup_nuclei_soc.S → SoC/Nuclei/Common/Source/GCC/startup_nuclei_soc.S


+ 0 - 0
Board/hbird/Source/nuclei_soc.c → SoC/Nuclei/Common/Source/nuclei_soc.c


+ 22 - 22
Board/hbird/Source/system_nuclei_soc.c → SoC/Nuclei/Common/Source/system_nuclei_soc.c

@@ -25,7 +25,7 @@
  ******************************************************************************/
 #include <stdint.h>
 #include <stdio.h>
-#include "nuclei_hal.h"
+#include "nuclei_sdk_hal.h"
 
 /*----------------------------------------------------------------------------
   Define clocks
@@ -74,16 +74,16 @@
 /* ToDo: initialize SystemCoreClock with the system core clock frequency value
          achieved after system intitialization.
          This means system core clock frequency after call to SystemInit() */
-/** 
+/**
  * \brief      Variable to hold the system core clock value
  * \details
- * Holds the system core clock, which is the system clock frequency supplied to the SysTick 
- * timer and the processor core clock. This variable can be used by debuggers to query the 
+ * Holds the system core clock, which is the system clock frequency supplied to the SysTick
+ * timer and the processor core clock. This variable can be used by debuggers to query the
  * frequency of the debug timer or to configure the trace clock speed.
- *                  
+ *
  * \attention
- * Compilers must be configured to avoid removing this variable in case the application 
- * program is not using it. Debugging systems require the variable to be physically 
+ * Compilers must be configured to avoid removing this variable in case the application
+ * program is not using it. Debugging systems require the variable to be physically
  * present in memory so that it can be examined to configure the debugger.
  */
 uint32_t SystemCoreClock = SYSTEM_CLOCK;  /* System Clock Frequency (Core Clock) */
@@ -92,11 +92,11 @@ uint32_t SystemCoreClock = SYSTEM_CLOCK;  /* System Clock Frequency (Core Clock)
   Clock functions
  *----------------------------------------------------------------------------*/
 
-/** 
+/**
  * \brief      Function to update the variable \ref SystemCoreClock
- * \details    
- * Updates the variable \ref SystemCoreClock and must be called whenever the core clock is changed 
- * during program execution. The function evaluates the clock register settings and calculates 
+ * \details
+ * Updates the variable \ref SystemCoreClock and must be called whenever the core clock is changed
+ * during program execution. The function evaluates the clock register settings and calculates
  * the current core clock.
  */
 void SystemCoreClockUpdate (void)            /* Get Core Clock Frequency */
@@ -109,11 +109,11 @@ void SystemCoreClockUpdate (void)            /* Get Core Clock Frequency */
     SystemCoreClock = SYSTEM_CLOCK;
 }
 
-/** 
+/**
  * \brief      Function to Initialize the system.
- * \details    
- * Initializes the microcontroller system. Typically, this function configures the 
- * oscillator (PLL) that is part of the microcontroller device. For systems 
+ * \details
+ * Initializes the microcontroller system. Typically, this function configures the
+ * oscillator (PLL) that is part of the microcontroller device. For systems
  * with a variable clock speed, it updates the variable \ref SystemCoreClock.
  * SystemInit is called from the file <b>startup<i>_device</i></b>.
  */
@@ -138,13 +138,13 @@ void SystemInit (void)
  */
 /** \brief Max exception handler number, don't include the NMI(0xFFF) one */
 #define MAX_SYSTEM_EXCEPTION_NUM        12
-/** 
+/**
  * \brief      Store the exception handlers for each exception ID
  * \note
  * - This SystemExceptionHandlers are used to store all the handlers for all
  * the exception codes Nuclei N/NX core provided.
  * - Exception code 0 - 11, totally 12 exceptions are mapped to SystemExceptionHandlers[0:11]
- * - Exception for NMI is also re-routed to exception handling(exception code 0xFFF) in startup code configuration, the handler itself is mapped to SystemExceptionHandlers[MAX_SYSTEM_EXCEPTION_NUM] 
+ * - Exception for NMI is also re-routed to exception handling(exception code 0xFFF) in startup code configuration, the handler itself is mapped to SystemExceptionHandlers[MAX_SYSTEM_EXCEPTION_NUM]
  */
 static unsigned long SystemExceptionHandlers[MAX_SYSTEM_EXCEPTION_NUM+1];
 
@@ -171,7 +171,7 @@ static void system_default_exception_handler(unsigned long mcause, unsigned long
     while(1);
 }
 
-/** 
+/**
  * \brief      Initialize all the default core exception handlers
  * \details
  * The core exception handler for each exception id will be initialized to \ref system_default_exception_handler.
@@ -185,7 +185,7 @@ static void Exception_Init(void)
     }
 }
 
-/** 
+/**
  * \brief       Register an exception handler for exception code EXCn
  * \details
  * * For EXCn < \ref MAX_SYSTEM_EXCEPTION_NUM, it will be registered into SystemExceptionHandlers[EXCn-1].
@@ -202,7 +202,7 @@ void Exception_Register_EXC(uint32_t EXCn, unsigned long exc_handler)
     }
 }
 
-/** 
+/**
  * \brief       Get current exception handler for exception code EXCn
  * \details
  * * For EXCn < \ref MAX_SYSTEM_EXCEPTION_NUM, it will return SystemExceptionHandlers[EXCn-1].
@@ -275,7 +275,7 @@ void SystemBannerPrint(void)
 void ECLIC_Init(void)
 {
     /* Global Configuration about MTH and NLBits.
-     * TODO: Please adapt it according to your system requirement. 
+     * TODO: Please adapt it according to your system requirement.
      * This function is called in _init function */
     ECLIC_SetMth(0);
     ECLIC_SetCfgNlbits(2);
@@ -314,7 +314,7 @@ int32_t ECLIC_Register_IRQ(IRQn_Type IRQn, uint8_t shv, ECLIC_TRIGGER_Type trig_
     /* set interrupt handler entry to vector table */
     ECLIC_SetVector(IRQn, (rv_csr_t)handler);
     /* enable interrupt */
-    ECLIC_EnableIRQ(IRQn); 
+    ECLIC_EnableIRQ(IRQn);
     return 0;
 }
 

+ 0 - 0
Board/hbird/openocd_hbird.cfg → SoC/Nuclei/Common/openocd_hbird.cfg


+ 0 - 0
Board/hbird/openocd_hbird_ilm.cfg → SoC/Nuclei/Common/openocd_hbird_ilm.cfg


+ 1 - 1
application/baremetal/benchmark/coremark/core_portme.h

@@ -1,7 +1,7 @@
 #ifndef CORE_PORTME_H
 #define CORE_PORTME_H
 
-#include "nuclei_hal.h"
+#include "nuclei_sdk_soc.h"
 //Bob: put some macro here such that the IDE SDK do not need to specify the macro specially
 //#define FLAGS_STR "-O3 -fno-common -funroll-loops -finline-functions  -falign-functions=4 -falign-jumps=4 -falign-loops=4 -funswitch-loops -fpeel-loops -fgcse-sm -fgcse-las"
 //#define FLAGS_STR "-O2 -fno-common -funroll-loops -finline-functions -falign-functions=4 -falign-jumps=4 -falign-loops=4"

+ 1 - 1
application/baremetal/benchmark/dhrystone/dhry_stubs.c

@@ -1,4 +1,4 @@
-#include "nuclei_hal.h"
+#include "nuclei_sdk_soc.h"
 
 /* The functions in this file are only meant to support Dhrystone on an
  * embedded RV32 system and are obviously incorrect in general. */

+ 1 - 1
application/baremetal/benchmark/whetstone/cpuidc.c

@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include "cpuidh.h"
 #include "config.h"
-#include "nuclei_hal.h"
+#include "nuclei_sdk_soc.h"
 
 volatile SPDP  theseSecs = 0.0;
 volatile SPDP  startSecs = 0.0;

+ 4 - 4
application/baremetal/benchmark/whetstone/whets.c

@@ -182,7 +182,7 @@
 
 #include "config.h"
 #include "cpuidh.h"
-#include "nuclei_hal.h"
+#include "nuclei_sdk_hal.h"
 
 /*PRECISION PRECISION PRECISION PRECISION PRECISION PRECISION PRECISION*/
 
@@ -323,7 +323,7 @@ void SOC_BUTTON_2_HANDLER(void)
 
     // Blue LED toggle
     gpio_toggle(GPIO, SOC_LED_BLUE_GPIO_MASK);
-    
+
     // Clear pending interrupt of Button 2
     gpio_clear_interrupt(GPIO, SOC_BUTTON_2_GPIO_OFS, GPIO_INT_RISE);
 
@@ -362,7 +362,7 @@ void config_eclic_irqs()
 {
     // Initialize the button as rising interrupt enabled
     gpio_enable_interrupt(GPIO, SOC_BUTTON_GPIO_MASK, GPIO_INT_RISE);
-    
+
     ECLIC_SetCfgNlbits(3);
     ECLIC_SetLevelIRQ(SOC_BUTTON_2_IRQn, 2);
     ECLIC_SetLevelIRQ(SOC_BUTTON_1_IRQn, 3);
@@ -396,7 +396,7 @@ void board_gpio_init(void)
 {
     gpio_enable_input(GPIO, SOC_BUTTON_GPIO_MASK);
     gpio_set_pue(GPIO, SOC_BUTTON_GPIO_MASK, GPIO_BIT_ALL_ONE);
-    
+
     gpio_enable_output(GPIO, SOC_LED_GPIO_MASK);
     gpio_write(GPIO, SOC_LED_GPIO_MASK, GPIO_BIT_ALL_ZERO);
 }

+ 1 - 1
application/baremetal/eclic_test/eclic_test.c

@@ -1,6 +1,6 @@
 // See LICENSE for license details.
 #include <stdio.h>
-#include <nuclei_soc.h>
+#include "nuclei_sdk_hal.h"
 #include "gpio.h"
 
 /* define the interrupt handler name same as vector incase download mode is flashxip */

+ 2 - 2
application/baremetal/helloworld/hello_world.c

@@ -2,7 +2,7 @@
 #include <stdio.h>
 #include <time.h>
 #include <stdlib.h>
-#include <nuclei_soc.h>
+#include "nuclei_sdk_soc.h"
 
 void print_misa(void)
 {
@@ -85,7 +85,7 @@ int main(void)
     srand(__get_rv_cycle()  | __get_rv_instret() | __RV_CSR_READ(CSR_MCYCLE));
     uint32_t rval = rand();
     rv_csr_t misa = __RV_CSR_READ(CSR_MISA);
-    
+
     printf("MISA: 0x%lx\r\n", misa);
     print_misa();
 

+ 1 - 1
application/baremetal/timer_test/timer_test.c

@@ -1,6 +1,6 @@
 // See LICENSE for license details.
 #include <stdio.h>
-#include <nuclei_soc.h>
+#include "nuclei_sdk_soc.h"
 /* Define the interrupt handler name same as vector table in case download mode is flashxip. */
 #define mtimer_irq_handler     eclic_mtip_handler
 #define mtimer_sw_irq_handler  eclic_msip_handler

+ 1 - 1
application/freertos/demo/Makefile

@@ -1,5 +1,5 @@
 TARGET = demo
-OS = FreeRTOS
+RTOS = FreeRTOS
 
 NUCLEI_SDK_ROOT = ../../..
 

+ 3 - 3
application/freertos/demo/main.c

@@ -80,7 +80,7 @@ here. */
 #include <stdlib.h>
 #include <unistd.h>
 
-#include "nuclei_hal.h"
+#include "nuclei_sdk_hal.h"
 
 #define mainQUEUE_RECEIVE_TASK_PRIORITY (tskIDLE_PRIORITY + 2)
 #define mainQUEUE_SEND_TASK_PRIORITY (tskIDLE_PRIORITY + 1)
@@ -162,7 +162,7 @@ void board_gpio_init(void)
     gpio_write(GPIO, SOC_LED_GPIO_MASK, GPIO_BIT_ALL_ZERO);
 
     // Initialize the button as rising interrupt enabled
-    gpio_enable_interrupt(GPIO, SOC_BUTTON_GPIO_MASK, GPIO_INT_RISE);    
+    gpio_enable_interrupt(GPIO, SOC_BUTTON_GPIO_MASK, GPIO_INT_RISE);
 }
 
 void prvSetupHardware(void)
@@ -193,7 +193,7 @@ void start_task(void *pvParameters);
 void start_task2(void *pvParameters);
 
 int main(void)
-{	
+{
     TimerHandle_t xExampleSoftwareTimer = NULL;
 
     /* Configure the system ready to run the demo.  The clock configuration

+ 1 - 1
application/ucosii/demo/Makefile

@@ -1,5 +1,5 @@
 TARGET = demo
-OS = UCOSII
+RTOS = UCOSII
 
 NUCLEI_SDK_ROOT = ../../..
 

+ 2 - 2
application/ucosii/demo/main.c

@@ -1,7 +1,7 @@
 #include <stdint.h>
 #include <ucos_ii.h>
 
-#include "nuclei_hal.h"
+#include "nuclei_sdk_hal.h"
 
 #define mainQUEUE_LENGTH (1)
 static void prvSetupHardware(void);
@@ -68,7 +68,7 @@ void board_gpio_init(void)
     gpio_write(GPIO, SOC_LED_GPIO_MASK, GPIO_BIT_ALL_ZERO);
 
     // Initialize the button as rising interrupt enabled
-    gpio_enable_interrupt(GPIO, SOC_BUTTON_GPIO_MASK, GPIO_INT_RISE);    
+    gpio_enable_interrupt(GPIO, SOC_BUTTON_GPIO_MASK, GPIO_INT_RISE);
 }
 
 void prvSetupHardware(void)

+ 1 - 1
test/core/test_atomic.c

@@ -1,6 +1,6 @@
 #include <stdlib.h>
 #include "ctest.h"
-#include "nuclei_hal.h"
+#include "nuclei_sdk_soc.h"
 
 #define INIT_VALUE  0x12345678
 #define TEST_VALUE  0xDEADBEEF

+ 1 - 1
test/core/test_compiler.c

@@ -1,6 +1,6 @@
 #include <stdlib.h>
 #include "ctest.h"
-#include "nuclei_hal.h"
+#include "nuclei_sdk_soc.h"
 
 CTEST(compiler, unaligned_read16) {
     uint32_t data = 0x12345678;

+ 1 - 1
test/core/test_csr.c

@@ -1,6 +1,6 @@
 #include <stdlib.h>
 #include "ctest.h"
-#include "nuclei_hal.h"
+#include "nuclei_sdk_soc.h"
 
 CTEST(core, riscv_xlen) {
     ASSERT_EQUAL(__RISCV_XLEN, __riscv_xlen);

+ 3 - 3
test/core/test_eclic.c

@@ -1,6 +1,6 @@
 #include <stdlib.h>
 #include "ctest.h"
-#include "nuclei_hal.h"
+#include "nuclei_sdk_soc.h"
 
 
 static volatile uint32_t irqTaken = 0;
@@ -124,7 +124,7 @@ CTEST(eclic, lvl_pri_irq)
     uint8_t lvlnew, prinew;
 
     get_max_lvl_pri(&maxpri, &maxlvl);
-    
+
     if (maxlvl == 0) {
         lvlnew = 0;
     } else {
@@ -144,7 +144,7 @@ CTEST(eclic, lvl_pri_irq)
 
     ECLIC_SetPriorityIRQ(SOC_INT19_IRQn, 255);
     ASSERT_EQUAL(ECLIC_GetPriorityIRQ(SOC_INT19_IRQn), maxpri);
-    
+
     ECLIC_SetLevelIRQ(SOC_INT19_IRQn, 255);
     ASSERT_EQUAL(ECLIC_GetLevelIRQ(SOC_INT19_IRQn), maxlvl);
 

+ 2 - 2
test/core/test_fpu.c

@@ -1,7 +1,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include "ctest.h"
-#include "nuclei_hal.h"
+#include "nuclei_sdk_soc.h"
 
 #if defined(__FPU_PRESENT) && __FPU_PRESENT > 0
 
@@ -49,7 +49,7 @@ CTEST(fpu, flwfsw) {
     __RV_FSW(FREG(0), &regf0, 0);
     CTEST_LOG("Current f0, data0 is 0x%x, 0x%x", regf0, data[0]);
     ASSERT_EQUAL(regf0, data[0]);
-    
+
     __RV_FLW(FREG(0), memory, 0);
     __RV_FSW(FREG(0), &temp, 0);
     ASSERT_EQUAL(memory[0], temp);

+ 1 - 1
test/core/test_pmp.c

@@ -1,7 +1,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include "ctest.h"
-#include "nuclei_hal.h"
+#include "nuclei_sdk_soc.h"
 
 #define PMPADDR(x)      _AC(CSR_PMPADDR, x)
 #define PMPCFG(x)       _AC(CSR_PMPCFG, x)

+ 1 - 1
test/core/test_timer.c

@@ -1,6 +1,6 @@
 #include <stdlib.h>
 #include "ctest.h"
-#include "nuclei_hal.h"
+#include "nuclei_sdk_soc.h"
 
 
 void test_mtip_handler(void)