- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We'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's the first point in the "Important Notes" section.
I'm not sure if it's related, but it's worth a try I guess.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page