AnsweredAssumed Answered

Understanding ADSP-TS201 cycle counting

Question asked by Daniel on Oct 19, 2011
Latest reply on Aug 27, 2015 by MaheshN

Hello!

 

I got a problem with basic cycle counting at simulation. The code is following:

#include <stdio.h>
#include <filter.h>
#include <cycle_count.h>
#define N 10
#define FIRLEN 3

fir_state *state;

int main( int argc, char *argv[] )

{
    int i;
    float x[N],y[N],coeffs[FIRLEN];
    float delay;
    cycle_t cycle_count;

    for (i=0;i<N;i++)
    {
        x[i] = (float)i;
        printf("x[%d]=%f\n",i,x[i]);
    }
    coeffs[0] = -.1;
    coeffs[1] = 1.;
    coeffs[2] = .1;
    delay = 0.;
    fir_init(*state,&(coeffs[0]),&delay,FIRLEN,0);
    START_CYCLE_COUNT(cycle_count);
    fir(&(x[0]),&(y[0]),N,state);
    STOP_CYCLE_COUNT(cycle_count,cycle_count);
    PRINT_CYCLES("Cycles: ",cycle_count);
    for (i=0;i<N;i++)
        printf("y[%d]=%f\n",i,y[i]);

   return 0;

}

 

The output is like following:

x[0]=0.000000

...

x[9]=9.000000

Cycles: 13772007659408502909

y[0]=0.000000

etc.

 

How should I interpret this value of the counter?

 

Daniel

Outcomes