diff --git a/include/hal/riscv/riscv_v5.h b/include/hal/riscv/riscv_v5.h index 23da57a..88ff492 100644 --- a/include/hal/riscv/riscv_v5.h +++ b/include/hal/riscv/riscv_v5.h @@ -25,7 +25,13 @@ #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 224a69f..f4d8be5 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__ -UARCHI_CORE_HAS_PULPV2 -DPLP_NO_BUILTIN -UCORE_PULP_BUILTINS -D__RISCV_GENERIC__ -DRV_ISA_RV32 -DPLP_NO_PERF_COUNTERS +PULP_CFLAGS += -D__ibex__ -UARCHI_CORE_HAS_PULPV2 -DPLP_NO_BUILTIN -UCORE_PULP_BUILTINS -DRV_ISA_RV32 -DPLP_NO_PERF_COUNTERS PULP_ARCH_CFLAGS ?= -march=rv32imc PULP_ARCH_LDFLAGS ?= -march=rv32imc PULP_ARCH_OBJDFLAGS ?= -Mmarch=rv32imc