Altera_Forum
Honored Contributor
13 years agoSDRAM address mapping
Working with Quartus 11.1 SP2, Nios II IDE 11.1, altera DE2
I am reading SDRAM values in Nios, and comparing them to the values from the DE2 Control panel and expecting the values to be the same. I expected that when I wrote into address 1 in nios it would correspond to address 1 on the DE2 Control panel. However, only the first 9 addresses in the GUI control match with the first 9 addresses in Nios. After that the two are not equal. My SOPC uses SDRAM, memory map: 0x00800000 - 0x00ffffff. Nios Address ---------------------DE2 Control Panel Address 0-9 ---------------------------------0-9 12 ----------------------------------18 2800-------------------------------- 20480 102800 -----------------------------20736 Only the first 9 addresses from a starting a address seem to match. e.g. 102800 - 102809 will write into DE2 address 20736 - 20745. But 102811 in nios is mapped to 20753. Is there a way I can get a 1 to 1 address map? I want to read data starting from 2800 to 96000+ 2800 and 102800 to96000 + 102800 in the DE2 control panel. But I dont know what addresss I should write in Nios. How I am reading SDRAM in Nios:void read_sdram(int length)
{
alt_u16 i;
alt_u16 *buffer_16 = (alt_u16 *)SDRAM_BASE;
for( i = 0; i < length; i++ )
{
printf("Address: %d: ",i);
printf("%d \n", buffer_16);
}
}