Forum Discussion
Altera_Forum
Honored Contributor
15 years agoFull On-Chip Memory
Hi, I'd like to know how to determine if the memory space of an on-chip memory is full. In my nios II system, I generated an on-chip M4K memory. It's size is 4096 bytes with a 32 bits data...
Altera_Forum
Honored Contributor
15 years ago --- Quote Start --- Hi Thormodo, Hmmm.. but the codes that I tried worked. As you can see in my 1st message, I was able to write that string using the standard IOWR. I did not put a "(int)" before the string though. When I read it and printed it out it was successfully printed. --- Quote End --- Didn't you get some warnings then? If I use the syntax below it get the following warning: warning: format argument is not a pointer (arg 2) IOWR_32DIRECT(ALTMEMDDR_1_BASE, 0x3fe, (int)"THIS IS TO TEST HOW MUCH DATA CAN A MEMORY SPACE CONTAIN"); printf("%s\n", IORD_32DIRECT(ALTMEMDDR_1_BASE, 0x3fe)); printf("%s\n", IORD_32DIRECT(ALTMEMDDR_1_BASE, 0x3ff)); And it prints out (without crashing) THIS IS TO TEST HOW MUCH DATA CAN A MEMORY SPACE CONTAIN THIS IS TO TEST HOW MUCH DATA CAN A MEMORY SPACE CONTAIN Maybe it's doing something funny with cache memory, I really don't know since I never used strings with NIOS II before.