cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
hwfgjdsd
Adventurer
Adventurer
2,555 Views
Registered: ‎05-22-2009

I get diffrent outputs by reading from BRAM

Hello,

 

I have generated a custom IP with the “Create and Import Peripheral Wizard” in XPS version 10.1. This custom IP include only a “User logic memory space” and I called it „frameheader“. Now I would like to use it in SDK.

 

I am using a code snipe of the generated selftest function (you can see it bellow). There the value “0xDEADBEEF” is written and read back from address 0,4,8,….255. After than, I read back some of the same addresses but I get different values.

Can anyone help me what I am doing wrong please?

 

 

code snipe:

 

Xuint32 LocalBRAMFrameheader; void testAllMem(void) { int Index; Xuint32 Mem32Value; //! Write data to user logic BRAMs and read back for ( Index = 0; Index < 256; Index++ ) { FRAMEHEADER_mWriteMemory(&LocalBRAMFrameheader+4*Index, 0xDEADBEEF); Mem32Value = FRAMEHEADER_mReadMemory(&LocalBRAMFrameheader+4*Index); if ( Mem32Value != 0xDEADBEEF ) { uartSend(" FAILURE !!! \r\n"); } } uartSend("\r\naddr0: "); uartSendNumHex( FRAMEHEADER_mReadMemory(&LocalBRAMFrameheader + 0) ); uartSend("\r\naddr4: "); uartSendNumHex( FRAMEHEADER_mReadMemory(&LocalBRAMFrameheader + 4) ); uartSend("\r\naddr8: "); uartSendNumHex( FRAMEHEADER_mReadMemory(&LocalBRAMFrameheader + 8) ); uartSend("\r\naddr12: "); uartSendNumHex( FRAMEHEADER_mReadMemory(&LocalBRAMFrameheader + 12) ); uartSend("\r\naddr16: "); uartSendNumHex( FRAMEHEADER_mReadMemory(&LocalBRAMFrameheader + 16) ); uartSend("\r\naddr20: "); uartSendNumHex( FRAMEHEADER_mReadMemory(&LocalBRAMFrameheader + 20) ); }

 

 output:

 

addr0: 0xDEADBEEF addr4: 0x00000000 addr8: 0xDEADBEEF addr12: 0xDEADBEEF addr16: 0xDEADBEEF addr20: 0xDEADBEEF

 (at address 4, I get 0x00000000  and not  0xDEADBEAF)

 

 

0 Kudos
1 Reply
hwfgjdsd
Adventurer
Adventurer
2,512 Views
Registered: ‎05-22-2009

Now I have seen, it seems that the MicroBlaze is not reading the wrong values. He hangs up on the write commands. Without the funtction FRAMEHEADER_mWriteMemory()  I can compute the rest of my code. Without that function, I can do nothing else.

 

0 Kudos