Skip to content

Commit

Permalink
[sw/isa-test] move RUN_TARGET to common.mk
Browse files Browse the repository at this point in the history
  • Loading branch information
umarcor committed Jul 12, 2021
1 parent da5711a commit 2684e0b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 102 deletions.
32 changes: 31 additions & 1 deletion sw/isa-test/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,40 @@ RISCV_GCC_OPTS ?= -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostart

NEORV32_LINK ?= link.imem_rom.ld

COMPILE_TARGET=\
COMPILE_TARGET ?= \
$$(RISCV_GCC) $(1) $$(RISCV_GCC_OPTS) \
$$(RISCV_TARGET_FLAGS) \
-I$(ROOTDIR)/riscv-test-suite/env/ \
-I$(TARGETDIR)/$(RISCV_TARGET)/ \
-T$(TARGETDIR)/$(RISCV_TARGET)/$(NEORV32_LINK) \
$$(<) -o $$@

NEORV32_CPU_EXTENSION_RISCV_C ?= false
NEORV32_CPU_EXTENSION_RISCV_M ?= false

NEORV32_SOFTWARE_EXAMPLE ?= $(NEORV32_LOCAL_COPY)/sw/example/blink_led

RUN_TARGET ?= \
cd $(work_dir_isa); \
echo ">"; \
rm -f $(NEORV32_LOCAL_COPY)/*.out; \
echo "copying/using SIM-only IMEM (ROM!)"; \
rm -f $(NEORV32_LOCAL_COPY)/rtl/core/neorv32_imem.vhd; \
cp -f $(NEORV32_LOCAL_COPY)/sim/neorv32_imem.simple.vhd $(NEORV32_LOCAL_COPY)/rtl/core/neorv32_imem.vhd; \
make -C $(NEORV32_SOFTWARE_EXAMPLE) main.elf; \
cp -f $< $(NEORV32_SOFTWARE_EXAMPLE)/main.elf; \
make -C $(NEORV32_SOFTWARE_EXAMPLE) main.bin install; \
touch $(NEORV32_LOCAL_COPY)/neorv32.uart0.sim_mode.data.out; \
GHDL_DEVNULL=true $(shell which time) -v $(NEORV32_LOCAL_COPY)/sim/ghdl.run.sh \
--stop-time=$(SIM_TIME) \
-gCPU_EXTENSION_RISCV_A=false \
-gCPU_EXTENSION_RISCV_C=$(NEORV32_CPU_EXTENSION_RISCV_C) \
-gCPU_EXTENSION_RISCV_E=false \
-gCPU_EXTENSION_RISCV_M=$(NEORV32_CPU_EXTENSION_RISCV_M) \
-gCPU_EXTENSION_RISCV_U=false \
-gCPU_EXTENSION_RISCV_Zicsr=true \
-gCPU_EXTENSION_RISCV_Zifencei=false \
-gEXT_IMEM_C=false \
-gMEM_INT_IMEM_SIZE='2097152'; \
cp $(NEORV32_LOCAL_COPY)/sim/neorv32.uart0.sim_mode.data.out $(*).signature.output; \
echo "<";
27 changes: 1 addition & 26 deletions sw/isa-test/port-neorv32/device/rv32i_m/C/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,29 +1,4 @@
NEORV32_MARCH ?= rv32ic
NEORV32_CPU_EXTENSION_RISCV_C ?= true

include $(NEORV32_ROOT)/sw/isa-test/common.mk

RUN_TARGET=\
cd $(work_dir_isa); \
echo ">"; \
rm -f $(NEORV32_LOCAL_COPY)/*.out; \
echo "copying/using SIM-only IMEM (ROM!)"; \
rm -f $(NEORV32_LOCAL_COPY)/rtl/core/neorv32_imem.vhd; \
cp -f $(NEORV32_LOCAL_COPY)/sim/neorv32_imem.simple.vhd $(NEORV32_LOCAL_COPY)/rtl/core/neorv32_imem.vhd; \
make -C $(NEORV32_LOCAL_COPY)/sw/example/blink_led main.elf; \
cp -f $< $(NEORV32_LOCAL_COPY)/sw/example/blink_led/main.elf; \
make -C $(NEORV32_LOCAL_COPY)/sw/example/blink_led main.bin install; \
touch $(NEORV32_LOCAL_COPY)/neorv32.uart0.sim_mode.data.out; \
GHDL_DEVNULL=true $(shell which time) -v $(NEORV32_LOCAL_COPY)/sim/ghdl.run.sh \
--stop-time=$(SIM_TIME) \
-gCPU_EXTENSION_RISCV_A=false \
-gCPU_EXTENSION_RISCV_C=true \
-gCPU_EXTENSION_RISCV_E=false \
-gCPU_EXTENSION_RISCV_M=false \
-gCPU_EXTENSION_RISCV_U=false \
-gCPU_EXTENSION_RISCV_Zicsr=true \
-gCPU_EXTENSION_RISCV_Zifencei=false \
-gEXT_IMEM_C=false \
-gMEM_INT_IMEM_SIZE='2097152'; \
cp $(NEORV32_LOCAL_COPY)/sim/neorv32.uart0.sim_mode.data.out $(*).signature.output; \
echo "<";
$(shell which time) -v
25 changes: 0 additions & 25 deletions sw/isa-test/port-neorv32/device/rv32i_m/I/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,26 +1 @@
include $(NEORV32_ROOT)/sw/isa-test/common.mk

RUN_TARGET=\
cd $(work_dir_isa); \
echo ">"; \
rm -f $(NEORV32_LOCAL_COPY)/*.out; \
echo "copying/using SIM-only IMEM (ROM!)"; \
rm -f $(NEORV32_LOCAL_COPY)/rtl/core/neorv32_imem.vhd; \
cp -f $(NEORV32_LOCAL_COPY)/sim/neorv32_imem.simple.vhd $(NEORV32_LOCAL_COPY)/rtl/core/neorv32_imem.vhd; \
make -C $(NEORV32_LOCAL_COPY)/sw/example/blink_led main.elf; \
cp -f $< $(NEORV32_LOCAL_COPY)/sw/example/blink_led/main.elf; \
make -C $(NEORV32_LOCAL_COPY)/sw/example/blink_led main.bin install; \
touch $(NEORV32_LOCAL_COPY)/neorv32.uart0.sim_mode.data.out; \
GHDL_DEVNULL=true $(shell which time) -v $(NEORV32_LOCAL_COPY)/sim/ghdl.run.sh \
--stop-time=$(SIM_TIME) \
-gCPU_EXTENSION_RISCV_A=false \
-gCPU_EXTENSION_RISCV_C=false \
-gCPU_EXTENSION_RISCV_E=false \
-gCPU_EXTENSION_RISCV_M=false \
-gCPU_EXTENSION_RISCV_U=false \
-gCPU_EXTENSION_RISCV_Zicsr=true \
-gCPU_EXTENSION_RISCV_Zifencei=false \
-gEXT_IMEM_C=false \
-gMEM_INT_IMEM_SIZE='2097152'; \
cp $(NEORV32_LOCAL_COPY)/sim/neorv32.uart0.sim_mode.data.out $(*).signature.output; \
echo "<";
26 changes: 1 addition & 25 deletions sw/isa-test/port-neorv32/device/rv32i_m/M/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,28 +1,4 @@
NEORV32_MARCH ?= rv32im
NEORV32_CPU_EXTENSION_RISCV_M ?= true

include $(NEORV32_ROOT)/sw/isa-test/common.mk

RUN_TARGET=\
cd $(work_dir_isa); \
echo ">"; \
rm -f $(NEORV32_LOCAL_COPY)/*.out; \
echo "copying/using SIM-only IMEM (ROM!)"; \
rm -f $(NEORV32_LOCAL_COPY)/rtl/core/neorv32_imem.vhd; \
cp -f $(NEORV32_LOCAL_COPY)/sim/neorv32_imem.simple.vhd $(NEORV32_LOCAL_COPY)/rtl/core/neorv32_imem.vhd; \
make -C $(NEORV32_LOCAL_COPY)/sw/example/blink_led main.elf; \
cp -f $< $(NEORV32_LOCAL_COPY)/sw/example/blink_led/main.elf; \
make -C $(NEORV32_LOCAL_COPY)/sw/example/blink_led main.bin install; \
touch $(NEORV32_LOCAL_COPY)/neorv32.uart0.sim_mode.data.out; \
GHDL_DEVNULL=true $(shell which time) -v $(NEORV32_LOCAL_COPY)/sim/ghdl.run.sh \
--stop-time=$(SIM_TIME) \
-gCPU_EXTENSION_RISCV_A=false \
-gCPU_EXTENSION_RISCV_C=false \
-gCPU_EXTENSION_RISCV_E=false \
-gCPU_EXTENSION_RISCV_M=true \
-gCPU_EXTENSION_RISCV_U=false \
-gCPU_EXTENSION_RISCV_Zicsr=true \
-gCPU_EXTENSION_RISCV_Zifencei=false \
-gEXT_IMEM_C=false \
-gMEM_INT_IMEM_SIZE='2097152'; \
cp $(NEORV32_LOCAL_COPY)/sim/neorv32.uart0.sim_mode.data.out $(*).signature.output; \
echo "<";
27 changes: 2 additions & 25 deletions sw/isa-test/port-neorv32/device/rv32i_m/privilege/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
include $(NEORV32_ROOT)/sw/isa-test/common.mk
NEORV32_CPU_EXTENSION_RISCV_C ?= true

RUN_TARGET=\
cd $(work_dir_isa); \
echo ">"; \
rm -f $(NEORV32_LOCAL_COPY)/*.out; \
echo "copying/using SIM-only IMEM (ROM!)"; \
rm -f $(NEORV32_LOCAL_COPY)/rtl/core/neorv32_imem.vhd; \
cp -f $(NEORV32_LOCAL_COPY)/sim/neorv32_imem.simple.vhd $(NEORV32_LOCAL_COPY)/rtl/core/neorv32_imem.vhd; \
make -C $(NEORV32_LOCAL_COPY)/sw/example/blink_led main.elf; \
cp -f $< $(NEORV32_LOCAL_COPY)/sw/example/blink_led/main.elf; \
make -C $(NEORV32_LOCAL_COPY)/sw/example/blink_led main.bin install; \
touch $(NEORV32_LOCAL_COPY)/neorv32.uart0.sim_mode.data.out; \
GHDL_DEVNULL=true $(shell which time) -v $(NEORV32_LOCAL_COPY)/sim/ghdl.run.sh \
--stop-time=$(SIM_TIME) \
-gCPU_EXTENSION_RISCV_A=false \
-gCPU_EXTENSION_RISCV_C=true \
-gCPU_EXTENSION_RISCV_E=false \
-gCPU_EXTENSION_RISCV_M=false \
-gCPU_EXTENSION_RISCV_U=false \
-gCPU_EXTENSION_RISCV_Zicsr=true \
-gCPU_EXTENSION_RISCV_Zifencei=false \
-gEXT_IMEM_C=false \
-gMEM_INT_IMEM_SIZE='2097152'; \
cp $(NEORV32_LOCAL_COPY)/sim/neorv32.uart0.sim_mode.data.out $(*).signature.output; \
echo "<";
include $(NEORV32_ROOT)/sw/isa-test/common.mk

0 comments on commit 2684e0b

Please sign in to comment.