Skip to content

Commit

Permalink
XCore target: Add target specific flags to root Makefiles.
Browse files Browse the repository at this point in the history
The default value of XCORE_TARGET_NEEDS_MEMORY is 32 (MB).
It should be noted that the XCore emulator's speed is affected by the size of memory.
Also the amount of host memory required is several times XCore-image memory size.
Thus running several large xcore-images in parallel may result in thrashing!
The default of 32 will require ~300MB of host memory.

As Makefile.config.in is included multiple times (viz: include $(LEVEL)/Makefile.config),
the addition of XCORE_TARGET_FLAGS to X_TARGET_FLAGS is done in Makefile.test

RUNTIMELIMIT is set to a default of 1 hour for the XCore emulator.
Test that take around or more than 1 hour to run have their RUNTIMELIMIT extended.

llvm-svn: 208667
  • Loading branch information
Robert Lytton committed May 13, 2014
1 parent afb609b commit 2614032
Show file tree
Hide file tree
Showing 51 changed files with 264 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Makefile.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,17 @@ ifeq ($(ARCH),THUMB)
TEST_TARGET_FLAGS += -mthumb
endif

ifeq ($(ARCH),XCore)
ifndef XCORE_TARGET_NEEDS_MEMORY
# The default memory for all tests is 32MB (rather than the usual default of 64K).
# (32MB target memory requires ~300MB of host memory)
XCORE_TARGET_NEEDS_MEMORY := 32
endif
XCORE_TARGET_FLAGS := --target=xcore -fcommon -fexceptions -mcmodel=large
XCORE_TARGET_FLAGS += -Wl,-target=XS1-L1,-Xmapper,--defsymbol,-Xmapper,CmdLineWords=400
XCORE_TARGET_FLAGS += -Wl,-Xmapper,--image-size,-Xmapper,$$(($(XCORE_TARGET_NEEDS_MEMORY) * 0x100000)),-Xmapper,--image-base,-Xmapper,$$(($(XCORE_TARGET_NEEDS_MEMORY) * 0x100000))
endif

# PowerPC/Linux needs -ffp-contract=off so that:
# The outputs can be compared to gcc.
# The outputs match the reference outputs.
Expand Down
5 changes: 5 additions & 0 deletions Makefile.programs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,13 @@ DIFFPROG := $(PROGDIR)/DiffOutput.sh "$(FPCMP) $(TOLERANCEOPT)"
# timeout. This is overridable on the commandline or in tests makefiles.
#
ifndef RUNTIMELIMIT
ifeq ($(ARCH),XCore)
# 1 hours
RUNTIMELIMIT := 3600
else
RUNTIMELIMIT := 500
endif
endif

# If the program specified a REFERENCE_OUTPUT_FILE, they obviously want to
# USE_REFERENCE_OUTPUT.
Expand Down
4 changes: 4 additions & 0 deletions Makefile.tests
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ include ${LEVEL}/Makefile.common
# TARGET_FLAGS in the TEST.* makefiles doesn't work out.
X_TARGET_FLAGS = $(TARGET_FLAGS) $(TEST_TARGET_FLAGS)

ifeq ($(ARCH),XCore)
X_TARGET_FLAGS += $(XCORE_TARGET_FLAGS)
endif

STATS = -stats -time-passes

.PHONY: clean default
Expand Down
4 changes: 4 additions & 0 deletions MultiSource/Applications/JM/ldecod/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ LDFLAGS = -lm $(TOOLLINKOPTS)

RUN_OPTIONS = -i $(PROJ_SRC_DIR)/data/test.264 -o Output/test_dec.yuv -r $(PROJ_SRC_DIR)/data/test_rec.yuv

ifeq ($(ARCH),XCore)
XCORE_TARGET_NEEDS_MEMORY := 64
endif

include ../../../Makefile.multisrc

clean::
Expand Down
5 changes: 4 additions & 1 deletion MultiSource/Applications/lua/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ Source = lapi.c lcode.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c lmem.c\
loslib.c ltablib.c lstrlib.c loadlib.c linit.c lua.c

LDFLAGS += -lm
ifneq ($(ARCH),XCore)

ifeq ($(ARCH),XCore)
XCORE_TARGET_NEEDS_MEMORY := 128
else
CPPFLAGS += -DLUA_USE_POSIX
endif

