Hi,
Recently i'm trying to read the cycle count for my program on sc589-ezkit ARM core, but the value of the cycles i got seems very large. I'm wondering why does it cost that amount of cycles even though it has only 4 assembly code.
/*****************************************************************************
* cycle_test_sc589_Core0.c
*****************************************************************************/
#include <sys/platform.h>
#include <sys/adi_core.h>
#include "adi_initialize.h"
#include "cycle_test_sc589_Core0.h"
#include "cycle_count.h"
#include <runtime/cache/adi_cache.h>
uint32_t adi_cache_gEnable = ADI_CACHE_ENABLE_ALL;
int main()
{
/**
* Initialize managed drivers and/or services that have been added to
* the project.
* @return zero on success
*/
adi_initComponents();
int a = 0;
int b = 1;
int sum;
cycle_stats_t stat;
CYCLES_INIT(stat);
CYCLES_START(stat);
sum = a+b;
CYCLES_STOP(stat);
CYCLES_PRINT(stat);
return 0;
}
The cycles i got here is 23.
Thanks in advance!