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/interface-arm.c | |
| parent | e929442f7113dd321057293b8addd7b6e781d77f (diff) | |
| download | libfixmath-90973e833d69a93525ef2c4eb5ab687ee13342df.tar.gz | |
Benchmark suite using simulators
Diffstat (limited to 'benchmarks/interface-arm.c')
| -rw-r--r-- | benchmarks/interface-arm.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/benchmarks/interface-arm.c b/benchmarks/interface-arm.c new file mode 100644 index 0000000..cd37979 --- /dev/null +++ b/benchmarks/interface-arm.c @@ -0,0 +1,32 @@ +#include "interface.h" +#include <stdint.h> +#include <stdio.h> + +// This targets an ARM Cortex M3 core using QEmu LM3S6965 emulation. +#define STBASE 0xE000E000 +#define STCTRL (*(volatile uint32_t*)(0x010 + STBASE)) +#define STRELOAD (*(volatile uint32_t*)(0x014 + STBASE)) +#define STCURRENT (*(volatile uint32_t*)(0x018 + STBASE)) + + +void interface_init() +{ + STRELOAD = 0x00FFFFFF; + STCTRL = 5; +} + +void start_timing() +{ + STCURRENT = 0; +} + +uint16_t end_timing() +{ + return 0x00FFFFFF - STCURRENT - 4; +} + +void print_value(const char *label, int32_t value) +{ + printf("%-20s %ld\n", label, value); +} + |
