From ceddc1af24483689ce2364b1920a348ba478e3b1 Mon Sep 17 00:00:00 2001 From: liangkangnan Date: Sun, 8 Nov 2020 22:09:38 +0800 Subject: [PATCH] test:example: move C examples to sdk directory Signed-off-by: liangkangnan --- {tests/example => sdk}/.gitignore | 0 sdk/README.md | 4 ++++ .../blinky_demo => sdk/bsp}/.gitignore | 0 sdk/bsp/README.md | 3 +++ {tests/example => sdk/bsp}/common.mk | 19 ++++++++++--------- {tests/example => sdk/bsp}/include/gpio.h | 0 {tests/example => sdk/bsp}/include/timer.h | 0 sdk/bsp/include/trap_code.h | 19 +++++++++++++++++++ {tests/example => sdk/bsp}/include/uart.h | 0 {tests/example => sdk/bsp}/include/utils.h | 0 {tests/example => sdk/bsp}/include/xprintf.h | 0 {tests/example => sdk/bsp}/init.c | 0 .../Source => sdk/bsp/lib}/.gitignore | 0 {tests/example => sdk/bsp}/lib/uart.c | 0 {tests/example => sdk/bsp}/lib/utils.c | 0 {tests/example => sdk/bsp}/lib/xprintf.c | 0 {tests/example => sdk/bsp}/link.lds | 0 {tests/example => sdk/bsp}/start.S | 0 {tests/example => sdk/bsp}/trap_entry.S | 12 +++++++++--- sdk/bsp/trap_handler.c | 18 ++++++++++++++++++ .../FreeRTOS/Demo/tinyriscv_GCC/.gitignore | 0 .../Demo/tinyriscv_GCC/FreeRTOSConfig.h | 0 .../FreeRTOS/Demo/tinyriscv_GCC/Makefile | 6 +++--- .../tinyriscv_GCC/blinky_demo}/.gitignore | 0 .../tinyriscv_GCC/blinky_demo/main_blinky.c | 0 .../FreeRTOS/Demo/tinyriscv_GCC/main.c | 0 .../examples/FreeRTOS/Source}/.gitignore | 0 .../examples}/FreeRTOS/Source/croutine.c | 0 .../examples}/FreeRTOS/Source/event_groups.c | 0 .../FreeRTOS/Source/include/FreeRTOS.h | 0 .../FreeRTOS/Source/include/StackMacros.h | 0 .../FreeRTOS/Source/include/atomic.h | 0 .../FreeRTOS/Source/include/croutine.h | 0 .../Source/include/deprecated_definitions.h | 0 .../FreeRTOS/Source/include/event_groups.h | 0 .../examples}/FreeRTOS/Source/include/list.h | 0 .../FreeRTOS/Source/include/message_buffer.h | 0 .../FreeRTOS/Source/include/mpu_prototypes.h | 0 .../FreeRTOS/Source/include/mpu_wrappers.h | 0 .../FreeRTOS/Source/include/portable.h | 0 .../FreeRTOS/Source/include/projdefs.h | 0 .../examples}/FreeRTOS/Source/include/queue.h | 0 .../FreeRTOS/Source/include/semphr.h | 0 .../FreeRTOS/Source/include/stack_macros.h | 0 .../FreeRTOS/Source/include/stdint.readme | 0 .../FreeRTOS/Source/include/stream_buffer.h | 0 .../examples}/FreeRTOS/Source/include/task.h | 0 .../FreeRTOS/Source/include/timers.h | 0 .../examples}/FreeRTOS/Source/list.c | 0 .../Source/portable/MemMang}/.gitignore | 0 .../FreeRTOS/Source/portable/MemMang/heap_1.c | 0 .../FreeRTOS/Source/portable/MemMang/heap_2.c | 0 .../FreeRTOS/Source/portable/MemMang/heap_3.c | 0 .../FreeRTOS/Source/portable/MemMang/heap_4.c | 0 .../FreeRTOS/Source/portable/MemMang/heap_5.c | 0 .../Source/portable/RISC-V/.gitignore | 6 ++++++ ...freertos_risc_v_chip_specific_extensions.h | 0 .../FreeRTOS/Source/portable/RISC-V/port.c | 0 .../FreeRTOS/Source/portable/RISC-V/portASM.S | 0 .../Source/portable/RISC-V/portmacro.h | 0 .../examples}/FreeRTOS/Source/queue.c | 0 .../examples}/FreeRTOS/Source/readme.txt | 0 .../examples}/FreeRTOS/Source/stream_buffer.c | 0 .../examples}/FreeRTOS/Source/tasks.c | 0 .../examples}/FreeRTOS/Source/timers.c | 0 {tests/example => sdk/examples}/README.md | 6 ------ .../examples}/coremark/.gitignore | 0 .../examples}/coremark/Makefile | 4 ++-- .../examples}/coremark/core_list_join.c | 0 .../examples}/coremark/core_main.c | 0 .../examples}/coremark/core_matrix.c | 0 .../examples}/coremark/core_portme.c | 6 +++--- .../examples}/coremark/core_portme.h | 2 +- .../examples}/coremark/core_state.c | 0 .../examples}/coremark/core_util.c | 0 .../examples}/coremark/coremark.h | 0 .../example => sdk/examples}/gpio/.gitignore | 0 {tests/example => sdk/examples}/gpio/Makefile | 4 ++-- .../example => sdk/examples}/gpio/README.md | 0 {tests/example => sdk/examples}/gpio/main.c | 4 ++-- .../examples}/simple/.gitignore | 0 .../example => sdk/examples}/simple/Makefile | 4 ++-- .../example => sdk/examples}/simple/README.md | 0 {tests/example => sdk/examples}/simple/main.c | 2 +- .../examples}/timer_int/.gitignore | 0 .../examples}/timer_int/Makefile | 4 ++-- .../examples}/timer_int/README.md | 0 .../example => sdk/examples}/timer_int/main.c | 6 +++--- .../examples}/uart_rx/.gitignore | 0 .../example => sdk/examples}/uart_rx/Makefile | 4 ++-- .../examples}/uart_rx/README.md | 0 .../example => sdk/examples}/uart_rx/main.c | 4 ++-- .../examples}/uart_tx/.gitignore | 0 .../example => sdk/examples}/uart_tx/Makefile | 4 ++-- .../examples}/uart_tx/README.md | 0 .../example => sdk/examples}/uart_tx/main.c | 4 ++-- tests/README.md | 4 +--- tests/example/trap_handler.c | 11 ----------- 98 files changed, 99 insertions(+), 61 deletions(-) rename {tests/example => sdk}/.gitignore (100%) create mode 100644 sdk/README.md rename {tests/example/FreeRTOS/Demo/tinyriscv_GCC/blinky_demo => sdk/bsp}/.gitignore (100%) create mode 100644 sdk/bsp/README.md rename {tests/example => sdk/bsp}/common.mk (61%) rename {tests/example => sdk/bsp}/include/gpio.h (100%) rename {tests/example => sdk/bsp}/include/timer.h (100%) create mode 100644 sdk/bsp/include/trap_code.h rename {tests/example => sdk/bsp}/include/uart.h (100%) rename {tests/example => sdk/bsp}/include/utils.h (100%) rename {tests/example => sdk/bsp}/include/xprintf.h (100%) rename {tests/example => sdk/bsp}/init.c (100%) rename {tests/example/FreeRTOS/Source => sdk/bsp/lib}/.gitignore (100%) rename {tests/example => sdk/bsp}/lib/uart.c (100%) rename {tests/example => sdk/bsp}/lib/utils.c (100%) rename {tests/example => sdk/bsp}/lib/xprintf.c (100%) rename {tests/example => sdk/bsp}/link.lds (100%) rename {tests/example => sdk/bsp}/start.S (100%) rename {tests/example => sdk/bsp}/trap_entry.S (94%) create mode 100644 sdk/bsp/trap_handler.c rename {tests/example => sdk/examples}/FreeRTOS/Demo/tinyriscv_GCC/.gitignore (100%) rename {tests/example => sdk/examples}/FreeRTOS/Demo/tinyriscv_GCC/FreeRTOSConfig.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Demo/tinyriscv_GCC/Makefile (85%) rename {tests/example/FreeRTOS/Source/portable/MemMang => sdk/examples/FreeRTOS/Demo/tinyriscv_GCC/blinky_demo}/.gitignore (100%) rename {tests/example => sdk/examples}/FreeRTOS/Demo/tinyriscv_GCC/blinky_demo/main_blinky.c (100%) rename {tests/example => sdk/examples}/FreeRTOS/Demo/tinyriscv_GCC/main.c (100%) rename {tests/example/FreeRTOS/Source/portable/RISC-V => sdk/examples/FreeRTOS/Source}/.gitignore (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/croutine.c (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/event_groups.c (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/include/FreeRTOS.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/include/StackMacros.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/include/atomic.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/include/croutine.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/include/deprecated_definitions.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/include/event_groups.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/include/list.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/include/message_buffer.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/include/mpu_prototypes.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/include/mpu_wrappers.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/include/portable.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/include/projdefs.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/include/queue.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/include/semphr.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/include/stack_macros.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/include/stdint.readme (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/include/stream_buffer.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/include/task.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/include/timers.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/list.c (100%) rename {tests/example/lib => sdk/examples/FreeRTOS/Source/portable/MemMang}/.gitignore (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/portable/MemMang/heap_1.c (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/portable/MemMang/heap_2.c (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/portable/MemMang/heap_3.c (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/portable/MemMang/heap_4.c (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/portable/MemMang/heap_5.c (100%) create mode 100644 sdk/examples/FreeRTOS/Source/portable/RISC-V/.gitignore rename {tests/example => sdk/examples}/FreeRTOS/Source/portable/RISC-V/freertos_risc_v_chip_specific_extensions.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/portable/RISC-V/port.c (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/portable/RISC-V/portASM.S (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/portable/RISC-V/portmacro.h (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/queue.c (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/readme.txt (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/stream_buffer.c (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/tasks.c (100%) rename {tests/example => sdk/examples}/FreeRTOS/Source/timers.c (100%) rename {tests/example => sdk/examples}/README.md (80%) rename {tests/example => sdk/examples}/coremark/.gitignore (100%) rename {tests/example => sdk/examples}/coremark/Makefile (89%) rename {tests/example => sdk/examples}/coremark/core_list_join.c (100%) rename {tests/example => sdk/examples}/coremark/core_main.c (100%) rename {tests/example => sdk/examples}/coremark/core_matrix.c (100%) rename {tests/example => sdk/examples}/coremark/core_portme.c (90%) rename {tests/example => sdk/examples}/coremark/core_portme.h (97%) rename {tests/example => sdk/examples}/coremark/core_state.c (100%) rename {tests/example => sdk/examples}/coremark/core_util.c (100%) rename {tests/example => sdk/examples}/coremark/coremark.h (100%) rename {tests/example => sdk/examples}/gpio/.gitignore (100%) rename {tests/example => sdk/examples}/gpio/Makefile (80%) rename {tests/example => sdk/examples}/gpio/README.md (100%) rename {tests/example => sdk/examples}/gpio/main.c (84%) rename {tests/example => sdk/examples}/simple/.gitignore (100%) rename {tests/example => sdk/examples}/simple/Makefile (80%) rename {tests/example => sdk/examples}/simple/README.md (100%) rename {tests/example => sdk/examples}/simple/main.c (92%) rename {tests/example => sdk/examples}/timer_int/.gitignore (100%) rename {tests/example => sdk/examples}/timer_int/Makefile (80%) rename {tests/example => sdk/examples}/timer_int/README.md (100%) rename {tests/example => sdk/examples}/timer_int/main.c (89%) rename {tests/example => sdk/examples}/uart_rx/.gitignore (100%) rename {tests/example => sdk/examples}/uart_rx/Makefile (80%) rename {tests/example => sdk/examples}/uart_rx/README.md (100%) rename {tests/example => sdk/examples}/uart_rx/main.c (63%) rename {tests/example => sdk/examples}/uart_tx/.gitignore (100%) rename {tests/example => sdk/examples}/uart_tx/Makefile (80%) rename {tests/example => sdk/examples}/uart_tx/README.md (100%) rename {tests/example => sdk/examples}/uart_tx/main.c (57%) delete mode 100644 tests/example/trap_handler.c diff --git a/tests/example/.gitignore b/sdk/.gitignore similarity index 100% rename from tests/example/.gitignore rename to sdk/.gitignore diff --git a/sdk/README.md b/sdk/README.md new file mode 100644 index 0000000..cf558f4 --- /dev/null +++ b/sdk/README.md @@ -0,0 +1,4 @@ +**bsp**:板级支持包,是所有C语言程序的基础(公共部分代码)。 + +**examples**:一些C语言程序例程。 + diff --git a/tests/example/FreeRTOS/Demo/tinyriscv_GCC/blinky_demo/.gitignore b/sdk/bsp/.gitignore similarity index 100% rename from tests/example/FreeRTOS/Demo/tinyriscv_GCC/blinky_demo/.gitignore rename to sdk/bsp/.gitignore diff --git a/sdk/bsp/README.md b/sdk/bsp/README.md new file mode 100644 index 0000000..1e06469 --- /dev/null +++ b/sdk/bsp/README.md @@ -0,0 +1,3 @@ +**include**: 公共头文件目录。 + +**lib**: 公共函数目录。 \ No newline at end of file diff --git a/tests/example/common.mk b/sdk/bsp/common.mk similarity index 61% rename from tests/example/common.mk rename to sdk/bsp/common.mk index c2aa7d1..51587dc 100644 --- a/tests/example/common.mk +++ b/sdk/bsp/common.mk @@ -1,14 +1,15 @@ -RISCV_PATH := $(TOOLCHAIN_DIR)/tools/gnu-mcu-eclipse-riscv-none-gcc-8.2.0-2.2-20190521-0004-win64/ +RISCV_TOOLS_PATH := $(TOOLCHAIN_DIR)/tools/gnu-mcu-eclipse-riscv-none-gcc-8.2.0-2.2-20190521-0004-win64/bin +RISCV_TOOLS_PREFIX := riscv-none-embed- -RISCV_GCC := $(abspath $(RISCV_PATH)/bin/riscv-none-embed-gcc) -RISCV_AS := $(abspath $(RISCV_PATH)/bin/riscv-none-embed-as) -RISCV_GXX := $(abspath $(RISCV_PATH)/bin/riscv-none-embed-g++) -RISCV_OBJDUMP := $(abspath $(RISCV_PATH)/bin/riscv-none-embed-objdump) -RISCV_GDB := $(abspath $(RISCV_PATH)/bin/riscv-none-embed-gdb) -RISCV_AR := $(abspath $(RISCV_PATH)/bin/riscv-none-embed-ar) -RISCV_OBJCOPY := $(abspath $(RISCV_PATH)/bin/riscv-none-embed-objcopy) -RISCV_READELF := $(abspath $(RISCV_PATH)/bin/riscv-none-embed-readelf) +RISCV_GCC := $(abspath $(RISCV_TOOLS_PATH)/$(RISCV_TOOLS_PREFIX)gcc) +RISCV_AS := $(abspath $(RISCV_TOOLS_PATH)/$(RISCV_TOOLS_PREFIX)as) +RISCV_GXX := $(abspath $(RISCV_TOOLS_PATH)/$(RISCV_TOOLS_PREFIX)g++) +RISCV_OBJDUMP := $(abspath $(RISCV_TOOLS_PATH)/$(RISCV_TOOLS_PREFIX)objdump) +RISCV_GDB := $(abspath $(RISCV_TOOLS_PATH)/$(RISCV_TOOLS_PREFIX)gdb) +RISCV_AR := $(abspath $(RISCV_TOOLS_PATH)/$(RISCV_TOOLS_PREFIX)ar) +RISCV_OBJCOPY := $(abspath $(RISCV_TOOLS_PATH)/$(RISCV_TOOLS_PREFIX)objcopy) +RISCV_READELF := $(abspath $(RISCV_TOOLS_PATH)/$(RISCV_TOOLS_PREFIX)readelf) .PHONY: all all: $(TARGET) diff --git a/tests/example/include/gpio.h b/sdk/bsp/include/gpio.h similarity index 100% rename from tests/example/include/gpio.h rename to sdk/bsp/include/gpio.h diff --git a/tests/example/include/timer.h b/sdk/bsp/include/timer.h similarity index 100% rename from tests/example/include/timer.h rename to sdk/bsp/include/timer.h diff --git a/sdk/bsp/include/trap_code.h b/sdk/bsp/include/trap_code.h new file mode 100644 index 0000000..05b416d --- /dev/null +++ b/sdk/bsp/include/trap_code.h @@ -0,0 +1,19 @@ +#ifndef _TRAP_CODE_H_ +#define _TRAP_CODE_H_ + +#define TRAP_USER_SW (0x80000000) +#define TRAP_MACH_SW (0x80000003) +#define TRAP_USER_TIMER (0x80000004) +#define TRAP_MACH_TIMER (0x80000007) +#define TRAP_USER_EXT (0x80000008) +#define TRAP_MACH_EXT (0x8000000B) +#define TRAP_INST_ADDR_MISA (0x00000000) +#define TRAP_ILLEGAL_INST (0x00000002) +#define TRAP_BREAKPOINT (0x00000003) +#define TRAP_LOAD_ADDR_MISA (0x00000004) +#define TRAP_STORE_ADDR_MISA (0x00000006) +#define TRAP_ECALL_U (0x00000008) +#define TRAP_ECALL_S (0x00000009) +#define TRAP_ECALL_M (0x0000000B) + +#endif diff --git a/tests/example/include/uart.h b/sdk/bsp/include/uart.h similarity index 100% rename from tests/example/include/uart.h rename to sdk/bsp/include/uart.h diff --git a/tests/example/include/utils.h b/sdk/bsp/include/utils.h similarity index 100% rename from tests/example/include/utils.h rename to sdk/bsp/include/utils.h diff --git a/tests/example/include/xprintf.h b/sdk/bsp/include/xprintf.h similarity index 100% rename from tests/example/include/xprintf.h rename to sdk/bsp/include/xprintf.h diff --git a/tests/example/init.c b/sdk/bsp/init.c similarity index 100% rename from tests/example/init.c rename to sdk/bsp/init.c diff --git a/tests/example/FreeRTOS/Source/.gitignore b/sdk/bsp/lib/.gitignore similarity index 100% rename from tests/example/FreeRTOS/Source/.gitignore rename to sdk/bsp/lib/.gitignore diff --git a/tests/example/lib/uart.c b/sdk/bsp/lib/uart.c similarity index 100% rename from tests/example/lib/uart.c rename to sdk/bsp/lib/uart.c diff --git a/tests/example/lib/utils.c b/sdk/bsp/lib/utils.c similarity index 100% rename from tests/example/lib/utils.c rename to sdk/bsp/lib/utils.c diff --git a/tests/example/lib/xprintf.c b/sdk/bsp/lib/xprintf.c similarity index 100% rename from tests/example/lib/xprintf.c rename to sdk/bsp/lib/xprintf.c diff --git a/tests/example/link.lds b/sdk/bsp/link.lds similarity index 100% rename from tests/example/link.lds rename to sdk/bsp/link.lds diff --git a/tests/example/start.S b/sdk/bsp/start.S similarity index 100% rename from tests/example/start.S rename to sdk/bsp/start.S diff --git a/tests/example/trap_entry.S b/sdk/bsp/trap_entry.S similarity index 94% rename from tests/example/trap_entry.S rename to sdk/bsp/trap_entry.S index ff980fe..f19f3a3 100644 --- a/tests/example/trap_entry.S +++ b/sdk/bsp/trap_entry.S @@ -50,10 +50,11 @@ test_if_asynchronous: srli a2, a0, 31 /* MSB of mcause is 1 if handing an asynchronous interrupt - shift to LSB to clear other bits. */ beq a2, x0, handle_synchronous /* Branch past interrupt handing if not asynchronous. */ - call trap_handler + call interrupt_handler j asynchronous_return handle_synchronous: + call exception_handler addi a1, a1, 4 csrw mepc, a1 @@ -97,7 +98,12 @@ asynchronous_return: mret -.weak trap_handler -trap_handler: +.weak interrupt_handler +interrupt_handler: 1: j 1b + +.weak exception_handler +exception_handler: +2: + j 2b diff --git a/sdk/bsp/trap_handler.c b/sdk/bsp/trap_handler.c new file mode 100644 index 0000000..d74a119 --- /dev/null +++ b/sdk/bsp/trap_handler.c @@ -0,0 +1,18 @@ +#include + +#include "./include/trap_code.h" + +extern void timer0_irq_handler() __attribute__((weak)); + + +void interrupt_handler(uint32_t mcause, uint32_t mepc) +{ + // we have only timer0 interrupt here + timer0_irq_handler(); +} + +void exception_handler(uint32_t mcause, uint32_t mepc) +{ + if ((mcause != TRAP_BREAKPOINT) && (mcause != TRAP_ECALL_M)) + while (1); +} diff --git a/tests/example/FreeRTOS/Demo/tinyriscv_GCC/.gitignore b/sdk/examples/FreeRTOS/Demo/tinyriscv_GCC/.gitignore similarity index 100% rename from tests/example/FreeRTOS/Demo/tinyriscv_GCC/.gitignore rename to sdk/examples/FreeRTOS/Demo/tinyriscv_GCC/.gitignore diff --git a/tests/example/FreeRTOS/Demo/tinyriscv_GCC/FreeRTOSConfig.h b/sdk/examples/FreeRTOS/Demo/tinyriscv_GCC/FreeRTOSConfig.h similarity index 100% rename from tests/example/FreeRTOS/Demo/tinyriscv_GCC/FreeRTOSConfig.h rename to sdk/examples/FreeRTOS/Demo/tinyriscv_GCC/FreeRTOSConfig.h diff --git a/tests/example/FreeRTOS/Demo/tinyriscv_GCC/Makefile b/sdk/examples/FreeRTOS/Demo/tinyriscv_GCC/Makefile similarity index 85% rename from tests/example/FreeRTOS/Demo/tinyriscv_GCC/Makefile rename to sdk/examples/FreeRTOS/Demo/tinyriscv_GCC/Makefile index 63a7527..354fc2f 100644 --- a/tests/example/FreeRTOS/Demo/tinyriscv_GCC/Makefile +++ b/sdk/examples/FreeRTOS/Demo/tinyriscv_GCC/Makefile @@ -11,7 +11,7 @@ TARGET = freertos CFLAGS += -Os ASM_SRCS := ../../Source/portable/RISC-V/portASM.S #LDFLAGS += -INCLUDES += -I. -I../../Source/portable/RISC-V -I../../Source/include -I../../../ +INCLUDES += -I. -I../../Source/portable/RISC-V -I../../Source/include -I../../../../bsp C_SRCS := \ main.c \ @@ -23,6 +23,6 @@ C_SRCS := \ ../../Source/portable/RISC-V/port.c \ -COMMON_DIR = ../../.. +COMMON_DIR = ../../../../bsp TOOLCHAIN_DIR = ../../../../.. -include ../../../common.mk +include ../../../../bsp/common.mk diff --git a/tests/example/FreeRTOS/Source/portable/MemMang/.gitignore b/sdk/examples/FreeRTOS/Demo/tinyriscv_GCC/blinky_demo/.gitignore similarity index 100% rename from tests/example/FreeRTOS/Source/portable/MemMang/.gitignore rename to sdk/examples/FreeRTOS/Demo/tinyriscv_GCC/blinky_demo/.gitignore diff --git a/tests/example/FreeRTOS/Demo/tinyriscv_GCC/blinky_demo/main_blinky.c b/sdk/examples/FreeRTOS/Demo/tinyriscv_GCC/blinky_demo/main_blinky.c similarity index 100% rename from tests/example/FreeRTOS/Demo/tinyriscv_GCC/blinky_demo/main_blinky.c rename to sdk/examples/FreeRTOS/Demo/tinyriscv_GCC/blinky_demo/main_blinky.c diff --git a/tests/example/FreeRTOS/Demo/tinyriscv_GCC/main.c b/sdk/examples/FreeRTOS/Demo/tinyriscv_GCC/main.c similarity index 100% rename from tests/example/FreeRTOS/Demo/tinyriscv_GCC/main.c rename to sdk/examples/FreeRTOS/Demo/tinyriscv_GCC/main.c diff --git a/tests/example/FreeRTOS/Source/portable/RISC-V/.gitignore b/sdk/examples/FreeRTOS/Source/.gitignore similarity index 100% rename from tests/example/FreeRTOS/Source/portable/RISC-V/.gitignore rename to sdk/examples/FreeRTOS/Source/.gitignore diff --git a/tests/example/FreeRTOS/Source/croutine.c b/sdk/examples/FreeRTOS/Source/croutine.c similarity index 100% rename from tests/example/FreeRTOS/Source/croutine.c rename to sdk/examples/FreeRTOS/Source/croutine.c diff --git a/tests/example/FreeRTOS/Source/event_groups.c b/sdk/examples/FreeRTOS/Source/event_groups.c similarity index 100% rename from tests/example/FreeRTOS/Source/event_groups.c rename to sdk/examples/FreeRTOS/Source/event_groups.c diff --git a/tests/example/FreeRTOS/Source/include/FreeRTOS.h b/sdk/examples/FreeRTOS/Source/include/FreeRTOS.h similarity index 100% rename from tests/example/FreeRTOS/Source/include/FreeRTOS.h rename to sdk/examples/FreeRTOS/Source/include/FreeRTOS.h diff --git a/tests/example/FreeRTOS/Source/include/StackMacros.h b/sdk/examples/FreeRTOS/Source/include/StackMacros.h similarity index 100% rename from tests/example/FreeRTOS/Source/include/StackMacros.h rename to sdk/examples/FreeRTOS/Source/include/StackMacros.h diff --git a/tests/example/FreeRTOS/Source/include/atomic.h b/sdk/examples/FreeRTOS/Source/include/atomic.h similarity index 100% rename from tests/example/FreeRTOS/Source/include/atomic.h rename to sdk/examples/FreeRTOS/Source/include/atomic.h diff --git a/tests/example/FreeRTOS/Source/include/croutine.h b/sdk/examples/FreeRTOS/Source/include/croutine.h similarity index 100% rename from tests/example/FreeRTOS/Source/include/croutine.h rename to sdk/examples/FreeRTOS/Source/include/croutine.h diff --git a/tests/example/FreeRTOS/Source/include/deprecated_definitions.h b/sdk/examples/FreeRTOS/Source/include/deprecated_definitions.h similarity index 100% rename from tests/example/FreeRTOS/Source/include/deprecated_definitions.h rename to sdk/examples/FreeRTOS/Source/include/deprecated_definitions.h diff --git a/tests/example/FreeRTOS/Source/include/event_groups.h b/sdk/examples/FreeRTOS/Source/include/event_groups.h similarity index 100% rename from tests/example/FreeRTOS/Source/include/event_groups.h rename to sdk/examples/FreeRTOS/Source/include/event_groups.h diff --git a/tests/example/FreeRTOS/Source/include/list.h b/sdk/examples/FreeRTOS/Source/include/list.h similarity index 100% rename from tests/example/FreeRTOS/Source/include/list.h rename to sdk/examples/FreeRTOS/Source/include/list.h diff --git a/tests/example/FreeRTOS/Source/include/message_buffer.h b/sdk/examples/FreeRTOS/Source/include/message_buffer.h similarity index 100% rename from tests/example/FreeRTOS/Source/include/message_buffer.h rename to sdk/examples/FreeRTOS/Source/include/message_buffer.h diff --git a/tests/example/FreeRTOS/Source/include/mpu_prototypes.h b/sdk/examples/FreeRTOS/Source/include/mpu_prototypes.h similarity index 100% rename from tests/example/FreeRTOS/Source/include/mpu_prototypes.h rename to sdk/examples/FreeRTOS/Source/include/mpu_prototypes.h diff --git a/tests/example/FreeRTOS/Source/include/mpu_wrappers.h b/sdk/examples/FreeRTOS/Source/include/mpu_wrappers.h similarity index 100% rename from tests/example/FreeRTOS/Source/include/mpu_wrappers.h rename to sdk/examples/FreeRTOS/Source/include/mpu_wrappers.h diff --git a/tests/example/FreeRTOS/Source/include/portable.h b/sdk/examples/FreeRTOS/Source/include/portable.h similarity index 100% rename from tests/example/FreeRTOS/Source/include/portable.h rename to sdk/examples/FreeRTOS/Source/include/portable.h diff --git a/tests/example/FreeRTOS/Source/include/projdefs.h b/sdk/examples/FreeRTOS/Source/include/projdefs.h similarity index 100% rename from tests/example/FreeRTOS/Source/include/projdefs.h rename to sdk/examples/FreeRTOS/Source/include/projdefs.h diff --git a/tests/example/FreeRTOS/Source/include/queue.h b/sdk/examples/FreeRTOS/Source/include/queue.h similarity index 100% rename from tests/example/FreeRTOS/Source/include/queue.h rename to sdk/examples/FreeRTOS/Source/include/queue.h diff --git a/tests/example/FreeRTOS/Source/include/semphr.h b/sdk/examples/FreeRTOS/Source/include/semphr.h similarity index 100% rename from tests/example/FreeRTOS/Source/include/semphr.h rename to sdk/examples/FreeRTOS/Source/include/semphr.h diff --git a/tests/example/FreeRTOS/Source/include/stack_macros.h b/sdk/examples/FreeRTOS/Source/include/stack_macros.h similarity index 100% rename from tests/example/FreeRTOS/Source/include/stack_macros.h rename to sdk/examples/FreeRTOS/Source/include/stack_macros.h diff --git a/tests/example/FreeRTOS/Source/include/stdint.readme b/sdk/examples/FreeRTOS/Source/include/stdint.readme similarity index 100% rename from tests/example/FreeRTOS/Source/include/stdint.readme rename to sdk/examples/FreeRTOS/Source/include/stdint.readme diff --git a/tests/example/FreeRTOS/Source/include/stream_buffer.h b/sdk/examples/FreeRTOS/Source/include/stream_buffer.h similarity index 100% rename from tests/example/FreeRTOS/Source/include/stream_buffer.h rename to sdk/examples/FreeRTOS/Source/include/stream_buffer.h diff --git a/tests/example/FreeRTOS/Source/include/task.h b/sdk/examples/FreeRTOS/Source/include/task.h similarity index 100% rename from tests/example/FreeRTOS/Source/include/task.h rename to sdk/examples/FreeRTOS/Source/include/task.h diff --git a/tests/example/FreeRTOS/Source/include/timers.h b/sdk/examples/FreeRTOS/Source/include/timers.h similarity index 100% rename from tests/example/FreeRTOS/Source/include/timers.h rename to sdk/examples/FreeRTOS/Source/include/timers.h diff --git a/tests/example/FreeRTOS/Source/list.c b/sdk/examples/FreeRTOS/Source/list.c similarity index 100% rename from tests/example/FreeRTOS/Source/list.c rename to sdk/examples/FreeRTOS/Source/list.c diff --git a/tests/example/lib/.gitignore b/sdk/examples/FreeRTOS/Source/portable/MemMang/.gitignore similarity index 100% rename from tests/example/lib/.gitignore rename to sdk/examples/FreeRTOS/Source/portable/MemMang/.gitignore diff --git a/tests/example/FreeRTOS/Source/portable/MemMang/heap_1.c b/sdk/examples/FreeRTOS/Source/portable/MemMang/heap_1.c similarity index 100% rename from tests/example/FreeRTOS/Source/portable/MemMang/heap_1.c rename to sdk/examples/FreeRTOS/Source/portable/MemMang/heap_1.c diff --git a/tests/example/FreeRTOS/Source/portable/MemMang/heap_2.c b/sdk/examples/FreeRTOS/Source/portable/MemMang/heap_2.c similarity index 100% rename from tests/example/FreeRTOS/Source/portable/MemMang/heap_2.c rename to sdk/examples/FreeRTOS/Source/portable/MemMang/heap_2.c diff --git a/tests/example/FreeRTOS/Source/portable/MemMang/heap_3.c b/sdk/examples/FreeRTOS/Source/portable/MemMang/heap_3.c similarity index 100% rename from tests/example/FreeRTOS/Source/portable/MemMang/heap_3.c rename to sdk/examples/FreeRTOS/Source/portable/MemMang/heap_3.c diff --git a/tests/example/FreeRTOS/Source/portable/MemMang/heap_4.c b/sdk/examples/FreeRTOS/Source/portable/MemMang/heap_4.c similarity index 100% rename from tests/example/FreeRTOS/Source/portable/MemMang/heap_4.c rename to sdk/examples/FreeRTOS/Source/portable/MemMang/heap_4.c diff --git a/tests/example/FreeRTOS/Source/portable/MemMang/heap_5.c b/sdk/examples/FreeRTOS/Source/portable/MemMang/heap_5.c similarity index 100% rename from tests/example/FreeRTOS/Source/portable/MemMang/heap_5.c rename to sdk/examples/FreeRTOS/Source/portable/MemMang/heap_5.c diff --git a/sdk/examples/FreeRTOS/Source/portable/RISC-V/.gitignore b/sdk/examples/FreeRTOS/Source/portable/RISC-V/.gitignore new file mode 100644 index 0000000..4c37608 --- /dev/null +++ b/sdk/examples/FreeRTOS/Source/portable/RISC-V/.gitignore @@ -0,0 +1,6 @@ +# Object files +*.o +*.ko +*.obj +*.bin +*.dump diff --git a/tests/example/FreeRTOS/Source/portable/RISC-V/freertos_risc_v_chip_specific_extensions.h b/sdk/examples/FreeRTOS/Source/portable/RISC-V/freertos_risc_v_chip_specific_extensions.h similarity index 100% rename from tests/example/FreeRTOS/Source/portable/RISC-V/freertos_risc_v_chip_specific_extensions.h rename to sdk/examples/FreeRTOS/Source/portable/RISC-V/freertos_risc_v_chip_specific_extensions.h diff --git a/tests/example/FreeRTOS/Source/portable/RISC-V/port.c b/sdk/examples/FreeRTOS/Source/portable/RISC-V/port.c similarity index 100% rename from tests/example/FreeRTOS/Source/portable/RISC-V/port.c rename to sdk/examples/FreeRTOS/Source/portable/RISC-V/port.c diff --git a/tests/example/FreeRTOS/Source/portable/RISC-V/portASM.S b/sdk/examples/FreeRTOS/Source/portable/RISC-V/portASM.S similarity index 100% rename from tests/example/FreeRTOS/Source/portable/RISC-V/portASM.S rename to sdk/examples/FreeRTOS/Source/portable/RISC-V/portASM.S diff --git a/tests/example/FreeRTOS/Source/portable/RISC-V/portmacro.h b/sdk/examples/FreeRTOS/Source/portable/RISC-V/portmacro.h similarity index 100% rename from tests/example/FreeRTOS/Source/portable/RISC-V/portmacro.h rename to sdk/examples/FreeRTOS/Source/portable/RISC-V/portmacro.h diff --git a/tests/example/FreeRTOS/Source/queue.c b/sdk/examples/FreeRTOS/Source/queue.c similarity index 100% rename from tests/example/FreeRTOS/Source/queue.c rename to sdk/examples/FreeRTOS/Source/queue.c diff --git a/tests/example/FreeRTOS/Source/readme.txt b/sdk/examples/FreeRTOS/Source/readme.txt similarity index 100% rename from tests/example/FreeRTOS/Source/readme.txt rename to sdk/examples/FreeRTOS/Source/readme.txt diff --git a/tests/example/FreeRTOS/Source/stream_buffer.c b/sdk/examples/FreeRTOS/Source/stream_buffer.c similarity index 100% rename from tests/example/FreeRTOS/Source/stream_buffer.c rename to sdk/examples/FreeRTOS/Source/stream_buffer.c diff --git a/tests/example/FreeRTOS/Source/tasks.c b/sdk/examples/FreeRTOS/Source/tasks.c similarity index 100% rename from tests/example/FreeRTOS/Source/tasks.c rename to sdk/examples/FreeRTOS/Source/tasks.c diff --git a/tests/example/FreeRTOS/Source/timers.c b/sdk/examples/FreeRTOS/Source/timers.c similarity index 100% rename from tests/example/FreeRTOS/Source/timers.c rename to sdk/examples/FreeRTOS/Source/timers.c diff --git a/tests/example/README.md b/sdk/examples/README.md similarity index 80% rename from tests/example/README.md rename to sdk/examples/README.md index c885caa..478b0bf 100644 --- a/tests/example/README.md +++ b/sdk/examples/README.md @@ -4,10 +4,6 @@ **gpio**: 两个GPIO,一个作为输入、一个作为输出,输出的电平等于输入的电平。 -**include**: 公共头文件目录。 - -**lib**: 公共函数目录。 - **simple**: 简单的加、减、乘、除运算测试例程。 **timer_int**: 定时器中断测试例程,每500ms翻转一下IO口的电平。在FPGA上运行时需要将其Makefile里的CFLAGS += -DSIMULATION这一行注释掉。 @@ -19,5 +15,3 @@ **coremark:**已经移植好的coremark跑分测试例程。 **FreeRTOS:**FreeRTOS嵌入式操作系统测试例程,效果:每1s翻转一下IO口的电平。 - -本目录下所有的.c和.S文件是所有例程的公共文件,每一个例程都需要用到它们。 \ No newline at end of file diff --git a/tests/example/coremark/.gitignore b/sdk/examples/coremark/.gitignore similarity index 100% rename from tests/example/coremark/.gitignore rename to sdk/examples/coremark/.gitignore diff --git a/tests/example/coremark/Makefile b/sdk/examples/coremark/Makefile similarity index 89% rename from tests/example/coremark/Makefile rename to sdk/examples/coremark/Makefile index 921b3f3..2c42c50 100644 --- a/tests/example/coremark/Makefile +++ b/sdk/examples/coremark/Makefile @@ -16,6 +16,6 @@ CFLAGS := -O2 -fno-common -funroll-loops -finline-functions --param max-inline-i CFLAGS += -DFLAGS_STR=\""$(CFLAGS)"\" CFLAGS += -DITERATIONS=10000 -DPERFORMANCE_RUN=1 -COMMON_DIR = .. +COMMON_DIR = ../../bsp TOOLCHAIN_DIR = ../../.. -include ../common.mk +include ../../bsp/common.mk diff --git a/tests/example/coremark/core_list_join.c b/sdk/examples/coremark/core_list_join.c similarity index 100% rename from tests/example/coremark/core_list_join.c rename to sdk/examples/coremark/core_list_join.c diff --git a/tests/example/coremark/core_main.c b/sdk/examples/coremark/core_main.c similarity index 100% rename from tests/example/coremark/core_main.c rename to sdk/examples/coremark/core_main.c diff --git a/tests/example/coremark/core_matrix.c b/sdk/examples/coremark/core_matrix.c similarity index 100% rename from tests/example/coremark/core_matrix.c rename to sdk/examples/coremark/core_matrix.c diff --git a/tests/example/coremark/core_portme.c b/sdk/examples/coremark/core_portme.c similarity index 90% rename from tests/example/coremark/core_portme.c rename to sdk/examples/coremark/core_portme.c index 38bf15e..b64285f 100644 --- a/tests/example/coremark/core_portme.c +++ b/sdk/examples/coremark/core_portme.c @@ -1,9 +1,9 @@ #include #include #include "coremark.h" -#include "../include/utils.h" -#include "../include/uart.h" -#include "../include/xprintf.h" +#include "../../bsp/include/utils.h" +#include "../../bsp/include/uart.h" +#include "../../bsp/include/xprintf.h" #if VALIDATION_RUN volatile ee_s32 seed1_volatile=0x3415; diff --git a/tests/example/coremark/core_portme.h b/sdk/examples/coremark/core_portme.h similarity index 97% rename from tests/example/coremark/core_portme.h rename to sdk/examples/coremark/core_portme.h index aa2adc3..47145ee 100644 --- a/tests/example/coremark/core_portme.h +++ b/sdk/examples/coremark/core_portme.h @@ -9,7 +9,7 @@ #include #include -#include "../include/xprintf.h" +#include "../../bsp/include/xprintf.h" #define HAS_FLOAT 0 #define HAS_TIME_H 1 diff --git a/tests/example/coremark/core_state.c b/sdk/examples/coremark/core_state.c similarity index 100% rename from tests/example/coremark/core_state.c rename to sdk/examples/coremark/core_state.c diff --git a/tests/example/coremark/core_util.c b/sdk/examples/coremark/core_util.c similarity index 100% rename from tests/example/coremark/core_util.c rename to sdk/examples/coremark/core_util.c diff --git a/tests/example/coremark/coremark.h b/sdk/examples/coremark/coremark.h similarity index 100% rename from tests/example/coremark/coremark.h rename to sdk/examples/coremark/coremark.h diff --git a/tests/example/gpio/.gitignore b/sdk/examples/gpio/.gitignore similarity index 100% rename from tests/example/gpio/.gitignore rename to sdk/examples/gpio/.gitignore diff --git a/tests/example/gpio/Makefile b/sdk/examples/gpio/Makefile similarity index 80% rename from tests/example/gpio/Makefile rename to sdk/examples/gpio/Makefile index fb2b7e7..c187e30 100644 --- a/tests/example/gpio/Makefile +++ b/sdk/examples/gpio/Makefile @@ -16,6 +16,6 @@ C_SRCS := \ main.c \ -COMMON_DIR = .. +COMMON_DIR = ../../bsp TOOLCHAIN_DIR = ../../.. -include ../common.mk +include ../../bsp/common.mk diff --git a/tests/example/gpio/README.md b/sdk/examples/gpio/README.md similarity index 100% rename from tests/example/gpio/README.md rename to sdk/examples/gpio/README.md diff --git a/tests/example/gpio/main.c b/sdk/examples/gpio/main.c similarity index 84% rename from tests/example/gpio/main.c rename to sdk/examples/gpio/main.c index 2d4226b..ed61e2d 100644 --- a/tests/example/gpio/main.c +++ b/sdk/examples/gpio/main.c @@ -1,7 +1,7 @@ #include -#include "../include/gpio.h" -#include "../include/utils.h" +#include "../../bsp/include/gpio.h" +#include "../../bsp/include/utils.h" int main() diff --git a/tests/example/simple/.gitignore b/sdk/examples/simple/.gitignore similarity index 100% rename from tests/example/simple/.gitignore rename to sdk/examples/simple/.gitignore diff --git a/tests/example/simple/Makefile b/sdk/examples/simple/Makefile similarity index 80% rename from tests/example/simple/Makefile rename to sdk/examples/simple/Makefile index 5490ad4..059d25a 100644 --- a/tests/example/simple/Makefile +++ b/sdk/examples/simple/Makefile @@ -16,6 +16,6 @@ C_SRCS := \ main.c \ -COMMON_DIR = .. +COMMON_DIR = ../../bsp TOOLCHAIN_DIR = ../../.. -include ../common.mk +include ../../bsp/common.mk diff --git a/tests/example/simple/README.md b/sdk/examples/simple/README.md similarity index 100% rename from tests/example/simple/README.md rename to sdk/examples/simple/README.md diff --git a/tests/example/simple/main.c b/sdk/examples/simple/main.c similarity index 92% rename from tests/example/simple/main.c rename to sdk/examples/simple/main.c index cb4a88c..64aea3b 100644 --- a/tests/example/simple/main.c +++ b/sdk/examples/simple/main.c @@ -1,5 +1,5 @@ #include -#include "../include/utils.h" +#include "../../bsp/include/utils.h" int mul = 3; diff --git a/tests/example/timer_int/.gitignore b/sdk/examples/timer_int/.gitignore similarity index 100% rename from tests/example/timer_int/.gitignore rename to sdk/examples/timer_int/.gitignore diff --git a/tests/example/timer_int/Makefile b/sdk/examples/timer_int/Makefile similarity index 80% rename from tests/example/timer_int/Makefile rename to sdk/examples/timer_int/Makefile index 6040005..1860901 100644 --- a/tests/example/timer_int/Makefile +++ b/sdk/examples/timer_int/Makefile @@ -16,6 +16,6 @@ C_SRCS := \ main.c \ -COMMON_DIR = .. +COMMON_DIR = ../../bsp TOOLCHAIN_DIR = ../../.. -include ../common.mk +include ../../bsp/common.mk diff --git a/tests/example/timer_int/README.md b/sdk/examples/timer_int/README.md similarity index 100% rename from tests/example/timer_int/README.md rename to sdk/examples/timer_int/README.md diff --git a/tests/example/timer_int/main.c b/sdk/examples/timer_int/main.c similarity index 89% rename from tests/example/timer_int/main.c rename to sdk/examples/timer_int/main.c index cb25ada..ada0ea5 100644 --- a/tests/example/timer_int/main.c +++ b/sdk/examples/timer_int/main.c @@ -1,8 +1,8 @@ #include -#include "../include/timer.h" -#include "../include/gpio.h" -#include "../include/utils.h" +#include "../../bsp/include/timer.h" +#include "../../bsp/include/gpio.h" +#include "../../bsp/include/utils.h" static volatile uint32_t count; diff --git a/tests/example/uart_rx/.gitignore b/sdk/examples/uart_rx/.gitignore similarity index 100% rename from tests/example/uart_rx/.gitignore rename to sdk/examples/uart_rx/.gitignore diff --git a/tests/example/uart_rx/Makefile b/sdk/examples/uart_rx/Makefile similarity index 80% rename from tests/example/uart_rx/Makefile rename to sdk/examples/uart_rx/Makefile index 00bb2b1..aa23595 100644 --- a/tests/example/uart_rx/Makefile +++ b/sdk/examples/uart_rx/Makefile @@ -16,6 +16,6 @@ C_SRCS := \ main.c \ -COMMON_DIR = .. +COMMON_DIR = ../../bsp TOOLCHAIN_DIR = ../../.. -include ../common.mk +include ../../bsp/common.mk diff --git a/tests/example/uart_rx/README.md b/sdk/examples/uart_rx/README.md similarity index 100% rename from tests/example/uart_rx/README.md rename to sdk/examples/uart_rx/README.md diff --git a/tests/example/uart_rx/main.c b/sdk/examples/uart_rx/main.c similarity index 63% rename from tests/example/uart_rx/main.c rename to sdk/examples/uart_rx/main.c index 703661e..64c2f0b 100644 --- a/tests/example/uart_rx/main.c +++ b/sdk/examples/uart_rx/main.c @@ -1,7 +1,7 @@ #include -#include "../include/uart.h" -#include "../include/xprintf.h" +#include "../../bsp/include/uart.h" +#include "../../bsp/include/xprintf.h" diff --git a/tests/example/uart_tx/.gitignore b/sdk/examples/uart_tx/.gitignore similarity index 100% rename from tests/example/uart_tx/.gitignore rename to sdk/examples/uart_tx/.gitignore diff --git a/tests/example/uart_tx/Makefile b/sdk/examples/uart_tx/Makefile similarity index 80% rename from tests/example/uart_tx/Makefile rename to sdk/examples/uart_tx/Makefile index e953c29..8cc6358 100644 --- a/tests/example/uart_tx/Makefile +++ b/sdk/examples/uart_tx/Makefile @@ -16,6 +16,6 @@ C_SRCS := \ main.c \ -COMMON_DIR = .. +COMMON_DIR = ../../bsp TOOLCHAIN_DIR = ../../.. -include ../common.mk +include ../../bsp/common.mk diff --git a/tests/example/uart_tx/README.md b/sdk/examples/uart_tx/README.md similarity index 100% rename from tests/example/uart_tx/README.md rename to sdk/examples/uart_tx/README.md diff --git a/tests/example/uart_tx/main.c b/sdk/examples/uart_tx/main.c similarity index 57% rename from tests/example/uart_tx/main.c rename to sdk/examples/uart_tx/main.c index 280a7a2..1010fbd 100644 --- a/tests/example/uart_tx/main.c +++ b/sdk/examples/uart_tx/main.c @@ -1,7 +1,7 @@ #include -#include "../include/uart.h" -#include "../include/xprintf.h" +#include "../../bsp/include/uart.h" +#include "../../bsp/include/xprintf.h" diff --git a/tests/README.md b/tests/README.md index 408058a..1131b00 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,7 +1,5 @@ # 目录说明 -example:包含C语言程序例程。 - -isa:旧的指令兼容性测试源码。RISC-V官方已经不更新了。 +isa:旧的指令兼容性测试源码,RISC-V官方已经不更新了。 riscv-compliance:新的指令兼容性测试源码,RISC-V官方一直在更新。 \ No newline at end of file diff --git a/tests/example/trap_handler.c b/tests/example/trap_handler.c deleted file mode 100644 index 689b500..0000000 --- a/tests/example/trap_handler.c +++ /dev/null @@ -1,11 +0,0 @@ -#include - - -extern void timer0_irq_handler() __attribute__((weak)); - - -void trap_handler(uint32_t mcause, uint32_t mepc) -{ - // we have only timer0 interrupt here - timer0_irq_handler(); -}