2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3 * Copyright (c) 2009 Advanced Micro Devices, Inc.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer;
10 * redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution;
13 * neither the name of the copyright holders nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 * AMD's contributions to the MOESI hammer protocol do not constitute an
30 * endorsement of its similarity to any AMD products.
32 * Authors: Milo Martin
36 machine(L1Cache, "AMD Hammer-like protocol")
37 : Sequencer * sequencer,
38 CacheMemory * L1IcacheMemory,
39 CacheMemory * L1DcacheMemory,
40 CacheMemory * L2cacheMemory,
41 int cache_response_latency = 10,
42 int issue_latency = 2,
43 int l2_cache_hit_latency = 10,
44 bool no_mig_atomic = true
48 MessageBuffer requestFromCache, network="To", virtual_network="2", ordered="false";
49 MessageBuffer responseFromCache, network="To", virtual_network="4", ordered="false";
50 MessageBuffer unblockFromCache, network="To", virtual_network="5", ordered="false";
52 MessageBuffer forwardToCache, network="From", virtual_network="3", ordered="false";
53 MessageBuffer responseToCache, network="From", virtual_network="4", ordered="false";
57 state_declaration(State, desc="Cache states", default="L1Cache_State_I") {
59 I, AccessPermission:Invalid, desc="Idle";
60 S, AccessPermission:Read_Only, desc="Shared";
61 O, AccessPermission:Read_Only, desc="Owned";
62 M, AccessPermission:Read_Only, desc="Modified (dirty)";
63 MM, AccessPermission:Read_Write, desc="Modified (dirty and locally modified)";
66 IM, AccessPermission:Busy, "IM", desc="Issued GetX";
67 SM, AccessPermission:Read_Only, "SM", desc="Issued GetX, we still have a valid copy of the line";
68 OM, AccessPermission:Read_Only, "OM", desc="Issued GetX, received data";
69 ISM, AccessPermission:Read_Only, "ISM", desc="Issued GetX, received valid data, waiting for all acks";
70 M_W, AccessPermission:Read_Only, "M^W", desc="Issued GetS, received exclusive data";
71 MM_W, AccessPermission:Read_Write, "MM^W", desc="Issued GetX, received exclusive data";
72 IS, AccessPermission:Busy, "IS", desc="Issued GetS";
73 SS, AccessPermission:Read_Only, "SS", desc="Issued GetS, received data, waiting for all acks";
74 OI, AccessPermission:Busy, "OI", desc="Issued PutO, waiting for ack";
75 MI, AccessPermission:Busy, "MI", desc="Issued PutX, waiting for ack";
76 II, AccessPermission:Busy, "II", desc="Issued PutX/O, saw Other_GETS or Other_GETX, waiting for ack";
77 IT, AccessPermission:Busy, "IT", desc="Invalid block transferring to L1";
78 ST, AccessPermission:Busy, "ST", desc="S block transferring to L1";
79 OT, AccessPermission:Busy, "OT", desc="O block transferring to L1";
80 MT, AccessPermission:Busy, "MT", desc="M block transferring to L1";
81 MMT, AccessPermission:Busy, "MMT", desc="MM block transferring to L1";
85 enumeration(Event, desc="Cache events") {
86 Load, desc="Load request from the processor";
87 Ifetch, desc="I-fetch request from the processor";
88 Store, desc="Store request from the processor";
89 L2_Replacement, desc="L2 Replacement";
90 L1_to_L2, desc="L1 to L2 transfer";
91 Trigger_L2_to_L1D, desc="Trigger L2 to L1-Data transfer";
92 Trigger_L2_to_L1I, desc="Trigger L2 to L1-Instruction transfer";
93 Complete_L2_to_L1, desc="L2 to L1 transfer completed";
96 Other_GETX, desc="A GetX from another processor";
97 Other_GETS, desc="A GetS from another processor";
98 Merged_GETS, desc="A Merged GetS from another processor";
99 Other_GETS_No_Mig, desc="A GetS from another processor";
100 NC_DMA_GETS, desc="special GetS when only DMA exists";
101 Invalidate, desc="Invalidate block";
104 Ack, desc="Received an ack message";
105 Shared_Ack, desc="Received an ack message, responder has a shared copy";
106 Data, desc="Received a data message";
107 Shared_Data, desc="Received a data message, responder has a shared copy";
108 Exclusive_Data, desc="Received a data message, responder had an exclusive copy, they gave it to us";
110 Writeback_Ack, desc="Writeback O.K. from directory";
111 Writeback_Nack, desc="Writeback not O.K. from directory";
114 All_acks, desc="Received all required data and message acks";
115 All_acks_no_sharers, desc="Received all acks and no other processor has a shared copy";
120 // STRUCTURE DEFINITIONS
122 MessageBuffer mandatoryQueue, ordered="false";
125 structure(Entry, desc="...", interface="AbstractCacheEntry") {
126 State CacheState, desc="cache state";
127 bool Dirty, desc="Is the data dirty (different than memory)?";
128 DataBlock DataBlk, desc="data for the block";
129 bool FromL2, default="false", desc="block just moved from L2";
130 bool AtomicAccessed, default="false", desc="block just moved from L2";
134 structure(TBE, desc="...") {
135 State TBEState, desc="Transient state";
136 DataBlock DataBlk, desc="data for the block, required for concurrent writebacks";
137 bool Dirty, desc="Is the data dirty (different than memory)?";
138 int NumPendingMsgs, desc="Number of acks/data messages that this processor is waiting for";
139 bool Sharers, desc="On a GetS, did we find any other sharers in the system";
140 bool AppliedSilentAcks, default="false", desc="for full-bit dir, does the pending msg count reflect the silent acks";
141 MachineID LastResponder, desc="last machine to send a response for this request";
142 MachineID CurOwner, desc="current owner of the block, used for UnblockS responses";
143 Time InitialRequestTime, default="0", desc="time the initial requests was sent from the L1Cache";
144 Time ForwardRequestTime, default="0", desc="time the dir forwarded the request";
145 Time FirstResponseTime, default="0", desc="the time the first response was received";
148 external_type(TBETable) {
150 void allocate(Address);
151 void deallocate(Address);
152 bool isPresent(Address);
155 TBETable TBEs, template_hack="<L1Cache_TBE>";
157 void set_cache_entry(AbstractCacheEntry b);
158 void unset_cache_entry();
162 Entry getCacheEntry(Address address), return_by_pointer="yes" {
163 Entry L2cache_entry := static_cast(Entry, "pointer", L2cacheMemory.lookup(address));
164 if(is_valid(L2cache_entry)) {
165 return L2cache_entry;
168 Entry L1Dcache_entry := static_cast(Entry, "pointer", L1DcacheMemory.lookup(address));
169 if(is_valid(L1Dcache_entry)) {
170 return L1Dcache_entry;
173 Entry L1Icache_entry := static_cast(Entry, "pointer", L1IcacheMemory.lookup(address));
174 return L1Icache_entry;
177 Entry getL2CacheEntry(Address address), return_by_pointer="yes" {
178 Entry L2cache_entry := static_cast(Entry, "pointer", L2cacheMemory.lookup(address));
179 return L2cache_entry;
182 Entry getL1DCacheEntry(Address address), return_by_pointer="yes" {
183 Entry L1Dcache_entry := static_cast(Entry, "pointer", L1DcacheMemory.lookup(address));
184 return L1Dcache_entry;
187 Entry getL1ICacheEntry(Address address), return_by_pointer="yes" {
188 Entry L1Icache_entry := static_cast(Entry, "pointer", L1IcacheMemory.lookup(address));
189 return L1Icache_entry;
192 State getState(TBE tbe, Entry cache_entry, Address addr) {
195 } else if (is_valid(cache_entry)) {
196 return cache_entry.CacheState;
201 void setState(TBE tbe, Entry cache_entry, Address addr, State state) {
202 assert((L1DcacheMemory.isTagPresent(addr) && L1IcacheMemory.isTagPresent(addr)) == false);
203 assert((L1IcacheMemory.isTagPresent(addr) && L2cacheMemory.isTagPresent(addr)) == false);
204 assert((L1DcacheMemory.isTagPresent(addr) && L2cacheMemory.isTagPresent(addr)) == false);
207 tbe.TBEState := state;
210 if (is_valid(cache_entry)) {
211 cache_entry.CacheState := state;
215 Event mandatory_request_type_to_event(CacheRequestType type) {
216 if (type == CacheRequestType:LD) {
218 } else if (type == CacheRequestType:IFETCH) {
220 } else if ((type == CacheRequestType:ST) || (type == CacheRequestType:ATOMIC)) {
223 error("Invalid CacheRequestType");
227 GenericMachineType getNondirectHitMachType(Address addr, MachineID sender) {
228 if (machineIDToMachineType(sender) == MachineType:L1Cache) {
230 // NOTE direct local hits should not call this
232 return GenericMachineType:L1Cache_wCC;
234 return ConvertMachToGenericMach(machineIDToMachineType(sender));
238 GenericMachineType testAndClearLocalHit(Entry cache_entry) {
239 if (is_valid(cache_entry) && cache_entry.FromL2) {
240 cache_entry.FromL2 := false;
241 return GenericMachineType:L2Cache;
243 return GenericMachineType:L1Cache;
247 bool IsAtomicAccessed(Entry cache_entry) {
248 assert(is_valid(cache_entry));
249 return cache_entry.AtomicAccessed;
252 MessageBuffer triggerQueue, ordered="false";
256 out_port(requestNetwork_out, RequestMsg, requestFromCache);
257 out_port(responseNetwork_out, ResponseMsg, responseFromCache);
258 out_port(unblockNetwork_out, ResponseMsg, unblockFromCache);
259 out_port(triggerQueue_out, TriggerMsg, triggerQueue);
264 in_port(triggerQueue_in, TriggerMsg, triggerQueue, rank=3) {
265 if (triggerQueue_in.isReady()) {
266 peek(triggerQueue_in, TriggerMsg) {
268 Entry cache_entry := getCacheEntry(in_msg.Address);
269 TBE tbe := TBEs[in_msg.Address];
271 if (in_msg.Type == TriggerType:L2_to_L1) {
272 trigger(Event:Complete_L2_to_L1, in_msg.Address, cache_entry, tbe);
273 } else if (in_msg.Type == TriggerType:ALL_ACKS) {
274 trigger(Event:All_acks, in_msg.Address, cache_entry, tbe);
275 } else if (in_msg.Type == TriggerType:ALL_ACKS_NO_SHARERS) {
276 trigger(Event:All_acks_no_sharers, in_msg.Address, cache_entry, tbe);
278 error("Unexpected message");
284 // Nothing from the unblock network
287 in_port(responseToCache_in, ResponseMsg, responseToCache, rank=2) {
288 if (responseToCache_in.isReady()) {
289 peek(responseToCache_in, ResponseMsg, block_on="Address") {
291 Entry cache_entry := getCacheEntry(in_msg.Address);
292 TBE tbe := TBEs[in_msg.Address];
294 if (in_msg.Type == CoherenceResponseType:ACK) {
295 trigger(Event:Ack, in_msg.Address, cache_entry, tbe);
296 } else if (in_msg.Type == CoherenceResponseType:ACK_SHARED) {
297 trigger(Event:Shared_Ack, in_msg.Address, cache_entry, tbe);
298 } else if (in_msg.Type == CoherenceResponseType:DATA) {
299 trigger(Event:Data, in_msg.Address, cache_entry, tbe);
300 } else if (in_msg.Type == CoherenceResponseType:DATA_SHARED) {
301 trigger(Event:Shared_Data, in_msg.Address, cache_entry, tbe);
302 } else if (in_msg.Type == CoherenceResponseType:DATA_EXCLUSIVE) {
303 trigger(Event:Exclusive_Data, in_msg.Address, cache_entry, tbe);
305 error("Unexpected message");
312 in_port(forwardToCache_in, RequestMsg, forwardToCache, rank=1) {
313 if (forwardToCache_in.isReady()) {
314 peek(forwardToCache_in, RequestMsg, block_on="Address") {
316 Entry cache_entry := getCacheEntry(in_msg.Address);
317 TBE tbe := TBEs[in_msg.Address];
319 if (in_msg.Type == CoherenceRequestType:GETX) {
320 trigger(Event:Other_GETX, in_msg.Address, cache_entry, tbe);
321 } else if (in_msg.Type == CoherenceRequestType:MERGED_GETS) {
322 trigger(Event:Merged_GETS, in_msg.Address, cache_entry, tbe);
323 } else if (in_msg.Type == CoherenceRequestType:GETS) {
324 if (machineCount(MachineType:L1Cache) > 1) {
325 if (is_valid(cache_entry)) {
326 if (IsAtomicAccessed(cache_entry) && no_mig_atomic) {
327 trigger(Event:Other_GETS_No_Mig, in_msg.Address, cache_entry, tbe);
329 trigger(Event:Other_GETS, in_msg.Address, cache_entry, tbe);
332 trigger(Event:Other_GETS, in_msg.Address, cache_entry, tbe);
335 trigger(Event:NC_DMA_GETS, in_msg.Address, cache_entry, tbe);
337 } else if (in_msg.Type == CoherenceRequestType:INV) {
338 trigger(Event:Invalidate, in_msg.Address, cache_entry, tbe);
339 } else if (in_msg.Type == CoherenceRequestType:WB_ACK) {
340 trigger(Event:Writeback_Ack, in_msg.Address, cache_entry, tbe);
341 } else if (in_msg.Type == CoherenceRequestType:WB_NACK) {
342 trigger(Event:Writeback_Nack, in_msg.Address, cache_entry, tbe);
344 error("Unexpected message");
350 // Nothing from the request network
353 in_port(mandatoryQueue_in, CacheMsg, mandatoryQueue, desc="...", rank=0) {
354 if (mandatoryQueue_in.isReady()) {
355 peek(mandatoryQueue_in, CacheMsg, block_on="LineAddress") {
357 // Check for data access to blocks in I-cache and ifetchs to blocks in D-cache
358 TBE tbe := TBEs[in_msg.LineAddress];
360 if (in_msg.Type == CacheRequestType:IFETCH) {
361 // ** INSTRUCTION ACCESS ***
363 Entry L1Icache_entry := getL1ICacheEntry(in_msg.LineAddress);
364 if (is_valid(L1Icache_entry)) {
365 // The tag matches for the L1, so the L1 fetches the line. We know it can't be in the L2 due to exclusion
366 trigger(mandatory_request_type_to_event(in_msg.Type),
367 in_msg.LineAddress, L1Icache_entry, tbe);
369 // Check to see if it is in the OTHER L1
370 Entry L1Dcache_entry := getL1DCacheEntry(in_msg.LineAddress);
371 if (is_valid(L1Dcache_entry)) {
372 // The block is in the wrong L1, try to write it to the L2
373 if (L2cacheMemory.cacheAvail(in_msg.LineAddress)) {
374 trigger(Event:L1_to_L2, in_msg.LineAddress, L1Dcache_entry, tbe);
376 Address l2_victim_addr := L2cacheMemory.cacheProbe(in_msg.LineAddress);
377 trigger(Event:L2_Replacement,
379 getL2CacheEntry(l2_victim_addr),
380 TBEs[l2_victim_addr]);
384 if (L1IcacheMemory.cacheAvail(in_msg.LineAddress)) {
385 // L1 does't have the line, but we have space for it in the L1
387 Entry L2cache_entry := getL2CacheEntry(in_msg.LineAddress);
388 if (is_valid(L2cache_entry)) {
389 // L2 has it (maybe not with the right permissions)
390 trigger(Event:Trigger_L2_to_L1I, in_msg.LineAddress,
393 // We have room, the L2 doesn't have it, so the L1 fetches the line
394 trigger(mandatory_request_type_to_event(in_msg.Type),
395 in_msg.LineAddress, L1Icache_entry, tbe);
398 // No room in the L1, so we need to make room
399 Address l1i_victim_addr := L1IcacheMemory.cacheProbe(in_msg.LineAddress);
400 if (L2cacheMemory.cacheAvail(l1i_victim_addr)) {
401 // The L2 has room, so we move the line from the L1 to the L2
402 trigger(Event:L1_to_L2,
404 getL1ICacheEntry(l1i_victim_addr),
405 TBEs[l1i_victim_addr]);
407 Address l2_victim_addr := L2cacheMemory.cacheProbe(l1i_victim_addr);
408 // The L2 does not have room, so we replace a line from the L2
409 trigger(Event:L2_Replacement,
411 getL2CacheEntry(l2_victim_addr),
412 TBEs[l2_victim_addr]);
417 // *** DATA ACCESS ***
419 Entry L1Dcache_entry := getL1DCacheEntry(in_msg.LineAddress);
420 if (is_valid(L1Dcache_entry)) {
421 // The tag matches for the L1, so the L1 fetches the line. We know it can't be in the L2 due to exclusion
422 trigger(mandatory_request_type_to_event(in_msg.Type),
423 in_msg.LineAddress, L1Dcache_entry, tbe);
426 // Check to see if it is in the OTHER L1
427 Entry L1Icache_entry := getL1ICacheEntry(in_msg.LineAddress);
428 if (is_valid(L1Icache_entry)) {
429 // The block is in the wrong L1, try to write it to the L2
430 if (L2cacheMemory.cacheAvail(in_msg.LineAddress)) {
431 trigger(Event:L1_to_L2, in_msg.LineAddress, L1Icache_entry, tbe);
433 Address l2_victim_addr := L2cacheMemory.cacheProbe(in_msg.LineAddress);
434 trigger(Event:L2_Replacement,
436 getL2CacheEntry(l2_victim_addr),
437 TBEs[l2_victim_addr]);
441 if (L1DcacheMemory.cacheAvail(in_msg.LineAddress)) {
442 // L1 does't have the line, but we have space for it in the L1
443 Entry L2cache_entry := getL2CacheEntry(in_msg.LineAddress);
444 if (is_valid(L2cache_entry)) {
445 // L2 has it (maybe not with the right permissions)
446 trigger(Event:Trigger_L2_to_L1D, in_msg.LineAddress,
449 // We have room, the L2 doesn't have it, so the L1 fetches the line
450 trigger(mandatory_request_type_to_event(in_msg.Type),
451 in_msg.LineAddress, L1Dcache_entry, tbe);
454 // No room in the L1, so we need to make room
455 Address l1d_victim_addr := L1DcacheMemory.cacheProbe(in_msg.LineAddress);
456 if (L2cacheMemory.cacheAvail(l1d_victim_addr)) {
457 // The L2 has room, so we move the line from the L1 to the L2
458 trigger(Event:L1_to_L2,
460 getL1DCacheEntry(l1d_victim_addr),
461 TBEs[l1d_victim_addr]);
463 Address l2_victim_addr := L2cacheMemory.cacheProbe(l1d_victim_addr);
464 // The L2 does not have room, so we replace a line from the L2
465 trigger(Event:L2_Replacement,
467 getL2CacheEntry(l2_victim_addr),
468 TBEs[l2_victim_addr]);
479 action(a_issueGETS, "a", desc="Issue GETS") {
480 enqueue(requestNetwork_out, RequestMsg, latency=issue_latency) {
481 assert(is_valid(tbe));
482 out_msg.Address := address;
483 out_msg.Type := CoherenceRequestType:GETS;
484 out_msg.Requestor := machineID;
485 out_msg.Destination.add(map_Address_to_Directory(address));
486 out_msg.MessageSize := MessageSizeType:Request_Control;
487 out_msg.InitialRequestTime := get_time();
488 tbe.NumPendingMsgs := machineCount(MachineType:L1Cache); // One from each other cache (n-1) plus the memory (+1)
492 action(b_issueGETX, "b", desc="Issue GETX") {
493 enqueue(requestNetwork_out, RequestMsg, latency=issue_latency) {
494 assert(is_valid(tbe));
495 out_msg.Address := address;
496 out_msg.Type := CoherenceRequestType:GETX;
497 out_msg.Requestor := machineID;
498 out_msg.Destination.add(map_Address_to_Directory(address));
499 out_msg.MessageSize := MessageSizeType:Request_Control;
500 out_msg.InitialRequestTime := get_time();
501 tbe.NumPendingMsgs := machineCount(MachineType:L1Cache); // One from each other cache (n-1) plus the memory (+1)
505 action(c_sendExclusiveData, "c", desc="Send exclusive data from cache to requestor") {
506 peek(forwardToCache_in, RequestMsg) {
507 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
508 assert(is_valid(cache_entry));
509 out_msg.Address := address;
510 out_msg.Type := CoherenceResponseType:DATA_EXCLUSIVE;
511 out_msg.Sender := machineID;
512 out_msg.Destination.add(in_msg.Requestor);
513 out_msg.DataBlk := cache_entry.DataBlk;
514 out_msg.Dirty := cache_entry.Dirty;
515 if (in_msg.DirectedProbe) {
516 out_msg.Acks := machineCount(MachineType:L1Cache);
520 out_msg.SilentAcks := in_msg.SilentAcks;
521 out_msg.MessageSize := MessageSizeType:Response_Data;
522 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
523 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
528 action(d_issuePUT, "d", desc="Issue PUT") {
529 enqueue(requestNetwork_out, RequestMsg, latency=issue_latency) {
530 out_msg.Address := address;
531 out_msg.Type := CoherenceRequestType:PUT;
532 out_msg.Requestor := machineID;
533 out_msg.Destination.add(map_Address_to_Directory(address));
534 out_msg.MessageSize := MessageSizeType:Writeback_Control;
538 action(e_sendData, "e", desc="Send data from cache to requestor") {
539 peek(forwardToCache_in, RequestMsg) {
540 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
541 assert(is_valid(cache_entry));
542 out_msg.Address := address;
543 out_msg.Type := CoherenceResponseType:DATA;
544 out_msg.Sender := machineID;
545 out_msg.Destination.add(in_msg.Requestor);
546 out_msg.DataBlk := cache_entry.DataBlk;
547 out_msg.Dirty := cache_entry.Dirty;
548 if (in_msg.DirectedProbe) {
549 out_msg.Acks := machineCount(MachineType:L1Cache);
553 out_msg.SilentAcks := in_msg.SilentAcks;
554 out_msg.MessageSize := MessageSizeType:Response_Data;
555 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
556 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
561 action(ee_sendDataShared, "\e", desc="Send data from cache to requestor, keep a shared copy") {
562 peek(forwardToCache_in, RequestMsg) {
563 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
564 assert(is_valid(cache_entry));
565 out_msg.Address := address;
566 out_msg.Type := CoherenceResponseType:DATA_SHARED;
567 out_msg.Sender := machineID;
568 out_msg.Destination.add(in_msg.Requestor);
569 out_msg.DataBlk := cache_entry.DataBlk;
570 out_msg.Dirty := cache_entry.Dirty;
571 DPRINTF(RubySlicc, "%s\n", out_msg.DataBlk);
572 if (in_msg.DirectedProbe) {
573 out_msg.Acks := machineCount(MachineType:L1Cache);
577 out_msg.SilentAcks := in_msg.SilentAcks;
578 out_msg.MessageSize := MessageSizeType:Response_Data;
579 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
580 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
585 action(em_sendDataSharedMultiple, "em", desc="Send data from cache to all requestors") {
586 peek(forwardToCache_in, RequestMsg) {
587 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
588 assert(is_valid(cache_entry));
589 out_msg.Address := address;
590 out_msg.Type := CoherenceResponseType:DATA_SHARED;
591 out_msg.Sender := machineID;
592 out_msg.Destination := in_msg.MergedRequestors;
593 out_msg.DataBlk := cache_entry.DataBlk;
594 out_msg.Dirty := cache_entry.Dirty;
595 DPRINTF(RubySlicc, "%s\n", out_msg.DataBlk);
596 out_msg.Acks := machineCount(MachineType:L1Cache);
597 out_msg.SilentAcks := in_msg.SilentAcks;
598 out_msg.MessageSize := MessageSizeType:Response_Data;
599 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
600 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
605 action(f_sendAck, "f", desc="Send ack from cache to requestor") {
606 peek(forwardToCache_in, RequestMsg) {
607 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
608 out_msg.Address := address;
609 out_msg.Type := CoherenceResponseType:ACK;
610 out_msg.Sender := machineID;
611 out_msg.Destination.add(in_msg.Requestor);
613 out_msg.SilentAcks := in_msg.SilentAcks;
614 assert(in_msg.DirectedProbe == false);
615 out_msg.MessageSize := MessageSizeType:Response_Control;
616 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
617 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
622 action(ff_sendAckShared, "\f", desc="Send shared ack from cache to requestor") {
623 peek(forwardToCache_in, RequestMsg) {
624 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
625 out_msg.Address := address;
626 out_msg.Type := CoherenceResponseType:ACK_SHARED;
627 out_msg.Sender := machineID;
628 out_msg.Destination.add(in_msg.Requestor);
630 out_msg.SilentAcks := in_msg.SilentAcks;
631 assert(in_msg.DirectedProbe == false);
632 out_msg.MessageSize := MessageSizeType:Response_Control;
633 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
634 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
639 action(g_sendUnblock, "g", desc="Send unblock to memory") {
640 enqueue(unblockNetwork_out, ResponseMsg, latency=cache_response_latency) {
641 out_msg.Address := address;
642 out_msg.Type := CoherenceResponseType:UNBLOCK;
643 out_msg.Sender := machineID;
644 out_msg.Destination.add(map_Address_to_Directory(address));
645 out_msg.MessageSize := MessageSizeType:Unblock_Control;
649 action(gm_sendUnblockM, "gm", desc="Send unblock to memory and indicate M/O/E state") {
650 enqueue(unblockNetwork_out, ResponseMsg, latency=cache_response_latency) {
651 out_msg.Address := address;
652 out_msg.Type := CoherenceResponseType:UNBLOCKM;
653 out_msg.Sender := machineID;
654 out_msg.Destination.add(map_Address_to_Directory(address));
655 out_msg.MessageSize := MessageSizeType:Unblock_Control;
659 action(gs_sendUnblockS, "gs", desc="Send unblock to memory and indicate S state") {
660 enqueue(unblockNetwork_out, ResponseMsg, latency=cache_response_latency) {
661 assert(is_valid(tbe));
662 out_msg.Address := address;
663 out_msg.Type := CoherenceResponseType:UNBLOCKS;
664 out_msg.Sender := machineID;
665 out_msg.CurOwner := tbe.CurOwner;
666 out_msg.Destination.add(map_Address_to_Directory(address));
667 out_msg.MessageSize := MessageSizeType:Unblock_Control;
671 action(h_load_hit, "h", desc="Notify sequencer the load completed.") {
672 assert(is_valid(cache_entry));
673 DPRINTF(RubySlicc, "%s\n", cache_entry.DataBlk);
674 sequencer.readCallback(address, testAndClearLocalHit(cache_entry),
675 cache_entry.DataBlk);
678 action(hx_external_load_hit, "hx", desc="load required external msgs") {
679 assert(is_valid(cache_entry));
680 assert(is_valid(tbe));
681 DPRINTF(RubySlicc, "%s\n", cache_entry.DataBlk);
682 peek(responseToCache_in, ResponseMsg) {
684 sequencer.readCallback(address,
685 getNondirectHitMachType(in_msg.Address, in_msg.Sender),
687 tbe.InitialRequestTime,
688 tbe.ForwardRequestTime,
689 tbe.FirstResponseTime);
693 action(hh_store_hit, "\h", desc="Notify sequencer that store completed.") {
694 assert(is_valid(cache_entry));
695 DPRINTF(RubySlicc, "%s\n", cache_entry.DataBlk);
696 peek(mandatoryQueue_in, CacheMsg) {
697 sequencer.writeCallback(address, testAndClearLocalHit(cache_entry),
698 cache_entry.DataBlk);
700 cache_entry.Dirty := true;
701 if (in_msg.Type == CacheRequestType:ATOMIC) {
702 cache_entry.AtomicAccessed := true;
707 action(sx_external_store_hit, "sx", desc="store required external msgs.") {
708 assert(is_valid(cache_entry));
709 assert(is_valid(tbe));
710 DPRINTF(RubySlicc, "%s\n", cache_entry.DataBlk);
711 peek(responseToCache_in, ResponseMsg) {
713 sequencer.writeCallback(address,
714 getNondirectHitMachType(address, in_msg.Sender),
716 tbe.InitialRequestTime,
717 tbe.ForwardRequestTime,
718 tbe.FirstResponseTime);
720 cache_entry.Dirty := true;
723 action(sxt_trig_ext_store_hit, "sxt", desc="store required external msgs.") {
724 assert(is_valid(cache_entry));
725 assert(is_valid(tbe));
726 DPRINTF(RubySlicc, "%s\n", cache_entry.DataBlk);
728 sequencer.writeCallback(address,
729 getNondirectHitMachType(address, tbe.LastResponder),
731 tbe.InitialRequestTime,
732 tbe.ForwardRequestTime,
733 tbe.FirstResponseTime);
735 cache_entry.Dirty := true;
738 action(i_allocateTBE, "i", desc="Allocate TBE") {
739 check_allocate(TBEs);
740 assert(is_valid(cache_entry));
741 TBEs.allocate(address);
742 set_tbe(TBEs[address]);
743 tbe.DataBlk := cache_entry.DataBlk; // Data only used for writebacks
744 tbe.Dirty := cache_entry.Dirty;
745 tbe.Sharers := false;
748 action(j_popTriggerQueue, "j", desc="Pop trigger queue.") {
749 triggerQueue_in.dequeue();
752 action(k_popMandatoryQueue, "k", desc="Pop mandatory queue.") {
753 mandatoryQueue_in.dequeue();
756 action(l_popForwardQueue, "l", desc="Pop forwareded request queue.") {
757 forwardToCache_in.dequeue();
760 action(hp_copyFromTBEToL2, "li", desc="Copy data from TBE to L2 cache entry.") {
761 assert(is_valid(cache_entry));
762 assert(is_valid(tbe));
763 cache_entry.Dirty := tbe.Dirty;
764 cache_entry.DataBlk := tbe.DataBlk;
767 action(nb_copyFromTBEToL1, "fu", desc="Copy data from TBE to L1 cache entry.") {
768 assert(is_valid(cache_entry));
769 assert(is_valid(tbe));
770 cache_entry.Dirty := tbe.Dirty;
771 cache_entry.DataBlk := tbe.DataBlk;
772 cache_entry.FromL2 := true;
775 action(m_decrementNumberOfMessages, "m", desc="Decrement the number of messages for which we're waiting") {
776 peek(responseToCache_in, ResponseMsg) {
777 assert(in_msg.Acks > 0);
778 assert(is_valid(tbe));
779 DPRINTF(RubySlicc, "Sender = %s\n", in_msg.Sender);
780 DPRINTF(RubySlicc, "SilentAcks = %d\n", in_msg.SilentAcks);
781 if (tbe.AppliedSilentAcks == false) {
782 tbe.NumPendingMsgs := tbe.NumPendingMsgs - in_msg.SilentAcks;
783 tbe.AppliedSilentAcks := true;
785 DPRINTF(RubySlicc, "%d\n", tbe.NumPendingMsgs);
786 tbe.NumPendingMsgs := tbe.NumPendingMsgs - in_msg.Acks;
787 DPRINTF(RubySlicc, "%d\n", tbe.NumPendingMsgs);
788 APPEND_TRANSITION_COMMENT(tbe.NumPendingMsgs);
789 APPEND_TRANSITION_COMMENT(in_msg.Sender);
790 tbe.LastResponder := in_msg.Sender;
791 if (tbe.InitialRequestTime != zero_time() && in_msg.InitialRequestTime != zero_time()) {
792 assert(tbe.InitialRequestTime == in_msg.InitialRequestTime);
794 if (in_msg.InitialRequestTime != zero_time()) {
795 tbe.InitialRequestTime := in_msg.InitialRequestTime;
797 if (tbe.ForwardRequestTime != zero_time() && in_msg.ForwardRequestTime != zero_time()) {
798 assert(tbe.ForwardRequestTime == in_msg.ForwardRequestTime);
800 if (in_msg.ForwardRequestTime != zero_time()) {
801 tbe.ForwardRequestTime := in_msg.ForwardRequestTime;
803 if (tbe.FirstResponseTime == zero_time()) {
804 tbe.FirstResponseTime := get_time();
808 action(uo_updateCurrentOwner, "uo", desc="When moving SS state, update current owner.") {
809 peek(responseToCache_in, ResponseMsg) {
810 assert(is_valid(tbe));
811 tbe.CurOwner := in_msg.Sender;
815 action(n_popResponseQueue, "n", desc="Pop response queue") {
816 responseToCache_in.dequeue();
819 action(ll_L2toL1Transfer, "ll", desc="") {
820 enqueue(triggerQueue_out, TriggerMsg, latency=l2_cache_hit_latency) {
821 out_msg.Address := address;
822 out_msg.Type := TriggerType:L2_to_L1;
826 action(o_checkForCompletion, "o", desc="Check if we have received all the messages required for completion") {
827 assert(is_valid(tbe));
828 if (tbe.NumPendingMsgs == 0) {
829 enqueue(triggerQueue_out, TriggerMsg) {
830 out_msg.Address := address;
832 out_msg.Type := TriggerType:ALL_ACKS;
834 out_msg.Type := TriggerType:ALL_ACKS_NO_SHARERS;
840 action(p_decrementNumberOfMessagesByOne, "p", desc="Decrement the number of messages for which we're waiting by one") {
841 assert(is_valid(tbe));
842 tbe.NumPendingMsgs := tbe.NumPendingMsgs - 1;
845 action(pp_incrementNumberOfMessagesByOne, "\p", desc="Increment the number of messages for which we're waiting by one") {
846 assert(is_valid(tbe));
847 tbe.NumPendingMsgs := tbe.NumPendingMsgs + 1;
850 action(q_sendDataFromTBEToCache, "q", desc="Send data from TBE to cache") {
851 peek(forwardToCache_in, RequestMsg) {
852 assert(in_msg.Requestor != machineID);
853 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
854 assert(is_valid(tbe));
855 out_msg.Address := address;
856 out_msg.Type := CoherenceResponseType:DATA;
857 out_msg.Sender := machineID;
858 out_msg.Destination.add(in_msg.Requestor);
859 DPRINTF(RubySlicc, "%s\n", out_msg.Destination);
860 out_msg.DataBlk := tbe.DataBlk;
861 out_msg.Dirty := tbe.Dirty;
862 if (in_msg.DirectedProbe) {
863 out_msg.Acks := machineCount(MachineType:L1Cache);
867 out_msg.SilentAcks := in_msg.SilentAcks;
868 out_msg.MessageSize := MessageSizeType:Response_Data;
869 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
870 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
875 action(qm_sendDataFromTBEToCache, "qm", desc="Send data from TBE to cache, multiple sharers") {
876 peek(forwardToCache_in, RequestMsg) {
877 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
878 assert(is_valid(tbe));
879 out_msg.Address := address;
880 out_msg.Type := CoherenceResponseType:DATA;
881 out_msg.Sender := machineID;
882 out_msg.Destination := in_msg.MergedRequestors;
883 DPRINTF(RubySlicc, "%s\n", out_msg.Destination);
884 out_msg.DataBlk := tbe.DataBlk;
885 out_msg.Dirty := tbe.Dirty;
886 out_msg.Acks := machineCount(MachineType:L1Cache);
887 out_msg.SilentAcks := in_msg.SilentAcks;
888 out_msg.MessageSize := MessageSizeType:Response_Data;
889 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
890 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
895 action(qq_sendDataFromTBEToMemory, "\q", desc="Send data from TBE to memory") {
896 enqueue(unblockNetwork_out, ResponseMsg, latency=cache_response_latency) {
897 assert(is_valid(tbe));
898 out_msg.Address := address;
899 out_msg.Sender := machineID;
900 out_msg.Destination.add(map_Address_to_Directory(address));
901 out_msg.Dirty := tbe.Dirty;
903 out_msg.Type := CoherenceResponseType:WB_DIRTY;
904 out_msg.DataBlk := tbe.DataBlk;
905 out_msg.MessageSize := MessageSizeType:Writeback_Data;
907 out_msg.Type := CoherenceResponseType:WB_CLEAN;
908 // NOTE: in a real system this would not send data. We send
909 // data here only so we can check it at the memory
910 out_msg.DataBlk := tbe.DataBlk;
911 out_msg.MessageSize := MessageSizeType:Writeback_Control;
916 action(r_setSharerBit, "r", desc="We saw other sharers") {
917 assert(is_valid(tbe));
921 action(s_deallocateTBE, "s", desc="Deallocate TBE") {
922 TBEs.deallocate(address);
926 action(t_sendExclusiveDataFromTBEToMemory, "t", desc="Send exclusive data from TBE to memory") {
927 enqueue(unblockNetwork_out, ResponseMsg, latency=cache_response_latency) {
928 assert(is_valid(tbe));
929 out_msg.Address := address;
930 out_msg.Sender := machineID;
931 out_msg.Destination.add(map_Address_to_Directory(address));
932 out_msg.DataBlk := tbe.DataBlk;
933 out_msg.Dirty := tbe.Dirty;
935 out_msg.Type := CoherenceResponseType:WB_EXCLUSIVE_DIRTY;
936 out_msg.DataBlk := tbe.DataBlk;
937 out_msg.MessageSize := MessageSizeType:Writeback_Data;
939 out_msg.Type := CoherenceResponseType:WB_EXCLUSIVE_CLEAN;
940 // NOTE: in a real system this would not send data. We send
941 // data here only so we can check it at the memory
942 out_msg.DataBlk := tbe.DataBlk;
943 out_msg.MessageSize := MessageSizeType:Writeback_Control;
948 action(u_writeDataToCache, "u", desc="Write data to cache") {
949 peek(responseToCache_in, ResponseMsg) {
950 assert(is_valid(cache_entry));
951 cache_entry.DataBlk := in_msg.DataBlk;
952 cache_entry.Dirty := in_msg.Dirty;
956 action(v_writeDataToCacheVerify, "v", desc="Write data to cache, assert it was same as before") {
957 peek(responseToCache_in, ResponseMsg) {
958 assert(is_valid(cache_entry));
959 DPRINTF(RubySlicc, "Cached Data Block: %s, Msg Data Block: %s\n",
960 cache_entry.DataBlk, in_msg.DataBlk);
961 assert(cache_entry.DataBlk == in_msg.DataBlk);
962 cache_entry.DataBlk := in_msg.DataBlk;
963 cache_entry.Dirty := in_msg.Dirty || cache_entry.Dirty;
967 action(gg_deallocateL1CacheBlock, "\g", desc="Deallocate cache block. Sets the cache to invalid, allowing a replacement in parallel with a fetch.") {
968 if (L1DcacheMemory.isTagPresent(address)) {
969 L1DcacheMemory.deallocate(address);
971 L1IcacheMemory.deallocate(address);
976 action(ii_allocateL1DCacheBlock, "\i", desc="Set L1 D-cache tag equal to tag of block B.") {
977 if (is_invalid(cache_entry)) {
978 set_cache_entry(L1DcacheMemory.allocate(address, new Entry));
982 action(jj_allocateL1ICacheBlock, "\j", desc="Set L1 I-cache tag equal to tag of block B.") {
983 if (is_invalid(cache_entry)) {
984 set_cache_entry(L1IcacheMemory.allocate(address, new Entry));
988 action(vv_allocateL2CacheBlock, "\v", desc="Set L2 cache tag equal to tag of block B.") {
989 set_cache_entry(L2cacheMemory.allocate(address, new Entry));
992 action(rr_deallocateL2CacheBlock, "\r", desc="Deallocate L2 cache block. Sets the cache to not present, allowing a replacement in parallel with a fetch.") {
993 L2cacheMemory.deallocate(address);
997 action(uu_profileMiss, "\u", desc="Profile the demand miss") {
998 peek(mandatoryQueue_in, CacheMsg) {
999 if (L1IcacheMemory.isTagPresent(address)) {
1000 L1IcacheMemory.profileMiss(in_msg);
1001 } else if (L1DcacheMemory.isTagPresent(address)) {
1002 L1DcacheMemory.profileMiss(in_msg);
1004 if (L2cacheMemory.isTagPresent(address) == false) {
1005 L2cacheMemory.profileMiss(in_msg);
1010 action(zz_stallAndWaitMandatoryQueue, "\z", desc="Send the head of the mandatory queue to the back of the queue.") {
1011 stall_and_wait(mandatoryQueue_in, address);
1014 action(kd_wakeUpDependents, "kd", desc="wake-up dependents") {
1015 wake_up_dependents(address);
1018 action(ka_wakeUpAllDependents, "ka", desc="wake-up all dependents") {
1019 wake_up_all_dependents();
1022 //*****************************************************
1024 //*****************************************************
1026 // Transitions for Load/Store/L2_Replacement from transient states
1027 transition({IM, SM, ISM, OM, IS, SS, OI, MI, II, IT, ST, OT, MT, MMT}, {Store, L2_Replacement}) {
1028 zz_stallAndWaitMandatoryQueue;
1031 transition({M_W, MM_W}, {L2_Replacement}) {
1032 zz_stallAndWaitMandatoryQueue;
1035 transition({IM, IS, OI, MI, II, IT, ST, OT, MT, MMT}, {Load, Ifetch}) {
1036 zz_stallAndWaitMandatoryQueue;
1039 transition({IM, SM, ISM, OM, IS, SS, MM_W, M_W, OI, MI, II, IT, ST, OT, MT, MMT}, L1_to_L2) {
1040 zz_stallAndWaitMandatoryQueue;
1043 transition({IT, ST, OT, MT, MMT}, {Other_GETX, NC_DMA_GETS, Other_GETS, Merged_GETS, Other_GETS_No_Mig, Invalidate}) {
1047 // Transitions moving data between the L1 and L2 caches
1048 transition({I, S, O, M, MM}, L1_to_L2) {
1050 gg_deallocateL1CacheBlock;
1051 vv_allocateL2CacheBlock;
1054 ka_wakeUpAllDependents;
1057 transition(I, Trigger_L2_to_L1D, IT) {
1059 rr_deallocateL2CacheBlock;
1060 ii_allocateL1DCacheBlock;
1061 nb_copyFromTBEToL1; // Not really needed for state I
1064 zz_stallAndWaitMandatoryQueue;
1068 transition(S, Trigger_L2_to_L1D, ST) {
1070 rr_deallocateL2CacheBlock;
1071 ii_allocateL1DCacheBlock;
1075 zz_stallAndWaitMandatoryQueue;
1079 transition(O, Trigger_L2_to_L1D, OT) {
1081 rr_deallocateL2CacheBlock;
1082 ii_allocateL1DCacheBlock;
1086 zz_stallAndWaitMandatoryQueue;
1090 transition(M, Trigger_L2_to_L1D, MT) {
1092 rr_deallocateL2CacheBlock;
1093 ii_allocateL1DCacheBlock;
1097 zz_stallAndWaitMandatoryQueue;
1101 transition(MM, Trigger_L2_to_L1D, MMT) {
1103 rr_deallocateL2CacheBlock;
1104 ii_allocateL1DCacheBlock;
1108 zz_stallAndWaitMandatoryQueue;
1112 transition(I, Trigger_L2_to_L1I, IT) {
1114 rr_deallocateL2CacheBlock;
1115 jj_allocateL1ICacheBlock;
1119 zz_stallAndWaitMandatoryQueue;
1123 transition(S, Trigger_L2_to_L1I, ST) {
1125 rr_deallocateL2CacheBlock;
1126 jj_allocateL1ICacheBlock;
1130 zz_stallAndWaitMandatoryQueue;
1134 transition(O, Trigger_L2_to_L1I, OT) {
1136 rr_deallocateL2CacheBlock;
1137 jj_allocateL1ICacheBlock;
1141 zz_stallAndWaitMandatoryQueue;
1145 transition(M, Trigger_L2_to_L1I, MT) {
1147 rr_deallocateL2CacheBlock;
1148 jj_allocateL1ICacheBlock;
1152 zz_stallAndWaitMandatoryQueue;
1156 transition(MM, Trigger_L2_to_L1I, MMT) {
1158 rr_deallocateL2CacheBlock;
1159 jj_allocateL1ICacheBlock;
1163 zz_stallAndWaitMandatoryQueue;
1167 transition(IT, Complete_L2_to_L1, I) {
1169 kd_wakeUpDependents;
1172 transition(ST, Complete_L2_to_L1, S) {
1174 kd_wakeUpDependents;
1177 transition(OT, Complete_L2_to_L1, O) {
1179 kd_wakeUpDependents;
1182 transition(MT, Complete_L2_to_L1, M) {
1184 kd_wakeUpDependents;
1187 transition(MMT, Complete_L2_to_L1, MM) {
1189 kd_wakeUpDependents;
1192 // Transitions from Idle
1193 transition(I, Load, IS) {
1194 ii_allocateL1DCacheBlock;
1198 k_popMandatoryQueue;
1201 transition(I, Ifetch, IS) {
1202 jj_allocateL1ICacheBlock;
1206 k_popMandatoryQueue;
1209 transition(I, Store, IM) {
1210 ii_allocateL1DCacheBlock;
1214 k_popMandatoryQueue;
1217 transition(I, L2_Replacement) {
1218 rr_deallocateL2CacheBlock;
1219 ka_wakeUpAllDependents;
1222 transition(I, {Other_GETX, NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig, Invalidate}) {
1227 // Transitions from Shared
1228 transition({S, SM, ISM}, {Load, Ifetch}) {
1230 k_popMandatoryQueue;
1233 transition(S, Store, SM) {
1237 k_popMandatoryQueue;
1240 transition(S, L2_Replacement, I) {
1241 rr_deallocateL2CacheBlock;
1242 ka_wakeUpAllDependents;
1245 transition(S, {Other_GETX, Invalidate}, I) {
1250 transition(S, {NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig}) {
1255 // Transitions from Owned
1256 transition({O, OM, SS, MM_W, M_W}, {Load, Ifetch}) {
1258 k_popMandatoryQueue;
1261 transition(O, Store, OM) {
1264 p_decrementNumberOfMessagesByOne;
1266 k_popMandatoryQueue;
1269 transition(O, L2_Replacement, OI) {
1272 rr_deallocateL2CacheBlock;
1273 ka_wakeUpAllDependents;
1276 transition(O, {Other_GETX, Invalidate}, I) {
1281 transition(O, {NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig}) {
1286 transition(O, Merged_GETS) {
1287 em_sendDataSharedMultiple;
1291 // Transitions from Modified
1292 transition(MM, {Load, Ifetch}) {
1294 k_popMandatoryQueue;
1297 transition(MM, Store) {
1299 k_popMandatoryQueue;
1302 transition(MM, L2_Replacement, MI) {
1305 rr_deallocateL2CacheBlock;
1306 ka_wakeUpAllDependents;
1309 transition(MM, {Other_GETX, Invalidate}, I) {
1310 c_sendExclusiveData;
1314 transition(MM, Other_GETS, I) {
1315 c_sendExclusiveData;
1319 transition(MM, NC_DMA_GETS) {
1320 c_sendExclusiveData;
1324 transition(MM, Other_GETS_No_Mig, O) {
1329 transition(MM, Merged_GETS, O) {
1330 em_sendDataSharedMultiple;
1334 // Transitions from Dirty Exclusive
1335 transition(M, {Load, Ifetch}) {
1337 k_popMandatoryQueue;
1340 transition(M, Store, MM) {
1342 k_popMandatoryQueue;
1345 transition(M, L2_Replacement, MI) {
1348 rr_deallocateL2CacheBlock;
1349 ka_wakeUpAllDependents;
1352 transition(M, {Other_GETX, Invalidate}, I) {
1353 c_sendExclusiveData;
1357 transition(M, {Other_GETS, Other_GETS_No_Mig}, O) {
1362 transition(M, NC_DMA_GETS) {
1367 transition(M, Merged_GETS, O) {
1368 em_sendDataSharedMultiple;
1372 // Transitions from IM
1374 transition(IM, {Other_GETX, NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig, Invalidate}) {
1379 transition(IM, Ack) {
1380 m_decrementNumberOfMessages;
1381 o_checkForCompletion;
1385 transition(IM, Data, ISM) {
1387 m_decrementNumberOfMessages;
1388 o_checkForCompletion;
1392 transition(IM, Exclusive_Data, MM_W) {
1394 m_decrementNumberOfMessages;
1395 o_checkForCompletion;
1396 sx_external_store_hit;
1398 kd_wakeUpDependents;
1401 // Transitions from SM
1402 transition(SM, {NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig}) {
1407 transition(SM, {Other_GETX, Invalidate}, IM) {
1412 transition(SM, Ack) {
1413 m_decrementNumberOfMessages;
1414 o_checkForCompletion;
1418 transition(SM, {Data, Exclusive_Data}, ISM) {
1419 v_writeDataToCacheVerify;
1420 m_decrementNumberOfMessages;
1421 o_checkForCompletion;
1425 // Transitions from ISM
1426 transition(ISM, Ack) {
1427 m_decrementNumberOfMessages;
1428 o_checkForCompletion;
1432 transition(ISM, All_acks_no_sharers, MM) {
1433 sxt_trig_ext_store_hit;
1437 kd_wakeUpDependents;
1440 // Transitions from OM
1442 transition(OM, {Other_GETX, Invalidate}, IM) {
1444 pp_incrementNumberOfMessagesByOne;
1448 transition(OM, {NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig}) {
1453 transition(OM, Merged_GETS) {
1454 em_sendDataSharedMultiple;
1458 transition(OM, Ack) {
1459 m_decrementNumberOfMessages;
1460 o_checkForCompletion;
1464 transition(OM, {All_acks, All_acks_no_sharers}, MM) {
1465 sxt_trig_ext_store_hit;
1469 kd_wakeUpDependents;
1472 // Transitions from IS
1474 transition(IS, {Other_GETX, NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig, Invalidate}) {
1479 transition(IS, Ack) {
1480 m_decrementNumberOfMessages;
1481 o_checkForCompletion;
1485 transition(IS, Shared_Ack) {
1486 m_decrementNumberOfMessages;
1488 o_checkForCompletion;
1492 transition(IS, Data, SS) {
1494 m_decrementNumberOfMessages;
1495 o_checkForCompletion;
1496 hx_external_load_hit;
1497 uo_updateCurrentOwner;
1499 kd_wakeUpDependents;
1502 transition(IS, Exclusive_Data, M_W) {
1504 m_decrementNumberOfMessages;
1505 o_checkForCompletion;
1506 hx_external_load_hit;
1508 kd_wakeUpDependents;
1511 transition(IS, Shared_Data, SS) {
1514 m_decrementNumberOfMessages;
1515 o_checkForCompletion;
1516 hx_external_load_hit;
1517 uo_updateCurrentOwner;
1519 kd_wakeUpDependents;
1522 // Transitions from SS
1524 transition(SS, Ack) {
1525 m_decrementNumberOfMessages;
1526 o_checkForCompletion;
1530 transition(SS, Shared_Ack) {
1531 m_decrementNumberOfMessages;
1533 o_checkForCompletion;
1537 transition(SS, All_acks, S) {
1541 kd_wakeUpDependents;
1544 transition(SS, All_acks_no_sharers, S) {
1545 // Note: The directory might still be the owner, so that is why we go to S
1549 kd_wakeUpDependents;
1552 // Transitions from MM_W
1554 transition(MM_W, Store) {
1556 k_popMandatoryQueue;
1559 transition(MM_W, Ack) {
1560 m_decrementNumberOfMessages;
1561 o_checkForCompletion;
1565 transition(MM_W, All_acks_no_sharers, MM) {
1569 kd_wakeUpDependents;
1572 // Transitions from M_W
1574 transition(M_W, Store, MM_W) {
1576 k_popMandatoryQueue;
1579 transition(M_W, Ack) {
1580 m_decrementNumberOfMessages;
1581 o_checkForCompletion;
1585 transition(M_W, All_acks_no_sharers, M) {
1589 kd_wakeUpDependents;
1592 // Transitions from OI/MI
1594 transition({OI, MI}, {Other_GETX, Invalidate}, II) {
1595 q_sendDataFromTBEToCache;
1599 transition({OI, MI}, {NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig}, OI) {
1600 q_sendDataFromTBEToCache;
1604 transition({OI, MI}, Merged_GETS, OI) {
1605 qm_sendDataFromTBEToCache;
1609 transition(MI, Writeback_Ack, I) {
1610 t_sendExclusiveDataFromTBEToMemory;
1613 kd_wakeUpDependents;
1616 transition(OI, Writeback_Ack, I) {
1617 qq_sendDataFromTBEToMemory;
1620 kd_wakeUpDependents;
1623 // Transitions from II
1624 transition(II, {NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig, Other_GETX, Invalidate}, II) {
1629 transition(II, Writeback_Ack, I) {
1633 kd_wakeUpDependents;
1636 transition(II, Writeback_Nack, I) {
1639 kd_wakeUpDependents;