Expand Down
3 changes: 3 additions & 0 deletions MultiSource/Applications/minisat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ RUN_OPTIONS = -verbosity=0 $(PROJ_SRC_DIR)/small.cnf
else
ifdef LARGE_PROBLEM_SIZE
RUN_OPTIONS = -verbosity=0 $(PROJ_SRC_DIR)/long.cnf
ifeq ($(ARCH),XCore)
XCORE_TARGET_NEEDS_MEMORY := 64
endif
else
RUN_OPTIONS = -verbosity=0 $(PROJ_SRC_DIR)/short.cnf
endif
Expand Down
6 changes: 6 additions & 0 deletions MultiSource/Applications/spiff/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,11 @@ RUN_OPTIONS = $(PROJ_SRC_DIR)/Sample.3 $(PROJ_SRC_DIR)/Sample.4
#RUN_OPTIONS = ./one ./two
# you get the idea...

ifeq ($(ARCH),XCore)
ifndef SMALL_PROBLEM_SIZE
XCORE_TARGET_NEEDS_MEMORY = 1024
endif
endif

include ../../Makefile.multisrc

3 changes: 3 additions & 0 deletions MultiSource/Benchmarks/ASCI_Purple/SMG2000/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ ifdef SMALL_PROBLEM_SIZE
RUN_OPTIONS ="-n 30 15 30 -c 0.1 1.0 10.0"
else
RUN_OPTIONS ="-n 100 40 100 -c 0.1 1.0 10.0"
ifeq ($(ARCH),XCore)
XCORE_TARGET_NEEDS_MEMORY := 256
endif
endif

include ../../../Makefile.multisrc
7 changes: 7 additions & 0 deletions MultiSource/Benchmarks/ASC_Sequoia/AMGmk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,11 @@ PROG = AMGmk
LIBS += -lm
LDFLAGS += -lm

ifeq ($(ARCH),XCore)
ifndef SMALL_PROBLEM_SIZE
# XCore takes over 1 hour.
RUNTIMELIMIT:=7200
endif
endif

include ../../../Makefile.multisrc
7 changes: 7 additions & 0 deletions MultiSource/Benchmarks/ASC_Sequoia/CrystalMk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,11 @@ PROG = CrystalMk
LIBS += -lm
LDFLAGS += -lm

ifeq ($(ARCH),XCore)
ifndef SMALL_PROBLEM_SIZE
# XCore takes ~1 hour.
RUNTIMELIMIT:=7200
endif
endif

include ../../../Makefile.multisrc
5 changes: 5 additions & 0 deletions MultiSource/Benchmarks/Bullet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ PROG = bullet
CPPFLAGS += -I$(PROJ_SRC_DIR)/include -DNO_TIME
LDFLAGS = -lstdc++ -lm

ifeq ($(ARCH),XCore)
# Use default RUNTIMELIMIT for the XCore.
XCORE_TARGET_NEEDS_MEMORY := 64
else
# This test can take more than the default 500s timeout on Thumb1
RUNTIMELIMIT:=1000
endif

include $(LEVEL)/Makefile.config

Expand Down
4 changes: 4 additions & 0 deletions MultiSource/Benchmarks/Fhourstones-3.1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ else
STDIN_FILENAME = $(PROJ_SRC_DIR)/inputs
endif

ifeq ($(ARCH),XCore)
XCORE_TARGET_NEEDS_MEMORY := 64
endif

include ../../Makefile.multisrc
4 changes: 4 additions & 0 deletions MultiSource/Benchmarks/NPB-serial/is/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ LDFLAGS =

ifdef SMALL_PROBLEM_SIZE
CPPFLAGS = -DSMALL_PROBLEM_SIZE
else
ifeq ($(ARCH),XCore)
XCORE_TARGET_NEEDS_MEMORY := 512
endif
endif

include $(LEVEL)/MultiSource/Makefile.multisrc
Expand Down
3 changes: 3 additions & 0 deletions MultiSource/Benchmarks/Olden/health/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ ifdef SMALL_PROBLEM_SIZE
RUN_OPTIONS = 8 15 1
else
RUN_OPTIONS = 9 20 1
ifeq ($(ARCH),XCore)
XCORE_TARGET_NEEDS_MEMORY := 64
endif
endif
endif

