From 55836db2d23b40ca947901e67f4036bb06e266a7 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 24 Dec 2021 11:46:34 -0500 Subject: [PATCH 1/3] Added a reference to the new file "gl/mgmt_defines.v" in the caravel_pico repository. The issue is that each SoC implementation defines its own modules and therefore needs its own includes. The implication is that this file now needs to exist in every SoC implementation's verilog/gl/ directory. --- verilog/rtl/caravan_netlists.v | 1 + verilog/rtl/caravel_netlists.v | 1 + 2 files changed, 2 insertions(+) diff --git a/verilog/rtl/caravan_netlists.v b/verilog/rtl/caravan_netlists.v index 5760b26c..8dc8a7eb 100644 --- a/verilog/rtl/caravan_netlists.v +++ b/verilog/rtl/caravan_netlists.v @@ -65,6 +65,7 @@ `include "gl/gpio_logic_high.v" `include "gl/xres_buf.v" `include "gl/spare_logic_block.v" + `include "gl/mgmt_defines.v" `include "gl/mgmt_core_wrapper.v" `include "gl/caravan.v" `else diff --git a/verilog/rtl/caravel_netlists.v b/verilog/rtl/caravel_netlists.v index 773bc124..c967700e 100644 --- a/verilog/rtl/caravel_netlists.v +++ b/verilog/rtl/caravel_netlists.v @@ -63,6 +63,7 @@ `include "gl/gpio_logic_high.v" `include "gl/xres_buf.v" `include "gl/spare_logic_block.v" + `include "gl/mgmt_defines.v" `include "gl/mgmt_core_wrapper.v" `include "gl/caravel.v" `else From b553b39f5f3152c46c119c4396ed852da13a3de8 Mon Sep 17 00:00:00 2001 From: RTimothyEdwards Date: Fri, 24 Dec 2021 16:48:26 +0000 Subject: [PATCH 2/3] Apply automatic changes to Manifest and README.rst --- manifest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest b/manifest index 7cd5e830..6b3a3984 100644 --- a/manifest +++ b/manifest @@ -3,7 +3,7 @@ 684085713662e37a26f9f981d35be7c6c7ff6e9a verilog/rtl/__user_analog_project_wrapper.v b5ad3558a91e508fad154b91565c7d664b247020 verilog/rtl/__user_project_wrapper.v ad30a2c7df753845db0ea65c1f3387c3e55b8f06 verilog/rtl/caravan.v -13bcfc49a7b2f62c85840105d0cf5d49cd4799a7 verilog/rtl/caravan_netlists.v +a855d65d6fc59352e4f8a994e451418d113586fc verilog/rtl/caravan_netlists.v a3d12a2d2d3596800bec47d1266dce2399a2fcc6 verilog/rtl/caravan_openframe.v 0b5b9fc879625af003415776671bc44cdc774470 verilog/rtl/caravel.v 2fe34f043edbe87c626e5616ad54f82c9ba067c2 verilog/rtl/caravel_clocking.v From 1526214cc1c401ba9b8db05cbfb53b644fe2bfe4 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 24 Dec 2021 13:42:36 -0500 Subject: [PATCH 3/3] Modifications to some of the Makefiles to make the specific RISC-V architecture type passed to gcc as the value to the '-march=' option an environment variable, setting that environment variable to "rv32imc" by default, and overriding it with "rv32ic" specifically for the new caravel_pico without the multiplier and divider option, on testbenches "mem" and "storage" which both have multiplies in the C code. --- verilog/dv/caravel/mgmt_soc/caravan/Makefile | 3 ++- verilog/dv/caravel/mgmt_soc/gpio/Makefile | 3 ++- verilog/dv/caravel/mgmt_soc/gpio_mgmt/Makefile | 3 ++- verilog/dv/caravel/mgmt_soc/hkspi/Makefile | 3 ++- verilog/dv/caravel/mgmt_soc/irq/Makefile | 3 ++- verilog/dv/caravel/mgmt_soc/mem/Makefile | 3 ++- verilog/dv/caravel/mgmt_soc/storage/Makefile | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/verilog/dv/caravel/mgmt_soc/caravan/Makefile b/verilog/dv/caravel/mgmt_soc/caravan/Makefile index 8e9f4bf3..eeae210b 100644 --- a/verilog/dv/caravel/mgmt_soc/caravan/Makefile +++ b/verilog/dv/caravel/mgmt_soc/caravan/Makefile @@ -22,6 +22,7 @@ BEHAVIOURAL_MODELS = ../../ FIRMWARE_PATH = ../.. GCC_PATH?=/ef/apps/bin GCC_PREFIX?=riscv32-unknown-elf +RISCV_TYPE?=rv32imc SIM_DEFINES = -DFUNCTIONAL -DSIM @@ -58,7 +59,7 @@ endif vvp $< %.elf: %.c $(FIRMWARE_PATH)/sections.lds $(FIRMWARE_PATH)/start.s check-env - ${GCC_PATH}/${GCC_PREFIX}-gcc -march=rv32imc -mabi=ilp32 -Wl,-Bstatic,-T,$(FIRMWARE_PATH)/sections.lds,--strip-debug -ffreestanding -nostdlib -o $@ $(FIRMWARE_PATH)/start.s $< + ${GCC_PATH}/${GCC_PREFIX}-gcc -march=$(RISCV_TYPE) -mabi=ilp32 -Wl,-Bstatic,-T,$(FIRMWARE_PATH)/sections.lds,--strip-debug -ffreestanding -nostdlib -o $@ $(FIRMWARE_PATH)/start.s $< %.hex: %.elf ${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@ diff --git a/verilog/dv/caravel/mgmt_soc/gpio/Makefile b/verilog/dv/caravel/mgmt_soc/gpio/Makefile index 1d067acd..9b79802d 100644 --- a/verilog/dv/caravel/mgmt_soc/gpio/Makefile +++ b/verilog/dv/caravel/mgmt_soc/gpio/Makefile @@ -18,6 +18,7 @@ PDK_PATH = $(PDK_ROOT)/sky130A VERILOG_PATH = ../../../.. RTL_PATH = $(VERILOG_PATH)/rtl BEHAVIOURAL_MODELS = ../../ +RISCV_TYPE ?= rv32imc FIRMWARE_PATH = ../.. GCC_PATH?=/ef/apps/bin @@ -58,7 +59,7 @@ endif vvp $< %.elf: %.c $(FIRMWARE_PATH)/sections.lds $(FIRMWARE_PATH)/start.s check-env - ${GCC_PATH}/${GCC_PREFIX}-gcc -march=rv32imc -mabi=ilp32 -Wl,-Bstatic,-T,$(FIRMWARE_PATH)/sections.lds,--strip-debug -ffreestanding -nostdlib -o $@ $(FIRMWARE_PATH)/start.s $< + ${GCC_PATH}/${GCC_PREFIX}-gcc -march=$(RISCV_TYPE) -mabi=ilp32 -Wl,-Bstatic,-T,$(FIRMWARE_PATH)/sections.lds,--strip-debug -ffreestanding -nostdlib -o $@ $(FIRMWARE_PATH)/start.s $< %.hex: %.elf ${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@ diff --git a/verilog/dv/caravel/mgmt_soc/gpio_mgmt/Makefile b/verilog/dv/caravel/mgmt_soc/gpio_mgmt/Makefile index 183307b7..a1df46e0 100644 --- a/verilog/dv/caravel/mgmt_soc/gpio_mgmt/Makefile +++ b/verilog/dv/caravel/mgmt_soc/gpio_mgmt/Makefile @@ -18,6 +18,7 @@ PDK_PATH = $(PDK_ROOT)/sky130A VERILOG_PATH = ../../../.. RTL_PATH = $(VERILOG_PATH)/rtl BEHAVIOURAL_MODELS = ../../ +RISCV_TYPE ?= rv32imc FIRMWARE_PATH = ../.. GCC_PATH?=/ef/apps/bin @@ -58,7 +59,7 @@ endif vvp $< %.elf: %.c $(FIRMWARE_PATH)/sections.lds $(FIRMWARE_PATH)/start.s check-env - ${GCC_PATH}/${GCC_PREFIX}-gcc -march=rv32imc -mabi=ilp32 -Wl,-Bstatic,-T,$(FIRMWARE_PATH)/sections.lds,--strip-debug -ffreestanding -nostdlib -o $@ $(FIRMWARE_PATH)/start.s $< + ${GCC_PATH}/${GCC_PREFIX}-gcc -march=$(RISCV_TYPE) -mabi=ilp32 -Wl,-Bstatic,-T,$(FIRMWARE_PATH)/sections.lds,--strip-debug -ffreestanding -nostdlib -o $@ $(FIRMWARE_PATH)/start.s $< %.hex: %.elf ${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@ diff --git a/verilog/dv/caravel/mgmt_soc/hkspi/Makefile b/verilog/dv/caravel/mgmt_soc/hkspi/Makefile index 7ee89e91..eb19b51a 100644 --- a/verilog/dv/caravel/mgmt_soc/hkspi/Makefile +++ b/verilog/dv/caravel/mgmt_soc/hkspi/Makefile @@ -18,6 +18,7 @@ PDK_PATH = $(PDK_ROOT)/sky130A VERILOG_PATH = ../../../.. RTL_PATH = $(VERILOG_PATH)/rtl BEHAVIOURAL_MODELS = ../../ +RISCV_TYPE ?= rv32imc FIRMWARE_PATH = ../.. GCC_PATH?=/ef/apps/bin @@ -58,7 +59,7 @@ endif vvp $< %.elf: %.c $(FIRMWARE_PATH)/sections.lds $(FIRMWARE_PATH)/start.s check-env - ${GCC_PATH}/${GCC_PREFIX}-gcc -march=rv32imc -mabi=ilp32 -Wl,-Bstatic,-T,$(FIRMWARE_PATH)/sections.lds,--strip-debug -ffreestanding -nostdlib -o $@ $(FIRMWARE_PATH)/start.s $< + ${GCC_PATH}/${GCC_PREFIX}-gcc -march=$(RISCV_TYPE) -mabi=ilp32 -Wl,-Bstatic,-T,$(FIRMWARE_PATH)/sections.lds,--strip-debug -ffreestanding -nostdlib -o $@ $(FIRMWARE_PATH)/start.s $< %.hex: %.elf ${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@ diff --git a/verilog/dv/caravel/mgmt_soc/irq/Makefile b/verilog/dv/caravel/mgmt_soc/irq/Makefile index 7737cbae..97598de9 100644 --- a/verilog/dv/caravel/mgmt_soc/irq/Makefile +++ b/verilog/dv/caravel/mgmt_soc/irq/Makefile @@ -18,6 +18,7 @@ PDK_PATH = $(PDK_ROOT)/sky130A VERILOG_PATH = ../../../.. RTL_PATH = $(VERILOG_PATH)/rtl BEHAVIOURAL_MODELS = ../../ +RISCV_TYPE ?= rv32imc FIRMWARE_PATH = ../.. GCC_PATH?=/ef/apps/bin @@ -58,7 +59,7 @@ endif vvp $< %.elf: %.c sections.lds start.S check-env - ${GCC_PATH}/${GCC_PREFIX}-gcc -march=rv32imc -mabi=ilp32 -Wl,-Bstatic,-T,sections.lds,--strip-debug -ffreestanding -nostdlib -o $@ start.S $< + ${GCC_PATH}/${GCC_PREFIX}-gcc -march=$(RISCV_TYPE) -mabi=ilp32 -Wl,-Bstatic,-T,sections.lds,--strip-debug -ffreestanding -nostdlib -o $@ start.S $< %.hex: %.elf ${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@ diff --git a/verilog/dv/caravel/mgmt_soc/mem/Makefile b/verilog/dv/caravel/mgmt_soc/mem/Makefile index 59e93ff6..b6590cda 100644 --- a/verilog/dv/caravel/mgmt_soc/mem/Makefile +++ b/verilog/dv/caravel/mgmt_soc/mem/Makefile @@ -18,6 +18,7 @@ PDK_PATH = $(PDK_ROOT)/sky130A VERILOG_PATH = ../../../.. RTL_PATH = $(VERILOG_PATH)/rtl BEHAVIOURAL_MODELS = ../../ +RISCV_TYPE ?= rv32imc FIRMWARE_PATH = ../.. GCC_PATH?=/ef/apps/bin @@ -58,7 +59,7 @@ endif vvp $< %.elf: %.c $(FIRMWARE_PATH)/sections.lds $(FIRMWARE_PATH)/start.s check-env - ${GCC_PATH}/${GCC_PREFIX}-gcc -march=rv32imc -mabi=ilp32 -Wl,-Bstatic,-T,$(FIRMWARE_PATH)/sections.lds,--strip-debug -ffreestanding -nostdlib -o $@ $(FIRMWARE_PATH)/start.s $< + ${GCC_PATH}/${GCC_PREFIX}-gcc -march=$(RISCV_TYPE) -mabi=ilp32 -Wl,-Bstatic,-T,$(FIRMWARE_PATH)/sections.lds,--strip-debug -ffreestanding -nostdlib -o $@ $(FIRMWARE_PATH)/start.s $< %.hex: %.elf ${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@ diff --git a/verilog/dv/caravel/mgmt_soc/storage/Makefile b/verilog/dv/caravel/mgmt_soc/storage/Makefile index 21eff796..08e6f7cd 100644 --- a/verilog/dv/caravel/mgmt_soc/storage/Makefile +++ b/verilog/dv/caravel/mgmt_soc/storage/Makefile @@ -18,6 +18,7 @@ PDK_PATH = $(PDK_ROOT)/sky130A VERILOG_PATH = ../../../.. RTL_PATH = $(VERILOG_PATH)/rtl BEHAVIOURAL_MODELS = ../../ +RISCV_TYPE ?= rv32imc FIRMWARE_PATH = ../.. GCC_PATH?=/ef/apps/bin @@ -58,7 +59,7 @@ endif vvp $< %.elf: %.c $(FIRMWARE_PATH)/sections.lds $(FIRMWARE_PATH)/start.s check-env - ${GCC_PATH}/${GCC_PREFIX}-gcc -march=rv32imc -mabi=ilp32 -Wl,-Bstatic,-T,$(FIRMWARE_PATH)/sections.lds,--strip-debug -ffreestanding -nostdlib -o $@ $(FIRMWARE_PATH)/start.s $< + ${GCC_PATH}/${GCC_PREFIX}-gcc -march=$(RISCV_TYPE) -mabi=ilp32 -Wl,-Bstatic,-T,$(FIRMWARE_PATH)/sections.lds,--strip-debug -ffreestanding -nostdlib -o $@ $(FIRMWARE_PATH)/start.s $< %.hex: %.elf ${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@