From a3f57b07d30562d885b648edc6926a388a37711a Mon Sep 17 00:00:00 2001 From: Michael Rogenmoser Date: Mon, 4 Jan 2021 14:09:11 +0100 Subject: [PATCH] Ibex cleanup --- include/archi/utils.h | 2 +- include/hal/eu/eu_v3.h | 2 +- include/hal/riscv/riscv_v5.h | 6 ------ rules/pulpos/targets/pulp.mk | 2 +- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/include/archi/utils.h b/include/archi/utils.h index 2e44761..f543c24 100644 --- a/include/archi/utils.h +++ b/include/archi/utils.h @@ -50,7 +50,7 @@ #define archi_read(add) (*(volatile unsigned int *)(long)(add)) -#if defined(__riscv__) && !defined(__LLVM__) && !defined(RV_ISA_RV32) && !defined(PLP_NO_BUILTIN) +#if defined(__riscv__) && !defined(__LLVM__) && !defined(RV_ISA_RV32) #define ARCHI_WRITE_VOL(base, offset, value) __builtin_pulp_write_base_off_v((value), (base), (offset)) #define ARCHI_WRITE(base, offset, value) __builtin_pulp_OffsetedWrite((value), (int *)(base), (offset)) #define ARCHI_READ(base, offset) __builtin_pulp_OffsetedRead((int *)(base), (offset)) diff --git a/include/hal/eu/eu_v3.h b/include/hal/eu/eu_v3.h index a7d522e..ebc7560 100644 --- a/include/hal/eu/eu_v3.h +++ b/include/hal/eu/eu_v3.h @@ -39,7 +39,7 @@ static inline unsigned int evt_read32(unsigned int base, unsigned int offset) { unsigned int value; - #if !defined(__LLVM__) && ((defined(OR1K_VERSION) && OR1K_VERSION >= 5) || (defined(RISCV_VERSION) && RISCV_VERSION >= 4)) && !defined(PLP_NO_BUILTIN) + #if !defined(__LLVM__) && ((defined(OR1K_VERSION) && OR1K_VERSION >= 5) || (defined(RISCV_VERSION) && RISCV_VERSION >= 4)) && !defined(RV_ISA_RV32) value = __builtin_pulp_event_unit_read((int *)base, offset); #else __asm__ __volatile__ ("" : : : "memory"); diff --git a/include/hal/riscv/riscv_v5.h b/include/hal/riscv/riscv_v5.h index be249d0..074e68f 100644 --- a/include/hal/riscv/riscv_v5.h +++ b/include/hal/riscv/riscv_v5.h @@ -25,13 +25,7 @@ #define CSR_PCMR_ACTIVE 0x1 -#ifdef __ibex__ -// For PULP, ibex added non-standard irqs to allow for 32 fast interrupts. -// These use custom CSRs: MIE: 0x7D0, MTVEC: 0x7D1, MIP: 0x7D2 -#define SR_MTVEC 0x7D1 -#else #define SR_MTVEC 0x305 -#endif diff --git a/rules/pulpos/targets/pulp.mk b/rules/pulpos/targets/pulp.mk index fecc378..776c0c5 100644 --- a/rules/pulpos/targets/pulp.mk +++ b/rules/pulpos/targets/pulp.mk @@ -1,6 +1,6 @@ ifdef USE_IBEX PULP_LDFLAGS += -PULP_CFLAGS += -D__ibex__ -U__riscv__ -UARCHI_CORE_HAS_PULPV2 -DPLP_NO_BUILTIN -UCORE_PULP_BUILTINS -DRV_ISA_RV32 +PULP_CFLAGS += -D__ibex__ -U__riscv__ -UARCHI_CORE_HAS_PULPV2 -DRV_ISA_RV32 PULP_ARCH_CFLAGS ?= -march=rv32imc PULP_ARCH_LDFLAGS ?= -march=rv32imc PULP_ARCH_OBJDFLAGS ?= -Mmarch=rv32imc