minor update
This commit is contained in:
@@ -38,7 +38,7 @@ jobs:
|
|||||||
- rm -rf $HOME/build32 && cp -r $PWD $HOME/build32
|
- rm -rf $HOME/build32 && cp -r $PWD $HOME/build32
|
||||||
- rm -rf $HOME/build64 && cp -r $PWD $HOME/build64
|
- rm -rf $HOME/build64 && cp -r $PWD $HOME/build64
|
||||||
- make -C $HOME/build32
|
- make -C $HOME/build32
|
||||||
- XLEN=64 RISCV_TOOLCHAIN_PATH=$TOOLDIR/riscv64-gnu-toolchain make -C $HOME/build64
|
- XLEN=64 make -C $HOME/build64
|
||||||
- stage: test
|
- stage: test
|
||||||
name: unittest
|
name: unittest
|
||||||
script: cp -r $HOME/build32 build && cd build && ./ci/travis_run.py ./ci/regression.sh --unittest
|
script: cp -r $HOME/build32 build && cd build && ./ci/travis_run.py ./ci/regression.sh --unittest
|
||||||
@@ -47,13 +47,13 @@ jobs:
|
|||||||
script: cp -r $HOME/build32 build && cd build && ./ci/travis_run.py ./ci/regression.sh --isa
|
script: cp -r $HOME/build32 build && cd build && ./ci/travis_run.py ./ci/regression.sh --isa
|
||||||
- stage: test
|
- stage: test
|
||||||
name: isa64
|
name: isa64
|
||||||
script: cp -r $HOME/build64 build && cd build && XLEN=64 RISCV_TOOLCHAIN_PATH=$TOOLDIR/riscv64-gnu-toolchain ./ci/travis_run.py ./ci/regression.sh --isa
|
script: cp -r $HOME/build64 build && cd build && XLEN=64 ./ci/travis_run.py ./ci/regression.sh --isa
|
||||||
- stage: test
|
- stage: test
|
||||||
name: regression
|
name: regression
|
||||||
script: cp -r $HOME/build32 build && cd build && ./ci/travis_run.py ./ci/regression.sh --regression
|
script: cp -r $HOME/build32 build && cd build && ./ci/travis_run.py ./ci/regression.sh --regression
|
||||||
- stage: test
|
- stage: test
|
||||||
name: regression64
|
name: regression64
|
||||||
script: cp -r $HOME/build64 build && cd build && XLEN=64 RISCV_TOOLCHAIN_PATH=$TOOLDIR/riscv64-gnu-toolchain ./ci/travis_run.py ./ci/regression.sh --regression
|
script: cp -r $HOME/build64 build && cd build && XLEN=64 ./ci/travis_run.py ./ci/regression.sh --regression
|
||||||
- stage: test
|
- stage: test
|
||||||
name: opencl
|
name: opencl
|
||||||
script: cp -r $HOME/build32 build && cd build && ./ci/travis_run.py ./ci/regression.sh --opencl
|
script: cp -r $HOME/build32 build && cd build && ./ci/travis_run.py ./ci/regression.sh --opencl
|
||||||
|
|||||||
@@ -16,14 +16,11 @@
|
|||||||
|
|
||||||
TOOLDIR=${TOOLDIR:=/opt}
|
TOOLDIR=${TOOLDIR:=/opt}
|
||||||
|
|
||||||
export RISCV_TOOLCHAIN_PATH=$TOOLDIR/riscv-gnu-toolchain
|
|
||||||
export LLVM_POCL=$TOOLDIR/llvm-pocl
|
|
||||||
export LLVM_VORTEX=$TOOLDIR/llvm-vortex
|
|
||||||
export VERILATOR_ROOT=$TOOLDIR/verilator
|
export VERILATOR_ROOT=$TOOLDIR/verilator
|
||||||
export PATH=$VERILATOR_ROOT/bin:$PATH
|
export PATH=$VERILATOR_ROOT/bin:$PATH
|
||||||
|
|
||||||
export SV2V_PATH=$TOOLDIR/sv2v
|
export SV2V_PATH=$TOOLDIR/sv2v
|
||||||
export PATH=$SV2V_PATH/bin:$PATH
|
export PATH=$SV2V_PATH/bin:$PATH
|
||||||
|
|
||||||
export YOSYS_PATH=$TOOLDIR/yosys
|
export YOSYS_PATH=$TOOLDIR/yosys
|
||||||
export PATH=$YOSYS_PATH/bin:$PATH
|
export PATH=$YOSYS_PATH/bin:$PATH
|
||||||
export POCL_CC_PATH=$TOOLDIR/pocl/compiler
|
|
||||||
export POCL_RT_PATH=$TOOLDIR/pocl/runtime
|
|
||||||
|
|||||||
@@ -9,9 +9,6 @@ OPAE Environment Setup
|
|||||||
$ export C_INCLUDE_PATH=$OPAE_HOME/include:$C_INCLUDE_PATH
|
$ export C_INCLUDE_PATH=$OPAE_HOME/include:$C_INCLUDE_PATH
|
||||||
$ export LIBRARY_PATH=$OPAE_HOME/lib:$LIBRARY_PATH
|
$ export LIBRARY_PATH=$OPAE_HOME/lib:$LIBRARY_PATH
|
||||||
$ export LD_LIBRARY_PATH=$OPAE_HOME/lib:$LD_LIBRARY_PATH
|
$ export LD_LIBRARY_PATH=$OPAE_HOME/lib:$LD_LIBRARY_PATH
|
||||||
$ export RISCV_TOOLCHAIN_PATH=/opt/riscv-gnu-toolchain
|
|
||||||
$ export PATH=:/opt/verilator/bin:$PATH
|
|
||||||
$ export VERILATOR_ROOT=/opt/verilator
|
|
||||||
|
|
||||||
OPAE Build
|
OPAE Build
|
||||||
------------------
|
------------------
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
XLEN ?= 32
|
XLEN ?= 32
|
||||||
|
TOOLDIR ?= /opt
|
||||||
|
|
||||||
ifeq ($(XLEN),64)
|
ifeq ($(XLEN),64)
|
||||||
RISCV_TOOLCHAIN_PATH ?= /opt/riscv64-gnu-toolchain
|
RISCV_TOOLCHAIN_PATH ?= $(TOOLDIR)/riscv64-gnu-toolchain
|
||||||
CFLAGS += -march=rv64imafd -mabi=lp64d
|
CFLAGS += -march=rv64imafd -mabi=lp64d
|
||||||
else
|
else
|
||||||
RISCV_TOOLCHAIN_PATH ?= /opt/riscv-gnu-toolchain
|
RISCV_TOOLCHAIN_PATH ?= $(TOOLDIR)/riscv-gnu-toolchain
|
||||||
CFLAGS += -march=rv32imaf -mabi=ilp32f
|
CFLAGS += -march=rv32imaf -mabi=ilp32f
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
XLEN ?= 32
|
XLEN ?= 32
|
||||||
|
TOOLDIR ?= /opt
|
||||||
|
|
||||||
ifeq ($(XLEN),64)
|
ifeq ($(XLEN),64)
|
||||||
RISCV_TOOLCHAIN_PATH ?= /opt/riscv64-gnu-toolchain
|
RISCV_TOOLCHAIN_PATH ?= $(TOOLDIR)/riscv64-gnu-toolchain
|
||||||
CFLAGS += -march=rv64imafd -mabi=lp64d
|
CFLAGS += -march=rv64imafd -mabi=lp64d
|
||||||
else
|
else
|
||||||
RISCV_TOOLCHAIN_PATH ?= /opt/riscv-gnu-toolchain
|
RISCV_TOOLCHAIN_PATH ?= $(TOOLDIR)/riscv-gnu-toolchain
|
||||||
CFLAGS += -march=rv32imaf -mabi=ilp32f
|
CFLAGS += -march=rv32imaf -mabi=ilp32f
|
||||||
endif
|
endif
|
||||||
|
|
||||||
RISCV_PREFIX ?= riscv$(XLEN)-unknown-elf
|
RISCV_PREFIX ?= riscv$(XLEN)-unknown-elf
|
||||||
RISCV_SYSROOT ?= $(RISCV_TOOLCHAIN_PATH)/$(RISCV_PREFIX)
|
RISCV_SYSROOT ?= $(RISCV_TOOLCHAIN_PATH)/$(RISCV_PREFIX)
|
||||||
|
|
||||||
LLVM_VORTEX ?= /opt/llvm-vortex
|
LLVM_VORTEX ?= $(TOOLDIR)/llvm-vortex
|
||||||
|
|
||||||
LLVM_CFLAGS += --sysroot=$(RISCV_SYSROOT)
|
LLVM_CFLAGS += --sysroot=$(RISCV_SYSROOT)
|
||||||
LLVM_CFLAGS += --gcc-toolchain=$(RISCV_TOOLCHAIN_PATH)
|
LLVM_CFLAGS += --gcc-toolchain=$(RISCV_TOOLCHAIN_PATH)
|
||||||
|
|||||||
49
tests/kernel/common.mk
Normal file
49
tests/kernel/common.mk
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
XLEN ?= 32
|
||||||
|
TOOLDIR ?= /opt
|
||||||
|
|
||||||
|
ifeq ($(XLEN),64)
|
||||||
|
RISCV_TOOLCHAIN_PATH ?= $(TOOLDIR)/riscv64-gnu-toolchain
|
||||||
|
CFLAGS += -march=rv64imafd -mabi=lp64d
|
||||||
|
else
|
||||||
|
RISCV_TOOLCHAIN_PATH ?= $(TOOLDIR)/riscv-gnu-toolchain
|
||||||
|
CFLAGS += -march=rv32imaf -mabi=ilp32f
|
||||||
|
endif
|
||||||
|
|
||||||
|
RISCV_PREFIX ?= riscv$(XLEN)-unknown-elf
|
||||||
|
|
||||||
|
VORTEX_KN_PATH ?= $(realpath ../../../kernel)
|
||||||
|
|
||||||
|
CC = $(RISCV_TOOLCHAIN_PATH)/bin/$(RISCV_PREFIX)-gcc
|
||||||
|
AR = $(RISCV_TOOLCHAIN_PATH)/bin/$(RISCV_PREFIX)-gcc-ar
|
||||||
|
DP = $(RISCV_TOOLCHAIN_PATH)/bin/$(RISCV_PREFIX)-objdump
|
||||||
|
CP = $(RISCV_TOOLCHAIN_PATH)/bin/$(RISCV_PREFIX)-objcopy
|
||||||
|
|
||||||
|
SIM_DIR = ../../../sim
|
||||||
|
|
||||||
|
CFLAGS += -O3 -mcmodel=medany -fno-exceptions -nostartfiles -fdata-sections -ffunction-sections
|
||||||
|
CFLAGS += -I$(VORTEX_KN_PATH)/include -I$(VORTEX_KN_PATH)/../hw
|
||||||
|
|
||||||
|
LDFLAGS += -lm -Wl,-Bstatic,--gc-sections,-T,$(VORTEX_KN_PATH)/linker/vx_link$(XLEN).ld,--defsym=STARTUP_ADDR=0x80000000 $(VORTEX_KN_PATH)/libvortexrt.a
|
||||||
|
|
||||||
|
all: $(PROJECT).elf $(PROJECT).bin $(PROJECT).dump
|
||||||
|
|
||||||
|
$(PROJECT).dump: $(PROJECT).elf
|
||||||
|
$(DP) -D $(PROJECT).elf > $(PROJECT).dump
|
||||||
|
|
||||||
|
$(PROJECT).bin: $(PROJECT).elf
|
||||||
|
$(CP) -O binary $(PROJECT).elf $(PROJECT).bin
|
||||||
|
|
||||||
|
$(PROJECT).elf: $(SRCS)
|
||||||
|
$(CC) $(CFLAGS) $(SRCS) $(LDFLAGS) -o $(PROJECT).elf
|
||||||
|
|
||||||
|
run-rtlsim: $(PROJECT).bin
|
||||||
|
$(SIM_DIR)/rtlsim/rtlsim $(PROJECT).bin
|
||||||
|
|
||||||
|
run-simx: $(PROJECT).bin
|
||||||
|
$(SIM_DIR)/simx/simx $(PROJECT).bin
|
||||||
|
|
||||||
|
.depend: $(SRCS)
|
||||||
|
$(CC) $(CFLAGS) -MM $^ > .depend;
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf *.elf *.bin *.dump .depend
|
||||||
@@ -1,52 +1,5 @@
|
|||||||
XLEN ?= 32
|
|
||||||
|
|
||||||
ifeq ($(XLEN),64)
|
|
||||||
RISCV_TOOLCHAIN_PATH ?= /opt/riscv64-gnu-toolchain
|
|
||||||
CFLAGS += -march=rv64imafd -mabi=lp64d
|
|
||||||
else
|
|
||||||
RISCV_TOOLCHAIN_PATH ?= /opt/riscv-gnu-toolchain
|
|
||||||
CFLAGS += -march=rv32imaf -mabi=ilp32f
|
|
||||||
endif
|
|
||||||
|
|
||||||
RISCV_PREFIX ?= riscv$(XLEN)-unknown-elf
|
|
||||||
|
|
||||||
VORTEX_KN_PATH ?= $(realpath ../../../kernel)
|
|
||||||
|
|
||||||
CC = $(RISCV_TOOLCHAIN_PATH)/bin/$(RISCV_PREFIX)-gcc
|
|
||||||
AR = $(RISCV_TOOLCHAIN_PATH)/bin/$(RISCV_PREFIX)-gcc-ar
|
|
||||||
DP = $(RISCV_TOOLCHAIN_PATH)/bin/$(RISCV_PREFIX)-objdump
|
|
||||||
CP = $(RISCV_TOOLCHAIN_PATH)/bin/$(RISCV_PREFIX)-objcopy
|
|
||||||
|
|
||||||
SIM_DIR = ../../../sim
|
|
||||||
|
|
||||||
CFLAGS += -O3 -mcmodel=medany -fno-exceptions -nostartfiles -fdata-sections -ffunction-sections
|
|
||||||
CFLAGS += -I$(VORTEX_KN_PATH)/include -I$(VORTEX_KN_PATH)/../hw
|
|
||||||
|
|
||||||
LDFLAGS += -lm -Wl,-Bstatic,--gc-sections,-T,$(VORTEX_KN_PATH)/linker/vx_link$(XLEN).ld,--defsym=STARTUP_ADDR=0x80000000 $(VORTEX_KN_PATH)/libvortexrt.a
|
|
||||||
|
|
||||||
PROJECT = conform
|
PROJECT = conform
|
||||||
|
|
||||||
SRCS = main.cpp tests.cpp
|
SRCS = main.cpp tests.cpp
|
||||||
|
|
||||||
all: $(PROJECT).elf $(PROJECT).bin $(PROJECT).dump
|
include ../common.mk
|
||||||
|
|
||||||
$(PROJECT).dump: $(PROJECT).elf
|
|
||||||
$(DP) -D $(PROJECT).elf > $(PROJECT).dump
|
|
||||||
|
|
||||||
$(PROJECT).bin: $(PROJECT).elf
|
|
||||||
$(CP) -O binary $(PROJECT).elf $(PROJECT).bin
|
|
||||||
|
|
||||||
$(PROJECT).elf: $(SRCS)
|
|
||||||
$(CC) $(CFLAGS) $(SRCS) $(LDFLAGS) -o $(PROJECT).elf
|
|
||||||
|
|
||||||
run-rtlsim: $(PROJECT).bin
|
|
||||||
$(SIM_DIR)/rtlsim/rtlsim $(PROJECT).bin
|
|
||||||
|
|
||||||
run-simx: $(PROJECT).bin
|
|
||||||
$(SIM_DIR)/simx/simx $(PROJECT).bin
|
|
||||||
|
|
||||||
.depend: $(SRCS)
|
|
||||||
$(CC) $(CFLAGS) -MM $^ > .depend;
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf *.elf *.bin *.dump .depend
|
|
||||||
|
|||||||
@@ -1,52 +1,5 @@
|
|||||||
XLEN ?= 32
|
|
||||||
|
|
||||||
ifeq ($(XLEN),64)
|
|
||||||
RISCV_TOOLCHAIN_PATH ?= /opt/riscv64-gnu-toolchain
|
|
||||||
CFLAGS += -march=rv64imafd -mabi=lp64d
|
|
||||||
else
|
|
||||||
RISCV_TOOLCHAIN_PATH ?= /opt/riscv-gnu-toolchain
|
|
||||||
CFLAGS += -march=rv32imaf -mabi=ilp32f
|
|
||||||
endif
|
|
||||||
|
|
||||||
RISCV_PREFIX ?= riscv$(XLEN)-unknown-elf
|
|
||||||
|
|
||||||
VORTEX_KN_PATH ?= $(realpath ../../../kernel)
|
|
||||||
|
|
||||||
CC = $(RISCV_TOOLCHAIN_PATH)/bin/$(RISCV_PREFIX)-gcc
|
|
||||||
AR = $(RISCV_TOOLCHAIN_PATH)/bin/$(RISCV_PREFIX)-gcc-ar
|
|
||||||
DP = $(RISCV_TOOLCHAIN_PATH)/bin/$(RISCV_PREFIX)-objdump
|
|
||||||
CP = $(RISCV_TOOLCHAIN_PATH)/bin/$(RISCV_PREFIX)-objcopy
|
|
||||||
|
|
||||||
SIM_DIR = ../../../sim
|
|
||||||
|
|
||||||
CFLAGS += -O3 -mcmodel=medany -fno-exceptions -nostartfiles -fdata-sections -ffunction-sections
|
|
||||||
CFLAGS += -I$(VORTEX_KN_PATH)/include -I$(VORTEX_KN_PATH)/../hw
|
|
||||||
|
|
||||||
LDFLAGS += -lm -Wl,-Bstatic,--gc-sections,-T,$(VORTEX_KN_PATH)/linker/vx_link$(XLEN).ld,--defsym=STARTUP_ADDR=0x80000000 $(VORTEX_KN_PATH)/libvortexrt.a
|
|
||||||
|
|
||||||
PROJECT = fibonacci
|
PROJECT = fibonacci
|
||||||
|
|
||||||
SRCS = main.cpp
|
SRCS = main.cpp
|
||||||
|
|
||||||
all: $(PROJECT).elf $(PROJECT).bin $(PROJECT).dump
|
include ../common.mk
|
||||||
|
|
||||||
$(PROJECT).dump: $(PROJECT).elf
|
|
||||||
$(DP) -D $(PROJECT).elf > $(PROJECT).dump
|
|
||||||
|
|
||||||
$(PROJECT).bin: $(PROJECT).elf
|
|
||||||
$(CP) -O binary $(PROJECT).elf $(PROJECT).bin
|
|
||||||
|
|
||||||
$(PROJECT).elf: $(SRCS)
|
|
||||||
$(CC) $(CFLAGS) $(SRCS) $(LDFLAGS) -o $(PROJECT).elf
|
|
||||||
|
|
||||||
run-rtlsim: $(PROJECT).bin
|
|
||||||
$(SIM_DIR)/rtlsim/rtlsim $(PROJECT).bin
|
|
||||||
|
|
||||||
run-simx: $(PROJECT).bin
|
|
||||||
$(SIM_DIR)/simx/simx $(PROJECT).bin
|
|
||||||
|
|
||||||
.depend: $(SRCS)
|
|
||||||
$(CC) $(CFLAGS) -MM $^ > .depend;
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf *.elf *.bin *.dump .depend
|
|
||||||
|
|||||||
@@ -1,52 +1,5 @@
|
|||||||
XLEN ?= 32
|
|
||||||
|
|
||||||
ifeq ($(XLEN),64)
|
|
||||||
RISCV_TOOLCHAIN_PATH ?= /opt/riscv64-gnu-toolchain
|
|
||||||
CFLAGS += -march=rv64imafd -mabi=lp64d
|
|
||||||
else
|
|
||||||
RISCV_TOOLCHAIN_PATH ?= /opt/riscv-gnu-toolchain
|
|
||||||
CFLAGS += -march=rv32imaf -mabi=ilp32f
|
|
||||||
endif
|
|
||||||
|
|
||||||
RISCV_PREFIX ?= riscv$(XLEN)-unknown-elf
|
|
||||||
|
|
||||||
VORTEX_KN_PATH ?= $(realpath ../../../kernel)
|
|
||||||
|
|
||||||
CC = $(RISCV_TOOLCHAIN_PATH)/bin/$(RISCV_PREFIX)-gcc
|
|
||||||
AR = $(RISCV_TOOLCHAIN_PATH)/bin/$(RISCV_PREFIX)-gcc-ar
|
|
||||||
DP = $(RISCV_TOOLCHAIN_PATH)/bin/$(RISCV_PREFIX)-objdump
|
|
||||||
CP = $(RISCV_TOOLCHAIN_PATH)/bin/$(RISCV_PREFIX)-objcopy
|
|
||||||
|
|
||||||
SIM_DIR = ../../../sim
|
|
||||||
|
|
||||||
CFLAGS += -O3 -v -mcmodel=medany -fno-exceptions -nostartfiles -fdata-sections -ffunction-sections
|
|
||||||
CFLAGS += -I$(VORTEX_KN_PATH)/include -I$(VORTEX_KN_PATH)/../hw
|
|
||||||
|
|
||||||
LDFLAGS += -lm -Wl,-Bstatic,--gc-sections,-T,$(VORTEX_KN_PATH)/linker/vx_link$(XLEN).ld,--defsym=STARTUP_ADDR=0x80000000 $(VORTEX_KN_PATH)/libvortexrt.a
|
|
||||||
|
|
||||||
PROJECT = hello
|
PROJECT = hello
|
||||||
|
|
||||||
SRCS = main.cpp
|
SRCS = main.cpp
|
||||||
|
|
||||||
all: $(PROJECT).elf $(PROJECT).bin $(PROJECT).dump
|
include ../common.mk
|
||||||
|
|
||||||
$(PROJECT).dump: $(PROJECT).elf
|
|
||||||
$(DP) -D $(PROJECT).elf > $(PROJECT).dump
|
|
||||||
|
|
||||||
$(PROJECT).bin: $(PROJECT).elf
|
|
||||||
$(CP) -O binary $(PROJECT).elf $(PROJECT).bin
|
|
||||||
|
|
||||||
$(PROJECT).elf: $(SRCS)
|
|
||||||
$(CC) $(CFLAGS) $(SRCS) $(LDFLAGS) -o $(PROJECT).elf
|
|
||||||
|
|
||||||
run-rtlsim: $(PROJECT).bin
|
|
||||||
$(SIM_DIR)/rtlsim/rtlsim $(PROJECT).bin
|
|
||||||
|
|
||||||
run-simx: $(PROJECT).bin
|
|
||||||
$(SIM_DIR)/simx/simx $(PROJECT).bin
|
|
||||||
|
|
||||||
.depend: $(SRCS)
|
|
||||||
$(CC) $(CFLAGS) -MM $^ > .depend;
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf *.elf *.bin *.dump .depend
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
XLEN ?= 32
|
XLEN ?= 32
|
||||||
|
TOOLDIR ?= /opt
|
||||||
|
|
||||||
TARGET ?= opaesim
|
TARGET ?= opaesim
|
||||||
|
|
||||||
@@ -6,12 +7,12 @@ XRT_SYN_DIR ?= ../../../hw/syn/xilinx/xrt
|
|||||||
XRT_DEVICE_INDEX ?= 0
|
XRT_DEVICE_INDEX ?= 0
|
||||||
|
|
||||||
ifeq ($(XLEN),64)
|
ifeq ($(XLEN),64)
|
||||||
RISCV_TOOLCHAIN_PATH ?= /opt/riscv64-gnu-toolchain
|
RISCV_TOOLCHAIN_PATH ?= $(TOOLDIR)/riscv64-gnu-toolchain
|
||||||
VX_CFLAGS += -march=rv64imafd -mabi=lp64d
|
VX_CFLAGS += -march=rv64imafd -mabi=lp64d
|
||||||
K_CFLAGS += -march=rv64imafd -mabi=ilp64d
|
K_CFLAGS += -march=rv64imafd -mabi=ilp64d
|
||||||
STARTUP_ADDR ?= 0x180000000
|
STARTUP_ADDR ?= 0x180000000
|
||||||
else
|
else
|
||||||
RISCV_TOOLCHAIN_PATH ?= /opt/riscv-gnu-toolchain
|
RISCV_TOOLCHAIN_PATH ?= $(TOOLDIR)/riscv-gnu-toolchain
|
||||||
VX_CFLAGS += -march=rv32imaf -mabi=ilp32f
|
VX_CFLAGS += -march=rv32imaf -mabi=ilp32f
|
||||||
K_CFLAGS += -march=rv32imaf -mabi=ilp32f
|
K_CFLAGS += -march=rv32imaf -mabi=ilp32f
|
||||||
STARTUP_ADDR ?= 0x80000000
|
STARTUP_ADDR ?= 0x80000000
|
||||||
@@ -20,16 +21,16 @@ endif
|
|||||||
RISCV_PREFIX ?= riscv$(XLEN)-unknown-elf
|
RISCV_PREFIX ?= riscv$(XLEN)-unknown-elf
|
||||||
RISCV_SYSROOT ?= $(RISCV_TOOLCHAIN_PATH)/$(RISCV_PREFIX)
|
RISCV_SYSROOT ?= $(RISCV_TOOLCHAIN_PATH)/$(RISCV_PREFIX)
|
||||||
|
|
||||||
POCL_CC_PATH ?= /opt/pocl/compiler
|
POCL_CC_PATH ?= $(TOOLDIR)/pocl/compiler
|
||||||
POCL_RT_PATH ?= /opt/pocl/runtime
|
POCL_RT_PATH ?= $(TOOLDIR)/pocl/runtime
|
||||||
|
|
||||||
VORTEX_RT_PATH ?= $(realpath ../../../runtime)
|
VORTEX_RT_PATH ?= $(realpath ../../../runtime)
|
||||||
VORTEX_KN_PATH ?= $(realpath ../../../kernel)
|
VORTEX_KN_PATH ?= $(realpath ../../../kernel)
|
||||||
|
|
||||||
FPGA_BIN_DIR ?= $(VORTEX_RT_PATH)/opae
|
FPGA_BIN_DIR ?= $(VORTEX_RT_PATH)/opae
|
||||||
|
|
||||||
LLVM_VORTEX ?= /opt/llvm-vortex
|
LLVM_VORTEX ?= $(TOOLDIR)/llvm-vortex
|
||||||
LLVM_POCL ?= /opt/llvm-vortex
|
LLVM_POCL ?= $(TOOLDIR)/llvm-vortex
|
||||||
|
|
||||||
K_CFLAGS += -v -O3 --sysroot=$(RISCV_SYSROOT) --gcc-toolchain=$(RISCV_TOOLCHAIN_PATH) -Xclang -target-feature -Xclang +vortex
|
K_CFLAGS += -v -O3 --sysroot=$(RISCV_SYSROOT) --gcc-toolchain=$(RISCV_TOOLCHAIN_PATH) -Xclang -target-feature -Xclang +vortex
|
||||||
K_CFLAGS += -fno-rtti -fno-exceptions -nostartfiles -fdata-sections -ffunction-sections
|
K_CFLAGS += -fno-rtti -fno-exceptions -nostartfiles -fdata-sections -ffunction-sections
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
XLEN ?= 32
|
XLEN ?= 32
|
||||||
|
|
||||||
|
TOOLDIR ?= /opt
|
||||||
|
|
||||||
TARGET ?= opaesim
|
TARGET ?= opaesim
|
||||||
|
|
||||||
XRT_SYN_DIR ?= ../../../hw/syn/xilinx/xrt
|
XRT_SYN_DIR ?= ../../../hw/syn/xilinx/xrt
|
||||||
XRT_DEVICE_INDEX ?= 0
|
XRT_DEVICE_INDEX ?= 0
|
||||||
|
|
||||||
ifeq ($(XLEN),64)
|
ifeq ($(XLEN),64)
|
||||||
RISCV_TOOLCHAIN_PATH ?= /opt/riscv64-gnu-toolchain
|
RISCV_TOOLCHAIN_PATH ?= $(TOOLDIR)/riscv64-gnu-toolchain
|
||||||
VX_CFLAGS += -march=rv64imafd -mabi=lp64d
|
VX_CFLAGS += -march=rv64imafd -mabi=lp64d
|
||||||
STARTUP_ADDR ?= 0x180000000
|
STARTUP_ADDR ?= 0x180000000
|
||||||
else
|
else
|
||||||
RISCV_TOOLCHAIN_PATH ?= /opt/riscv-gnu-toolchain
|
RISCV_TOOLCHAIN_PATH ?= $(TOOLDIR)/riscv-gnu-toolchain
|
||||||
VX_CFLAGS += -march=rv32imaf -mabi=ilp32f
|
VX_CFLAGS += -march=rv32imaf -mabi=ilp32f
|
||||||
STARTUP_ADDR ?= 0x80000000
|
STARTUP_ADDR ?= 0x80000000
|
||||||
endif
|
endif
|
||||||
@@ -23,7 +25,7 @@ VORTEX_KN_PATH ?= $(realpath ../../../kernel)
|
|||||||
|
|
||||||
FPGA_BIN_DIR ?= $(VORTEX_RT_PATH)/opae
|
FPGA_BIN_DIR ?= $(VORTEX_RT_PATH)/opae
|
||||||
|
|
||||||
LLVM_VORTEX ?= /opt/llvm-vortex
|
LLVM_VORTEX ?= $(TOOLDIR)/llvm-vortex
|
||||||
|
|
||||||
LLVM_CFLAGS += --sysroot=$(RISCV_SYSROOT)
|
LLVM_CFLAGS += --sysroot=$(RISCV_SYSROOT)
|
||||||
LLVM_CFLAGS += --gcc-toolchain=$(RISCV_TOOLCHAIN_PATH)
|
LLVM_CFLAGS += --gcc-toolchain=$(RISCV_TOOLCHAIN_PATH)
|
||||||
|
|||||||
30
tests/unittest/common.mk
Normal file
30
tests/unittest/common.mk
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
VORTEX_RT_PATH ?= $(realpath ../../../runtime)
|
||||||
|
|
||||||
|
CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors
|
||||||
|
|
||||||
|
CXXFLAGS += -I$(VORTEX_RT_PATH)/common
|
||||||
|
|
||||||
|
# Debugigng
|
||||||
|
ifdef DEBUG
|
||||||
|
CXXFLAGS += -g -O0
|
||||||
|
else
|
||||||
|
CXXFLAGS += -O2 -DNDEBUG
|
||||||
|
endif
|
||||||
|
|
||||||
|
all: $(PROJECT)
|
||||||
|
|
||||||
|
$(PROJECT): $(SRCS)
|
||||||
|
$(CXX) $(CXXFLAGS) $^ $(LDFLAGS) -o $@
|
||||||
|
|
||||||
|
run:
|
||||||
|
./$(PROJECT)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(PROJECT) *.o .depend
|
||||||
|
|
||||||
|
clean-all: clean
|
||||||
|
rm -rf *.elf *.bin *.dump
|
||||||
|
|
||||||
|
ifneq ($(MAKECMDGOALS),clean)
|
||||||
|
-include .depend
|
||||||
|
endif
|
||||||
@@ -1,34 +1,5 @@
|
|||||||
VORTEX_RT_PATH ?= $(realpath ../../../runtime)
|
|
||||||
|
|
||||||
CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors
|
|
||||||
|
|
||||||
CXXFLAGS += -I$(VORTEX_RT_PATH)/common
|
|
||||||
|
|
||||||
# Debugigng
|
|
||||||
ifdef DEBUG
|
|
||||||
CXXFLAGS += -g -O0
|
|
||||||
else
|
|
||||||
CXXFLAGS += -O2 -DNDEBUG
|
|
||||||
endif
|
|
||||||
|
|
||||||
PROJECT = vx_malloc
|
PROJECT = vx_malloc
|
||||||
|
|
||||||
SRCS = main.cpp
|
SRCS = main.cpp
|
||||||
|
|
||||||
all: $(PROJECT)
|
include ../common.mk
|
||||||
|
|
||||||
$(PROJECT): $(SRCS)
|
|
||||||
$(CXX) $(CXXFLAGS) $^ $(LDFLAGS) -o $@
|
|
||||||
|
|
||||||
run:
|
|
||||||
./$(PROJECT)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf $(PROJECT) *.o .depend
|
|
||||||
|
|
||||||
clean-all: clean
|
|
||||||
rm -rf *.elf *.bin *.dump
|
|
||||||
|
|
||||||
ifneq ($(MAKECMDGOALS),clean)
|
|
||||||
-include .depend
|
|
||||||
endif
|
|
||||||
|
|||||||
Reference in New Issue
Block a user