Expand Down
3 changes: 3 additions & 0 deletions MultiSource/Benchmarks/Olden/perimeter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ ifdef SMALL_PROBLEM_SIZE
RUN_OPTIONS = 9
else
RUN_OPTIONS = 10
ifeq ($(ARCH),XCore)
XCORE_TARGET_NEEDS_MEMORY := 64
endif
endif
endif

Expand Down
3 changes: 3 additions & 0 deletions MultiSource/Benchmarks/Olden/treeadd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ ifdef SMALL_PROBLEM_SIZE
RUN_OPTIONS = 20
else
RUN_OPTIONS = 22
ifeq ($(ARCH),XCore)
XCORE_TARGET_NEEDS_MEMORY := 128
endif
endif

include $(LEVEL)/MultiSource/Makefile.multisrc
Expand Down
3 changes: 3 additions & 0 deletions MultiSource/Benchmarks/Olden/tsp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ ifdef SMALL_PROBLEM_SIZE
RUN_OPTIONS = 102400
else
RUN_OPTIONS = 1024000
ifeq ($(ARCH),XCore)
XCORE_TARGET_NEEDS_MEMORY := 64
endif
endif
endif

Expand Down
3 changes: 3 additions & 0 deletions MultiSource/Benchmarks/Olden/voronoi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ ifdef SMALL_PROBLEM_SIZE
RUN_OPTIONS = 10000 20 32 7
else
RUN_OPTIONS = 100000 20 32 7
ifeq ($(ARCH),XCore)
XCORE_TARGET_NEEDS_MEMORY := 64
endif
endif
endif
HASH_PROGRAM_OUTPUT = 1
Expand Down
8 changes: 8 additions & 0 deletions MultiSource/Benchmarks/SciMark2-C/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@ PROG = scimark2
CPPFLAGS =
LDFLAGS = -lm

ifeq ($(ARCH),XCore)
ifndef SMALL_PROBLEM_SIZE
# XCore target takes over 9hours to complete a medium sized problem.
RUNTIMELIMIT := 50000
# Ignore 'LARGE_PROBLEM_SIZE' requests
endif
else
ifdef LARGE_PROBLEM_SIZE
RUN_OPTIONS = -large
endif
endif

include ../../Makefile.multisrc
6 changes: 6 additions & 0 deletions MultiSource/Benchmarks/TSVC/ControlFlow-dbl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ PROG = ControlFlow-dbl
LDFLAGS = -lm
CFLAGS += -std=gnu99
RUN_OPTIONS = 2325 14

ifeq ($(ARCH),XCore)
# XCore takes ~1 hour.
RUNTIMELIMIT:=7200
endif

include $(LEVEL)/MultiSource/Makefile.multisrc

6 changes: 6 additions & 0 deletions MultiSource/Benchmarks/TSVC/ControlLoops-dbl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ PROG = ControlLoops-dbl
LDFLAGS = -lm
CFLAGS += -std=gnu99
RUN_OPTIONS = 1640 14

ifeq ($(ARCH),XCore)
# XCore takes ~1 hour.
RUNTIMELIMIT:=7200
endif

include $(LEVEL)/MultiSource/Makefile.multisrc

6 changes: 6 additions & 0 deletions MultiSource/Benchmarks/TSVC/Expansion-dbl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ PROG = Expansion-dbl
LDFLAGS = -lm
CFLAGS += -std=gnu99
RUN_OPTIONS = 4160 14

ifeq ($(ARCH),XCore)
# XCore takes ~1 hour.
RUNTIMELIMIT:=7200
endif

include $(LEVEL)/MultiSource/Makefile.multisrc

6 changes: 6 additions & 0 deletions MultiSource/Benchmarks/TSVC/GlobalDataFlow-dbl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ PROG = GlobalDataFlow-dbl
LDFLAGS = -lm
CFLAGS += -std=gnu99
RUN_OPTIONS = 3450 14

ifeq ($(ARCH),XCore)
# XCore takes ~1 hour.
RUNTIMELIMIT:=7200
endif

include $(LEVEL)/MultiSource/Makefile.multisrc

6 changes: 6 additions & 0 deletions MultiSource/Benchmarks/TSVC/InductionVariable-dbl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ PROG = InductionVariable-dbl
LDFLAGS = -lm
CFLAGS += -std=gnu99
RUN_OPTIONS = 9100 14

ifeq ($(ARCH),XCore)
# XCore takes ~1 hour.
RUNTIMELIMIT:=7200
endif

include $(LEVEL)/MultiSource/Makefile.multisrc

