Add generic dejagnu support for running benchmarks.

Adds a generic framework for running the benchmarks.  Have updated
the existing run.exp script (just run the benchmarks) to use the new
framework, and have added perf-stat.exp (uses the kernel perf counters
to measure instructions) and have rewritten measure.exp as
mageec-wand.exp to use the new framework.

ChangeLog:

	* beebs.test/measure.exp: Deleted.
	* beebs.test/mageec-wand.exp: New file.
	* beebs.test/perf-stat.exp: New file.
	* lib/beebs.exp: New file.
	* beebs.test/run.exp: Update to use beebs.exp support.
Use global env in mageec-wand.exp.

Need to access the global value of env in order to see the environment
variables.

ChangeLog:

	* beebs.test/mageec-wand.exp (beebs_cleanup_after_all_benchmarks):
	Pull in global env.
	(beebs_setup_before_benchmark_run): Likewise.
Restore the beebs_run_benchmark procedure.

The beebs_run_benchmark procedure was not being set to call
default_beebs_run_benchmark as it should.

ChangeLog

	* lib/beebs.exp (beebs_restore_default_procs): Restore
	beebs_run_benchmark too.
Merge remote-tracking branch 'tjteru/master' into dejagnu3
Update new dejagnu to handle newly split benchmarks.

Benchmarks are now split, so one binary per directory.  This commit
updates the dejagnu work to reflect this.

ChangeLog:

	* beebs.test/mageec-wand.exp (beebs_setup_before_benchmark_run):
	Rename to ...
	(beebs_setup_before_benchmark): ... this.
	(beebs_cleanup_after_benchmark_run): Rename to ...
	(beebs_cleanup_after_benchmark): ... this.
	(beebs_cleanup_after_benchmark_run): Update, use benchmark not
	filename to identify results.
	* beebs.test/perf-stat.exp (beebs_run_benchmark): Update
	parameters.  The filename is now a full path, use as such.  Use
	benchmark, not directory to identify results.
	* lib/beebs.exp (default_beebs_filter_benchmarks): Renamed to...
	(default_beebs_filter_benchmark): ...this. Rename parameters.
	(default_beebs_setup_before_benchmark): Add filename parameter.
	(default_beebs_cleanup_after_benchmark): Add filename parameter.
	(default_beebs_setup_before_benchmark_run): Deleted.
	(default_beebs_cleanup_after_benchmark_run): Deleted.
	(beebs_get_benchmark_files): Deleted.
	(default_beebs_announce): Remove directory parameter.
	(default_beebs_run_benchmark): Likewise.
	(beebs_run_all_benchmarks): Remove calls to deleted functions.
	Assume only one binary in each benchmark directory.  Update
	parameters on remaining calls.
	(beebs_restore_default_procs): Reorder procedures.  Update
	parameters.
Merge pull request #18 from T-J-Teru/dejagnu3

Merge in changes to support running the benchmarks using dejagnu.
Restore use of ENERGY_DATA in mageec-wand.exp.

The environment variable ENERGY_DATA used to control the placement of
the results file from the energytool script.  The last commit lost this
ability, this commit brings it back.

ChangeLog:

	* beebs.test/mageec-wand.exp (beebs_setup_before_all_benchmarks):
	Restore use of ENERGY_DATA environment variable to control path to
	output file.
Initialise variables, and turn of strict-aliasing.

A few benchmarks cause gcc to raise strict aliasing warnings, which we
ask to have reported as errors (-Werror).  For these benchmarks I've
turned off strict-aliasing, rather than try to rewrite the code to avoid
the warnings.

There's a bunch of variable initialisation added to avoid more compiler
warnings.

In one case, ludcmp, I've increased the size of a global array.  The
compiler is warning that the code might access beyond the bounds of the
array.  Without spending more time looking at the code I can't tell if
the code is wrong, or just really smart and so we know that the accesses
are all fine.  Given that the sizes involved are all very small I've
just increased the sizes of the global arrays to prevent the warnings.
This is a HACK, but if we assume the code is correct then my change has
done nothing but waste a little memory.
Update list of excluded benchmarks for atmega328p.

The EXCLUDED_BENCHMARKS list for the atmega328p chip needed a few more
benchmarks adding, these all require too much data space and so don't
link.

ChangeLog:

	* config/avr/chips/atmega328p/chip.cfg (EXCLUDED_BENCHMARKS):
	Update list.
Add __end__ symbol to arm linker scripts.

Freshly built arm cross compiler seems to require and __end__ symbol.
Add one of the linker script.

ChangeLog:

	* config/arm/chips/stm32f051/chip.ld: Add __end__ symbol.
	* config/arm/chips/stm32f100/chip.ld: Add __end__ symbol.
Standardise benchmark signature, add noinline attribute.

