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.

PreFenceR(a) Fencerr( ,a) Fencewr( ,a)<br />

PreFenceW(a) Fencerw( ,a) Fenceww( ,a)<br />

PostFenceR(a) Fencerr(a, ) Fencerw(a, )<br />

PostFenceW(a) Fencewr(a, ) Fenceww(a, )<br />

Informally, PreFenceW(a) requires that all preceding Loadl <strong>and</strong> Commit instructions be<br />

completed before any following Storel instruction to location a can be performed. PostFenceR(a)<br />

requires that all preceding Loadl instructions to location a be completed before any following<br />

Reconcile or Storel instruction can be performed. In an implementation <strong>of</strong> release consistency,<br />

we can use a PreFenceW instruction before releasing a semaphore, <strong>and</strong> a PostFenceR instruction<br />

after acquiring a semaphore.<br />

CRF-bits The Loadl <strong>and</strong> Storel instructions can be augmented with proper CRF-bits so<br />

that the semantics <strong>of</strong> some commit, reconcile <strong>and</strong> fence operations can be represented without<br />

explicit instructions. There are six CRF-bits, Com, Rec, PreR, PreW, PostR <strong>and</strong> PostW. If<br />

turned on, the Com-bit implies a commit operation for a Storel, while a Rec-bit implies a<br />

reconcile operation for a Loadl.<br />

The PreR, PreW, PostR <strong>and</strong> PostW bits can be used to enforce fence operations between an<br />

address <strong>and</strong> the whole address space. Intuitively, the PreR-bit means that all preceding Loadl<br />

instructions must complete before the instruction itself completes while the PreW-bit means<br />

that all preceding Commit instructions must complete before the instruction itself completes.<br />

For a Loadl instruction, it makes little sense to set the PreR-bit or PreW-bit without setting<br />

the Rec-bit. The PostR-bit implies that the instruction must complete before any following<br />

Reconcile instruction completes while the PostW-bit implies that the instruction must complete<br />

before any following Storel instruction completes. For a Storel instruction, it makes little sense<br />

to set the PostR-bit or PostW-bit without setting the Com-bit. The precise semantics <strong>of</strong> the<br />

CRF-bits can be given using CRF instructions. For example, an instruction with all the CRF-<br />

bits set can be de ned as follows:<br />

Loadl(a) [Rec,PreR,PreW,PostR,PostW]<br />

Fencerr( ,a) Fencewr( ,a) Reconcile(a) Loadl(a) Fencerr(a, ) Fencerw(a, )<br />

Storel(a,v) [Com,PreR,PreW,PostR,PostW]<br />

Fencerw( ,a) Fenceww( ,a) Storel(a,v) Commit(a) Fencewr(a, ) Fenceww(a, )<br />

While ne-grain commit <strong>and</strong> reconcile instructions give the compiler more control over coherence<br />

actions <strong>of</strong> the system, coarse-grain fence instructions can reduce the number <strong>of</strong> instructions<br />

to be executed. In practice, commit <strong>and</strong> reconcile instructions can also be merged with fence<br />

instructions under certain circumstances. Furthermore, the semantics <strong>of</strong> some CRF instructions<br />

can be attached to synchronization instructions such asTest-&-Set <strong>and</strong> Swap.<br />

58

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

Saved successfully!

Ooh no, something went wrong!