From a18b197ac4c26a6454ed16e4727327f545a45d10 Mon Sep 17 00:00:00 2001 From: jaseg Date: Tue, 15 Aug 2017 15:57:33 +0200 Subject: Benchmark code --- fw/main.c | 14 +++++++------- fw/measure_transpose_performance.gdb | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 fw/measure_transpose_performance.gdb diff --git a/fw/main.c b/fw/main.c index 2f79954..092028b 100644 --- a/fw/main.c +++ b/fw/main.c @@ -245,12 +245,13 @@ int main(void) { RCC->CFGR |= (2<VAL = 0U; + SysTick->LOAD = 0x00FFFFFF; + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk; while (42) { - static int tick __attribute__((used)); - static int cvr __attribute__((used)); - tick = sys_time; + static unsigned int cvr __attribute__((used)); cvr = SysTick->VAL; //if (fb_op == FB_FORMAT) { transpose_data(rx_buf, write_fb); @@ -259,8 +260,7 @@ int main(void) { // while (fb_op == FB_UPDATE) // ; //} - tick = sys_time - tick; - cvr = SysTick->VAL - cvr; + cvr = cvr - SysTick->VAL; asm volatile ("bkpt"); } //LL_Init1msTick(SystemCoreClock); diff --git a/fw/measure_transpose_performance.gdb b/fw/measure_transpose_performance.gdb new file mode 100644 index 0000000..966d69f --- /dev/null +++ b/fw/measure_transpose_performance.gdb @@ -0,0 +1,17 @@ +target remote localhost:3333 +file main.elf +load +set print pretty on +set pagination off +cont +print cvr/50.0F +cont +print cvr/50.0F +cont +print cvr/50.0F +cont +print cvr/50.0F +cont +print cvr/50.0F +cont +quit -- cgit