diff options
| author | Petteri.Aimonen <Petteri.Aimonen@gmail.com> | 2012-02-27 16:40:45 +0000 |
|---|---|---|
| committer | Petteri.Aimonen <Petteri.Aimonen@gmail.com> | 2012-02-27 16:40:45 +0000 |
| commit | 90973e833d69a93525ef2c4eb5ab687ee13342df (patch) | |
| tree | c154fc48cca12a87b8a82f9892c53d593f5da592 /benchmarks/Makefile | |
| parent | e929442f7113dd321057293b8addd7b6e781d77f (diff) | |
| download | libfixmath-90973e833d69a93525ef2c4eb5ab687ee13342df.tar.gz | |
Benchmark suite using simulators
Diffstat (limited to 'benchmarks/Makefile')
| -rw-r--r-- | benchmarks/Makefile | 33 |
1 files changed, 33 insertions, 0 deletions
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 + + |
