Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12690 Discussions

Problems with diferents Nios II configurations

Altera_Forum
Honored Contributor II
975 Views

I'm doing a simple benchmar that reserve memory for a two matrix and multiply it. Every iteration reserve more memory. But my problem is that in standard nios II configuration it runs perfect, but when I use it in full featured it doesn't run. Can someone explain me why it succes or what I can do for resolve it?? 

 

I put the code here: 

 

# include <stdlib.h># include <stdio.h># include <time.h> 

 

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

 

int *a,*b,*c; 

int i, j, k, x; 

time_t start_time, end_time; 

int time_final=0; 

int crow=0; 

int ROWS = 2; 

int ITER = 1000; 

 

printf("\nStarting main program.\n\n"); 

printf("\n\nMultiplying two matrices of size %dX%d %d times.\n\n", ROWS, ROWS, ITER); 

 

start_time = time(NULL); 

 

for(crow=2;crow<=14;crow++){ 

ROWS = crow; 

a = malloc(ROWS*ROWS); 

b = malloc(ROWS*ROWS); 

 

for(x=0; x<ITER; x++) { 

for(i=0;i<ROWS*ROWS;i++) { 

a = i+1;  

b = ROWS*ROWS-i-1; 

 

i=0; 

for (i=0; i < ROWS; i++) { 

for (j = 0; j < ROWS; j++) { 

for (k=0; k < ROWS; k++) a[i+j] += a[i+k]*b[k+j]; 

b[i+j] += a[i+k]*b[k+j]; 

end_time = time(NULL); 

time_final = difftime(end_time,start_time); 

printf ("\nNumero de Columnes: %d ,Temps: %d\n",ROWS,time_final);  

free(a); 

free(http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/cool.gif ; 

exit(0); 

 

 

 

 

 

thanks to all, 

 

 

 

Guillem
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
264 Views

We&#39;ve have unresolved issues with the data cache lines in full-featured designs... take a look at the readme.txt file that came with the distribution, it&#39;s the first point in the "Important Notes" section. 

 

I&#39;m not sure if it&#39;s related, but it&#39;s worth a try I guess.
0 Kudos
Reply