From 90973e833d69a93525ef2c4eb5ab687ee13342df Mon Sep 17 00:00:00 2001 From: "Petteri.Aimonen" Date: Mon, 27 Feb 2012 16:40:45 +0000 Subject: Benchmark suite using simulators --- benchmarks/Makefile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 benchmarks/Makefile (limited to 'benchmarks/Makefile') diff --git a/benchmarks/Makefile b/benchmarks/Makefile new file mode 100644 index 0000000..efd450e --- /dev/null +++ b/benchmarks/Makefile @@ -0,0 +1,33 @@ +# These are testcases & benchmarks for the library on the target processors +# (currently ARM Cortex M3 and AVR). They are a bit tricky to run, as they +# depend on specific simulator versions. + +FILES = benchmark.c ../libfixmath/fix16.c ../libfixmath/fix16_sqrt.c ../libfixmath/fix16_exp.c + +CFLAGS = -DFIXMATH_NO_OVERFLOW -DFIXMATH_NO_ROUNDING -ffast-math -I../libfixmath + +testcases.c: generate_testcases.py + python $< + +benchmark-arm.elf: $(FILES) interface-arm.c testcases.c + # Note: this needs hacked QEmu that "makes no sense": + # https://bugs.launchpad.net/qemu/+bug/696094 + arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -T generic-m-hosted.ld \ + -Wall -O2 $(CFLAGS) \ + -o $@ -I .. $(FILES) interface-arm.c -lm + +run-benchmark-arm: benchmark-arm.elf + qemu-system-arm -cpu cortex-m3 -icount 0 -device armv7m_nvic \ + -nographic -monitor null -serial null \ + -semihosting -kernel $< + +benchmark-avr.elf: $(FILES) interface-avr.c testcases.c + avr-gcc -Wall -mmcu=atmega128 $(CFLAGS) \ + -Wall -O2 -DFIXMATH_OPTIMIZE_8BIT \ + -o $@ -I .. $(FILES) interface-avr.c + +run-benchmark-avr: benchmark-avr.elf + # Note: this needs simulavrxx 1.0rc0 or newer + simulavr -d atmega128 -f $< -W 0x20,- -T exit + + -- cgit v1.2.3