mirror of
https://github.com/vortexgpgpu/vortex.git
synced 2025-04-23 21:39:10 -04:00
add VM_ENABLE flag to configure&compilation
This commit is contained in:
parent
7528dd9c0f
commit
48ff4ee4e0
6 changed files with 23 additions and 6 deletions
|
@ -34,4 +34,6 @@ RISCV_SYSROOT ?= $(RISCV_TOOLCHAIN_PATH)/$(RISCV_PREFIX)
|
|||
VORTEX_RT_PATH ?= $(VORTEX_HOME)/runtime
|
||||
VORTEX_KN_PATH ?= $(VORTEX_HOME)/kernel
|
||||
|
||||
THIRD_PARTY_DIR ?= $(VORTEX_HOME)/third_party
|
||||
THIRD_PARTY_DIR ?= $(VORTEX_HOME)/third_party
|
||||
|
||||
VM_ENABLE ?= @VM_ENABLE@
|
9
configure
vendored
9
configure
vendored
|
@ -63,7 +63,7 @@ copy_files() {
|
|||
filename_no_ext="${filename%.in}"
|
||||
dest_file="$dest_dir/$filename_no_ext"
|
||||
mkdir -p "$dest_dir"
|
||||
sed "s|@VORTEX_HOME@|$SCRIPT_DIR|g; s|@XLEN@|$XLEN|g; s|@TOOLDIR@|$TOOLDIR|g; s|@OSVERSION@|$OSVERSION|g; s|@PREFIX@|$PREFIX|g" "$file" > "$dest_file"
|
||||
sed "s|@VORTEX_HOME@|$SCRIPT_DIR|g; s|@XLEN@|$XLEN|g; s|@TOOLDIR@|$TOOLDIR|g; s|@OSVERSION@|$OSVERSION|g; s|@PREFIX@|$PREFIX|g; s|@VM_ENABLE@|$VM_ENABLE|g" "$file" > "$dest_file"
|
||||
# apply permissions to bash scripts
|
||||
read -r firstline < "$dest_file"
|
||||
if [[ "$firstline" =~ ^#!.*bash ]]; then
|
||||
|
@ -114,6 +114,7 @@ default_xlen=32
|
|||
default_tooldir=$HOME/tools
|
||||
default_osversion=$(detect_osversion)
|
||||
default_prefix=$CURRENT_DIR
|
||||
default_vm=0
|
||||
|
||||
# load default configuration parameters from existing config.mk
|
||||
if [ -f "config.mk" ]; then
|
||||
|
@ -126,6 +127,7 @@ if [ -f "config.mk" ]; then
|
|||
TOOLDIR\ ?*) default_tooldir=${value//\?=/} ;;
|
||||
OSVERSION\ ?*) default_osversion=${value//\?=/} ;;
|
||||
PREFIX\ ?*) default_prefix=${value//\?=/} ;;
|
||||
VM_ENABLE\ ?*) default_vm=${value//\?=/} ;;
|
||||
esac
|
||||
done < config.mk
|
||||
fi
|
||||
|
@ -135,6 +137,7 @@ XLEN=${XLEN:=$default_xlen}
|
|||
TOOLDIR=${TOOLDIR:=$default_tooldir}
|
||||
OSVERSION=${OSVERSION:=$default_osversion}
|
||||
PREFIX=${PREFIX:=$default_prefix}
|
||||
VM_ENABLE=${VM_ENABLE:=$default_vm}
|
||||
|
||||
# parse command line arguments
|
||||
usage() {
|
||||
|
@ -143,6 +146,7 @@ usage() {
|
|||
echo " --tooldir=<path> Set the TOOLDIR path (default: $HOME/tools)"
|
||||
echo " --osversion=<version> Set the OS Version (default: $(detect_osversion))"
|
||||
echo " --prefix=<path> Set installation directory"
|
||||
echo " --vm_enable=<value> Enable Virtual Memory support (default: 0)"
|
||||
exit 1
|
||||
}
|
||||
while [[ "$#" -gt 0 ]]; do
|
||||
|
@ -151,6 +155,7 @@ while [[ "$#" -gt 0 ]]; do
|
|||
--tooldir=*) TOOLDIR="${1#*=}" ;;
|
||||
--osversion=*) OSVERSION="${1#*=}" ;;
|
||||
--prefix=*) PREFIX="${1#*=}" ;;
|
||||
--vm_enable=*) VM_ENABLE="${1#*=}" ;;
|
||||
-h|--help) usage ;;
|
||||
*) echo "Unknown parameter passed: $1"; usage ;;
|
||||
esac
|
||||
|
@ -172,3 +177,5 @@ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|||
THIRD_PARTY_DIR=$SCRIPT_DIR/third_party
|
||||
|
||||
copy_files "$SCRIPT_DIR" "$CURRENT_DIR"
|
||||
|
||||
echo "VM Enable: "$VM_ENABLE
|
|
@ -33,10 +33,6 @@
|
|||
`endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
`ifndef VM_DISABLE
|
||||
`define VM_ENABLE
|
||||
`endif
|
||||
|
||||
`ifndef EXT_M_DISABLE
|
||||
`define EXT_M_ENABLE
|
||||
`endif
|
||||
|
|
|
@ -32,6 +32,10 @@ CFLAGS += -O3 -mcmodel=medany -fno-exceptions -fdata-sections -ffunction-section
|
|||
CFLAGS += -I$(INC_DIR) -I$(ROOT_DIR)/hw
|
||||
CFLAGS += -DXLEN_$(XLEN)
|
||||
|
||||
ifeq ($(VM_ENABLE), 1)
|
||||
CFLAGS += -DVM_ENABLE
|
||||
endif
|
||||
|
||||
PROJECT := libvortex
|
||||
|
||||
SRCS = $(SRC_DIR)/vx_start.S $(SRC_DIR)/vx_syscalls.c $(SRC_DIR)/vx_print.S $(SRC_DIR)/tinyprintf.c $(SRC_DIR)/vx_print.c $(SRC_DIR)/vx_spawn.c $(SRC_DIR)/vx_serial.S $(SRC_DIR)/vx_perf.c
|
||||
|
|
|
@ -10,6 +10,10 @@ CXXFLAGS += -I$(INC_DIR) -I../common -I$(ROOT_DIR)/hw -I$(SIM_DIR)/simx -I$(COMM
|
|||
CXXFLAGS += $(CONFIGS)
|
||||
CXXFLAGS += -DXLEN_$(XLEN)
|
||||
|
||||
ifeq ($(VM_ENABLE), 1)
|
||||
CXXFLAGS += -DVM_ENABLE
|
||||
endif
|
||||
|
||||
LDFLAGS += -shared -pthread
|
||||
LDFLAGS += -L$(DESTDIR) -lsimx
|
||||
|
||||
|
|
|
@ -14,6 +14,10 @@ CXXFLAGS += -I$(THIRD_PARTY_DIR)/ramulator/src
|
|||
CXXFLAGS += -DXLEN_$(XLEN)
|
||||
CXXFLAGS += $(CONFIGS)
|
||||
|
||||
ifeq ($(VM_ENABLE), 1)
|
||||
CXXFLAGS += -DVM_ENABLE
|
||||
endif
|
||||
|
||||
LDFLAGS += $(THIRD_PARTY_DIR)/softfloat/build/Linux-x86_64-GCC/softfloat.a
|
||||
LDFLAGS += -Wl,-rpath,$(THIRD_PARTY_DIR)/ramulator -L$(THIRD_PARTY_DIR)/ramulator -lramulator
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue