static void arm_cmplx_dot_prod_f32_test_render(float32_t *A, float32_t *B, uint32_t blockSize, float32_t *realResult, float32_t *imagResult) { #ifdef AVG_CYCLES int i, avg_cycles, sum = 0; unsigned int cycle_count_asm = 0; for(i=0; i<1000; i++) { /* ---------------------------------------------------------------------- ** Initialize the timer calculation. ** ------------------------------------------------------------------- */ enable_ccnt(); enable_cntens(0x80000001); /* ---------------------------------------------------------------------- ** Call the Complex Dot Product process function ** ------------------------------------------------------------------- */ arm_cmplx_dot_prod_f32(A, B, blockSize, realResult, imagResult); /* ---------------------------------------------------------------------- ** Calculate the execution time ** ------------------------------------------------------------------- */ cycle_count_asm = ccnt(); disable_ccnt(); /* copying cycles of the function called each time */ sum += cycle_count_asm; } avg_cycles = sum/1000; printf("Cmplx_dot_prod_f32 Size = %d Cycles = %d\n", blockSize, avg_cycles); #else /* ---------------------------------------------------------------------- ** Call the Complex Dot Product process function ** ------------------------------------------------------------------- */ arm_cmplx_dot_prod_f32(A, B, blockSize, realResult, imagResult); #endif }
void pmu_start(void) { enable_pmu(); // Enable the PMU ccnt_divider(0); reset_ccnt(); // Reset the CCNT (cycle counter) reset_pmn(); // Reset the configurable counters pmn_config(0, perf_event[0]); // Configure counter 0 to count event code 0x03 pmn_config(1, perf_event[1]); // Configure counter 1 to count event code 0x03 pmn_config(2, perf_event[2]); // Configure counter 2 to count event code 0x03 pmn_config(3, perf_event[3]); // Configure counter 3 to count event code 0x03 pmn_config(4, perf_event[4]); // Configure counter 4 to count event code 0x03 pmn_config(5, perf_event[5]); // Configure counter 5 to count event code 0x03 enable_ccnt(); // Enable CCNT enable_pmn(0); // Enable counter enable_pmn(1); // Enable counter enable_pmn(2); // Enable counter enable_pmn(3); // Enable counter enable_pmn(4); // Enable counter enable_pmn(5); // Enable counter }