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.

Backward-Message-<strong>Cache</strong>-to-Mem-for-Wb Rule<br />

Sys(Msite(mem, min msg, mout), Site(id , cache, cin, cout, pmb, mpb, proc) j sites)<br />

if Src(msg)=id ^ Cmd(msg)=Wb<br />

! Sys(Msite(mem, min, mout), Site(id , cache, cin, msg cout, pmb, mpb, proc) j sites)<br />

Backward-C-Send-Wb Rule<br />

Site(id , Cell(a,v,WbPending) j cache, in, out Msg(id ,H,Wb,a,v), pmb, mpb, proc)<br />

! Site(id , Cell(a,v,Dirty) j cache, in, out, pmb, mpb, proc)<br />

The backward rules above will be used for backward draining <strong>of</strong> Wb messages. They are<br />

the backward version <strong>of</strong> the M-Receive-Wb, Message-<strong>Cache</strong>-to-Mem (for Wb messages) <strong>and</strong><br />

C-Send-Wb rules, respectively. It is trivial to show that Invariants 15, 16 <strong>and</strong> 17 still hold in<br />

the presence <strong>of</strong> the backward rules.<br />

In addition to the backward rules, the draining rules also contain some WP rules that are<br />

needed to drain <strong>Cache</strong>, WbAck, FlushAck <strong>and</strong> Purge messages. Furthermore, we need to tailor<br />

the cache-to-memory message passing rule to disallow Wb messages to ow to the memory<br />

throughout the draining process. The following Message-<strong>Cache</strong>-to-Mem-for-Purge rule is a<br />

restricted version <strong>of</strong> the Message-<strong>Cache</strong>-to-Mem rule.<br />

Message-<strong>Cache</strong>-to-Mem-for-Purge Rule<br />

Sys(Msite(mem, min, mout), Site(id , cache, cin, msg cout, pmb, mpb, proc) j sites)<br />

if Dest(msg)=H ^ Cmd(msg) = Purge<br />

! Sys(Msite(mem, min msg, mout), Site(id , cache, cin, cout, pmb, mpb, proc) j sites)<br />

De nition 18 (Draining Rules) Given a WP term s, the drained term dr(s) is the normal<br />

form <strong>of</strong> s with respect to the following draining rules:<br />

D f C-Receive-<strong>Cache</strong>, C-Receive-WbAck,<br />

C-Receive-FlushAck, M-Receive-Purge,<br />

Backward-M-Receive-Wb, Backward-C-Send-Wb,<br />

Message-Mem-to-<strong>Cache</strong>, Message-<strong>Cache</strong>-to-Mem-for-Purge,<br />

Backward-Message-<strong>Cache</strong>-to-Mem-for-Wb g<br />

Lemma 19 D is strongly terminating <strong>and</strong> con uent, that is, rewriting a WP term with respect<br />

to the draining rules always terminates <strong>and</strong> reaches the same normal form, regardless <strong>of</strong> the<br />

order in which the rules are applied.<br />

Pro<strong>of</strong> The termination is obvious because according to the draining rules, <strong>Cache</strong>, WbAck,<br />

FlushAck <strong>and</strong> Wb messages can only ow from memory to caches, <strong>and</strong> Purge messages can<br />

only ow from caches to memory. The con uence follows from the fact that the draining rules<br />

do not interfere with each other. 2<br />

Lemma 20 ensures that the processor-to-memory bu ers, the memory-to-processor bu ers <strong>and</strong><br />

the processors all remain unchanged after the draining rules are applied. Lemma 21 ensures<br />

99

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

Saved successfully!

Ooh no, something went wrong!