6 changes: 6 additions & 0 deletions MultiSource/Benchmarks/TSVC/LinearDependence-dbl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ PROG = LinearDependence-dbl
LDFLAGS = -lm
CFLAGS += -std=gnu99
RUN_OPTIONS = 3570 14

ifeq ($(ARCH),XCore)
# XCore takes ~1 hour.
RUNTIMELIMIT:=7200
endif

include $(LEVEL)/MultiSource/Makefile.multisrc

6 changes: 6 additions & 0 deletions MultiSource/Benchmarks/TSVC/LoopRerolling-dbl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ PROG = LoopRerolling-dbl
LDFLAGS = -lm
CFLAGS += -std=gnu99
RUN_OPTIONS = 5260 14

ifeq ($(ARCH),XCore)
# XCore takes ~1 hour.
RUNTIMELIMIT:=7200
endif

include $(LEVEL)/MultiSource/Makefile.multisrc

6 changes: 6 additions & 0 deletions MultiSource/Benchmarks/TSVC/NodeSplitting-dbl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ PROG = NodeSplitting-dbl
LDFLAGS = -lm
CFLAGS += -std=gnu99
RUN_OPTIONS = 10000 14

ifeq ($(ARCH),XCore)
# XCore takes ~1 hour.
RUNTIMELIMIT:=7200
endif

include $(LEVEL)/MultiSource/Makefile.multisrc

6 changes: 6 additions & 0 deletions MultiSource/Benchmarks/TSVC/NodeSplitting-flt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ PROG = NodeSplitting-flt
LDFLAGS = -lm
CFLAGS += -std=gnu99
RUN_OPTIONS = 10000 5

ifeq ($(ARCH),XCore)
# XCore takes ~1 hour.
RUNTIMELIMIT:=7200
endif

include $(LEVEL)/MultiSource/Makefile.multisrc

6 changes: 6 additions & 0 deletions MultiSource/Benchmarks/TSVC/StatementReordering-dbl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ PROG = StatementReordering-dbl
LDFLAGS = -lm
CFLAGS += -std=gnu99
RUN_OPTIONS = 20000 14

ifeq ($(ARCH),XCore)
# XCore takes ~1 hour.
RUNTIMELIMIT:=7200
endif

include $(LEVEL)/MultiSource/Makefile.multisrc

3 changes: 3 additions & 0 deletions MultiSource/Benchmarks/Trimaran/netbench-crc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ ifdef SMALL_PROBLEM_SIZE
RUN_OPTIONS = 1000
else
RUN_OPTIONS = 12000
ifeq ($(ARCH),XCore)
XCORE_TARGET_NEEDS_MEMORY := 256
endif
endif
endif

Expand Down
7 changes: 7 additions & 0 deletions MultiSource/Benchmarks/mafft/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ STDIN_FILENAME = $(PROJ_SRC_DIR)/pyruvate_decarboxylase.fasta
LDFLAGS = -lm
FP_TOLERANCE = 0.00001
HASH_PROGRAM_OUTPUT = 1

ifeq ($(ARCH),XCore)
XCORE_TARGET_NEEDS_MEMORY := 256
# XCore takes ~2 hours.
RUNTIMELIMIT:=10800
endif

include $(LEVEL)/MultiSource/Makefile.multisrc

clean::
Expand Down
5 changes: 5 additions & 0 deletions MultiSource/Benchmarks/nbench/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ LDFLAGS =

include ../../Makefile.multisrc

ifeq ($(ARCH),XCore)
# XCore takes ~1 hour.
RUNTIMELIMIT:=7200
else
# This test can take more than the default 500s timeout at -O0.
RUNTIMELIMIT:=750
endif

# Always copy NNET.DAT so it's available with SRCDIR != OBJDIR builds.
# FIXME: Hack
Expand Down
8 changes: 8 additions & 0 deletions SingleSource/Benchmarks/CoyoteBench/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
LEVEL = ../../..
LDFLAGS += -lm -lstdc++

ifeq ($(ARCH),XCore)
ifndef SMALL_PROBLEM_SIZE
XCORE_TARGET_NEEDS_MEMORY := 128
# XCore takes ~1.25 hour.
RUNTIMELIMIT:=7200
endif
endif

include $(LEVEL)/SingleSource/Makefile.singlesrc

Loading

0 comments on commit 2614032

Please sign in to comment.