AnsweredAssumed Answered

sequence of Read-after-Write access to external memory

Question asked by Prashant Employee on Apr 8, 2011
Latest reply on Apr 8, 2011 by Prashant

I have a piece of code where a read-after-write on external memory (async memory) is performed in order to check the correctness of the accesses.

 

The code is simple and as follow:
#define pSRAM_pointer ((unsigned short *) 0x20000000)

….........

                short SRAM_write, SRAM_read;

                *pSRAM_pointer = SRAM_write;

                SRAM_read = *pSRAM_pointer;

The asm code generated is as expected:
                 R0 = W [ FP + 0xa ] ( X ) ;

                P1 = 0 ;

                P1.H = 0x2000 ;

                W [ P1 ] = R0.L ;

                R0 = W [ P1 ] ( X ) ;

                W [ FP + 0x8 ] = R0 ;


But, looking at the RD/ WR/ signals on the BF pins, the BF actually perform the Read first and then the Write operation (Read signal /RD asserts first and then Write signal /WR).

I am not sure why it is happening like this.

Outcomes