3-phase PV router
Loading...
Searching...
No Matches
test_main.cpp File Reference

Performance benchmarks for FastDivision. More...

#include <Arduino.h>
#include <unity.h>
#include "../bench_report.h"
#include "../bench_timer.h"
#include "../halt_after_tests.h"
#include "FastDivision.h"
#include "FastDivision.cpp"
Include dependency graph for test_main.cpp:

Go to the source code of this file.

Functions

void loop ()
 
void reportBenchmark (const char *name, uint32_t fastTime, uint32_t stdTime)
 Reports benchmark results to Serial.
 
void setUp (void)
 
void setup ()
 
void tearDown (void)
 
void test_perf_cycle_estimation (void)
 
void test_perf_divmod10_large_values (void)
 
void test_perf_divmod10_small_values (void)
 
void test_perf_divu10_large_values (void)
 
void test_perf_divu10_medium_values (void)
 
void test_perf_divu10_small_values (void)
 
void test_perf_summary (void)
 

Variables

constexpr uint32_t ITERATIONS = 10000UL
 
volatile uint16_t v_result16
 
volatile uint32_t v_result32
 
volatile uint8_t v_result8
 

Detailed Description

Performance benchmarks for FastDivision.

Measures execution time of AVR assembly fast division functions compared to standard C division operators.

Runs in CI in the simavr simulator (uno_sim environment): simavr is cycle-accurate, so the timings are exact and the same from run to run. On a connected board: pio test -e uno -f "*test_fastdivision_perf*"

Every result is also printed as a BENCH line (bench_report.h), for the CI benchmark history.

Definition in file test_main.cpp.

Function Documentation

◆ loop()

void loop ( )

Definition at line 329 of file test_main.cpp.

Here is the call graph for this function:

◆ reportBenchmark()

void reportBenchmark ( const char * name,
uint32_t fastTime,
uint32_t stdTime )

Reports benchmark results to Serial.

Definition at line 49 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setUp()

void setUp ( void )

Definition at line 34 of file test_main.cpp.

◆ setup()

void setup ( )

Definition at line 315 of file test_main.cpp.

◆ tearDown()

void tearDown ( void )

Definition at line 38 of file test_main.cpp.

◆ test_perf_cycle_estimation()

void test_perf_cycle_estimation ( void )

Definition at line 241 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_perf_divmod10_large_values()

void test_perf_divmod10_large_values ( void )

Definition at line 202 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_perf_divmod10_small_values()

void test_perf_divmod10_small_values ( void )

Definition at line 167 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_perf_divu10_large_values()

void test_perf_divu10_large_values ( void )

Definition at line 133 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_perf_divu10_medium_values()

void test_perf_divu10_medium_values ( void )

Definition at line 103 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_perf_divu10_small_values()

void test_perf_divu10_small_values ( void )

Definition at line 72 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_perf_summary()

void test_perf_summary ( void )

Definition at line 289 of file test_main.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ ITERATIONS

uint32_t ITERATIONS = 10000UL
constexpr

Definition at line 27 of file test_main.cpp.

◆ v_result16

volatile uint16_t v_result16

Definition at line 30 of file test_main.cpp.

◆ v_result32

volatile uint32_t v_result32

Definition at line 31 of file test_main.cpp.

◆ v_result8

volatile uint8_t v_result8

Definition at line 32 of file test_main.cpp.