Add a declaration of benchmark function in common code to ensure that
everyone uses the same signature.  Add the noinline attribute to stop
the benchmark function inlining into main.
Update around 1/3 of the callers to fall into line with the benchmark
signature, the other 2/3 are already compliant.

ChangeLog:

	* include/support.h (benchmark): Add declaration with noinline
	attribute.
	* src/bubblesort/bubblesort.c (benchmark): Change signature to
	return an int, and do actually return an int.
	* src/cnt/cnt.c (benchmark): Likewise.
	* src/duff/duff.c (benchmark): Likewise.
	* src/expint/expint.c (benchmark): Likewise.
	* src/fac/fac.c (benchmark): Likewise.
	* src/fft/fft1.c (benchmark): Likewise.
	* src/fir/fir.c (benchmark): Likewise.
	* src/insertsort/insertsort.c (benchmark): Likewise.
	* src/jfdctint/jfdctint.c (benchmark): Likewise.
	* src/lms/lms.c (benchmark): Likewise.
	* src/ludcmp/ludcmp.c (benchmark): Likewise.
	* src/minver/minver.c (benchmark): Likewise.
	* src/ndes/ndes.c (benchmark): Likewise.
	* src/nettle-arcfour/arcfour.c (benchmark): Likewise.
	* src/nettle-cast128/cast128.c (benchmark): Likewise.
	* src/nettle-des/des.c (benchmark): Likewise.
	* src/nettle-md5/md5.c (benchmark): Likewise.
	* src/newlib-exp/ef_exp.c (benchmark): Likewise.
	* src/newlib-log/ef_log.c (benchmark): Likewise.
	* src/newlib-mod/ef_mod.c (benchmark): Likewise.
	* src/newlib-sqrt/ef_sqrt.c (benchmark): Likewise.
	* src/ns/ns.c (benchmark): Likewise.
	* src/picojpeg/picojpeg_test.c (benchmark): Likewise.
	* src/prime/prime.c (benchmark): Likewise.
	* src/qrduino/qrtest.c (benchmark): Likewise.
	* src/qsort/qsort.c (benchmark): Likewise.
	* src/qurt/qurt.c (benchmark): Likewise.
	* src/recursion/recursion.c (benchmark): Likewise.
	* src/select/select.c (benchmark): Likewise.
	* src/sqrt/sqrt.c (benchmark): Likewise.
	* src/st/st.c (benchmark): Likewise.
	* src/stringsearch1/stringsearch1.c (benchmark): Likewise.
	* src/template/template.c (benchmark): Likewise.
	* src/trio/trio_test.c (benchmark): Likewise.
	* src/ud/ud.c (benchmark): Likewise.
Add GPL headers to qrduino benchmark.

The original source,  https://github.com/tz1/qrduino, is GPL.

ChangeLog:

	* src/qrduino/qrtest.c: Update GPL header to correct benchmark
	name.
	* src/qrduino/ecctable.h: Add GPL header.
	* src/qrduino/qrbits.h: Add GPL header.
	* src/qrduino/qrencode.c: Add GPL header.
	* src/qrduino/qrencode.h: Add GPL header.
	* src/qrduino/qrframe.c: Add GPL header.
Added GPL headers to some of the benchmarks for the WCET set.

    * src/cnt/cnt.c: Added GPL header
    * src/compress/compress.c: Added GPL header
    * src/duff/duff.c: Added GPL header
    * src/edn/edn.c: Added GPL header
    * src/matmult/matmult.c: Added GPL header
Merge pull request #24 from jpallister/gpl_headers

Added GPL headers to some of the benchmarks for the WCET set.
Fix the pin triggering on stm32f100 chip

    * config/arm/chips/stm32f100/chipsupport.h: The pin initialisation
        was broken, not setting to output correctly.
Merge branch 'master' of github.com:mageec/beebs
Merge pull request #25 from jpallister/master

Fix pin triggering on STM32VLDISCOVERY board
Fix 'make distcheck'.

The 'make distcheck' rule is showing up two errors.  The lib/
directory (and contents) are not being included in the distribution, and
the results/ directory (created by running make check) is not being
cleaned up as part of a make distclean.  All fixed in this commit.

ChangeLog:

	* Makefile.am (EXTRA_DIST): Add lib directory.
	(distclean-local): New rule, cleanup results directory.
	* Makefile.in: Regenerate.
Improvements to BEEBS documentation.

- More appropriate email address.
- Place line break in title (it's long).
- Remove out of date comment that 'make check' doesn't work.
- Regenerate to update dates in documentation.

ChangeLog:

	* doc/texinfo.tex: Deleted.
	* doc/beebs.texi: Place line break in long title.  Update email
	address.  Remove comment about 'make check' not working.
	* doc/beebs.info: Regenerate.
	* doc/version.texi: Regenerated with recent date.
	* doc/Makefile.in: Regenerated.