Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21616 Discussions

Q to custom SOPC component

Altera_Forum
Honored Contributor II
1,154 Views

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?
0 Kudos
0 Replies
Reply