Forum Discussion
Altera_Forum
Honored Contributor
11 years agoI really don't understand what's happening in my design. I give you details:
The hardware part (a Quartus II project downloaded on the Cyclone IV of a de0-nano board) is instantiating a qsys project with a Nios II cpu and a dual-port memory. The cpu can read the memory that can be written by the hardware part. For the moment I don't write anything, the memory (8-bit words) is initialized by a .hex file created as a memory initialization file by Quartus II as showed by this picture: https://www.alteraforum.com/forum/attachment.php?attachmentid=9298 A software is running on the cpu. I give the code:#include <stdio.h>
# include "system.h"
int main()
{
int *pmem;
int i=0;
printf("Start!\n");
for (i=0; i<15; i++)
{
pmem=(int *)(0x80000000|(ONCHIP_MEMORY2_0_BASE+i));
printf("%u\n", *pmem);
}
return 0;
} and the result is: --- Quote Start --- Start! 67305985 67305985 67305985 67305985 134678021 134678021 134678021 134678021 2826 2826 2826 2826 0 0 0 --- Quote End --- I don't understand this. If you can explain what is done, please tell me. Thanks.