Part Number: TMDSMDSK6455
Hi guys, I'm at the beginning of my journey in DSP programming. I have a DSK6455 and I'm going to make the following piece of code optimized.
#pragma MUST_ITERATE(NUMBER_OF_COLUMNS, NUMBER_OF_COLUMNS, 1) #pragma UNROLL(2) for (col = 0; col < NUMBER_OF_COLUMNS; ++col) { int16_t current_cost = 0; for (row = 0; row < NUMBER_OF_ROWS; ++row) { int16_t ix = (data_lookup_table[row][col] - data_lookup_table[row][which_column]) * 10.0; current_cost += sinlut[ix];//sine looking up. } if (current_cost > current_max) { current_max = current_cost; current_max_index = col; } } t1 = TSCL;
I tried to profile this piece of code, line by line, and noticed that reading from memory (for example data_lookup_table[row][col]) and storing them in a temporary variable, takes 80 to 120 clocks. I watched the C6000 optimization video series and there, It's told that reading from memory takes 4 clocks. Am I wrong? Can I make the program faster?