mirror of
https://github.com/saymrwulf/pulp-runtime.git
synced 2026-06-10 00:39:08 +00:00
Add compatibility for ibex
This commit is contained in:
parent
b8f77f397f
commit
8db90e9429
5 changed files with 18 additions and 5 deletions
|
|
@ -50,7 +50,7 @@
|
|||
#define archi_read(add) (*(volatile unsigned int *)(long)(add))
|
||||
|
||||
|
||||
#if defined(__riscv__) && !defined(__LLVM__) && !defined(RV_ISA_RV32)
|
||||
#if defined(__riscv__) && !defined(__LLVM__) && !defined(RV_ISA_RV32) && !defined(PLP_NO_BUILTIN)
|
||||
#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))
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ static inline unsigned int plp_dma_getCmd(int ext2loc, unsigned int size, int is
|
|||
res = __builtin_bitinsert(res, broadcast, 1, MCHAN_CMD_CMD_BLE_BIT);
|
||||
return res;
|
||||
#else
|
||||
return (ext2loc << MCHAN_CMD_CMD_TYPE_BIT) | (PLP_DMA_INC << MCHAN_CMD_CMD_INC_BIT) | (is2D << MCHAN_CMD_CMD__2D_EXT_BIT) | (size << MCHAN_CMD_CMD_LEN_BIT) | (trigEvt<<MCHAN_CMD_ELE_BIT) | (trigIrq<<MCHAN_CMD_ILE_BIT) | (broadcast<<MCHAN_CMD_CMD_BLE_BIT);
|
||||
return (ext2loc << MCHAN_CMD_CMD_TYPE_BIT) | (PLP_DMA_INC << MCHAN_CMD_CMD_INC_BIT) | (is2D << MCHAN_CMD_CMD__2D_EXT_BIT) | (size << MCHAN_CMD_CMD_LEN_BIT) | (trigEvt<<MCHAN_CMD_CMD_ELE_BIT) | (trigIrq<<MCHAN_CMD_CMD_ILE_BIT) | (broadcast<<MCHAN_CMD_CMD_BLE_BIT);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
#if !defined(__LLVM__) && ((defined(OR1K_VERSION) && OR1K_VERSION >= 5) || (defined(RISCV_VERSION) && RISCV_VERSION >= 4)) && !defined(PLP_NO_BUILTIN)
|
||||
value = __builtin_pulp_event_unit_read((int *)base, offset);
|
||||
#else
|
||||
__asm__ __volatile__ ("" : : : "memory");
|
||||
|
|
|
|||
|
|
@ -118,7 +118,9 @@ static inline unsigned int rt_irq_get_fc_vector_base()
|
|||
else
|
||||
{
|
||||
#if defined(ARCHI_HAS_CLUSTER)
|
||||
#if defined(ARCHI_CORE_HAS_1_10)
|
||||
#if defined(__RISCV_GENERIC__)
|
||||
return hal_spr_read(0x305) & ~1;
|
||||
#elif defined(ARCHI_CORE_HAS_1_10)
|
||||
return __builtin_pulp_spr_read(SR_MTVEC) & ~1;
|
||||
#elif defined(ARCHI_CLUSTER_CTRL_ADDR)
|
||||
return plp_ctrl_bootaddr_get();
|
||||
|
|
@ -148,7 +150,9 @@ static inline void rt_irq_set_fc_vector_base(unsigned int base)
|
|||
else
|
||||
{
|
||||
#if defined(ARCHI_HAS_CLUSTER)
|
||||
#if defined(ARCHI_CORE_HAS_1_10)
|
||||
#if defined(__RISCV_GENERIC__)
|
||||
hal_spr_write(0x305, base);
|
||||
#elif defined(ARCHI_CORE_HAS_1_10)
|
||||
__builtin_pulp_spr_write(SR_MTVEC, base | 1);
|
||||
#elif defined(ARCHI_CLUSTER_CTRL_ADDR)
|
||||
plp_ctrl_bootaddr_set(base);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,17 @@
|
|||
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_ARCH_CFLAGS ?= -march=rv32imc
|
||||
PULP_ARCH_LDFLAGS ?= -march=rv32imc
|
||||
PULP_ARCH_OBJDFLAGS ?= -Mmarch=rv32imc
|
||||
else
|
||||
PULP_LDFLAGS +=
|
||||
PULP_CFLAGS += -D__riscv__
|
||||
PULP_ARCH_CFLAGS ?= -march=rv32imcxgap9
|
||||
PULP_ARCH_LDFLAGS ?= -march=rv32imcxgap9
|
||||
PULP_ARCH_OBJDFLAGS ?= -Mmarch=rv32imcxgap9
|
||||
endif
|
||||
|
||||
PULP_CFLAGS += -fdata-sections -ffunction-sections -include chips/pulp/config.h -I$(PULPRT_HOME)/include/chips/pulp
|
||||
PULP_OMP_CFLAGS += -fopenmp -mnativeomp
|
||||
PULP_LDFLAGS += -nostartfiles -nostdlib -Wl,--gc-sections -L$(PULPRT_HOME)/kernel -Tchips/pulp/link.ld -lgcc
|
||||
|
|
|
|||
Loading…
Reference in a new issue