05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

A3.8.2 Ordering requirements for memory accesses<br />

Application Level Memory Model<br />

<strong>ARM</strong>v7 <strong>and</strong> <strong>ARM</strong>v6 define access restrictions in the permitted ordering of memory accesses. These<br />

restrictions depend on the memory attributes of the accesses involved.<br />

Two terms used in describing the memory access ordering requirements are:<br />

Address dependency<br />

An address dependency exists when the value returned by a read access is used to compute<br />

the virtual address of a subsequent read or write access. An address dependency exists even<br />

if the value read by the first read access does not change the virtual address of the second<br />

read or write access. This might be the case if the value returned is masked off before it is<br />

used, or if it has no effect on the predicted address value for the second access.<br />

Control dependency<br />

A control dependency exists when the data value returned by a read access is used to<br />

determine the condition code flags, <strong>and</strong> the values of the flags are used for condition code<br />

checking to determine the address of a subsequent read access. This address determination<br />

might be through conditional execution, or through the evaluation of a branch.<br />

Figure A3-4 on page A3-46 shows the memory ordering between two explicit accesses A1 <strong>and</strong> A2, where<br />

A1 occurs before A2 in program order. The symbols used in the figure are as follows:<br />

< Accesses must be observed in program order, that is, A1 must be observed before A2.<br />

- Accesses can be observed in any order, provided that the requirements of uniprocessor<br />

semantics, for example respecting dependencies between instructions in a single processor,<br />

are maintained.<br />

The following additional restrictions apply to the ordering of memory accesses that have this<br />

symbol:<br />

If there is an address dependency then the two memory accesses are observed in<br />

program order by any observer in the common shareability domain of the two<br />

accesses.<br />

This ordering restriction does not apply if there is only a control dependency between<br />

the two read accesses.<br />

If there is both an address dependency <strong>and</strong> a control dependency between two read<br />

accesses the ordering requirements of the address dependency apply.<br />

If the value returned by a read access is used as data written by a subsequent write<br />

access, then the two memory accesses are observed in program order.<br />

It is impossible for an observer in the shareability domain of a memory location to<br />

observe a write access to that memory location if that location would not be written<br />

to in a sequential execution of a program.<br />

It is impossible for an observer in the shareability domain of a memory location to<br />

observe a write value written to that memory location if that value would not be<br />

written in a sequential execution of a program.<br />

<strong>ARM</strong> DDI 0406B Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. A3-45

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!