Forum Discussion
Altera_Forum
Honored Contributor
15 years agoThe part where you are reading back the data you are using IORD_32DIRECT which means you have to pass in byte offsets (and they must be a multiple of 4 since Nios II does not support unaligned accesses). i.e. use this instead:
if (IORD_32DIRECT(SRAM_BASE, 4*testNumber) != testNumber) I saw some other spots where you were using IOWR_32DIRECT, you probably will have to do the same 4* there too. For example if I wanted to read back words from 'SSRAM_BASE' I would do this: IORD_32DIRECT(SSRAM_BASE, 0) IORD_32DIRECT(SSRAM_BASE, 4) IORD_32DIRECT(SSRAM_BASE, 8) etc...