<br><br>
<div class="gmail_quote">2009/8/27 Scott Wood <span dir="ltr"><<a href="mailto:scottwood@freescale.com">scottwood@freescale.com</a>></span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im"><br>> //check if we successfully store value at 0x400,0000<br>><br>> lis r22, 0x400<br>> ori r22,r22,0x0<br>> lwz r23,0(r22)<br>> cmpw r23, 30<br><br></div>The values should not be equal, since you wrote a byte and read back a<br>
word.<br><br>Furthermore, you are storing the constant 30, but are comparing r23 with<br>the register r30 (I never liked that aspect of ppc asm syntax -- too<br>error prone). If you want to compare with the constant 30, use "cmpwi".<br>
<div class="im"><br>> beq print_equal<br>><br>> 1: b 1b<br>><br>> print_equal:<br>> ...<br>> //code end<br>><br>> I found that, print_equal was not called ,the whole code seemed to<br>> enter an infinite loop.<br>
<br></div>That's because you have an infinite loop in your code, right after "beq<br>print_equal".<br><font color="#888888"><br>-Scott<br></font></blockquote></div>
<div><br> </div>
<div> </div>
<div>Thank you very much.</div>
<div> </div>
<div>I am using a SMP E500 v2, and I want CPU0 to write some value to a physical address, and </div>
<div> </div>
<div>wait for CPU1 to read from it.</div>
<div> </div>
<div>However, it seemed failed to communicate between CPUs by DRAM.. CPU1 can not read </div>
<div> </div>
<div>the correct value from the address where CPU1 wrote to.</div>
<div> </div>
<div>BTW: the physical address is at 16M .</div>
<div> </div>
<div> </div>