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.

<strong>Cache</strong> message can always be processed eventually.<br />

Lemma 16 Given a WP term s,<br />

Msg(H,id ,<strong>Cache</strong>,a,-) 2 MoutCin id (s) )<br />

a =2 <strong>Cache</strong> id(s) _ Msg(H,id ,FlushAck,a) 2 MoutCin id (s)<br />

Lemma 17 means that at any time, there can be at most one outst<strong>and</strong>ing message on each<br />

address between the same source <strong>and</strong> destination, except for <strong>Cache</strong> <strong>and</strong> FlushAck messages.<br />

Lemma 17 Given a WP term s,<br />

msg1 2 s ^ msg2 2 s )<br />

Src(msg1) 6=Src(msg2) _ Dest(msg1) 6= Dest(msg2) _ Addr(msg1) 6=Addr(msg2) _<br />

(Cmd(msg1)=<strong>Cache</strong> ^ Cmd(msg2) = FlushAck) _<br />

(Cmd(msg1)=FlushAck ^ Cmd(msg2)=<strong>Cache</strong>)<br />

Pro<strong>of</strong> (Lemmas 15, 16 <strong>and</strong> 17) The pro<strong>of</strong> is based on induction on rewriting steps. The<br />

invariants hold trivially for the initial term where all caches <strong>and</strong> queues are empty. It can be<br />

shown by checking each rule that, if the invariants hold for a term, then they still hold after<br />

the term is rewritten according to that rule. 2<br />

5.4.2 Mapping from WP to CRF<br />

We de ne a mapping function that maps terms <strong>of</strong> WP to terms <strong>of</strong> CRF. For WP terms in which<br />

all message queues are empty, it is straightforward to nd the corresponding CRF terms. There<br />

is a one-to-one correspondence between these drained terms <strong>of</strong> WP <strong>and</strong> the terms <strong>of</strong> CRF. For<br />

WP terms that contain non-empty message queues, we apply a set <strong>of</strong> draining rules to extract<br />

all the messages from the queues.<br />

We use backward draining for Wb messages <strong>and</strong> forward draining for all other messages<br />

(note that forwarding draining <strong>of</strong> Wb messages would lead to non-deterministic drained terms<br />

when there are multiple writeback messages regarding the same address). Consequently, all the<br />

<strong>Cache</strong>, WbAck, FlushAck <strong>and</strong> Wb messages will be drained at cache sites, while all the Purge<br />

messages will be drained at the memory.<br />

Backward Rules: The Backward-M-Receive-Wb rule allows the memory to extract a Wb<br />

message from the suspended message bu er <strong>and</strong> place it back to the incoming queue. The<br />

Backward-Message-<strong>Cache</strong>-to-Mem-for-Wb rule moves a Wb message from the memory's incom-<br />

ing queue back to thesourcecache's outgoing queue. The Backward-C-Send-Wb rule allows a<br />

cache to reclaim a Wb message from its outgoing queue <strong>and</strong> recover the cache state.<br />

Backward-M-Receive-Wb Rule<br />

Msite(Cell(a,v1,T[dir,smj(id ,v)]) j mem, in, out)<br />

! Msite(Cell(a,v1,T[id jdir,sm]) j mem, Msg(id ,H,Wb,a,v) in, out)<br />

98

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

Saved successfully!

Ooh no, something went wrong!