From 17518fc5902847cfffcf4a1391b26793c340107a Mon Sep 17 00:00:00 2001 From: stnolting Date: Sun, 20 Oct 2024 20:28:31 +0200 Subject: [PATCH 1/8] [linker script] constrain IMEM/rom size to actual physical size --- sw/common/neorv32.ld | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/sw/common/neorv32.ld b/sw/common/neorv32.ld index 41b7a6dac..b827a2a25 100644 --- a/sw/common/neorv32.ld +++ b/sw/common/neorv32.ld @@ -1,5 +1,5 @@ /* ================================================================================ */ -/* NEORV32 CPU - RISC-V GCC Linker Script */ +/* NEORV32 - RISC-V GCC Linker Script */ /* -------------------------------------------------------------------------------- */ /* The NEORV32 RISC-V Processor - https://github.com/stnolting/neorv32 */ /* Copyright (c) NEORV32 contributors. */ @@ -13,7 +13,6 @@ * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ - OUTPUT_FORMAT("elf32-littleriscv") OUTPUT_ARCH(riscv) ENTRY(_start) @@ -25,25 +24,24 @@ SEARCH_DIR("=/usr/lib") /* ************************************************************************************************* */ /* +++ NEORV32 memory layout configuration +++ */ -/* If the symbols are not explicitly defined the default configurations are used. If required, only */ -/* edit the very last entry in each row. */ +/* If the symbols are not explicitly defined the default configurations are used. */ /* NOTE: section sizes have to be a multiple of 4 bytes; base addresses have to be 32-bit-aligned. */ /* ************************************************************************************************* */ -/* Default rom/ram (IMEM/DMEM) sizes */ -__neorv32_rom_size = DEFINED(__neorv32_rom_size) ? __neorv32_rom_size : 2048M; -__neorv32_ram_size = DEFINED(__neorv32_ram_size) ? __neorv32_ram_size : 8K; - /* Default HEAP size (= 0; no heap at all) */ __neorv32_heap_size = DEFINED(__neorv32_heap_size) ? __neorv32_heap_size : 0; -/* Default section base addresses */ +/* Default rom/ram (IMEM/DMEM) sizes */ +__neorv32_rom_size = DEFINED(__neorv32_rom_size) ? __neorv32_rom_size : 16k; +__neorv32_ram_size = DEFINED(__neorv32_ram_size) ? __neorv32_ram_size : 8K; + +/* Default rom/ram (IMEM/DMEM) base addresses */ __neorv32_rom_base = DEFINED(__neorv32_rom_base) ? __neorv32_rom_base : 0x00000000; __neorv32_ram_base = DEFINED(__neorv32_ram_base) ? __neorv32_ram_base : 0x80000000; /* ************************************************************************************************* */ -/* when compiling the bootloader the ROM section is automatically re-mapped to the */ +/* When compiling the bootloader the ROM section is automatically re-mapped to the */ /* processor-internal bootloader ROM address space. */ /* ************************************************************************************************* */ MEMORY From af20b4a301ba331983a23c9eff951683a1219b60 Mon Sep 17 00:00:00 2001 From: stnolting Date: Sun, 20 Oct 2024 20:29:07 +0200 Subject: [PATCH 2/8] [sw] cleanup folder makefile --- sw/example/makefile | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sw/example/makefile b/sw/example/makefile index 23541c51a..f7535b7cd 100644 --- a/sw/example/makefile +++ b/sw/example/makefile @@ -1,6 +1,3 @@ -#------------------------------------------------------------------------------- -# Make defaults and targets -#------------------------------------------------------------------------------- .SUFFIXES: .DEFAULT_GOAL := help @@ -20,10 +17,6 @@ $(SUBDIRS): .PHONY: $(TOPTARGETS) $(SUBDIRS) - -#------------------------------------------------------------------------------- -# Help -#------------------------------------------------------------------------------- help: @echo "Build / clean up all projects" @echo "Targets:" From 4c93fda0cea4d5545a95574a5fd53b82b142270e Mon Sep 17 00:00:00 2001 From: stnolting Date: Sun, 20 Oct 2024 20:29:46 +0200 Subject: [PATCH 3/8] [docs] rework software/makefile/linker sections --- docs/datasheet/software.adoc | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/docs/datasheet/software.adoc b/docs/datasheet/software.adoc index 1917fc8ee..2e541f730 100644 --- a/docs/datasheet/software.adoc +++ b/docs/datasheet/software.adoc @@ -362,45 +362,39 @@ relevant for the executable itself; the remaining sections are just listed for c | `io` | Address space for the processor-internal IO/peripheral devices |======================= -[NOTE] -The `rom` section is automatically re-mapped to the processor-internal <<_bootloader_rom_bootrom>> when compiling the -bootloader sources. - Each section has two main attributes: `ORIGIN` and `LENGTH`. `ORIGIN` defines the base address of the according section while `LENGTH` defines its size in bytes. For the `ram` and `rom` sections these attributes are configured indirectly -via variables that provide default values. +via variables that already provide _default values_: .Linker script - section configuration [source] ---- /* Default rom/ram (IMEM/DMEM) sizes */ -__neorv32_rom_size = DEFINED(__neorv32_rom_size) ? __neorv32_rom_size : 2048M; +__neorv32_rom_size = DEFINED(__neorv32_rom_size) ? __neorv32_rom_size : 16k; __neorv32_ram_size = DEFINED(__neorv32_ram_size) ? __neorv32_ram_size : 8K; -/* Default section base addresses */ +/* Default rom/ram (IMEM/DMEM) base addresses */ __neorv32_rom_base = DEFINED(__neorv32_rom_base) ? __neorv32_rom_base : 0x00000000; __neorv32_ram_base = DEFINED(__neorv32_ram_base) ? __neorv32_ram_base : 0x80000000; ---- -The region size and base address configuration can be edited by the user - either by explicitly -changing the default values in the linker script or by overriding them when invoking `make`: +.Bootloader ROM +[NOTE] +The `rom` section is automatically re-mapped to the processor-internal <<_bootloader_rom_bootrom>> when compiling the +bootloader sources. + +The default region sizes (and base addresses) can be edited by the user when invoking `make`: -.Overriding default `rom` size configuration (configuring 4096 bytes) +.Overriding default memory sizes (configuring 64kB IMEM and 32kB DMEM) [source, bash] ---- -$ make USER_FLAGS+="-Wl,--defsym,__neorv32_rom_size=4096" clean_all exe +$ make USER_FLAGS+="-Wl,--defsym,__neorv32_rom_size=64k -Wl,--defsym,__neorv32_ram_size=32k" clean_all exe ---- -[IMPORTANT] +.Changing the default base addresses +[WARNING] `__neorv32_rom_base` (= `ORIGIN` of the `rom` section) and `__neorv32_ram_base` (= `ORIGIN` of the `ram` section) have to -be sync to the actual memory layout configuration of the processor (see section <<_address_space>>). - -[NOTE] -The default configuration for the `rom` section assumes a maximum of 2GB _logical_ memory address space. This size does not -have to reflect the _actual_ physical size of the entire instruction memory. It just provides a maximum limit. When uploading -a new executable via the bootloader, the bootloader itself checks if sufficient _physical_ instruction memory is available. -If a new executable is embedded right into the internal-IMEM the synthesis tool will check, if the configured instruction memory -size is sufficient. +be match the actual processor memory layout configuration of the processor (see section <<_address_space>>). The linker maps all the regions from the compiled object files into five final sections: `.text`, `.rodata`, `.data`, `.bss` and `.heap`: From fa024f9a27eb6faba4d9f67b644ea57f6807fa3f Mon Sep 17 00:00:00 2001 From: stnolting Date: Sun, 20 Oct 2024 20:37:11 +0200 Subject: [PATCH 4/8] [sw/example] adjust project-specific makefiles add all relevant configuration options (ISA, memory sizes, ...) --- sw/example/atomic_test/makefile | 31 ++++++++++++++++- sw/example/bus_explorer/makefile | 31 ++++++++++++++++- sw/example/coremark/makefile | 31 ++++++++++++++++- sw/example/demo_blink_led/makefile | 31 ++++++++++++++++- sw/example/demo_blink_led_asm/makefile | 31 ++++++++++++++++- sw/example/demo_cfs/makefile | 31 ++++++++++++++++- sw/example/demo_cfu/makefile | 31 ++++++++++++++++- sw/example/demo_crc/makefile | 31 ++++++++++++++++- sw/example/demo_dma/makefile | 31 ++++++++++++++++- sw/example/demo_emulate_unaligned/makefile | 31 ++++++++++++++++- sw/example/demo_gptmr/makefile | 31 ++++++++++++++++- sw/example/demo_hpm/makefile | 31 ++++++++++++++++- sw/example/demo_mtime/makefile | 31 ++++++++++++++++- sw/example/demo_neopixel/makefile | 31 ++++++++++++++++- sw/example/demo_newlib/makefile | 32 ++++++++++++++++-- sw/example/demo_onewire/makefile | 33 ++++++++++++++++-- sw/example/demo_pwm/makefile | 33 ++++++++++++++++-- sw/example/demo_sdi/makefile | 31 ++++++++++++++++- sw/example/demo_slink/makefile | 33 ++++++++++++++++-- sw/example/demo_spi/makefile | 33 ++++++++++++++++-- sw/example/demo_spi_irq/makefile | 33 +++++++++++++++--- sw/example/demo_trng/makefile | 33 ++++++++++++++++-- sw/example/demo_twi/makefile | 33 ++++++++++++++++-- sw/example/demo_wdt/makefile | 33 ++++++++++++++++-- sw/example/demo_xip/makefile | 33 ++++++++++++++++-- sw/example/demo_xirq/makefile | 33 ++++++++++++++++-- sw/example/dhrystone/makefile | 33 ++++++++++++++++-- sw/example/float_corner_test/makefile | 33 ++++++++++++++++-- sw/example/floating_point_test/makefile | 31 ++++++++++++++++- sw/example/game_of_life/makefile | 31 ++++++++++++++++- sw/example/hello_cpp/makefile | 34 +++++++++++++++++-- sw/example/hello_world/makefile | 31 ++++++++++++++++- sw/example/performance_tests/I/makefile | 3 ++ sw/example/performance_tests/M/makefile | 2 ++ sw/example/performance_tests/Zfinx/makefile | 2 ++ sw/example/processor_check/makefile | 37 ++++++++++++++++++--- 36 files changed, 1011 insertions(+), 53 deletions(-) diff --git a/sw/example/atomic_test/makefile b/sw/example/atomic_test/makefile index 8f9e2fdc0..13c2d50b2 100644 --- a/sw/example/atomic_test/makefile +++ b/sw/example/atomic_test/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32ia_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/bus_explorer/makefile b/sw/example/bus_explorer/makefile index 8f9e2fdc0..81c21d943 100644 --- a/sw/example/bus_explorer/makefile +++ b/sw/example/bus_explorer/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/coremark/makefile b/sw/example/coremark/makefile index 8f9e2fdc0..de0eaf072 100644 --- a/sw/example/coremark/makefile +++ b/sw/example/coremark/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32imc_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -O3 + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=32k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/demo_blink_led/makefile b/sw/example/demo_blink_led/makefile index 8f9e2fdc0..81c21d943 100644 --- a/sw/example/demo_blink_led/makefile +++ b/sw/example/demo_blink_led/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/demo_blink_led_asm/makefile b/sw/example/demo_blink_led_asm/makefile index 8f9e2fdc0..81c21d943 100644 --- a/sw/example/demo_blink_led_asm/makefile +++ b/sw/example/demo_blink_led_asm/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/demo_cfs/makefile b/sw/example/demo_cfs/makefile index 8f9e2fdc0..81c21d943 100644 --- a/sw/example/demo_cfs/makefile +++ b/sw/example/demo_cfs/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/demo_cfu/makefile b/sw/example/demo_cfu/makefile index 8f9e2fdc0..81c21d943 100644 --- a/sw/example/demo_cfu/makefile +++ b/sw/example/demo_cfu/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/demo_crc/makefile b/sw/example/demo_crc/makefile index 8f9e2fdc0..81c21d943 100644 --- a/sw/example/demo_crc/makefile +++ b/sw/example/demo_crc/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/demo_dma/makefile b/sw/example/demo_dma/makefile index 8f9e2fdc0..81c21d943 100644 --- a/sw/example/demo_dma/makefile +++ b/sw/example/demo_dma/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/demo_emulate_unaligned/makefile b/sw/example/demo_emulate_unaligned/makefile index 8f9e2fdc0..81c21d943 100644 --- a/sw/example/demo_emulate_unaligned/makefile +++ b/sw/example/demo_emulate_unaligned/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/demo_gptmr/makefile b/sw/example/demo_gptmr/makefile index 8f9e2fdc0..81c21d943 100644 --- a/sw/example/demo_gptmr/makefile +++ b/sw/example/demo_gptmr/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/demo_hpm/makefile b/sw/example/demo_hpm/makefile index 8f9e2fdc0..81c21d943 100644 --- a/sw/example/demo_hpm/makefile +++ b/sw/example/demo_hpm/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/demo_mtime/makefile b/sw/example/demo_mtime/makefile index 8f9e2fdc0..81c21d943 100644 --- a/sw/example/demo_mtime/makefile +++ b/sw/example/demo_mtime/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/demo_neopixel/makefile b/sw/example/demo_neopixel/makefile index 8f9e2fdc0..81c21d943 100644 --- a/sw/example/demo_neopixel/makefile +++ b/sw/example/demo_neopixel/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/demo_newlib/makefile b/sw/example/demo_newlib/makefile index b7296654c..d622ea030 100644 --- a/sw/example/demo_newlib/makefile +++ b/sw/example/demo_newlib/makefile @@ -1,5 +1,33 @@ -# Configure max HEAP size -override USER_FLAGS += "-Wl,--defsym,__neorv32_heap_size=3072" +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=3072 + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. + +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/demo_onewire/makefile b/sw/example/demo_onewire/makefile index 8f9e2fdc0..c2c0d4f9e 100644 --- a/sw/example/demo_onewire/makefile +++ b/sw/example/demo_onewire/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. -include $(NEORV32_HOME)/sw/common/common.mk +# Include the main NEORV32 makefile +include $(NEORV32_HOME)/sw/common/common.mk \ No newline at end of file diff --git a/sw/example/demo_pwm/makefile b/sw/example/demo_pwm/makefile index 8f9e2fdc0..c2c0d4f9e 100644 --- a/sw/example/demo_pwm/makefile +++ b/sw/example/demo_pwm/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. -include $(NEORV32_HOME)/sw/common/common.mk +# Include the main NEORV32 makefile +include $(NEORV32_HOME)/sw/common/common.mk \ No newline at end of file diff --git a/sw/example/demo_sdi/makefile b/sw/example/demo_sdi/makefile index 8f9e2fdc0..81c21d943 100644 --- a/sw/example/demo_sdi/makefile +++ b/sw/example/demo_sdi/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/demo_slink/makefile b/sw/example/demo_slink/makefile index 8f9e2fdc0..c2c0d4f9e 100644 --- a/sw/example/demo_slink/makefile +++ b/sw/example/demo_slink/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. -include $(NEORV32_HOME)/sw/common/common.mk +# Include the main NEORV32 makefile +include $(NEORV32_HOME)/sw/common/common.mk \ No newline at end of file diff --git a/sw/example/demo_spi/makefile b/sw/example/demo_spi/makefile index 8f9e2fdc0..c2c0d4f9e 100644 --- a/sw/example/demo_spi/makefile +++ b/sw/example/demo_spi/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. -include $(NEORV32_HOME)/sw/common/common.mk +# Include the main NEORV32 makefile +include $(NEORV32_HOME)/sw/common/common.mk \ No newline at end of file diff --git a/sw/example/demo_spi_irq/makefile b/sw/example/demo_spi_irq/makefile index dbb60f018..913222fe5 100644 --- a/sw/example/demo_spi_irq/makefile +++ b/sw/example/demo_spi_irq/makefile @@ -1,7 +1,32 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) -NEORV32_HOME ?= ../../.. +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 -APP_SRC ?= $(wildcard ./*.c) $(wildcard ./*.s) $(wildcard ./*.cpp) $(wildcard ./*.S) $(wildcard ./drv/*.c) -APP_INC ?= -I . -I ./drv +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +APP_SRC += $(wildcard ./*.c) $(wildcard ./*.s) $(wildcard ./*.cpp) $(wildcard ./*.S) $(wildcard ./drv/*.c) +APP_INC += -I . -I ./drv + +# Set path to NEORV32 root directory +NEORV32_HOME ?= ../../.. include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/demo_trng/makefile b/sw/example/demo_trng/makefile index 8f9e2fdc0..c2c0d4f9e 100644 --- a/sw/example/demo_trng/makefile +++ b/sw/example/demo_trng/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. -include $(NEORV32_HOME)/sw/common/common.mk +# Include the main NEORV32 makefile +include $(NEORV32_HOME)/sw/common/common.mk \ No newline at end of file diff --git a/sw/example/demo_twi/makefile b/sw/example/demo_twi/makefile index 8f9e2fdc0..c2c0d4f9e 100644 --- a/sw/example/demo_twi/makefile +++ b/sw/example/demo_twi/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. -include $(NEORV32_HOME)/sw/common/common.mk +# Include the main NEORV32 makefile +include $(NEORV32_HOME)/sw/common/common.mk \ No newline at end of file diff --git a/sw/example/demo_wdt/makefile b/sw/example/demo_wdt/makefile index 8f9e2fdc0..c2c0d4f9e 100644 --- a/sw/example/demo_wdt/makefile +++ b/sw/example/demo_wdt/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. -include $(NEORV32_HOME)/sw/common/common.mk +# Include the main NEORV32 makefile +include $(NEORV32_HOME)/sw/common/common.mk \ No newline at end of file diff --git a/sw/example/demo_xip/makefile b/sw/example/demo_xip/makefile index 8f9e2fdc0..c2c0d4f9e 100644 --- a/sw/example/demo_xip/makefile +++ b/sw/example/demo_xip/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. -include $(NEORV32_HOME)/sw/common/common.mk +# Include the main NEORV32 makefile +include $(NEORV32_HOME)/sw/common/common.mk \ No newline at end of file diff --git a/sw/example/demo_xirq/makefile b/sw/example/demo_xirq/makefile index 8f9e2fdc0..c2c0d4f9e 100644 --- a/sw/example/demo_xirq/makefile +++ b/sw/example/demo_xirq/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. -include $(NEORV32_HOME)/sw/common/common.mk +# Include the main NEORV32 makefile +include $(NEORV32_HOME)/sw/common/common.mk \ No newline at end of file diff --git a/sw/example/dhrystone/makefile b/sw/example/dhrystone/makefile index 8f9e2fdc0..c2c0d4f9e 100644 --- a/sw/example/dhrystone/makefile +++ b/sw/example/dhrystone/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. -include $(NEORV32_HOME)/sw/common/common.mk +# Include the main NEORV32 makefile +include $(NEORV32_HOME)/sw/common/common.mk \ No newline at end of file diff --git a/sw/example/float_corner_test/makefile b/sw/example/float_corner_test/makefile index 8f9e2fdc0..c2c0d4f9e 100644 --- a/sw/example/float_corner_test/makefile +++ b/sw/example/float_corner_test/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. -include $(NEORV32_HOME)/sw/common/common.mk +# Include the main NEORV32 makefile +include $(NEORV32_HOME)/sw/common/common.mk \ No newline at end of file diff --git a/sw/example/floating_point_test/makefile b/sw/example/floating_point_test/makefile index 8f9e2fdc0..81c21d943 100644 --- a/sw/example/floating_point_test/makefile +++ b/sw/example/floating_point_test/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/game_of_life/makefile b/sw/example/game_of_life/makefile index 8f9e2fdc0..fad5eadb9 100644 --- a/sw/example/game_of_life/makefile +++ b/sw/example/game_of_life/makefile @@ -1,4 +1,33 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +APP_SRC += $(wildcard ./*.c) +APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/hello_cpp/makefile b/sw/example/hello_cpp/makefile index e303f51e0..d3092c735 100644 --- a/sw/example/hello_cpp/makefile +++ b/sw/example/hello_cpp/makefile @@ -1,7 +1,37 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. + +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk # Use c++ compiler and define c++ standard override CC = $(RISCV_PREFIX)g++ -override USER_FLAGS += -std=c++11 +USER_FLAGS += -std=c++11 diff --git a/sw/example/hello_world/makefile b/sw/example/hello_world/makefile index 0ba3e704b..a9d190c30 100644 --- a/sw/example/hello_world/makefile +++ b/sw/example/hello_world/makefile @@ -1,6 +1,35 @@ -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA +MARCH = rv32i_zicsr_zifencei + +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=16k + +# Adjust processor DMEM size +USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#USER_FLAGS += -Wl,--defsym,__neorv32_heap_size=1k + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk sim-check: sim diff --git a/sw/example/performance_tests/I/makefile b/sw/example/performance_tests/I/makefile index 7b9872632..c50f10cfc 100644 --- a/sw/example/performance_tests/I/makefile +++ b/sw/example/performance_tests/I/makefile @@ -1,5 +1,8 @@ # Modify this variable to fit your NEORV32 setup (neorv32 home folder) NEORV32_HOME ?= ../../../.. +MARCH ?= rv32i_zicsr_zifencei GHDL_RUN_FLAGS ?= -gPERFORMANCE_OPTION=1 --stop-time=4500us +override USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=128k +override USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=16k include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/performance_tests/M/makefile b/sw/example/performance_tests/M/makefile index 8f681aace..0699433fd 100644 --- a/sw/example/performance_tests/M/makefile +++ b/sw/example/performance_tests/M/makefile @@ -2,5 +2,7 @@ NEORV32_HOME ?= ../../../.. MARCH ?= rv32im_zicsr_zifencei GHDL_RUN_FLAGS ?= -gPERFORMANCE_OPTION=1 --stop-time=1500us +override USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=128k +override USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=16k include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/performance_tests/Zfinx/makefile b/sw/example/performance_tests/Zfinx/makefile index 1a914590c..aa02b51b8 100644 --- a/sw/example/performance_tests/Zfinx/makefile +++ b/sw/example/performance_tests/Zfinx/makefile @@ -2,5 +2,7 @@ NEORV32_HOME ?= ../../../.. MARCH ?= rv32i_zicsr_zifencei_zfinx GHDL_RUN_FLAGS ?= -gPERFORMANCE_OPTION=1 --stop-time=4500us +override USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=64k +override USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=16k include $(NEORV32_HOME)/sw/common/common.mk diff --git a/sw/example/processor_check/makefile b/sw/example/processor_check/makefile index f8c7559f3..810d83ca4 100644 --- a/sw/example/processor_check/makefile +++ b/sw/example/processor_check/makefile @@ -1,11 +1,38 @@ -# Override default configuration -override GHDL_RUN_FLAGS ?= --stop-time=15ms -override EFFORT = -Os +# Application makefile. +# Use this makefile to configure all relevant CPU / compiler options. + +# Override the default CPU ISA override MARCH = rv32ima_zba_zbb_zbs_zbkb_zbkc_zbkx_zknd_zkne_zknh_zksh_zksed_zicsr_zfinx_zifencei_zicond -override USER_FLAGS += -flto -Wl,--defsym,__neorv32_heap_size=3096 -# Modify this variable to fit your NEORV32 setup (neorv32 home folder) +# Override the default RISC-V GCC prefix +#RISCV_PREFIX ?= riscv-none-elf- + +# Override default optimization goal +EFFORT = -Os + +# Add extended debug symbols +override USER_FLAGS += -ggdb -gdwarf-3 + +# Adjust processor IMEM size +override USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=32k + +# Adjust processor DMEM size +override USER_FLAGS += -Wl,--defsym,__neorv32_ram_size=8k + +# Adjust maximum heap size +#SER_FLAGS += -Wl,--defsym,__neorv32_heap_size=3096 + +# Simulation arguments +override GHDL_RUN_FLAGS ?= --stop-time=15ms + +# Additional sources +#APP_SRC += $(wildcard ./*.c) +#APP_INC += -I . + +# Set path to NEORV32 root directory NEORV32_HOME ?= ../../.. + +# Include the main NEORV32 makefile include $(NEORV32_HOME)/sw/common/common.mk # Add test-specific makefile target From 039243923c55e7af482d711f3044d1581d8afda0 Mon Sep 17 00:00:00 2001 From: stnolting Date: Sun, 20 Oct 2024 21:00:59 +0200 Subject: [PATCH 5/8] [vuint] fix incorrect number of test cases --- sim/neorv32_tb.vhd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/neorv32_tb.vhd b/sim/neorv32_tb.vhd index 1df4e6e5b..8db13649b 100644 --- a/sim/neorv32_tb.vhd +++ b/sim/neorv32_tb.vhd @@ -158,7 +158,7 @@ begin if ci_mode then -- No need to send the full expectation in one big chunk check_uart(net, uart1_rx_handle, nul & nul); - check_uart(net, uart1_rx_handle, "0/56" & cr & lf); + check_uart(net, uart1_rx_handle, "0/55" & cr & lf); end if; -- Wait until all expected data has been received From bc560ddcac0719d38022491022d9787a24cc3d62 Mon Sep 17 00:00:00 2001 From: stnolting Date: Sun, 20 Oct 2024 21:01:13 +0200 Subject: [PATCH 6/8] [processor_check] enable link-time-optimization --- sw/example/processor_check/makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sw/example/processor_check/makefile b/sw/example/processor_check/makefile index 810d83ca4..d93fab26d 100644 --- a/sw/example/processor_check/makefile +++ b/sw/example/processor_check/makefile @@ -13,6 +13,9 @@ EFFORT = -Os # Add extended debug symbols override USER_FLAGS += -ggdb -gdwarf-3 +# Enable link time optimization +override USER_FLAGS += -flto + # Adjust processor IMEM size override USER_FLAGS += -Wl,--defsym,__neorv32_rom_size=32k From 7474593437b11eae069104731a167d3a0ff93bf8 Mon Sep 17 00:00:00 2001 From: stnolting Date: Mon, 21 Oct 2024 21:35:50 +0200 Subject: [PATCH 7/8] [package] update version ID --- rtl/core/neorv32_package.vhd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtl/core/neorv32_package.vhd b/rtl/core/neorv32_package.vhd index 30ccb8d86..3ae7dffa4 100644 --- a/rtl/core/neorv32_package.vhd +++ b/rtl/core/neorv32_package.vhd @@ -29,7 +29,7 @@ package neorv32_package is -- Architecture Constants ----------------------------------------------------------------- -- ------------------------------------------------------------------------------------------- - constant hw_version_c : std_ulogic_vector(31 downto 0) := x"01100509"; -- hardware version + constant hw_version_c : std_ulogic_vector(31 downto 0) := x"01100510"; -- hardware version constant archid_c : natural := 19; -- official RISC-V architecture ID constant XLEN : natural := 32; -- native data path width From c97623e350f6893cc1c379bc15496fc2938c1579 Mon Sep 17 00:00:00 2001 From: stnolting Date: Mon, 21 Oct 2024 21:36:08 +0200 Subject: [PATCH 8/8] [changelog] add v1.10.5.10 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85a904c81..bee7b9026 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ mimpid = 0x01040312 -> Version 01.04.03.12 -> v1.4.3.12 | Date | Version | Comment | Ticket | |:----:|:-------:|:--------|:------:| +| 21.10.2024 | 1.10.5.10 | :test_tube: rework linker script's ROM/IMEM default size (=16kB); add customization variable to all makefiles in `sw/example` | [#1072](https://github.com/stnolting/neorv32/pull/1072) | | 20.10.2024 | 1.10.5.9 | :warning: rework XIRQ controller; remove "interrupt pending" register `EIP` | [#1071](https://github.com/stnolting/neorv32/pull/1071) | | 18.10.2024 | 1.10.5.8 | minor RTL code cleanups | [#1068](https://github.com/stnolting/neorv32/pull/1068) | | 18.10.2024 | 1.10.5.7 | use individual/new module for XBUS-to-AXI4-Lite bridge | [#1063](https://github.com/stnolting/neorv32/pull/1063) |