cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
heber.green
Observer
Observer
1,842 Views
Registered: ‎03-18-2009

Help using memory mapped i/o reads/writes to access plb temac registers

I'm trying to get the plb temac to work in EDK 10.1.03 using only memory mapped i/o reads. I've been given the task of making this thing fit in BRAM only. I'm using a Virtex-4 FX100 so I've got plenty of BRAM, but I'm trying to avoid using the temac drivers and function calls because my EDK project is just barely fitting in the amount of BRAM the docm can address. Currently the project builds fine and I don't get any errors or warnings about my .elf file being to big to fit the BRAM. My register reads always return 0x00000000. Here's the code I'm using:

 

void macRead(Xuint32 offset)  

{

Xuint32 *ptr;

Xuint32 data;

ptr = (Xuint32*)XPAR_PLB_TEMAC_0_BASEADDR + offset;

   data = ptr[offset];

printf("Data read from offset 0x%04X is 0x%08X\n\r", offset, data);

}

 

void macWrite(Xuint32 offset, Xuint32 data)

{

Xuint32 *ptr;

ptr = (Xuint32*)XPAR_PLB_TEMAC_0_BASEADDR + offset;

ptr[offset] = data;

printf("Wrote 0x%08X to offset 0x%04X\n\r", data, offset);

}

 

This style of accessing the registers seems to work fine when trying to access any other Xilinx IP's I have added to my project. Am I missing something? Are there any good tools I can use to try and debug where my reads are going to and what's being returned? Thanks,

-Heber 

0 Kudos
0 Replies