blob: 488e1a742b2646d5fcbc6b41402cd96c86dc334e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# 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 interface.c ../libfixmath/fix16.c ../libfixmath/fix16_sqrt.c ../libfixmath/fix16_exp.c
CFLAGS = -std=gnu11 -I../libfixmath
.PHONY clean:
rm -f *.elf
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) \
-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
|