09.08.2013 Views

Design and Verification of Adaptive Cache Coherence Protocols ...

Design and Verification of Adaptive Cache Coherence Protocols ...

Design and Verification of Adaptive Cache Coherence Protocols ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

I2 ) Loadl Storel Fencerr Fencerw Fencewr Fenceww Commit Reconcile<br />

I1 + (a 0 ) (a 0 ,v 0 ) (a 0 1,a 0 2) (a 0 1,a 0 2) (a 0 1,a 0 2) (a 0 1,a 0 2) (a 0 ) (a 0 )<br />

Loadl(a) true a 6= a 0<br />

a 6= a 0 1 a 6= a 0 Storel(a,v) a 6= a<br />

1 true true true true<br />

0<br />

a 6= a 0 true true true true a 6= a 0 true<br />

Fencerr(a1,a2) true true true true true true true a2 6= a 0<br />

Fencerw(a1,a2) true a2 6= a 0<br />

true true true true true true<br />

Fencewr(a1,a2) true true true true true true true a2 6= a 0<br />

Fenceww(a1,a2) true a2 6= a 0<br />

true true true true true true<br />

Commit(a) true true true true a 6= a 0 1 a 6= a 0 1 true true<br />

Reconcile(a) a 6= a 0 true true true true true true true<br />

Figure 3.6: Instruction Reordering Table <strong>of</strong> CRF<br />

imposes ordering constraints on preceding Commit instructions instead <strong>of</strong> Storel instructions,<br />

since only a Commit can force the dirty copy to be written back to the memory. It makes little<br />

sense to ensure a Storel is completed if it is not followed by a Commit. Likewise, a Fence r<br />

instruction imposes ordering constraints on following Reconcile instructions instead <strong>of</strong> Loadl<br />

instructions, since only a Reconcile can force a stale copy tobepurged.It makes little sense to<br />

postpone a Loadl if it is not preceded by a Reconcile.<br />

Figure 3.6 concisely de nes the conditions under which two adjacent CRF instructions can<br />

be reordered (assume instruction I1 precedes instruction I2, <strong>and</strong> a `true' condition indicates that<br />

the reordering is allowed). The underlying rationale is to allow maximum reordering exibility<br />

for out-<strong>of</strong>-order execution. There are 64 reordering rules de ned by the reordering table. As<br />

an example, the rule corresponding to the Storel-Storel entry allows two Storel instructions to<br />

be reordered if they access di erent addresses:<br />

CRF-Reorder-Storel-Storel Rule<br />

ht,Storel(a,v)iht 0 ,Storel(a 0 ,v 0 )i if a 6= a 0<br />

! ht 0 ,Storel(a 0 ,v 0 )iht,Storel(a,v)i<br />

This rule is commutative in the sense that reordered instructions can be reordered back.<br />

However, not all the reordering rules commute. For example, the rule represented by the Fencerr-<br />

Loadl entry does not commute: once the reordering is performed, the instructions cannot be<br />

reordered back unless the address <strong>of</strong> the Loadl instruction <strong>and</strong> the pre-address <strong>of</strong> the Fencerr<br />

instruction are di erent (according to the Loadl-Fencerr entry).<br />

We also need a rule to discharge a memory fence:<br />

CRF-Fence Rule<br />

Site(sache, ht,Fence (a1,a2)ipmb, mpb, proc)<br />

! Site(sache, pmb, mpbjht,Acki, proc)<br />

It is worth pointing out that appropriate extension is needed for CRF in order to de ne the<br />

semantics <strong>of</strong> synchronization instructions such as Test-&-Set, Swap, Lock/Unlock <strong>and</strong> Load-<br />

&-Reserve/Store-Conditional. The CRF model by itself contains no particular synchronization<br />

54

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

Saved successfully!

Ooh no, something went wrong!