Few fixes

This commit is contained in:
Germain Haugou 2019-12-15 16:58:00 +01:00
parent 8b884c9667
commit cbcdbe22ff
7 changed files with 33 additions and 9 deletions

View file

@ -42,6 +42,12 @@
#define L1_GLOBAL_DATA __attribute__((section(".data_l1")))
#define L1_DATA L1_GLOBAL_DATA
#ifdef USE_CLUSTER
#define RT_LOCAL_DATA L1_DATA
#else
#define RT_LOCAL_DATA FC_DATA
#endif
#endif
@ -54,7 +60,9 @@
#endif
#endif
#ifdef ARCHI_CLUSTER_NB_PE
#define ARCHI_NB_PE ARCHI_CLUSTER_NB_PE
#endif
#include "alloc.h"

View file

@ -53,6 +53,8 @@ void uart_close(int uart_id);
int uart_write(int uart_id, void *buffer, uint32_t size);
int uart_read(int uart_id, void *buffer, uint32_t size);
void synch_barrier();
#endif

View file

@ -2,5 +2,4 @@
scriptDir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
export PULPRT_HOME=$scriptDir
export PULP_SDK_HOME=$scriptDir
export PULPRT_HOME=$scriptDir

View file

@ -35,6 +35,11 @@ static void pos_wait_forever()
void cluster_entry_stub()
{
eu_evt_maskSet((1<<PULP_DISPATCH_EVENT) | (1<<PULP_MUTEX_EVENT) | (1<<PULP_HW_BAR_EVENT));
eu_bar_setup(eu_bar_addr(0), (1<<ARCHI_CLUSTER_NB_PE) - 1);
int retval = ((int (*)())cluster_entry)();
if (hal_core_id() == 0)
@ -77,3 +82,9 @@ int cluster_wait(int cid)
while(1);
return 0;
}
void synch_barrier()
{
if (hal_cluster_id() != ARCHI_FC_CID)
eu_bar_trig_wait_clr(eu_bar_addr(0));
}

View file

@ -1,4 +1,4 @@
TARGET_BUILD_DIR = $(CURDIR)/build
TARGET_BUILD_DIR = $(CURDIR)/build$(build_dir_ext)
ifndef VERBOSE
V = @
endif
@ -28,6 +28,10 @@ PULP_APP_CFLAGS += -I$(PULPRT_HOME)/include -I$(PULPRT_HOME)/kernel -I$(PULPOS_A
PULP_APP_CFLAGS += $(foreach inc,$(PULPOS_MODULES),-I$(inc)/include)
ifdef PULPRUN_PLATFORM
platform=$(PULPRUN_PLATFORM)
endif
ifndef platform
platform=gvsoc
@ -171,7 +175,7 @@ clean:
$(V)rm -rf $(TARGET_BUILD_DIR)
run:
pulp-run --platform=$(platform) --config=$(PULPRUN_TARGET) --binary=$(TARGETS) $(runner_args) prepare run
pulp-run --platform=$(platform) --config=$(PULPRUN_TARGET) --dir=$(TARGET_BUILD_DIR) --binary=$(TARGETS) $(runner_args) prepare run
dis:
$(PULP_OBJDUMP) $(PULP_ARCH_OBJDFLAGS) $(disopt) $(TARGETS)

View file

@ -3,9 +3,9 @@ PULP_CFLAGS += -D__riscv__
PULP_ARCH_CFLAGS ?= -march=rv32imcxgap9
PULP_ARCH_LDFLAGS ?= -march=rv32imcxgap9
PULP_ARCH_OBJDFLAGS ?= -Mmarch=rv32imcxgap9
PULP_CFLAGS += -Werror -Wextra -Wall -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wundef -fdata-sections -ffunction-sections -include chips/pulp/config.h -I$(PULPRT_HOME)/include/chips/pulp
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
PULP_LDFLAGS += -nostartfiles -nostdlib -Wl,--gc-sections -L$(PULPRT_HOME)/kernel -Tchips/pulp/link.ld -lgcc
PULP_CC = riscv32-unknown-elf-gcc
PULP_AR ?= riscv32-unknown-elf-ar

View file

@ -3,9 +3,9 @@ PULP_CFLAGS += -D__riscv__
PULP_ARCH_CFLAGS ?= -march=rv32imcxgap9
PULP_ARCH_LDFLAGS ?= -march=rv32imcxgap9
PULP_ARCH_OBJDFLAGS ?= -Mmarch=rv32imcxgap9
PULP_CFLAGS += -Werror -Wextra -Wall -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wundef -fdata-sections -ffunction-sections -include chips/pulp/config.h -I$(PULPRT_HOME)/include/chips/pulpissimo
PULP_CFLAGS += -fdata-sections -ffunction-sections -include chips/pulp/config.h -I$(PULPRT_HOME)/include/chips/pulpissimo
PULP_OMP_CFLAGS += -fopenmp -mnativeomp
PULP_LDFLAGS = -nostartfiles -nostdlib -Wl,--gc-sections -L$(PULPRT_HOME)/kernel -Tchips/pulpissimo/link.ld -lgcc
PULP_LDFLAGS += -nostartfiles -nostdlib -Wl,--gc-sections -L$(PULPRT_HOME)/kernel -Tchips/pulpissimo/link.ld -lgcc
PULP_CC = riscv32-unknown-elf-gcc
PULP_AR ?= riscv32-unknown-elf-ar