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 enumeration(State, desc="Cache states", default="L1Cache_State_I") {
62 M, desc="Modified (dirty)";
63 MM, desc="Modified (dirty and locally modified)";
66 IM, "IM", desc="Issued GetX";
67 SM, "SM", desc="Issued GetX, we still have an old copy of the line";
68 OM, "OM", desc="Issued GetX, received data";
69 ISM, "ISM", desc="Issued GetX, received data, waiting for all acks";
70 M_W, "M^W", desc="Issued GetS, received exclusive data";
71 MM_W, "MM^W", desc="Issued GetX, received exclusive data";
72 IS, "IS", desc="Issued GetS";
73 SS, "SS", desc="Issued GetS, received data, waiting for all acks";
74 OI, "OI", desc="Issued PutO, waiting for ack";
75 MI, "MI", desc="Issued PutX, waiting for ack";
76 II, "II", desc="Issued PutX/O, saw Other_GETS or Other_GETX, waiting for ack";
77 IT, "IT", desc="Invalid block transferring to L1";
78 ST, "ST", desc="S block transferring to L1";
79 OT, "OT", desc="O block transferring to L1";
80 MT, "MT", desc="M block transferring to L1";
81 MMT, "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;
214 if ((state == State:MM) ||
215 (state == State:MM_W)) {
216 cache_entry.changePermission(AccessPermission:Read_Write);
217 } else if (state == State:S ||
220 state == State:M_W ||
222 state == State:ISM ||
225 cache_entry.changePermission(AccessPermission:Read_Only);
227 cache_entry.changePermission(AccessPermission:Invalid);
232 Event mandatory_request_type_to_event(CacheRequestType type) {
233 if (type == CacheRequestType:LD) {
235 } else if (type == CacheRequestType:IFETCH) {
237 } else if ((type == CacheRequestType:ST) || (type == CacheRequestType:ATOMIC)) {
240 error("Invalid CacheRequestType");
244 GenericMachineType getNondirectHitMachType(Address addr, MachineID sender) {
245 if (machineIDToMachineType(sender) == MachineType:L1Cache) {
247 // NOTE direct local hits should not call this
249 return GenericMachineType:L1Cache_wCC;
251 return ConvertMachToGenericMach(machineIDToMachineType(sender));
255 GenericMachineType testAndClearLocalHit(Entry cache_entry) {
256 if (is_valid(cache_entry) && cache_entry.FromL2) {
257 cache_entry.FromL2 := false;
258 return GenericMachineType:L2Cache;
260 return GenericMachineType:L1Cache;
264 bool IsAtomicAccessed(Entry cache_entry) {
265 assert(is_valid(cache_entry));
266 return cache_entry.AtomicAccessed;
269 MessageBuffer triggerQueue, ordered="false";
273 out_port(requestNetwork_out, RequestMsg, requestFromCache);
274 out_port(responseNetwork_out, ResponseMsg, responseFromCache);
275 out_port(unblockNetwork_out, ResponseMsg, unblockFromCache);
276 out_port(triggerQueue_out, TriggerMsg, triggerQueue);
281 in_port(triggerQueue_in, TriggerMsg, triggerQueue, rank=3) {
282 if (triggerQueue_in.isReady()) {
283 peek(triggerQueue_in, TriggerMsg) {
285 Entry cache_entry := getCacheEntry(in_msg.Address);
286 TBE tbe := TBEs[in_msg.Address];
288 if (in_msg.Type == TriggerType:L2_to_L1) {
289 trigger(Event:Complete_L2_to_L1, in_msg.Address, cache_entry, tbe);
290 } else if (in_msg.Type == TriggerType:ALL_ACKS) {
291 trigger(Event:All_acks, in_msg.Address, cache_entry, tbe);
292 } else if (in_msg.Type == TriggerType:ALL_ACKS_NO_SHARERS) {
293 trigger(Event:All_acks_no_sharers, in_msg.Address, cache_entry, tbe);
295 error("Unexpected message");
301 // Nothing from the unblock network
304 in_port(responseToCache_in, ResponseMsg, responseToCache, rank=2) {
305 if (responseToCache_in.isReady()) {
306 peek(responseToCache_in, ResponseMsg, block_on="Address") {
308 Entry cache_entry := getCacheEntry(in_msg.Address);
309 TBE tbe := TBEs[in_msg.Address];
311 if (in_msg.Type == CoherenceResponseType:ACK) {
312 trigger(Event:Ack, in_msg.Address, cache_entry, tbe);
313 } else if (in_msg.Type == CoherenceResponseType:ACK_SHARED) {
314 trigger(Event:Shared_Ack, in_msg.Address, cache_entry, tbe);
315 } else if (in_msg.Type == CoherenceResponseType:DATA) {
316 trigger(Event:Data, in_msg.Address, cache_entry, tbe);
317 } else if (in_msg.Type == CoherenceResponseType:DATA_SHARED) {
318 trigger(Event:Shared_Data, in_msg.Address, cache_entry, tbe);
319 } else if (in_msg.Type == CoherenceResponseType:DATA_EXCLUSIVE) {
320 trigger(Event:Exclusive_Data, in_msg.Address, cache_entry, tbe);
322 error("Unexpected message");
329 in_port(forwardToCache_in, RequestMsg, forwardToCache, rank=1) {
330 if (forwardToCache_in.isReady()) {
331 peek(forwardToCache_in, RequestMsg, block_on="Address") {
333 Entry cache_entry := getCacheEntry(in_msg.Address);
334 TBE tbe := TBEs[in_msg.Address];
336 if (in_msg.Type == CoherenceRequestType:GETX) {
337 trigger(Event:Other_GETX, in_msg.Address, cache_entry, tbe);
338 } else if (in_msg.Type == CoherenceRequestType:MERGED_GETS) {
339 trigger(Event:Merged_GETS, in_msg.Address, cache_entry, tbe);
340 } else if (in_msg.Type == CoherenceRequestType:GETS) {
341 if (machineCount(MachineType:L1Cache) > 1) {
342 if (is_valid(cache_entry)) {
343 if (IsAtomicAccessed(cache_entry) && no_mig_atomic) {
344 trigger(Event:Other_GETS_No_Mig, in_msg.Address, cache_entry, tbe);
346 trigger(Event:Other_GETS, in_msg.Address, cache_entry, tbe);
349 trigger(Event:Other_GETS, in_msg.Address, cache_entry, tbe);
352 trigger(Event:NC_DMA_GETS, in_msg.Address, cache_entry, tbe);
354 } else if (in_msg.Type == CoherenceRequestType:INV) {
355 trigger(Event:Invalidate, in_msg.Address, cache_entry, tbe);
356 } else if (in_msg.Type == CoherenceRequestType:WB_ACK) {
357 trigger(Event:Writeback_Ack, in_msg.Address, cache_entry, tbe);
358 } else if (in_msg.Type == CoherenceRequestType:WB_NACK) {
359 trigger(Event:Writeback_Nack, in_msg.Address, cache_entry, tbe);
361 error("Unexpected message");
367 // Nothing from the request network
370 in_port(mandatoryQueue_in, CacheMsg, mandatoryQueue, desc="...", rank=0) {
371 if (mandatoryQueue_in.isReady()) {
372 peek(mandatoryQueue_in, CacheMsg, block_on="LineAddress") {
374 // Check for data access to blocks in I-cache and ifetchs to blocks in D-cache
375 TBE tbe := TBEs[in_msg.LineAddress];
377 if (in_msg.Type == CacheRequestType:IFETCH) {
378 // ** INSTRUCTION ACCESS ***
380 Entry L1Icache_entry := getL1ICacheEntry(in_msg.LineAddress);
381 if (is_valid(L1Icache_entry)) {
382 // The tag matches for the L1, so the L1 fetches the line. We know it can't be in the L2 due to exclusion
383 trigger(mandatory_request_type_to_event(in_msg.Type),
384 in_msg.LineAddress, L1Icache_entry, tbe);
386 // Check to see if it is in the OTHER L1
387 Entry L1Dcache_entry := getL1DCacheEntry(in_msg.LineAddress);
388 if (is_valid(L1Dcache_entry)) {
389 // The block is in the wrong L1, try to write it to the L2
390 if (L2cacheMemory.cacheAvail(in_msg.LineAddress)) {
391 trigger(Event:L1_to_L2, in_msg.LineAddress, L1Dcache_entry, tbe);
393 trigger(Event:L2_Replacement,
394 L2cacheMemory.cacheProbe(in_msg.LineAddress),
395 getL2CacheEntry(L2cacheMemory.cacheProbe(in_msg.LineAddress)),
396 TBEs[L2cacheMemory.cacheProbe(in_msg.LineAddress)]);
400 if (L1IcacheMemory.cacheAvail(in_msg.LineAddress)) {
401 // L1 does't have the line, but we have space for it in the L1
403 Entry L2cache_entry := getL2CacheEntry(in_msg.LineAddress);
404 if (is_valid(L2cache_entry)) {
405 // L2 has it (maybe not with the right permissions)
406 trigger(Event:Trigger_L2_to_L1I, in_msg.LineAddress,
409 // We have room, the L2 doesn't have it, so the L1 fetches the line
410 trigger(mandatory_request_type_to_event(in_msg.Type),
411 in_msg.LineAddress, L1Icache_entry, tbe);
414 // No room in the L1, so we need to make room
415 if (L2cacheMemory.cacheAvail(L1IcacheMemory.cacheProbe(in_msg.LineAddress))) {
416 // The L2 has room, so we move the line from the L1 to the L2
417 trigger(Event:L1_to_L2,
418 L1IcacheMemory.cacheProbe(in_msg.LineAddress),
419 getL1ICacheEntry(L1IcacheMemory.cacheProbe(in_msg.LineAddress)),
420 TBEs[L1IcacheMemory.cacheProbe(in_msg.LineAddress)]);
422 // The L2 does not have room, so we replace a line from the L2
423 trigger(Event:L2_Replacement,
424 L2cacheMemory.cacheProbe(L1IcacheMemory.cacheProbe(in_msg.LineAddress)),
425 getL2CacheEntry(L2cacheMemory.cacheProbe(L1IcacheMemory.cacheProbe(in_msg.LineAddress))),
426 TBEs[L2cacheMemory.cacheProbe(L1IcacheMemory.cacheProbe(in_msg.LineAddress))]);
431 // *** DATA ACCESS ***
433 Entry L1Dcache_entry := getL1DCacheEntry(in_msg.LineAddress);
434 if (is_valid(L1Dcache_entry)) {
435 // The tag matches for the L1, so the L1 fetches the line. We know it can't be in the L2 due to exclusion
436 trigger(mandatory_request_type_to_event(in_msg.Type),
437 in_msg.LineAddress, L1Dcache_entry, tbe);
440 // Check to see if it is in the OTHER L1
441 Entry L1Icache_entry := getL1ICacheEntry(in_msg.LineAddress);
442 if (is_valid(L1Icache_entry)) {
443 // The block is in the wrong L1, try to write it to the L2
444 if (L2cacheMemory.cacheAvail(in_msg.LineAddress)) {
445 trigger(Event:L1_to_L2, in_msg.LineAddress, L1Icache_entry, tbe);
447 trigger(Event:L2_Replacement,
448 L2cacheMemory.cacheProbe(in_msg.LineAddress),
449 getL2CacheEntry(L2cacheMemory.cacheProbe(in_msg.LineAddress)),
450 TBEs[L2cacheMemory.cacheProbe(in_msg.LineAddress)]);
454 if (L1DcacheMemory.cacheAvail(in_msg.LineAddress)) {
455 // L1 does't have the line, but we have space for it in the L1
456 Entry L2cache_entry := getL2CacheEntry(in_msg.LineAddress);
457 if (is_valid(L2cache_entry)) {
458 // L2 has it (maybe not with the right permissions)
459 trigger(Event:Trigger_L2_to_L1D, in_msg.LineAddress,
462 // We have room, the L2 doesn't have it, so the L1 fetches the line
463 trigger(mandatory_request_type_to_event(in_msg.Type),
464 in_msg.LineAddress, L1Dcache_entry, tbe);
467 // No room in the L1, so we need to make room
468 if (L2cacheMemory.cacheAvail(L1DcacheMemory.cacheProbe(in_msg.LineAddress))) {
469 // The L2 has room, so we move the line from the L1 to the L2
470 trigger(Event:L1_to_L2,
471 L1DcacheMemory.cacheProbe(in_msg.LineAddress),
472 getL1DCacheEntry(L1DcacheMemory.cacheProbe(in_msg.LineAddress)),
473 TBEs[L1DcacheMemory.cacheProbe(in_msg.LineAddress)]);
475 // The L2 does not have room, so we replace a line from the L2
476 trigger(Event:L2_Replacement,
477 L2cacheMemory.cacheProbe(L1DcacheMemory.cacheProbe(in_msg.LineAddress)),
478 getL2CacheEntry(L2cacheMemory.cacheProbe(L1DcacheMemory.cacheProbe(in_msg.LineAddress))),
479 TBEs[L2cacheMemory.cacheProbe(L1DcacheMemory.cacheProbe(in_msg.LineAddress))]);
490 action(a_issueGETS, "a", desc="Issue GETS") {
491 enqueue(requestNetwork_out, RequestMsg, latency=issue_latency) {
492 assert(is_valid(tbe));
493 out_msg.Address := address;
494 out_msg.Type := CoherenceRequestType:GETS;
495 out_msg.Requestor := machineID;
496 out_msg.Destination.add(map_Address_to_Directory(address));
497 out_msg.MessageSize := MessageSizeType:Request_Control;
498 out_msg.InitialRequestTime := get_time();
499 tbe.NumPendingMsgs := machineCount(MachineType:L1Cache); // One from each other cache (n-1) plus the memory (+1)
503 action(b_issueGETX, "b", desc="Issue GETX") {
504 enqueue(requestNetwork_out, RequestMsg, latency=issue_latency) {
505 assert(is_valid(tbe));
506 out_msg.Address := address;
507 out_msg.Type := CoherenceRequestType:GETX;
508 out_msg.Requestor := machineID;
509 out_msg.Destination.add(map_Address_to_Directory(address));
510 out_msg.MessageSize := MessageSizeType:Request_Control;
511 out_msg.InitialRequestTime := get_time();
512 tbe.NumPendingMsgs := machineCount(MachineType:L1Cache); // One from each other cache (n-1) plus the memory (+1)
516 action(c_sendExclusiveData, "c", desc="Send exclusive data from cache to requestor") {
517 peek(forwardToCache_in, RequestMsg) {
518 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
519 assert(is_valid(cache_entry));
520 out_msg.Address := address;
521 out_msg.Type := CoherenceResponseType:DATA_EXCLUSIVE;
522 out_msg.Sender := machineID;
523 out_msg.Destination.add(in_msg.Requestor);
524 out_msg.DataBlk := cache_entry.DataBlk;
525 out_msg.Dirty := cache_entry.Dirty;
526 if (in_msg.DirectedProbe) {
527 out_msg.Acks := machineCount(MachineType:L1Cache);
531 out_msg.SilentAcks := in_msg.SilentAcks;
532 out_msg.MessageSize := MessageSizeType:Response_Data;
533 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
534 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
539 action(d_issuePUT, "d", desc="Issue PUT") {
540 enqueue(requestNetwork_out, RequestMsg, latency=issue_latency) {
541 out_msg.Address := address;
542 out_msg.Type := CoherenceRequestType:PUT;
543 out_msg.Requestor := machineID;
544 out_msg.Destination.add(map_Address_to_Directory(address));
545 out_msg.MessageSize := MessageSizeType:Writeback_Control;
549 action(e_sendData, "e", desc="Send data from cache to requestor") {
550 peek(forwardToCache_in, RequestMsg) {
551 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
552 assert(is_valid(cache_entry));
553 out_msg.Address := address;
554 out_msg.Type := CoherenceResponseType:DATA;
555 out_msg.Sender := machineID;
556 out_msg.Destination.add(in_msg.Requestor);
557 out_msg.DataBlk := cache_entry.DataBlk;
558 out_msg.Dirty := cache_entry.Dirty;
559 if (in_msg.DirectedProbe) {
560 out_msg.Acks := machineCount(MachineType:L1Cache);
564 out_msg.SilentAcks := in_msg.SilentAcks;
565 out_msg.MessageSize := MessageSizeType:Response_Data;
566 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
567 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
572 action(ee_sendDataShared, "\e", desc="Send data from cache to requestor, keep a shared copy") {
573 peek(forwardToCache_in, RequestMsg) {
574 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
575 assert(is_valid(cache_entry));
576 out_msg.Address := address;
577 out_msg.Type := CoherenceResponseType:DATA_SHARED;
578 out_msg.Sender := machineID;
579 out_msg.Destination.add(in_msg.Requestor);
580 out_msg.DataBlk := cache_entry.DataBlk;
581 out_msg.Dirty := cache_entry.Dirty;
582 DPRINTF(RubySlicc, "%s\n", out_msg.DataBlk);
583 if (in_msg.DirectedProbe) {
584 out_msg.Acks := machineCount(MachineType:L1Cache);
588 out_msg.SilentAcks := in_msg.SilentAcks;
589 out_msg.MessageSize := MessageSizeType:Response_Data;
590 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
591 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
596 action(em_sendDataSharedMultiple, "em", desc="Send data from cache to all requestors") {
597 peek(forwardToCache_in, RequestMsg) {
598 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
599 assert(is_valid(cache_entry));
600 out_msg.Address := address;
601 out_msg.Type := CoherenceResponseType:DATA_SHARED;
602 out_msg.Sender := machineID;
603 out_msg.Destination := in_msg.MergedRequestors;
604 out_msg.DataBlk := cache_entry.DataBlk;
605 out_msg.Dirty := cache_entry.Dirty;
606 DPRINTF(RubySlicc, "%s\n", out_msg.DataBlk);
607 out_msg.Acks := machineCount(MachineType:L1Cache);
608 out_msg.SilentAcks := in_msg.SilentAcks;
609 out_msg.MessageSize := MessageSizeType:Response_Data;
610 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
611 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
616 action(f_sendAck, "f", desc="Send ack from cache to requestor") {
617 peek(forwardToCache_in, RequestMsg) {
618 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
619 out_msg.Address := address;
620 out_msg.Type := CoherenceResponseType:ACK;
621 out_msg.Sender := machineID;
622 out_msg.Destination.add(in_msg.Requestor);
624 out_msg.SilentAcks := in_msg.SilentAcks;
625 assert(in_msg.DirectedProbe == false);
626 out_msg.MessageSize := MessageSizeType:Response_Control;
627 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
628 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
633 action(ff_sendAckShared, "\f", desc="Send shared ack from cache to requestor") {
634 peek(forwardToCache_in, RequestMsg) {
635 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
636 out_msg.Address := address;
637 out_msg.Type := CoherenceResponseType:ACK_SHARED;
638 out_msg.Sender := machineID;
639 out_msg.Destination.add(in_msg.Requestor);
641 out_msg.SilentAcks := in_msg.SilentAcks;
642 assert(in_msg.DirectedProbe == false);
643 out_msg.MessageSize := MessageSizeType:Response_Control;
644 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
645 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
650 action(g_sendUnblock, "g", desc="Send unblock to memory") {
651 enqueue(unblockNetwork_out, ResponseMsg, latency=cache_response_latency) {
652 out_msg.Address := address;
653 out_msg.Type := CoherenceResponseType:UNBLOCK;
654 out_msg.Sender := machineID;
655 out_msg.Destination.add(map_Address_to_Directory(address));
656 out_msg.MessageSize := MessageSizeType:Unblock_Control;
660 action(gm_sendUnblockM, "gm", desc="Send unblock to memory and indicate M/O/E state") {
661 enqueue(unblockNetwork_out, ResponseMsg, latency=cache_response_latency) {
662 out_msg.Address := address;
663 out_msg.Type := CoherenceResponseType:UNBLOCKM;
664 out_msg.Sender := machineID;
665 out_msg.Destination.add(map_Address_to_Directory(address));
666 out_msg.MessageSize := MessageSizeType:Unblock_Control;
670 action(gs_sendUnblockS, "gs", desc="Send unblock to memory and indicate S state") {
671 enqueue(unblockNetwork_out, ResponseMsg, latency=cache_response_latency) {
672 assert(is_valid(tbe));
673 out_msg.Address := address;
674 out_msg.Type := CoherenceResponseType:UNBLOCKS;
675 out_msg.Sender := machineID;
676 out_msg.CurOwner := tbe.CurOwner;
677 out_msg.Destination.add(map_Address_to_Directory(address));
678 out_msg.MessageSize := MessageSizeType:Unblock_Control;
682 action(h_load_hit, "h", desc="Notify sequencer the load completed.") {
683 assert(is_valid(cache_entry));
684 DPRINTF(RubySlicc, "%s\n", cache_entry.DataBlk);
685 sequencer.readCallback(address, testAndClearLocalHit(cache_entry),
686 cache_entry.DataBlk);
689 action(hx_external_load_hit, "hx", desc="load required external msgs") {
690 assert(is_valid(cache_entry));
691 assert(is_valid(tbe));
692 DPRINTF(RubySlicc, "%s\n", cache_entry.DataBlk);
693 peek(responseToCache_in, ResponseMsg) {
695 sequencer.readCallback(address,
696 getNondirectHitMachType(in_msg.Address, in_msg.Sender),
698 tbe.InitialRequestTime,
699 tbe.ForwardRequestTime,
700 tbe.FirstResponseTime);
704 action(hh_store_hit, "\h", desc="Notify sequencer that store completed.") {
705 assert(is_valid(cache_entry));
706 DPRINTF(RubySlicc, "%s\n", cache_entry.DataBlk);
707 peek(mandatoryQueue_in, CacheMsg) {
708 sequencer.writeCallback(address, testAndClearLocalHit(cache_entry),
709 cache_entry.DataBlk);
711 cache_entry.Dirty := true;
712 if (in_msg.Type == CacheRequestType:ATOMIC) {
713 cache_entry.AtomicAccessed := true;
718 action(sx_external_store_hit, "sx", desc="store required external msgs.") {
719 assert(is_valid(cache_entry));
720 assert(is_valid(tbe));
721 DPRINTF(RubySlicc, "%s\n", cache_entry.DataBlk);
722 peek(responseToCache_in, ResponseMsg) {
724 sequencer.writeCallback(address,
725 getNondirectHitMachType(address, in_msg.Sender),
727 tbe.InitialRequestTime,
728 tbe.ForwardRequestTime,
729 tbe.FirstResponseTime);
731 cache_entry.Dirty := true;
734 action(sxt_trig_ext_store_hit, "sxt", desc="store required external msgs.") {
735 assert(is_valid(cache_entry));
736 assert(is_valid(tbe));
737 DPRINTF(RubySlicc, "%s\n", cache_entry.DataBlk);
739 sequencer.writeCallback(address,
740 getNondirectHitMachType(address, tbe.LastResponder),
742 tbe.InitialRequestTime,
743 tbe.ForwardRequestTime,
744 tbe.FirstResponseTime);
746 cache_entry.Dirty := true;
749 action(i_allocateTBE, "i", desc="Allocate TBE") {
750 check_allocate(TBEs);
751 assert(is_valid(cache_entry));
752 TBEs.allocate(address);
753 set_tbe(TBEs[address]);
754 tbe.DataBlk := cache_entry.DataBlk; // Data only used for writebacks
755 tbe.Dirty := cache_entry.Dirty;
756 tbe.Sharers := false;
759 action(j_popTriggerQueue, "j", desc="Pop trigger queue.") {
760 triggerQueue_in.dequeue();
763 action(k_popMandatoryQueue, "k", desc="Pop mandatory queue.") {
764 mandatoryQueue_in.dequeue();
767 action(l_popForwardQueue, "l", desc="Pop forwareded request queue.") {
768 forwardToCache_in.dequeue();
771 action(hp_copyFromTBEToL2, "li", desc="Copy data from TBE to L2 cache entry.") {
772 assert(is_valid(cache_entry));
773 assert(is_valid(tbe));
774 cache_entry.Dirty := tbe.Dirty;
775 cache_entry.DataBlk := tbe.DataBlk;
778 action(nb_copyFromTBEToL1, "fu", desc="Copy data from TBE to L1 cache entry.") {
779 assert(is_valid(cache_entry));
780 assert(is_valid(tbe));
781 cache_entry.Dirty := tbe.Dirty;
782 cache_entry.DataBlk := tbe.DataBlk;
783 cache_entry.FromL2 := true;
786 action(m_decrementNumberOfMessages, "m", desc="Decrement the number of messages for which we're waiting") {
787 peek(responseToCache_in, ResponseMsg) {
788 assert(in_msg.Acks > 0);
789 assert(is_valid(tbe));
790 DPRINTF(RubySlicc, "Sender = %s\n", in_msg.Sender);
791 DPRINTF(RubySlicc, "SilentAcks = %d\n", in_msg.SilentAcks);
792 if (tbe.AppliedSilentAcks == false) {
793 tbe.NumPendingMsgs := tbe.NumPendingMsgs - in_msg.SilentAcks;
794 tbe.AppliedSilentAcks := true;
796 DPRINTF(RubySlicc, "%d\n", tbe.NumPendingMsgs);
797 tbe.NumPendingMsgs := tbe.NumPendingMsgs - in_msg.Acks;
798 DPRINTF(RubySlicc, "%d\n", tbe.NumPendingMsgs);
799 APPEND_TRANSITION_COMMENT(tbe.NumPendingMsgs);
800 APPEND_TRANSITION_COMMENT(in_msg.Sender);
801 tbe.LastResponder := in_msg.Sender;
802 if (tbe.InitialRequestTime != zero_time() && in_msg.InitialRequestTime != zero_time()) {
803 assert(tbe.InitialRequestTime == in_msg.InitialRequestTime);
805 if (in_msg.InitialRequestTime != zero_time()) {
806 tbe.InitialRequestTime := in_msg.InitialRequestTime;
808 if (tbe.ForwardRequestTime != zero_time() && in_msg.ForwardRequestTime != zero_time()) {
809 assert(tbe.ForwardRequestTime == in_msg.ForwardRequestTime);
811 if (in_msg.ForwardRequestTime != zero_time()) {
812 tbe.ForwardRequestTime := in_msg.ForwardRequestTime;
814 if (tbe.FirstResponseTime == zero_time()) {
815 tbe.FirstResponseTime := get_time();
819 action(uo_updateCurrentOwner, "uo", desc="When moving SS state, update current owner.") {
820 peek(responseToCache_in, ResponseMsg) {
821 assert(is_valid(tbe));
822 tbe.CurOwner := in_msg.Sender;
826 action(n_popResponseQueue, "n", desc="Pop response queue") {
827 responseToCache_in.dequeue();
830 action(ll_L2toL1Transfer, "ll", desc="") {
831 enqueue(triggerQueue_out, TriggerMsg, latency=l2_cache_hit_latency) {
832 out_msg.Address := address;
833 out_msg.Type := TriggerType:L2_to_L1;
837 action(o_checkForCompletion, "o", desc="Check if we have received all the messages required for completion") {
838 assert(is_valid(tbe));
839 if (tbe.NumPendingMsgs == 0) {
840 enqueue(triggerQueue_out, TriggerMsg) {
841 out_msg.Address := address;
843 out_msg.Type := TriggerType:ALL_ACKS;
845 out_msg.Type := TriggerType:ALL_ACKS_NO_SHARERS;
851 action(p_decrementNumberOfMessagesByOne, "p", desc="Decrement the number of messages for which we're waiting by one") {
852 assert(is_valid(tbe));
853 tbe.NumPendingMsgs := tbe.NumPendingMsgs - 1;
856 action(pp_incrementNumberOfMessagesByOne, "\p", desc="Increment the number of messages for which we're waiting by one") {
857 assert(is_valid(tbe));
858 tbe.NumPendingMsgs := tbe.NumPendingMsgs + 1;
861 action(q_sendDataFromTBEToCache, "q", desc="Send data from TBE to cache") {
862 peek(forwardToCache_in, RequestMsg) {
863 assert(in_msg.Requestor != machineID);
864 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
865 assert(is_valid(tbe));
866 out_msg.Address := address;
867 out_msg.Type := CoherenceResponseType:DATA;
868 out_msg.Sender := machineID;
869 out_msg.Destination.add(in_msg.Requestor);
870 DPRINTF(RubySlicc, "%s\n", out_msg.Destination);
871 out_msg.DataBlk := tbe.DataBlk;
872 out_msg.Dirty := tbe.Dirty;
873 if (in_msg.DirectedProbe) {
874 out_msg.Acks := machineCount(MachineType:L1Cache);
878 out_msg.SilentAcks := in_msg.SilentAcks;
879 out_msg.MessageSize := MessageSizeType:Response_Data;
880 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
881 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
886 action(qm_sendDataFromTBEToCache, "qm", desc="Send data from TBE to cache, multiple sharers") {
887 peek(forwardToCache_in, RequestMsg) {
888 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
889 assert(is_valid(tbe));
890 out_msg.Address := address;
891 out_msg.Type := CoherenceResponseType:DATA;
892 out_msg.Sender := machineID;
893 out_msg.Destination := in_msg.MergedRequestors;
894 DPRINTF(RubySlicc, "%s\n", out_msg.Destination);
895 out_msg.DataBlk := tbe.DataBlk;
896 out_msg.Dirty := tbe.Dirty;
897 out_msg.Acks := machineCount(MachineType:L1Cache);
898 out_msg.SilentAcks := in_msg.SilentAcks;
899 out_msg.MessageSize := MessageSizeType:Response_Data;
900 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
901 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
906 action(qq_sendDataFromTBEToMemory, "\q", desc="Send data from TBE to memory") {
907 enqueue(unblockNetwork_out, ResponseMsg, latency=cache_response_latency) {
908 assert(is_valid(tbe));
909 out_msg.Address := address;
910 out_msg.Sender := machineID;
911 out_msg.Destination.add(map_Address_to_Directory(address));
912 out_msg.Dirty := tbe.Dirty;
914 out_msg.Type := CoherenceResponseType:WB_DIRTY;
915 out_msg.DataBlk := tbe.DataBlk;
916 out_msg.MessageSize := MessageSizeType:Writeback_Data;
918 out_msg.Type := CoherenceResponseType:WB_CLEAN;
919 // NOTE: in a real system this would not send data. We send
920 // data here only so we can check it at the memory
921 out_msg.DataBlk := tbe.DataBlk;
922 out_msg.MessageSize := MessageSizeType:Writeback_Control;
927 action(r_setSharerBit, "r", desc="We saw other sharers") {
928 assert(is_valid(tbe));
932 action(s_deallocateTBE, "s", desc="Deallocate TBE") {
933 TBEs.deallocate(address);
937 action(t_sendExclusiveDataFromTBEToMemory, "t", desc="Send exclusive data from TBE to memory") {
938 enqueue(unblockNetwork_out, ResponseMsg, latency=cache_response_latency) {
939 assert(is_valid(tbe));
940 out_msg.Address := address;
941 out_msg.Sender := machineID;
942 out_msg.Destination.add(map_Address_to_Directory(address));
943 out_msg.DataBlk := tbe.DataBlk;
944 out_msg.Dirty := tbe.Dirty;
946 out_msg.Type := CoherenceResponseType:WB_EXCLUSIVE_DIRTY;
947 out_msg.DataBlk := tbe.DataBlk;
948 out_msg.MessageSize := MessageSizeType:Writeback_Data;
950 out_msg.Type := CoherenceResponseType:WB_EXCLUSIVE_CLEAN;
951 // NOTE: in a real system this would not send data. We send
952 // data here only so we can check it at the memory
953 out_msg.DataBlk := tbe.DataBlk;
954 out_msg.MessageSize := MessageSizeType:Writeback_Control;
959 action(u_writeDataToCache, "u", desc="Write data to cache") {
960 peek(responseToCache_in, ResponseMsg) {
961 assert(is_valid(cache_entry));
962 cache_entry.DataBlk := in_msg.DataBlk;
963 cache_entry.Dirty := in_msg.Dirty;
967 action(v_writeDataToCacheVerify, "v", desc="Write data to cache, assert it was same as before") {
968 peek(responseToCache_in, ResponseMsg) {
969 assert(is_valid(cache_entry));
970 DPRINTF(RubySlicc, "Cached Data Block: %s, Msg Data Block: %s\n",
971 cache_entry.DataBlk, in_msg.DataBlk);
972 assert(cache_entry.DataBlk == in_msg.DataBlk);
973 cache_entry.DataBlk := in_msg.DataBlk;
974 cache_entry.Dirty := in_msg.Dirty || cache_entry.Dirty;
978 action(gg_deallocateL1CacheBlock, "\g", desc="Deallocate cache block. Sets the cache to invalid, allowing a replacement in parallel with a fetch.") {
979 if (L1DcacheMemory.isTagPresent(address)) {
980 L1DcacheMemory.deallocate(address);
982 L1IcacheMemory.deallocate(address);
987 action(ii_allocateL1DCacheBlock, "\i", desc="Set L1 D-cache tag equal to tag of block B.") {
988 if (is_invalid(cache_entry)) {
989 set_cache_entry(L1DcacheMemory.allocate(address, new Entry));
993 action(jj_allocateL1ICacheBlock, "\j", desc="Set L1 I-cache tag equal to tag of block B.") {
994 if (is_invalid(cache_entry)) {
995 set_cache_entry(L1IcacheMemory.allocate(address, new Entry));
999 action(vv_allocateL2CacheBlock, "\v", desc="Set L2 cache tag equal to tag of block B.") {
1000 set_cache_entry(L2cacheMemory.allocate(address, new Entry));
1003 action(rr_deallocateL2CacheBlock, "\r", desc="Deallocate L2 cache block. Sets the cache to not present, allowing a replacement in parallel with a fetch.") {
1004 L2cacheMemory.deallocate(address);
1005 unset_cache_entry();
1008 action(uu_profileMiss, "\u", desc="Profile the demand miss") {
1009 peek(mandatoryQueue_in, CacheMsg) {
1010 if (L1IcacheMemory.isTagPresent(address)) {
1011 L1IcacheMemory.profileMiss(in_msg);
1012 } else if (L1DcacheMemory.isTagPresent(address)) {
1013 L1DcacheMemory.profileMiss(in_msg);
1015 if (L2cacheMemory.isTagPresent(address) == false) {
1016 L2cacheMemory.profileMiss(in_msg);
1021 action(zz_stallAndWaitMandatoryQueue, "\z", desc="Send the head of the mandatory queue to the back of the queue.") {
1022 stall_and_wait(mandatoryQueue_in, address);
1025 action(kd_wakeUpDependents, "kd", desc="wake-up dependents") {
1026 wake_up_dependents(address);
1029 action(ka_wakeUpAllDependents, "ka", desc="wake-up all dependents") {
1030 wake_up_all_dependents();
1033 //*****************************************************
1035 //*****************************************************
1037 // Transitions for Load/Store/L2_Replacement from transient states
1038 transition({IM, SM, ISM, OM, IS, SS, OI, MI, II, IT, ST, OT, MT, MMT}, {Store, L2_Replacement}) {
1039 zz_stallAndWaitMandatoryQueue;
1042 transition({M_W, MM_W}, {L2_Replacement}) {
1043 zz_stallAndWaitMandatoryQueue;
1046 transition({IM, IS, OI, MI, II, IT, ST, OT, MT, MMT}, {Load, Ifetch}) {
1047 zz_stallAndWaitMandatoryQueue;
1050 transition({IM, SM, ISM, OM, IS, SS, MM_W, M_W, OI, MI, II, IT, ST, OT, MT, MMT}, L1_to_L2) {
1051 zz_stallAndWaitMandatoryQueue;
1054 transition({IT, ST, OT, MT, MMT}, {Other_GETX, NC_DMA_GETS, Other_GETS, Merged_GETS, Other_GETS_No_Mig, Invalidate}) {
1058 // Transitions moving data between the L1 and L2 caches
1059 transition({I, S, O, M, MM}, L1_to_L2) {
1061 gg_deallocateL1CacheBlock;
1062 vv_allocateL2CacheBlock;
1065 ka_wakeUpAllDependents;
1068 transition(I, Trigger_L2_to_L1D, IT) {
1070 rr_deallocateL2CacheBlock;
1071 ii_allocateL1DCacheBlock;
1072 nb_copyFromTBEToL1; // Not really needed for state I
1075 zz_stallAndWaitMandatoryQueue;
1079 transition(S, Trigger_L2_to_L1D, ST) {
1081 rr_deallocateL2CacheBlock;
1082 ii_allocateL1DCacheBlock;
1086 zz_stallAndWaitMandatoryQueue;
1090 transition(O, Trigger_L2_to_L1D, OT) {
1092 rr_deallocateL2CacheBlock;
1093 ii_allocateL1DCacheBlock;
1097 zz_stallAndWaitMandatoryQueue;
1101 transition(M, Trigger_L2_to_L1D, MT) {
1103 rr_deallocateL2CacheBlock;
1104 ii_allocateL1DCacheBlock;
1108 zz_stallAndWaitMandatoryQueue;
1112 transition(MM, Trigger_L2_to_L1D, MMT) {
1114 rr_deallocateL2CacheBlock;
1115 ii_allocateL1DCacheBlock;
1119 zz_stallAndWaitMandatoryQueue;
1123 transition(I, Trigger_L2_to_L1I, IT) {
1125 rr_deallocateL2CacheBlock;
1126 jj_allocateL1ICacheBlock;
1130 zz_stallAndWaitMandatoryQueue;
1134 transition(S, Trigger_L2_to_L1I, ST) {
1136 rr_deallocateL2CacheBlock;
1137 jj_allocateL1ICacheBlock;
1141 zz_stallAndWaitMandatoryQueue;
1145 transition(O, Trigger_L2_to_L1I, OT) {
1147 rr_deallocateL2CacheBlock;
1148 jj_allocateL1ICacheBlock;
1152 zz_stallAndWaitMandatoryQueue;
1156 transition(M, Trigger_L2_to_L1I, MT) {
1158 rr_deallocateL2CacheBlock;
1159 jj_allocateL1ICacheBlock;
1163 zz_stallAndWaitMandatoryQueue;
1167 transition(MM, Trigger_L2_to_L1I, MMT) {
1169 rr_deallocateL2CacheBlock;
1170 jj_allocateL1ICacheBlock;
1174 zz_stallAndWaitMandatoryQueue;
1178 transition(IT, Complete_L2_to_L1, I) {
1180 kd_wakeUpDependents;
1183 transition(ST, Complete_L2_to_L1, S) {
1185 kd_wakeUpDependents;
1188 transition(OT, Complete_L2_to_L1, O) {
1190 kd_wakeUpDependents;
1193 transition(MT, Complete_L2_to_L1, M) {
1195 kd_wakeUpDependents;
1198 transition(MMT, Complete_L2_to_L1, MM) {
1200 kd_wakeUpDependents;
1203 // Transitions from Idle
1204 transition(I, Load, IS) {
1205 ii_allocateL1DCacheBlock;
1209 k_popMandatoryQueue;
1212 transition(I, Ifetch, IS) {
1213 jj_allocateL1ICacheBlock;
1217 k_popMandatoryQueue;
1220 transition(I, Store, IM) {
1221 ii_allocateL1DCacheBlock;
1225 k_popMandatoryQueue;
1228 transition(I, L2_Replacement) {
1229 rr_deallocateL2CacheBlock;
1230 ka_wakeUpAllDependents;
1233 transition(I, {Other_GETX, NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig, Invalidate}) {
1238 // Transitions from Shared
1239 transition({S, SM, ISM}, {Load, Ifetch}) {
1241 k_popMandatoryQueue;
1244 transition(S, Store, SM) {
1248 k_popMandatoryQueue;
1251 transition(S, L2_Replacement, I) {
1252 rr_deallocateL2CacheBlock;
1253 ka_wakeUpAllDependents;
1256 transition(S, {Other_GETX, Invalidate}, I) {
1261 transition(S, {NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig}) {
1266 // Transitions from Owned
1267 transition({O, OM, SS, MM_W, M_W}, {Load, Ifetch}) {
1269 k_popMandatoryQueue;
1272 transition(O, Store, OM) {
1275 p_decrementNumberOfMessagesByOne;
1277 k_popMandatoryQueue;
1280 transition(O, L2_Replacement, OI) {
1283 rr_deallocateL2CacheBlock;
1284 ka_wakeUpAllDependents;
1287 transition(O, {Other_GETX, Invalidate}, I) {
1292 transition(O, {NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig}) {
1297 transition(O, Merged_GETS) {
1298 em_sendDataSharedMultiple;
1302 // Transitions from Modified
1303 transition(MM, {Load, Ifetch}) {
1305 k_popMandatoryQueue;
1308 transition(MM, Store) {
1310 k_popMandatoryQueue;
1313 transition(MM, L2_Replacement, MI) {
1316 rr_deallocateL2CacheBlock;
1317 ka_wakeUpAllDependents;
1320 transition(MM, {Other_GETX, Invalidate}, I) {
1321 c_sendExclusiveData;
1325 transition(MM, Other_GETS, I) {
1326 c_sendExclusiveData;
1330 transition(MM, NC_DMA_GETS) {
1331 c_sendExclusiveData;
1335 transition(MM, Other_GETS_No_Mig, O) {
1340 transition(MM, Merged_GETS, O) {
1341 em_sendDataSharedMultiple;
1345 // Transitions from Dirty Exclusive
1346 transition(M, {Load, Ifetch}) {
1348 k_popMandatoryQueue;
1351 transition(M, Store, MM) {
1353 k_popMandatoryQueue;
1356 transition(M, L2_Replacement, MI) {
1359 rr_deallocateL2CacheBlock;
1360 ka_wakeUpAllDependents;
1363 transition(M, {Other_GETX, Invalidate}, I) {
1364 c_sendExclusiveData;
1368 transition(M, {Other_GETS, Other_GETS_No_Mig}, O) {
1373 transition(M, NC_DMA_GETS) {
1378 transition(M, Merged_GETS, O) {
1379 em_sendDataSharedMultiple;
1383 // Transitions from IM
1385 transition(IM, {Other_GETX, NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig, Invalidate}) {
1390 transition(IM, Ack) {
1391 m_decrementNumberOfMessages;
1392 o_checkForCompletion;
1396 transition(IM, Data, ISM) {
1398 m_decrementNumberOfMessages;
1399 o_checkForCompletion;
1403 transition(IM, Exclusive_Data, MM_W) {
1405 m_decrementNumberOfMessages;
1406 o_checkForCompletion;
1407 sx_external_store_hit;
1409 kd_wakeUpDependents;
1412 // Transitions from SM
1413 transition(SM, {NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig}) {
1418 transition(SM, {Other_GETX, Invalidate}, IM) {
1423 transition(SM, Ack) {
1424 m_decrementNumberOfMessages;
1425 o_checkForCompletion;
1429 transition(SM, {Data, Exclusive_Data}, ISM) {
1430 v_writeDataToCacheVerify;
1431 m_decrementNumberOfMessages;
1432 o_checkForCompletion;
1436 // Transitions from ISM
1437 transition(ISM, Ack) {
1438 m_decrementNumberOfMessages;
1439 o_checkForCompletion;
1443 transition(ISM, All_acks_no_sharers, MM) {
1444 sxt_trig_ext_store_hit;
1448 kd_wakeUpDependents;
1451 // Transitions from OM
1453 transition(OM, {Other_GETX, Invalidate}, IM) {
1455 pp_incrementNumberOfMessagesByOne;
1459 transition(OM, {NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig}) {
1464 transition(OM, Merged_GETS) {
1465 em_sendDataSharedMultiple;
1469 transition(OM, Ack) {
1470 m_decrementNumberOfMessages;
1471 o_checkForCompletion;
1475 transition(OM, {All_acks, All_acks_no_sharers}, MM) {
1476 sxt_trig_ext_store_hit;
1480 kd_wakeUpDependents;
1483 // Transitions from IS
1485 transition(IS, {Other_GETX, NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig, Invalidate}) {
1490 transition(IS, Ack) {
1491 m_decrementNumberOfMessages;
1492 o_checkForCompletion;
1496 transition(IS, Shared_Ack) {
1497 m_decrementNumberOfMessages;
1499 o_checkForCompletion;
1503 transition(IS, Data, SS) {
1505 m_decrementNumberOfMessages;
1506 o_checkForCompletion;
1507 hx_external_load_hit;
1508 uo_updateCurrentOwner;
1510 kd_wakeUpDependents;
1513 transition(IS, Exclusive_Data, M_W) {
1515 m_decrementNumberOfMessages;
1516 o_checkForCompletion;
1517 hx_external_load_hit;
1519 kd_wakeUpDependents;
1522 transition(IS, Shared_Data, SS) {
1525 m_decrementNumberOfMessages;
1526 o_checkForCompletion;
1527 hx_external_load_hit;
1528 uo_updateCurrentOwner;
1530 kd_wakeUpDependents;
1533 // Transitions from SS
1535 transition(SS, Ack) {
1536 m_decrementNumberOfMessages;
1537 o_checkForCompletion;
1541 transition(SS, Shared_Ack) {
1542 m_decrementNumberOfMessages;
1544 o_checkForCompletion;
1548 transition(SS, All_acks, S) {
1552 kd_wakeUpDependents;
1555 transition(SS, All_acks_no_sharers, S) {
1556 // Note: The directory might still be the owner, so that is why we go to S
1560 kd_wakeUpDependents;
1563 // Transitions from MM_W
1565 transition(MM_W, Store) {
1567 k_popMandatoryQueue;
1570 transition(MM_W, Ack) {
1571 m_decrementNumberOfMessages;
1572 o_checkForCompletion;
1576 transition(MM_W, All_acks_no_sharers, MM) {
1580 kd_wakeUpDependents;
1583 // Transitions from M_W
1585 transition(M_W, Store, MM_W) {
1587 k_popMandatoryQueue;
1590 transition(M_W, Ack) {
1591 m_decrementNumberOfMessages;
1592 o_checkForCompletion;
1596 transition(M_W, All_acks_no_sharers, M) {
1600 kd_wakeUpDependents;
1603 // Transitions from OI/MI
1605 transition({OI, MI}, {Other_GETX, Invalidate}, II) {
1606 q_sendDataFromTBEToCache;
1610 transition({OI, MI}, {NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig}, OI) {
1611 q_sendDataFromTBEToCache;
1615 transition({OI, MI}, Merged_GETS, OI) {
1616 qm_sendDataFromTBEToCache;
1620 transition(MI, Writeback_Ack, I) {
1621 t_sendExclusiveDataFromTBEToMemory;
1624 kd_wakeUpDependents;
1627 transition(OI, Writeback_Ack, I) {
1628 qq_sendDataFromTBEToMemory;
1631 kd_wakeUpDependents;
1634 // Transitions from II
1635 transition(II, {NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig, Other_GETX, Invalidate}, II) {
1640 transition(II, Writeback_Ack, I) {
1644 kd_wakeUpDependents;
1647 transition(II, Writeback_Nack, I) {
1650 kd_wakeUpDependents;