Altera_Forum
Honored Contributor
19 years agoNIOS II addressing problem
I am having trouble with an SOPC builder component.
I am using signaltap to try to debug it. I have a pointer to an address which I write to and then read from. But the address that is asserted is different in the two cases. I am using the code below. unsigned short * ptr;
unsigned short bla;
int i = 0;
ptr = (unsigned short *)MG1264_INTERFACE_0_BASE+1;
while(1)
{
*ptr = (unsigned short)0xaaaa;
bla = *ptr;
} MG1264_INTERFACE_0_BASE is 0x800 as I understand it this should write to address 0x802 and then read from address 0x802. So address bit 1 should be 1 in both read and write. This is not the case however. Address bit 1 is 1 when I do a write but when I read, address 1 is 0. Bearing in mind these are the nios address lines and not mine. Has anyone come across this before or have any idea what the problem may be? Many thanks, Richard