Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

Q to custom SOPC component

Hello there,

I am using a DPRAM as component in the SOPC Builder, I just used the

DPRAM_TopLevel.vhd from the LPM_megafunction_wizard as HDL-File for the

own component (after Avalon-Slave Interface assignments) and it properly

worked.

I get access to the DPRAM whithout any problems when I use:

IOWR(DPRAM_BASE, Offset, 0x12345678);

IORD(DPRAM_BASE, Offset);

But when I try to dereference a pointer to DPRAM_BASE I cannot write a “word” to the DPRAM.

My function is as implemented as followed.

volatile unsigned int *ptr;

void TestDPRAM(void)

{

int i = 0;

ptr = (unsigned int*)(DPRAM _BASE);

for (i=0; i<DPRAM_SPAN;i++)

{

*ptr = (unsigned int)0x12345678;

printf("\Addresse: %x\t",(unsigned int)ptr);

printf("\tValue: %x",(int)*ptr);

ptr = ptr+1;

}

}

Do you have any advice what is going wrong?
No RepliesBe the first to reply