Rename parsec to parsec_benchmark

This commit is contained in:
Ciro Santilli
2018-03-03 16:36:24 +00:00
parent 1b6ab61426
commit ad3c48dfee
10 changed files with 295 additions and 83 deletions

View File

@@ -1,16 +1,29 @@
config BR2_PACKAGE_PARSEC
bool "PARSEC"
config BR2_PACKAGE_PARSEC_BENCHMARK
bool "PARSEC_BENCHMARK"
# Parsec shell scripts use a hardcoded /bin/bash
# One option would be to try and use /bin/sh.
# But symlinking fails because of BusyBox' symlink mechanism.
# The other option would be to patch Parsec to use /bin/sh and be POSIX compliant.
# But let's take the path of smallest resistance for now.
select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
select BR2_PACKAGE_BASH
help
Parsec system benchmark.
http://parsec.cs.princeton.edu/
if BR2_PACKAGE_PARSEC
if BR2_PACKAGE_PARSEC_BENCHMARK
config BR2_PACKAGE_PARSEC_BUILD_LIST
config BR2_PACKAGE_PARSEC_BENCHMARK_BUILD_LIST
string "build_list"
default all
default splash2x
help
Space separated list of parsec packages to build.
config BR2_PACKAGE_PARSEC_BENCHMARK_INPUT_SIZE
string "input_size"
default test
help
Which input size to generate on the host for the guest.
endif

View File

@@ -1 +1 @@
name: PARSEC
name: PARSEC_BENCHMARK

View File

@@ -1,23 +1,54 @@
################################################################################
#
# PARSEC
# PARSEC_BENCHMARK
#
################################################################################
PARSEC_VERSION = master
PARSEC_SITE = git@github.com:cirosantilli/parsec-benchmark.git
PARSEC_SITE_METHOD = git
PARSEC_BENCHMARK_VERSION = master
PARSEC_BENCHMARK_SITE = git@github.com:cirosantilli/parsec-benchmark.git
PARSEC_BENCHMARK_SITE_METHOD = git
define PARSEC_BUILD_CMDS
cd $(@D) && . env.sh && for pkg in $(BR2_PACKAGE_PARSEC_BUILD_LIST); do parsecmgmt -a build -p $$pkg; done
#cd '$(@D)/gem5/util/m5' && $(MAKE) -f 'Makefile.$(ARCH_MAKE)' CC='$(TARGET_CC)' LD='$(TARGET_LD)'
define PARSEC_BENCHMARK_BUILD_CMDS
# TODO make this nicer, only untar when extract step is done.
# EXTRACT_CMDS and EXTRA_DOWNLOADS would be good candidates,
# but they don't run with OVERRIDE_SRCDIR.
'$(PARSEC_BENCHMARK_PKGDIR)/parsec-benchmark/get-inputs' $(if $(filter $(V),1),-v,) '$(DL_DIR)' '$(@D)/'
# We run the benchmarks with the wrong arch here to generate the inputs on the host.
# This is because on gem5 this takes too long to do.
cd $(@D) && . env.sh && for pkg in $(BR2_PACKAGE_PARSEC_BENCHMARK_BUILD_LIST); do \
export HOSTCC='$(HOSTCC)'; \
export M4='$(HOST_DIR)/usr/bin/m4'; \
export MAKE='$(MAKE)'; \
export OSTYPE=linux; \
export TARGET_CROSS='$(TARGET_CROSS)'; \
export HOSTTYPE='$(BR2_ARCH)'; \
parsecmgmt -a build -p $$pkg; \
parsecmgmt -a run -p $$pkg -i $(BR2_PACKAGE_PARSEC_BENCHMARK_INPUT_SIZE); \
done
endef
define PARSEC_INSTALL_TARGET_CMDS
# This is a bit coarse and makes the image huge with useless source code,
# and input files, but I don't feel like creating per-package installs.
# And it doesn't matter much for simulators anyways.
rsync -av '$(@D)/' '$(TARGET_DIR)/parsec'
define PARSEC_BENCHMARK_INSTALL_TARGET_CMDS
# This is a bit coarse and makes the image larger with useless source code.
#
# But according to du, the source accounts for only 1/5 of the total size,
# so benchmarks dominate, and it doesn't matter much.
#
# Also it is not so critical for simulators anyways unlike real embedded systems.
#
# One possibility to make this better may be to install only the 'inst/' and 'input/'
# folders for each package + toplevel '/bin/' and '/config/', but of course we won't
# know if this works until time consuming testing is done :-)
mkdir -p '$(TARGET_DIR)/parsec/'
rsync -am $(if $(filter $(V),1),-v,) --include '*/' \
--include '/bin/***' \
--include '/config/***' \
--include '/env.sh' \
--include 'inst/***' \
--include 'run/***' \
--exclude '*' '$(@D)/' '$(TARGET_DIR)/parsec/' \
;
# rsync finished.
endef
$(eval $(generic-package))