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.
This commit is contained in:
Tim Edwards 2021-12-24 13:42:36 -05:00
parent b553b39f5f
commit 1526214cc1
7 changed files with 14 additions and 7 deletions

View File

@ -22,6 +22,7 @@ BEHAVIOURAL_MODELS = ../../
FIRMWARE_PATH = ../.. FIRMWARE_PATH = ../..
GCC_PATH?=/ef/apps/bin GCC_PATH?=/ef/apps/bin
GCC_PREFIX?=riscv32-unknown-elf GCC_PREFIX?=riscv32-unknown-elf
RISCV_TYPE?=rv32imc
SIM_DEFINES = -DFUNCTIONAL -DSIM SIM_DEFINES = -DFUNCTIONAL -DSIM
@ -58,7 +59,7 @@ endif
vvp $< vvp $<
%.elf: %.c $(FIRMWARE_PATH)/sections.lds $(FIRMWARE_PATH)/start.s check-env %.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 %.hex: %.elf
${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@ ${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@

View File

@ -18,6 +18,7 @@ PDK_PATH = $(PDK_ROOT)/sky130A
VERILOG_PATH = ../../../.. VERILOG_PATH = ../../../..
RTL_PATH = $(VERILOG_PATH)/rtl RTL_PATH = $(VERILOG_PATH)/rtl
BEHAVIOURAL_MODELS = ../../ BEHAVIOURAL_MODELS = ../../
RISCV_TYPE ?= rv32imc
FIRMWARE_PATH = ../.. FIRMWARE_PATH = ../..
GCC_PATH?=/ef/apps/bin GCC_PATH?=/ef/apps/bin
@ -58,7 +59,7 @@ endif
vvp $< vvp $<
%.elf: %.c $(FIRMWARE_PATH)/sections.lds $(FIRMWARE_PATH)/start.s check-env %.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 %.hex: %.elf
${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@ ${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@

View File

@ -18,6 +18,7 @@ PDK_PATH = $(PDK_ROOT)/sky130A
VERILOG_PATH = ../../../.. VERILOG_PATH = ../../../..
RTL_PATH = $(VERILOG_PATH)/rtl RTL_PATH = $(VERILOG_PATH)/rtl
BEHAVIOURAL_MODELS = ../../ BEHAVIOURAL_MODELS = ../../
RISCV_TYPE ?= rv32imc
FIRMWARE_PATH = ../.. FIRMWARE_PATH = ../..
GCC_PATH?=/ef/apps/bin GCC_PATH?=/ef/apps/bin
@ -58,7 +59,7 @@ endif
vvp $< vvp $<
%.elf: %.c $(FIRMWARE_PATH)/sections.lds $(FIRMWARE_PATH)/start.s check-env %.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 %.hex: %.elf
${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@ ${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@

View File

@ -18,6 +18,7 @@ PDK_PATH = $(PDK_ROOT)/sky130A
VERILOG_PATH = ../../../.. VERILOG_PATH = ../../../..
RTL_PATH = $(VERILOG_PATH)/rtl RTL_PATH = $(VERILOG_PATH)/rtl
BEHAVIOURAL_MODELS = ../../ BEHAVIOURAL_MODELS = ../../
RISCV_TYPE ?= rv32imc
FIRMWARE_PATH = ../.. FIRMWARE_PATH = ../..
GCC_PATH?=/ef/apps/bin GCC_PATH?=/ef/apps/bin
@ -58,7 +59,7 @@ endif
vvp $< vvp $<
%.elf: %.c $(FIRMWARE_PATH)/sections.lds $(FIRMWARE_PATH)/start.s check-env %.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 %.hex: %.elf
${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@ ${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@

View File

@ -18,6 +18,7 @@ PDK_PATH = $(PDK_ROOT)/sky130A
VERILOG_PATH = ../../../.. VERILOG_PATH = ../../../..
RTL_PATH = $(VERILOG_PATH)/rtl RTL_PATH = $(VERILOG_PATH)/rtl
BEHAVIOURAL_MODELS = ../../ BEHAVIOURAL_MODELS = ../../
RISCV_TYPE ?= rv32imc
FIRMWARE_PATH = ../.. FIRMWARE_PATH = ../..
GCC_PATH?=/ef/apps/bin GCC_PATH?=/ef/apps/bin
@ -58,7 +59,7 @@ endif
vvp $< vvp $<
%.elf: %.c sections.lds start.S check-env %.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 %.hex: %.elf
${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@ ${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@

View File

@ -18,6 +18,7 @@ PDK_PATH = $(PDK_ROOT)/sky130A
VERILOG_PATH = ../../../.. VERILOG_PATH = ../../../..
RTL_PATH = $(VERILOG_PATH)/rtl RTL_PATH = $(VERILOG_PATH)/rtl
BEHAVIOURAL_MODELS = ../../ BEHAVIOURAL_MODELS = ../../
RISCV_TYPE ?= rv32imc
FIRMWARE_PATH = ../.. FIRMWARE_PATH = ../..
GCC_PATH?=/ef/apps/bin GCC_PATH?=/ef/apps/bin
@ -58,7 +59,7 @@ endif
vvp $< vvp $<
%.elf: %.c $(FIRMWARE_PATH)/sections.lds $(FIRMWARE_PATH)/start.s check-env %.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 %.hex: %.elf
${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@ ${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@

View File

@ -18,6 +18,7 @@ PDK_PATH = $(PDK_ROOT)/sky130A
VERILOG_PATH = ../../../.. VERILOG_PATH = ../../../..
RTL_PATH = $(VERILOG_PATH)/rtl RTL_PATH = $(VERILOG_PATH)/rtl
BEHAVIOURAL_MODELS = ../../ BEHAVIOURAL_MODELS = ../../
RISCV_TYPE ?= rv32imc
FIRMWARE_PATH = ../.. FIRMWARE_PATH = ../..
GCC_PATH?=/ef/apps/bin GCC_PATH?=/ef/apps/bin
@ -58,7 +59,7 @@ endif
vvp $< vvp $<
%.elf: %.c $(FIRMWARE_PATH)/sections.lds $(FIRMWARE_PATH)/start.s check-env %.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 %.hex: %.elf
${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@ ${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@