Altera_Forum
Honored Contributor
17 years agoproblem access meories !!
hi,
i try implement a design that contain one NIOSII processor and three onchip meories. first memory is used for store program. the two others memories are used to store data. i use the connection matrix to connect the first memory to the data and instruction bus. the two others are connected to the data bus only. my problem is: when i try read and print data from the two data memories, i have a corrupted result like this: M0=6 M1=7 M2=5 M3=1 Resultat=2: first data memory M0=-1 M1=-1 M2=-1 M3=-1 Resultat=-1: second data memory For access both data memories,I use this boucle: z1=(unsigned int*)0x00002800; z2=(unsigned int*)0x00002800; for(k=1;k<3;k++) { //M=0; printf("\n-------------------CPU%d--------------------\n",k); for(i=0;i<5;i++) { B=IORD_32DIRECT(z1,0); if(i!=4) { printf("M%d=%d\t", i,B); } else { printf("Resultat=%d\n",B); } z1++; //M++; } z2+=0x400; z1=z2; } can someone help me! best regards