diff --git a/software/software.mk b/software/software.mk index fd876a73e..a80d3de42 100644 --- a/software/software.mk +++ b/software/software.mk @@ -9,10 +9,16 @@ DEFINE+=$(defmacro)FREQ=$(FREQ) TOOLCHAIN_PREFIX:=riscv64-unknown-elf- CFLAGS=-Os -nostdlib -march=$(MFLAGS) -mabi=ilp32 +MFLAGS=$(MFLAGS_BASE)$(MFLAG_M)$(MFLAG_C) + +MFLAGS_BASE:=rv32i + +ifeq ($(USE_MUL_DIV),1) +MFLAG_M=m +endif + ifeq ($(USE_COMPRESSED),1) -MFLAGS=rv32imc -else -MFLAGS=rv32im +MFLAG_C=c endif #INCLUDE diff --git a/submodules/CPU b/submodules/CPU index 613dc94b6..6d846dd84 160000 --- a/submodules/CPU +++ b/submodules/CPU @@ -1 +1 @@ -Subproject commit 613dc94b6a345e61556f5dd09184fca50041e24e +Subproject commit 6d846dd84151ea166fecbe326dec89bf43a499cb diff --git a/system.mk b/system.mk index 6d8bb4eed..4c24894c8 100644 --- a/system.mk +++ b/system.mk @@ -33,6 +33,9 @@ INIT_MEM ?=1 #PERIPHERALS:=UART PERIPHERALS ?=UART +#RISC-V HARD MULTIPLIER AND DIVIDER INSTRUCTIONS +USE_MUL_DIV ?=1 + #RISC-V COMPRESSED INSTRUCTIONS USE_COMPRESSED ?=1