From 3750c672a7209a78e48b9a34ae597530fadc5cc0 Mon Sep 17 00:00:00 2001 From: Blaise Tine Date: Sun, 30 Jan 2022 00:26:55 -0500 Subject: [PATCH] Makefiles update --- driver/asesim/Makefile | 10 ++++++++-- driver/vlsim/Makefile | 10 ++++++++-- tests/opencl/bfs/Makefile | 10 ++++++++-- tests/opencl/convolution/Makefile | 10 ++++++++-- tests/opencl/guassian/Makefile | 10 ++++++++-- tests/opencl/kmeans/Makefile | 10 ++++++++-- tests/opencl/nearn/Makefile | 10 ++++++++-- tests/opencl/oclprintf/Makefile | 10 ++++++++-- tests/opencl/psort/Makefile | 10 ++++++++-- tests/opencl/saxpy/Makefile | 10 ++++++++-- tests/opencl/sfilter/Makefile | 10 ++++++++-- tests/opencl/sgemm/Makefile | 10 ++++++++-- tests/opencl/transpose/Makefile | 10 ++++++++-- tests/opencl/vecadd/Makefile | 10 ++++++++-- tests/regression/basic/Makefile | 10 ++++++++-- tests/regression/demo/Makefile | 10 ++++++++-- tests/regression/diverge/Makefile | 10 ++++++++-- tests/regression/dogfood/Makefile | 10 ++++++++-- tests/regression/fence/Makefile | 10 ++++++++-- tests/regression/io_addr/Makefile | 10 ++++++++-- tests/regression/mstress/Makefile | 10 ++++++++-- tests/regression/no_mf_ext/Makefile | 10 ++++++++-- tests/regression/no_smem/Makefile | 10 ++++++++-- tests/regression/prefetch/Makefile | 10 ++++++++-- tests/regression/printf/Makefile | 10 ++++++++-- tests/regression/sort/Makefile | 10 ++++++++-- tests/regression/tex/Makefile | 10 ++++++++-- 27 files changed, 216 insertions(+), 54 deletions(-) diff --git a/driver/asesim/Makefile b/driver/asesim/Makefile index 4452a194..a85b4908 100644 --- a/driver/asesim/Makefile +++ b/driver/asesim/Makefile @@ -6,8 +6,7 @@ SCRIPT_DIR=../../hw/scripts OPAE_SYN_DIR=../../hw/syn/opae -CXXFLAGS += -std=c++11 -O2 -DNDEBUG -Wall -Wextra -pedantic -Wfatal-errors -#CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors CXXFLAGS += -I. -I../include -I../../hw -I$(OPAE_HOME)/include -I$(OPAE_SYN_DIR) @@ -37,6 +36,13 @@ PROJECT = libvortex.so SRCS = ../common/opae.cpp ../common/vx_utils.cpp +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + # Enable scope analyzer ifdef SCOPE CXXFLAGS += -DSCOPE diff --git a/driver/vlsim/Makefile b/driver/vlsim/Makefile index 23c07635..a560c3a8 100644 --- a/driver/vlsim/Makefile +++ b/driver/vlsim/Makefile @@ -4,8 +4,7 @@ RTL_DIR=../../hw/rtl SCRIPT_DIR=../../hw/scripts -CXXFLAGS += -std=c++11 -O2 -DNDEBUG -Wall -Wextra -pedantic -Wfatal-errors -#CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors CXXFLAGS += -I. -I../include -I../../hw -I$(VLSIM_DIR) @@ -23,6 +22,13 @@ LDFLAGS += -L. -lopae-c-vlsim SRCS = ../common/opae.cpp ../common/vx_utils.cpp +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + # Enable scope analyzer ifdef SCOPE CXXFLAGS += -DSCOPE diff --git a/tests/opencl/bfs/Makefile b/tests/opencl/bfs/Makefile index 13b88729..37f8e7f9 100644 --- a/tests/opencl/bfs/Makefile +++ b/tests/opencl/bfs/Makefile @@ -11,13 +11,19 @@ K_LLCFLAGS += "-O3 -march=riscv32 -target-abi=ilp32f -mcpu=generic-rv32 -mattr=+ K_CFLAGS += "-v -O3 -Wstack-usage=1024 --sysroot=$(SYSROOT) --gcc-toolchain=$(RISCV_TOOLCHAIN_PATH) -march=rv32imf -mabi=ilp32f -Xclang -target-feature -Xclang +vortex -I$(VORTEX_RT_PATH)/include -fno-rtti -fno-exceptions -ffreestanding -nostartfiles -fdata-sections -ffunction-sections" K_LDFLAGS += "-Wl,-Bstatic,-T$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-sections $(VORTEX_RT_PATH)/libvortexrt.a -lm" -CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -pedantic -Wfatal-errors -#CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors CXXFLAGS += -I$(POCL_RT_PATH)/include LDFLAGS += -L$(POCL_RT_PATH)/lib -L$(VORTEX_DRV_PATH)/stub -lOpenCL -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = bfs SRCS = main.cc diff --git a/tests/opencl/convolution/Makefile b/tests/opencl/convolution/Makefile index e76b5968..47a2738e 100644 --- a/tests/opencl/convolution/Makefile +++ b/tests/opencl/convolution/Makefile @@ -11,13 +11,19 @@ K_LLCFLAGS += "-O3 -march=riscv32 -target-abi=ilp32f -mcpu=generic-rv32 -mattr=+ K_CFLAGS += "-v -O3 --sysroot=$(SYSROOT) --gcc-toolchain=$(RISCV_TOOLCHAIN_PATH) -march=rv32imf -mabi=ilp32f -Xclang -target-feature -Xclang +vortex -I$(VORTEX_RT_PATH)/include -fno-rtti -fno-exceptions -ffreestanding -nostartfiles -fdata-sections -ffunction-sections" K_LDFLAGS += "-Wl,-Bstatic,-T$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-sections $(VORTEX_RT_PATH)/libvortexrt.a -lm" -CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -pedantic -Wfatal-errors -#CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors CXXFLAGS += -I$(POCL_RT_PATH)/include LDFLAGS += -L$(POCL_RT_PATH)/lib -L$(VORTEX_DRV_PATH)/simx -lOpenCL -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = convolution SRCS = main.cpp utils.cpp diff --git a/tests/opencl/guassian/Makefile b/tests/opencl/guassian/Makefile index 01be4ae5..609855de 100644 --- a/tests/opencl/guassian/Makefile +++ b/tests/opencl/guassian/Makefile @@ -11,8 +11,7 @@ K_LLCFLAGS += "-O3 -march=riscv32 -target-abi=ilp32f -mcpu=generic-rv32 -mattr=+ K_CFLAGS += "-v -O3 --sysroot=$(SYSROOT) --gcc-toolchain=$(RISCV_TOOLCHAIN_PATH) -march=rv32imf -mabi=ilp32f -Xclang -target-feature -Xclang +vortex -I$(VORTEX_RT_PATH)/include -fno-rtti -fno-exceptions -ffreestanding -nostartfiles -fdata-sections -ffunction-sections" K_LDFLAGS += "-Wl,-Bstatic,-T$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-sections $(VORTEX_RT_PATH)/libvortexrt.a -lm" -CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -Wfatal-errors -#CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -Wfatal-errors CXXFLAGS += -Wno-deprecated-declarations -Wno-unused-parameter CXXFLAGS += -Wno-unused-variable -Wno-narrowing -Wno-unused-result -Wno-unused-but-set-variable @@ -21,6 +20,13 @@ CXXFLAGS += -I$(POCL_RT_PATH)/include LDFLAGS += -L$(POCL_RT_PATH)/lib -L$(VORTEX_DRV_PATH)/stub -lOpenCL -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = guassian SRCS = main.cc clutils.cpp utils.cpp diff --git a/tests/opencl/kmeans/Makefile b/tests/opencl/kmeans/Makefile index 8251d75a..ae2ade9d 100644 --- a/tests/opencl/kmeans/Makefile +++ b/tests/opencl/kmeans/Makefile @@ -11,13 +11,19 @@ K_LLCFLAGS += "-O3 -march=riscv32 -target-abi=ilp32f -mcpu=generic-rv32 -mattr=+ K_CFLAGS += "-v -O3 --sysroot=$(SYSROOT) --gcc-toolchain=$(RISCV_TOOLCHAIN_PATH) -march=rv32imf -mabi=ilp32f -Xclang -target-feature -Xclang +vortex -I$(VORTEX_RT_PATH)/include -fno-rtti -fno-exceptions -ffreestanding -nostartfiles -fdata-sections -ffunction-sections" K_LDFLAGS += "-Wl,-Bstatic,-T$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-sections $(VORTEX_RT_PATH)/libvortexrt.a -lm" -CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -pedantic -Wfatal-errors -#CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors CXXFLAGS += -I$(POCL_RT_PATH)/include LDFLAGS += -L$(POCL_RT_PATH)/lib -L$(VORTEX_DRV_PATH)/stub -lOpenCL -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = kmeans SRCS = main.cc read_input.c rmse.c kmeans_clustering.c cluster.c getopt.c diff --git a/tests/opencl/nearn/Makefile b/tests/opencl/nearn/Makefile index 52d20b38..5170d4e9 100644 --- a/tests/opencl/nearn/Makefile +++ b/tests/opencl/nearn/Makefile @@ -13,8 +13,7 @@ K_LLCFLAGS += "-O3 -march=riscv32 -target-abi=ilp32f -mcpu=generic-rv32 -mattr=+ K_CFLAGS += "-v -O3 --sysroot=$(SYSROOT) --gcc-toolchain=$(RISCV_TOOLCHAIN_PATH) -march=rv32imf -mabi=ilp32f -Xclang -target-feature -Xclang +vortex -I$(VORTEX_RT_PATH)/include -fno-rtti -fno-exceptions -ffreestanding -nostartfiles -fdata-sections -ffunction-sections" K_LDFLAGS += "-Wl,-Bstatic,-T$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-sections $(VORTEX_RT_PATH)/libvortexrt.a -lm" -CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -Wfatal-errors -#CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -Wfatal-errors CXXFLAGS += -Wno-deprecated-declarations -Wno-unused-parameter CXXFLAGS += -Wno-unused-variable -Wno-narrowing -Wno-unused-result -Wno-unused-but-set-variable @@ -23,6 +22,13 @@ CXXFLAGS += -I$(POCL_RT_PATH)/include LDFLAGS += -L$(POCL_RT_PATH)/lib -L$(VORTEX_DRV_PATH)/stub -lOpenCL -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = nearn SRCS = main.cc clutils.cpp utils.cpp diff --git a/tests/opencl/oclprintf/Makefile b/tests/opencl/oclprintf/Makefile index 2c2fffa5..ba0140da 100644 --- a/tests/opencl/oclprintf/Makefile +++ b/tests/opencl/oclprintf/Makefile @@ -13,8 +13,7 @@ K_LLCFLAGS += "-O3 -march=riscv32 -target-abi=ilp32f -mcpu=generic-rv32 -mattr=+ K_CFLAGS += "-v -O3 --sysroot=$(SYSROOT) --gcc-toolchain=$(RISCV_TOOLCHAIN_PATH) -march=rv32imf -mabi=ilp32f -Xclang -target-feature -Xclang +vortex -I$(VORTEX_RT_PATH)/include -fno-rtti -fno-exceptions -ffreestanding -nostartfiles -fdata-sections -ffunction-sections" K_LDFLAGS += "-Wl,-Bstatic,-T$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-sections $(VORTEX_RT_PATH)/libvortexrt.a -lm" -CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -Wfatal-errors -#CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -Wfatal-errors CXXFLAGS += -Wno-deprecated-declarations -Wno-unused-parameter -Wno-narrowing @@ -22,6 +21,13 @@ CXXFLAGS += -I$(POCL_RT_PATH)/include LDFLAGS += -L$(POCL_RT_PATH)/lib -L$(VORTEX_DRV_PATH)/stub -lOpenCL -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = oclprintf SRCS = main.cc diff --git a/tests/opencl/psort/Makefile b/tests/opencl/psort/Makefile index 747e185b..43c6b0d3 100644 --- a/tests/opencl/psort/Makefile +++ b/tests/opencl/psort/Makefile @@ -13,8 +13,7 @@ K_LLCFLAGS += "-O3 -march=riscv32 -target-abi=ilp32f -mcpu=generic-rv32 -mattr=+ K_CFLAGS += "-v -O3 --sysroot=$(SYSROOT) --gcc-toolchain=$(RISCV_TOOLCHAIN_PATH) -march=rv32imf -mabi=ilp32f -Xclang -target-feature -Xclang +vortex -I$(VORTEX_RT_PATH)/include -fno-rtti -fno-exceptions -ffreestanding -nostartfiles -fdata-sections -ffunction-sections" K_LDFLAGS += "-Wl,-Bstatic,-T$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-sections $(VORTEX_RT_PATH)/libvortexrt.a -lm" -CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -Wfatal-errors -#CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -Wfatal-errors CXXFLAGS += -Wno-deprecated-declarations -Wno-unused-parameter -Wno-strict-aliasing -Wno-narrowing @@ -22,6 +21,13 @@ CXXFLAGS += -I$(POCL_RT_PATH)/include LDFLAGS += -L$(POCL_RT_PATH)/lib -L$(VORTEX_DRV_PATH)/stub -lOpenCL -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = psort SRCS = main.cc diff --git a/tests/opencl/saxpy/Makefile b/tests/opencl/saxpy/Makefile index 6dc44a19..3b3a8c39 100644 --- a/tests/opencl/saxpy/Makefile +++ b/tests/opencl/saxpy/Makefile @@ -13,8 +13,7 @@ K_LLCFLAGS += "-O3 -march=riscv32 -target-abi=ilp32f -mcpu=generic-rv32 -mattr=+ K_CFLAGS += "-v -O3 --sysroot=$(SYSROOT) --gcc-toolchain=$(RISCV_TOOLCHAIN_PATH) -march=rv32imf -mabi=ilp32f -Xclang -target-feature -Xclang +vortex -I$(VORTEX_RT_PATH)/include -fno-rtti -fno-exceptions -ffreestanding -nostartfiles -fdata-sections -ffunction-sections" K_LDFLAGS += "-Wl,-Bstatic,-T$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-sections $(VORTEX_RT_PATH)/libvortexrt.a -lm" -CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -Wfatal-errors -#CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -Wfatal-errors CXXFLAGS += -Wno-deprecated-declarations -Wno-unused-parameter -Wno-narrowing @@ -22,6 +21,13 @@ CXXFLAGS += -I$(POCL_RT_PATH)/include LDFLAGS += -L$(POCL_RT_PATH)/lib -L$(VORTEX_DRV_PATH)/stub -lOpenCL -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = saxpy SRCS = main.cc diff --git a/tests/opencl/sfilter/Makefile b/tests/opencl/sfilter/Makefile index 423a8976..c8be6618 100644 --- a/tests/opencl/sfilter/Makefile +++ b/tests/opencl/sfilter/Makefile @@ -13,8 +13,7 @@ K_LLCFLAGS += "-O3 -march=riscv32 -target-abi=ilp32f -mcpu=generic-rv32 -mattr=+ K_CFLAGS += "-v -O3 --sysroot=$(SYSROOT) --gcc-toolchain=$(RISCV_TOOLCHAIN_PATH) -march=rv32imf -mabi=ilp32f -Xclang -target-feature -Xclang +vortex -I$(VORTEX_RT_PATH)/include -fno-rtti -fno-exceptions -ffreestanding -nostartfiles -fdata-sections -ffunction-sections" K_LDFLAGS += "-Wl,-Bstatic,-T$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-sections $(VORTEX_RT_PATH)/libvortexrt.a -lm" -CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -Wfatal-errors -#CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -Wfatal-errors CXXFLAGS += -Wno-deprecated-declarations -Wno-unused-parameter -Wno-narrowing @@ -22,6 +21,13 @@ CXXFLAGS += -I$(POCL_RT_PATH)/include LDFLAGS += -L$(POCL_RT_PATH)/lib -L$(VORTEX_DRV_PATH)/stub -lOpenCL -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = sfilter SRCS = main.cc diff --git a/tests/opencl/sgemm/Makefile b/tests/opencl/sgemm/Makefile index 64c3b818..2739742c 100644 --- a/tests/opencl/sgemm/Makefile +++ b/tests/opencl/sgemm/Makefile @@ -13,8 +13,7 @@ K_LLCFLAGS += "-O3 -march=riscv32 -target-abi=ilp32f -mcpu=generic-rv32 -mattr=+ K_CFLAGS += "-v -O3 --sysroot=$(SYSROOT) --gcc-toolchain=$(RISCV_TOOLCHAIN_PATH) -march=rv32imf -mabi=ilp32f -Xclang -target-feature -Xclang +vortex -I$(VORTEX_RT_PATH)/include -fno-rtti -fno-exceptions -ffreestanding -nostartfiles -fdata-sections -ffunction-sections" K_LDFLAGS += "-Wl,-Bstatic,-T$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-sections $(VORTEX_RT_PATH)/libvortexrt.a -lm" -CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -Wfatal-errors -#CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -Wfatal-errors CXXFLAGS += -Wno-deprecated-declarations -Wno-unused-parameter -Wno-narrowing @@ -22,6 +21,13 @@ CXXFLAGS += -I$(POCL_RT_PATH)/include LDFLAGS += -L$(POCL_RT_PATH)/lib -L$(VORTEX_DRV_PATH)/stub -lOpenCL -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = sgemm SRCS = main.cc diff --git a/tests/opencl/transpose/Makefile b/tests/opencl/transpose/Makefile index 008e69bc..7a5845d7 100644 --- a/tests/opencl/transpose/Makefile +++ b/tests/opencl/transpose/Makefile @@ -11,13 +11,19 @@ K_LLCFLAGS += "-O3 -march=riscv32 -target-abi=ilp32f -mcpu=generic-rv32 -mattr=+ K_CFLAGS += "-v -O3 --sysroot=$(SYSROOT) --gcc-toolchain=$(RISCV_TOOLCHAIN_PATH) -march=rv32imf -mabi=ilp32f -Xclang -target-feature -Xclang +vortex -I$(VORTEX_RT_PATH)/include -fno-rtti -fno-exceptions -ffreestanding -nostartfiles -fdata-sections -ffunction-sections" K_LDFLAGS += "-Wl,-Bstatic,-T$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-sections $(VORTEX_RT_PATH)/libvortexrt.a -lm" -CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -pedantic -Wfatal-errors -#CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors CXXFLAGS += -I$(POCL_RT_PATH)/include LDFLAGS += -L$(POCL_RT_PATH)/lib -L$(VORTEX_DRV_PATH)/stub -lOpenCL -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = transpose SRCS = main.cc transpose_gold.cpp diff --git a/tests/opencl/vecadd/Makefile b/tests/opencl/vecadd/Makefile index 76db3f46..cdd8e5dd 100644 --- a/tests/opencl/vecadd/Makefile +++ b/tests/opencl/vecadd/Makefile @@ -13,8 +13,7 @@ K_LLCFLAGS += "-O3 -march=riscv32 -target-abi=ilp32f -mcpu=generic-rv32 -mattr=+ K_CFLAGS += "-v -O3 --sysroot=$(SYSROOT) --gcc-toolchain=$(RISCV_TOOLCHAIN_PATH) -march=rv32imf -mabi=ilp32f -Xclang -target-feature -Xclang +vortex -I$(VORTEX_RT_PATH)/include -fno-rtti -fno-exceptions -ffreestanding -nostartfiles -fdata-sections -ffunction-sections" K_LDFLAGS += "-Wl,-Bstatic,-T$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-sections $(VORTEX_RT_PATH)/libvortexrt.a -lm" -CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -Wfatal-errors -#CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -Wfatal-errors CXXFLAGS += -Wno-deprecated-declarations -Wno-unused-parameter -Wno-narrowing @@ -22,6 +21,13 @@ CXXFLAGS += -I$(POCL_RT_PATH)/include LDFLAGS += -L$(POCL_RT_PATH)/lib -L$(VORTEX_DRV_PATH)/stub -lOpenCL -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = vecadd SRCS = main.cc diff --git a/tests/regression/basic/Makefile b/tests/regression/basic/Makefile index dcf85e2d..1697fa08 100644 --- a/tests/regression/basic/Makefile +++ b/tests/regression/basic/Makefile @@ -16,13 +16,19 @@ VX_LDFLAGS += -Wl,-Bstatic,-T,$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-secti VX_SRCS = kernel.c -#CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -pedantic -Wfatal-errors -CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors CXXFLAGS += -I$(VORTEX_DRV_PATH)/include LDFLAGS += -L$(VORTEX_DRV_PATH)/stub -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = basic SRCS = main.cpp diff --git a/tests/regression/demo/Makefile b/tests/regression/demo/Makefile index 798f5780..5342fd07 100644 --- a/tests/regression/demo/Makefile +++ b/tests/regression/demo/Makefile @@ -16,13 +16,19 @@ VX_LDFLAGS += -Wl,-Bstatic,-T,$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-secti VX_SRCS = kernel.c -#CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -pedantic -Wfatal-errors -CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors CXXFLAGS += -I$(VORTEX_DRV_PATH)/include LDFLAGS += -L$(VORTEX_DRV_PATH)/stub -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = demo SRCS = main.cpp diff --git a/tests/regression/diverge/Makefile b/tests/regression/diverge/Makefile index 679847af..5f0bb74e 100644 --- a/tests/regression/diverge/Makefile +++ b/tests/regression/diverge/Makefile @@ -16,13 +16,19 @@ VX_LDFLAGS += -Wl,-Bstatic,-T,$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-secti VX_SRCS = kernel.c -#CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -pedantic -Wfatal-errors -CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors CXXFLAGS += -I$(VORTEX_DRV_PATH)/include LDFLAGS += -L$(VORTEX_DRV_PATH)/stub -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = diverge SRCS = main.cpp diff --git a/tests/regression/dogfood/Makefile b/tests/regression/dogfood/Makefile index 61113c7e..6b2d0c62 100644 --- a/tests/regression/dogfood/Makefile +++ b/tests/regression/dogfood/Makefile @@ -18,13 +18,19 @@ VX_LDFLAGS += -lm VX_SRCS = kernel.c -#CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -pedantic -Wfatal-errors -CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors CXXFLAGS += -I$(VORTEX_DRV_PATH)/include -I$(VORTEX_RT_PATH)/../hw LDFLAGS += -L$(VORTEX_DRV_PATH)/stub -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = dogfood SRCS = main.cpp diff --git a/tests/regression/fence/Makefile b/tests/regression/fence/Makefile index 3491cb99..4f9cf2e6 100644 --- a/tests/regression/fence/Makefile +++ b/tests/regression/fence/Makefile @@ -16,13 +16,19 @@ VX_LDFLAGS += -Wl,-Bstatic,-T,$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-secti VX_SRCS = kernel.c -#CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -pedantic -Wfatal-errors -CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors CXXFLAGS += -I$(VORTEX_DRV_PATH)/include LDFLAGS += -L$(VORTEX_DRV_PATH)/stub -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = fence SRCS = main.cpp diff --git a/tests/regression/io_addr/Makefile b/tests/regression/io_addr/Makefile index 80f62fc6..8e8e7226 100644 --- a/tests/regression/io_addr/Makefile +++ b/tests/regression/io_addr/Makefile @@ -16,13 +16,19 @@ VX_LDFLAGS += -Wl,-Bstatic,-T,$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-secti VX_SRCS = kernel.c -#CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -pedantic -Wfatal-errors -CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors CXXFLAGS += -I$(VORTEX_DRV_PATH)/include -I../../../hw LDFLAGS += -L$(VORTEX_DRV_PATH)/stub -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = io_addr SRCS = main.cpp diff --git a/tests/regression/mstress/Makefile b/tests/regression/mstress/Makefile index 024967de..a0ebb0c8 100644 --- a/tests/regression/mstress/Makefile +++ b/tests/regression/mstress/Makefile @@ -16,13 +16,19 @@ VX_LDFLAGS += -Wl,-Bstatic,-T,$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-secti VX_SRCS = kernel.c -#CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -pedantic -Wfatal-errors -CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors CXXFLAGS += -I$(VORTEX_DRV_PATH)/include LDFLAGS += -L$(VORTEX_DRV_PATH)/stub -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = mstress SRCS = main.cpp diff --git a/tests/regression/no_mf_ext/Makefile b/tests/regression/no_mf_ext/Makefile index 99384023..ba7fafe4 100644 --- a/tests/regression/no_mf_ext/Makefile +++ b/tests/regression/no_mf_ext/Makefile @@ -16,13 +16,19 @@ VX_LDFLAGS += -Wl,-Bstatic,-T,$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-secti VX_SRCS = kernel.c -#CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -pedantic -Wfatal-errors -CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors CXXFLAGS += -I$(VORTEX_DRV_PATH)/include LDFLAGS += -L$(VORTEX_DRV_PATH)/stub -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = no_mf_ext SRCS = main.cpp diff --git a/tests/regression/no_smem/Makefile b/tests/regression/no_smem/Makefile index de5a4f78..598c11e9 100644 --- a/tests/regression/no_smem/Makefile +++ b/tests/regression/no_smem/Makefile @@ -18,13 +18,19 @@ VX_RUNTIME = $(VORTEX_RT_PATH)/src/vx_start.S $(VORTEX_RT_PATH)/src/vx_perf.c VX_SRCS = kernel.c $(VX_RUNTIME) -#CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -pedantic -Wfatal-errors -CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors CXXFLAGS += -I$(VORTEX_DRV_PATH)/include LDFLAGS += -L$(VORTEX_DRV_PATH)/stub -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = no_smem SRCS = main.cpp diff --git a/tests/regression/prefetch/Makefile b/tests/regression/prefetch/Makefile index af58821c..011b1bac 100644 --- a/tests/regression/prefetch/Makefile +++ b/tests/regression/prefetch/Makefile @@ -16,13 +16,19 @@ VX_LDFLAGS += -Wl,-Bstatic,-T,$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-secti VX_SRCS = kernel.c -#CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -pedantic -Wfatal-errors -CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors CXXFLAGS += -I$(VORTEX_DRV_PATH)/include LDFLAGS += -L$(VORTEX_DRV_PATH)/stub -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = prefetch SRCS = main.cpp diff --git a/tests/regression/printf/Makefile b/tests/regression/printf/Makefile index a7aeb266..01d6a422 100644 --- a/tests/regression/printf/Makefile +++ b/tests/regression/printf/Makefile @@ -16,13 +16,19 @@ VX_LDFLAGS += -Wl,-Bstatic,-T,$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-secti VX_SRCS = kernel.c -#CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -pedantic -Wfatal-errors -CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors CXXFLAGS += -I$(VORTEX_DRV_PATH)/include LDFLAGS += -L$(VORTEX_DRV_PATH)/stub -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = printf SRCS = main.cpp diff --git a/tests/regression/sort/Makefile b/tests/regression/sort/Makefile index dfb7db47..162e49bf 100644 --- a/tests/regression/sort/Makefile +++ b/tests/regression/sort/Makefile @@ -24,13 +24,19 @@ VX_DPFLAGS = -arch=riscv32 -mcpu=generic-rv32 -mattr=+m,+f -mattr=+vortex VX_SRCS = kernel.c -#CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -pedantic -Wfatal-errors -CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wfatal-errors CXXFLAGS += -I$(VORTEX_DRV_PATH)/include LDFLAGS += -L$(VORTEX_DRV_PATH)/stub -lvortex +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = sort SRCS = main.cpp diff --git a/tests/regression/tex/Makefile b/tests/regression/tex/Makefile index ff38c514..298328f9 100644 --- a/tests/regression/tex/Makefile +++ b/tests/regression/tex/Makefile @@ -16,13 +16,19 @@ VX_LDFLAGS += -Wl,-Bstatic,-T,$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-secti VX_SRCS = kernel.c -#CXXFLAGS += -std=c++11 -O2 -Wall -Wextra -Wfatal-errors -CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -Wfatal-errors +CXXFLAGS += -std=c++11 -Wall -Wextra -Wfatal-errors CXXFLAGS += -I$(VORTEX_DRV_PATH)/include -I$(VORTEX_RT_PATH)/../hw -I$(VORTEX_RT_PATH)/../sim/common -I$(VORTEX_RT_PATH)/../third_party LDFLAGS += -L$(VORTEX_DRV_PATH)/stub -lvortex $(VORTEX_RT_PATH)/../third_party/cocogfx/libcocogfx.a -lz +# Debugigng +ifdef DEBUG + CXXFLAGS += -g -O0 +else + CXXFLAGS += -O2 -DNDEBUG +endif + PROJECT = tex SRCS = main.cpp utils.cpp