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

Create successful ePaper yourself

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

Specification Implementation<br />

t 0<br />

A<br />

B<br />

2.5.1 Veri cation <strong>of</strong> Soundness<br />

t<br />

t<br />

1<br />

2<br />

B<br />

A<br />

t<br />

3<br />

s0<br />

A1<br />

B1<br />

s<br />

s<br />

1<br />

2<br />

s3 A2 B1<br />

B1<br />

A1<br />

B2<br />

Figure 2.10: Forward Draining<br />

We use simulation to prove the soundness <strong>of</strong> an implementation. We rst build a mapping<br />

function that maps an implementation term to a speci cation term, <strong>and</strong> then show that the<br />

speci cation can simulate the implementation with respect to the mapping function. We de ne<br />

the mapping function based on the notion <strong>of</strong> drained terms or drained states. Intuitively,<br />

a drained implementation term contains no partially executed operation <strong>and</strong> therefore can<br />

be trivially mapped to a speci cation term via a projection function (or a combination <strong>of</strong> a<br />

projection function <strong>and</strong> a lift function).<br />

Based on the concept <strong>of</strong> drained terms, the implementation terms are classi ed into equiva-<br />

lent classes where each equivalent class contains exactly one drained term as the representative<br />

<strong>of</strong> the class. A term can be rewritten to a drained term via forward or backward draining.<br />

Forward draining means that the term can be rewritten to the corresponding drained term ac-<br />

cording to some implementation rules backward draining means that the drained term can be<br />

rewritten back to the term itself according to some implementation rules. Intuitively, forward<br />

draining completes partially executed operations, while backward draining cancels partially ex-<br />

ecuted operations <strong>and</strong> recovers the system state. We can specify a set <strong>of</strong> draining rules so that<br />

for each implementation term, its normal form with respect to the draining rules represents a<br />

drained term.<br />

Figure 2.10 shows the use <strong>of</strong> forward draining. The speci cation allows t0 to be rewritten<br />

to t3 by applying rules A <strong>and</strong> B the order in which the rules are applied does not matter. The<br />

implementation takes two consecutive steps to achieve the semantic e ect <strong>of</strong> each speci cation<br />

rule: A1 <strong>and</strong> A2 for rule A, <strong>and</strong> B1 <strong>and</strong> B2 for rule B. The application <strong>of</strong> rules A1 <strong>and</strong> A2<br />

can be interleaved with the application <strong>of</strong> rules B1 <strong>and</strong> B2. It is obvious that s0, s3, s5 <strong>and</strong><br />

s8 are drained terms that correspond to t0, t1, t2 <strong>and</strong> t3, respectively. We can use forward<br />

draining to drain other implementation terms by completing partially executed operations this<br />

can be achieved by chosing A2 <strong>and</strong> B2 as the draining rules. Therefore, s1 is drained to s3, s2<br />

is drained to s5, <strong>and</strong> s4, s6 <strong>and</strong> s7 are drained to s8.<br />

Figure 2.11 shows the use <strong>of</strong> backward draining in a non-con uent system. The speci cation<br />

allows t0 to be rewritten to t3 or t4, while applying rules A <strong>and</strong> B in di erent orders can lead<br />

38<br />

s<br />

4<br />

s5<br />

A2<br />

B2<br />

A1<br />

s<br />

s<br />

6<br />

7<br />

B2<br />

A2<br />

s8

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

Saved successfully!

Ooh no, something went wrong!