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 structure(TBETable, external="yes") {
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();
161 void wakeUpAllBuffers();
162 void wakeUpBuffers(Address a);
164 Entry getCacheEntry(Address address), return_by_pointer="yes" {
165 Entry L2cache_entry := static_cast(Entry, "pointer", L2cacheMemory.lookup(address));
166 if(is_valid(L2cache_entry)) {
167 return L2cache_entry;
170 Entry L1Dcache_entry := static_cast(Entry, "pointer", L1DcacheMemory.lookup(address));
171 if(is_valid(L1Dcache_entry)) {
172 return L1Dcache_entry;
175 Entry L1Icache_entry := static_cast(Entry, "pointer", L1IcacheMemory.lookup(address));
176 return L1Icache_entry;
179 Entry getL2CacheEntry(Address address), return_by_pointer="yes" {
180 Entry L2cache_entry := static_cast(Entry, "pointer", L2cacheMemory.lookup(address));
181 return L2cache_entry;
184 Entry getL1DCacheEntry(Address address), return_by_pointer="yes" {
185 Entry L1Dcache_entry := static_cast(Entry, "pointer", L1DcacheMemory.lookup(address));
186 return L1Dcache_entry;
189 Entry getL1ICacheEntry(Address address), return_by_pointer="yes" {
190 Entry L1Icache_entry := static_cast(Entry, "pointer", L1IcacheMemory.lookup(address));
191 return L1Icache_entry;
194 State getState(TBE tbe, Entry cache_entry, Address addr) {
197 } else if (is_valid(cache_entry)) {
198 return cache_entry.CacheState;
203 void setState(TBE tbe, Entry cache_entry, Address addr, State state) {
204 assert((L1DcacheMemory.isTagPresent(addr) && L1IcacheMemory.isTagPresent(addr)) == false);
205 assert((L1IcacheMemory.isTagPresent(addr) && L2cacheMemory.isTagPresent(addr)) == false);
206 assert((L1DcacheMemory.isTagPresent(addr) && L2cacheMemory.isTagPresent(addr)) == false);
209 tbe.TBEState := state;
212 if (is_valid(cache_entry)) {
213 cache_entry.CacheState := state;
217 Event mandatory_request_type_to_event(RubyRequestType type) {
218 if (type == RubyRequestType:LD) {
220 } else if (type == RubyRequestType:IFETCH) {
222 } else if ((type == RubyRequestType:ST) || (type == RubyRequestType:ATOMIC)) {
225 error("Invalid RubyRequestType");
229 GenericMachineType getNondirectHitMachType(Address addr, MachineID sender) {
230 if (machineIDToMachineType(sender) == MachineType:L1Cache) {
232 // NOTE direct local hits should not call this
234 return GenericMachineType:L1Cache_wCC;
236 return ConvertMachToGenericMach(machineIDToMachineType(sender));
240 GenericMachineType testAndClearLocalHit(Entry cache_entry) {
241 if (is_valid(cache_entry) && cache_entry.FromL2) {
242 cache_entry.FromL2 := false;
243 return GenericMachineType:L2Cache;
245 return GenericMachineType:L1Cache;
249 bool IsAtomicAccessed(Entry cache_entry) {
250 assert(is_valid(cache_entry));
251 return cache_entry.AtomicAccessed;
254 MessageBuffer triggerQueue, ordered="false";
258 out_port(requestNetwork_out, RequestMsg, requestFromCache);
259 out_port(responseNetwork_out, ResponseMsg, responseFromCache);
260 out_port(unblockNetwork_out, ResponseMsg, unblockFromCache);
261 out_port(triggerQueue_out, TriggerMsg, triggerQueue);
266 in_port(triggerQueue_in, TriggerMsg, triggerQueue, rank=3) {
267 if (triggerQueue_in.isReady()) {
268 peek(triggerQueue_in, TriggerMsg) {
270 Entry cache_entry := getCacheEntry(in_msg.Address);
271 TBE tbe := TBEs[in_msg.Address];
273 if (in_msg.Type == TriggerType:L2_to_L1) {
274 trigger(Event:Complete_L2_to_L1, in_msg.Address, cache_entry, tbe);
275 } else if (in_msg.Type == TriggerType:ALL_ACKS) {
276 trigger(Event:All_acks, in_msg.Address, cache_entry, tbe);
277 } else if (in_msg.Type == TriggerType:ALL_ACKS_NO_SHARERS) {
278 trigger(Event:All_acks_no_sharers, in_msg.Address, cache_entry, tbe);
280 error("Unexpected message");
286 // Nothing from the unblock network
289 in_port(responseToCache_in, ResponseMsg, responseToCache, rank=2) {
290 if (responseToCache_in.isReady()) {
291 peek(responseToCache_in, ResponseMsg, block_on="Address") {
293 Entry cache_entry := getCacheEntry(in_msg.Address);
294 TBE tbe := TBEs[in_msg.Address];
296 if (in_msg.Type == CoherenceResponseType:ACK) {
297 trigger(Event:Ack, in_msg.Address, cache_entry, tbe);
298 } else if (in_msg.Type == CoherenceResponseType:ACK_SHARED) {
299 trigger(Event:Shared_Ack, in_msg.Address, cache_entry, tbe);
300 } else if (in_msg.Type == CoherenceResponseType:DATA) {
301 trigger(Event:Data, in_msg.Address, cache_entry, tbe);
302 } else if (in_msg.Type == CoherenceResponseType:DATA_SHARED) {
303 trigger(Event:Shared_Data, in_msg.Address, cache_entry, tbe);
304 } else if (in_msg.Type == CoherenceResponseType:DATA_EXCLUSIVE) {
305 trigger(Event:Exclusive_Data, in_msg.Address, cache_entry, tbe);
307 error("Unexpected message");
314 in_port(forwardToCache_in, RequestMsg, forwardToCache, rank=1) {
315 if (forwardToCache_in.isReady()) {
316 peek(forwardToCache_in, RequestMsg, block_on="Address") {
318 Entry cache_entry := getCacheEntry(in_msg.Address);
319 TBE tbe := TBEs[in_msg.Address];
321 if (in_msg.Type == CoherenceRequestType:GETX) {
322 trigger(Event:Other_GETX, in_msg.Address, cache_entry, tbe);
323 } else if (in_msg.Type == CoherenceRequestType:MERGED_GETS) {
324 trigger(Event:Merged_GETS, in_msg.Address, cache_entry, tbe);
325 } else if (in_msg.Type == CoherenceRequestType:GETS) {
326 if (machineCount(MachineType:L1Cache) > 1) {
327 if (is_valid(cache_entry)) {
328 if (IsAtomicAccessed(cache_entry) && no_mig_atomic) {
329 trigger(Event:Other_GETS_No_Mig, in_msg.Address, cache_entry, tbe);
331 trigger(Event:Other_GETS, in_msg.Address, cache_entry, tbe);
334 trigger(Event:Other_GETS, in_msg.Address, cache_entry, tbe);
337 trigger(Event:NC_DMA_GETS, in_msg.Address, cache_entry, tbe);
339 } else if (in_msg.Type == CoherenceRequestType:INV) {
340 trigger(Event:Invalidate, in_msg.Address, cache_entry, tbe);
341 } else if (in_msg.Type == CoherenceRequestType:WB_ACK) {
342 trigger(Event:Writeback_Ack, in_msg.Address, cache_entry, tbe);
343 } else if (in_msg.Type == CoherenceRequestType:WB_NACK) {
344 trigger(Event:Writeback_Nack, in_msg.Address, cache_entry, tbe);
346 error("Unexpected message");
352 // Nothing from the request network
355 in_port(mandatoryQueue_in, RubyRequest, mandatoryQueue, desc="...", rank=0) {
356 if (mandatoryQueue_in.isReady()) {
357 peek(mandatoryQueue_in, RubyRequest, block_on="LineAddress") {
359 // Check for data access to blocks in I-cache and ifetchs to blocks in D-cache
360 TBE tbe := TBEs[in_msg.LineAddress];
362 if (in_msg.Type == RubyRequestType:IFETCH) {
363 // ** INSTRUCTION ACCESS ***
365 Entry L1Icache_entry := getL1ICacheEntry(in_msg.LineAddress);
366 if (is_valid(L1Icache_entry)) {
367 // The tag matches for the L1, so the L1 fetches the line. We know it can't be in the L2 due to exclusion
368 trigger(mandatory_request_type_to_event(in_msg.Type),
369 in_msg.LineAddress, L1Icache_entry, tbe);
371 // Check to see if it is in the OTHER L1
372 Entry L1Dcache_entry := getL1DCacheEntry(in_msg.LineAddress);
373 if (is_valid(L1Dcache_entry)) {
374 // The block is in the wrong L1, try to write it to the L2
375 if (L2cacheMemory.cacheAvail(in_msg.LineAddress)) {
376 trigger(Event:L1_to_L2, in_msg.LineAddress, L1Dcache_entry, tbe);
378 Address l2_victim_addr := L2cacheMemory.cacheProbe(in_msg.LineAddress);
379 trigger(Event:L2_Replacement,
381 getL2CacheEntry(l2_victim_addr),
382 TBEs[l2_victim_addr]);
386 if (L1IcacheMemory.cacheAvail(in_msg.LineAddress)) {
387 // L1 does't have the line, but we have space for it in the L1
389 Entry L2cache_entry := getL2CacheEntry(in_msg.LineAddress);
390 if (is_valid(L2cache_entry)) {
391 // L2 has it (maybe not with the right permissions)
392 trigger(Event:Trigger_L2_to_L1I, in_msg.LineAddress,
395 // We have room, the L2 doesn't have it, so the L1 fetches the line
396 trigger(mandatory_request_type_to_event(in_msg.Type),
397 in_msg.LineAddress, L1Icache_entry, tbe);
400 // No room in the L1, so we need to make room
401 Address l1i_victim_addr := L1IcacheMemory.cacheProbe(in_msg.LineAddress);
402 if (L2cacheMemory.cacheAvail(l1i_victim_addr)) {
403 // The L2 has room, so we move the line from the L1 to the L2
404 trigger(Event:L1_to_L2,
406 getL1ICacheEntry(l1i_victim_addr),
407 TBEs[l1i_victim_addr]);
409 Address l2_victim_addr := L2cacheMemory.cacheProbe(l1i_victim_addr);
410 // The L2 does not have room, so we replace a line from the L2
411 trigger(Event:L2_Replacement,
413 getL2CacheEntry(l2_victim_addr),
414 TBEs[l2_victim_addr]);
419 // *** DATA ACCESS ***
421 Entry L1Dcache_entry := getL1DCacheEntry(in_msg.LineAddress);
422 if (is_valid(L1Dcache_entry)) {
423 // The tag matches for the L1, so the L1 fetches the line. We know it can't be in the L2 due to exclusion
424 trigger(mandatory_request_type_to_event(in_msg.Type),
425 in_msg.LineAddress, L1Dcache_entry, tbe);
428 // Check to see if it is in the OTHER L1
429 Entry L1Icache_entry := getL1ICacheEntry(in_msg.LineAddress);
430 if (is_valid(L1Icache_entry)) {
431 // The block is in the wrong L1, try to write it to the L2
432 if (L2cacheMemory.cacheAvail(in_msg.LineAddress)) {
433 trigger(Event:L1_to_L2, in_msg.LineAddress, L1Icache_entry, tbe);
435 Address l2_victim_addr := L2cacheMemory.cacheProbe(in_msg.LineAddress);
436 trigger(Event:L2_Replacement,
438 getL2CacheEntry(l2_victim_addr),
439 TBEs[l2_victim_addr]);
443 if (L1DcacheMemory.cacheAvail(in_msg.LineAddress)) {
444 // L1 does't have the line, but we have space for it in the L1
445 Entry L2cache_entry := getL2CacheEntry(in_msg.LineAddress);
446 if (is_valid(L2cache_entry)) {
447 // L2 has it (maybe not with the right permissions)
448 trigger(Event:Trigger_L2_to_L1D, in_msg.LineAddress,
451 // We have room, the L2 doesn't have it, so the L1 fetches the line
452 trigger(mandatory_request_type_to_event(in_msg.Type),
453 in_msg.LineAddress, L1Dcache_entry, tbe);
456 // No room in the L1, so we need to make room
457 Address l1d_victim_addr := L1DcacheMemory.cacheProbe(in_msg.LineAddress);
458 if (L2cacheMemory.cacheAvail(l1d_victim_addr)) {
459 // The L2 has room, so we move the line from the L1 to the L2
460 trigger(Event:L1_to_L2,
462 getL1DCacheEntry(l1d_victim_addr),
463 TBEs[l1d_victim_addr]);
465 Address l2_victim_addr := L2cacheMemory.cacheProbe(l1d_victim_addr);
466 // The L2 does not have room, so we replace a line from the L2
467 trigger(Event:L2_Replacement,
469 getL2CacheEntry(l2_victim_addr),
470 TBEs[l2_victim_addr]);
481 action(a_issueGETS, "a", desc="Issue GETS") {
482 enqueue(requestNetwork_out, RequestMsg, latency=issue_latency) {
483 assert(is_valid(tbe));
484 out_msg.Address := address;
485 out_msg.Type := CoherenceRequestType:GETS;
486 out_msg.Requestor := machineID;
487 out_msg.Destination.add(map_Address_to_Directory(address));
488 out_msg.MessageSize := MessageSizeType:Request_Control;
489 out_msg.InitialRequestTime := get_time();
490 tbe.NumPendingMsgs := machineCount(MachineType:L1Cache); // One from each other cache (n-1) plus the memory (+1)
494 action(b_issueGETX, "b", desc="Issue GETX") {
495 enqueue(requestNetwork_out, RequestMsg, latency=issue_latency) {
496 assert(is_valid(tbe));
497 out_msg.Address := address;
498 out_msg.Type := CoherenceRequestType:GETX;
499 out_msg.Requestor := machineID;
500 out_msg.Destination.add(map_Address_to_Directory(address));
501 out_msg.MessageSize := MessageSizeType:Request_Control;
502 out_msg.InitialRequestTime := get_time();
503 tbe.NumPendingMsgs := machineCount(MachineType:L1Cache); // One from each other cache (n-1) plus the memory (+1)
507 action(c_sendExclusiveData, "c", desc="Send exclusive data from cache to requestor") {
508 peek(forwardToCache_in, RequestMsg) {
509 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
510 assert(is_valid(cache_entry));
511 out_msg.Address := address;
512 out_msg.Type := CoherenceResponseType:DATA_EXCLUSIVE;
513 out_msg.Sender := machineID;
514 out_msg.Destination.add(in_msg.Requestor);
515 out_msg.DataBlk := cache_entry.DataBlk;
516 out_msg.Dirty := cache_entry.Dirty;
517 if (in_msg.DirectedProbe) {
518 out_msg.Acks := machineCount(MachineType:L1Cache);
522 out_msg.SilentAcks := in_msg.SilentAcks;
523 out_msg.MessageSize := MessageSizeType:Response_Data;
524 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
525 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
530 action(d_issuePUT, "d", desc="Issue PUT") {
531 enqueue(requestNetwork_out, RequestMsg, latency=issue_latency) {
532 out_msg.Address := address;
533 out_msg.Type := CoherenceRequestType:PUT;
534 out_msg.Requestor := machineID;
535 out_msg.Destination.add(map_Address_to_Directory(address));
536 out_msg.MessageSize := MessageSizeType:Writeback_Control;
540 action(e_sendData, "e", desc="Send data from cache to requestor") {
541 peek(forwardToCache_in, RequestMsg) {
542 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
543 assert(is_valid(cache_entry));
544 out_msg.Address := address;
545 out_msg.Type := CoherenceResponseType:DATA;
546 out_msg.Sender := machineID;
547 out_msg.Destination.add(in_msg.Requestor);
548 out_msg.DataBlk := cache_entry.DataBlk;
549 out_msg.Dirty := cache_entry.Dirty;
550 if (in_msg.DirectedProbe) {
551 out_msg.Acks := machineCount(MachineType:L1Cache);
555 out_msg.SilentAcks := in_msg.SilentAcks;
556 out_msg.MessageSize := MessageSizeType:Response_Data;
557 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
558 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
563 action(ee_sendDataShared, "\e", desc="Send data from cache to requestor, remaining the owner") {
564 peek(forwardToCache_in, RequestMsg) {
565 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
566 assert(is_valid(cache_entry));
567 out_msg.Address := address;
568 out_msg.Type := CoherenceResponseType:DATA_SHARED;
569 out_msg.Sender := machineID;
570 out_msg.Destination.add(in_msg.Requestor);
571 out_msg.DataBlk := cache_entry.DataBlk;
572 out_msg.Dirty := cache_entry.Dirty;
573 DPRINTF(RubySlicc, "%s\n", out_msg.DataBlk);
574 if (in_msg.DirectedProbe) {
575 out_msg.Acks := machineCount(MachineType:L1Cache);
579 out_msg.SilentAcks := in_msg.SilentAcks;
580 out_msg.MessageSize := MessageSizeType:Response_Data;
581 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
582 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
587 action(em_sendDataSharedMultiple, "em", desc="Send data from cache to all requestors, still the owner") {
588 peek(forwardToCache_in, RequestMsg) {
589 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
590 assert(is_valid(cache_entry));
591 out_msg.Address := address;
592 out_msg.Type := CoherenceResponseType:DATA_SHARED;
593 out_msg.Sender := machineID;
594 out_msg.Destination := in_msg.MergedRequestors;
595 out_msg.DataBlk := cache_entry.DataBlk;
596 out_msg.Dirty := cache_entry.Dirty;
597 DPRINTF(RubySlicc, "%s\n", out_msg.DataBlk);
598 out_msg.Acks := machineCount(MachineType:L1Cache);
599 out_msg.SilentAcks := in_msg.SilentAcks;
600 out_msg.MessageSize := MessageSizeType:Response_Data;
601 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
602 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
607 action(f_sendAck, "f", desc="Send ack from cache to requestor") {
608 peek(forwardToCache_in, RequestMsg) {
609 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
610 out_msg.Address := address;
611 out_msg.Type := CoherenceResponseType:ACK;
612 out_msg.Sender := machineID;
613 out_msg.Destination.add(in_msg.Requestor);
615 out_msg.SilentAcks := in_msg.SilentAcks;
616 assert(in_msg.DirectedProbe == false);
617 out_msg.MessageSize := MessageSizeType:Response_Control;
618 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
619 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
624 action(ff_sendAckShared, "\f", desc="Send shared ack from cache to requestor") {
625 peek(forwardToCache_in, RequestMsg) {
626 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
627 out_msg.Address := address;
628 out_msg.Type := CoherenceResponseType:ACK_SHARED;
629 out_msg.Sender := machineID;
630 out_msg.Destination.add(in_msg.Requestor);
632 out_msg.SilentAcks := in_msg.SilentAcks;
633 assert(in_msg.DirectedProbe == false);
634 out_msg.MessageSize := MessageSizeType:Response_Control;
635 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
636 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
641 action(g_sendUnblock, "g", desc="Send unblock to memory") {
642 enqueue(unblockNetwork_out, ResponseMsg, latency=cache_response_latency) {
643 out_msg.Address := address;
644 out_msg.Type := CoherenceResponseType:UNBLOCK;
645 out_msg.Sender := machineID;
646 out_msg.Destination.add(map_Address_to_Directory(address));
647 out_msg.MessageSize := MessageSizeType:Unblock_Control;
651 action(gm_sendUnblockM, "gm", desc="Send unblock to memory and indicate M/O/E state") {
652 enqueue(unblockNetwork_out, ResponseMsg, latency=cache_response_latency) {
653 out_msg.Address := address;
654 out_msg.Type := CoherenceResponseType:UNBLOCKM;
655 out_msg.Sender := machineID;
656 out_msg.Destination.add(map_Address_to_Directory(address));
657 out_msg.MessageSize := MessageSizeType:Unblock_Control;
661 action(gs_sendUnblockS, "gs", desc="Send unblock to memory and indicate S state") {
662 enqueue(unblockNetwork_out, ResponseMsg, latency=cache_response_latency) {
663 assert(is_valid(tbe));
664 out_msg.Address := address;
665 out_msg.Type := CoherenceResponseType:UNBLOCKS;
666 out_msg.Sender := machineID;
667 out_msg.CurOwner := tbe.CurOwner;
668 out_msg.Destination.add(map_Address_to_Directory(address));
669 out_msg.MessageSize := MessageSizeType:Unblock_Control;
673 action(h_load_hit, "h", desc="Notify sequencer the load completed.") {
674 assert(is_valid(cache_entry));
675 DPRINTF(RubySlicc, "%s\n", cache_entry.DataBlk);
676 sequencer.readCallback(address, testAndClearLocalHit(cache_entry),
677 cache_entry.DataBlk);
680 action(hx_external_load_hit, "hx", desc="load required external msgs") {
681 assert(is_valid(cache_entry));
682 assert(is_valid(tbe));
683 DPRINTF(RubySlicc, "%s\n", cache_entry.DataBlk);
684 peek(responseToCache_in, ResponseMsg) {
686 sequencer.readCallback(address,
687 getNondirectHitMachType(in_msg.Address, in_msg.Sender),
689 tbe.InitialRequestTime,
690 tbe.ForwardRequestTime,
691 tbe.FirstResponseTime);
695 action(hh_store_hit, "\h", desc="Notify sequencer that store completed.") {
696 assert(is_valid(cache_entry));
697 DPRINTF(RubySlicc, "%s\n", cache_entry.DataBlk);
698 peek(mandatoryQueue_in, RubyRequest) {
699 sequencer.writeCallback(address, testAndClearLocalHit(cache_entry),
700 cache_entry.DataBlk);
702 cache_entry.Dirty := true;
703 if (in_msg.Type == RubyRequestType:ATOMIC) {
704 cache_entry.AtomicAccessed := true;
709 action(sx_external_store_hit, "sx", desc="store required external msgs.") {
710 assert(is_valid(cache_entry));
711 assert(is_valid(tbe));
712 DPRINTF(RubySlicc, "%s\n", cache_entry.DataBlk);
713 peek(responseToCache_in, ResponseMsg) {
715 sequencer.writeCallback(address,
716 getNondirectHitMachType(address, in_msg.Sender),
718 tbe.InitialRequestTime,
719 tbe.ForwardRequestTime,
720 tbe.FirstResponseTime);
722 cache_entry.Dirty := true;
725 action(sxt_trig_ext_store_hit, "sxt", desc="store required external msgs.") {
726 assert(is_valid(cache_entry));
727 assert(is_valid(tbe));
728 DPRINTF(RubySlicc, "%s\n", cache_entry.DataBlk);
730 sequencer.writeCallback(address,
731 getNondirectHitMachType(address, tbe.LastResponder),
733 tbe.InitialRequestTime,
734 tbe.ForwardRequestTime,
735 tbe.FirstResponseTime);
737 cache_entry.Dirty := true;
740 action(i_allocateTBE, "i", desc="Allocate TBE") {
741 check_allocate(TBEs);
742 assert(is_valid(cache_entry));
743 TBEs.allocate(address);
744 set_tbe(TBEs[address]);
745 tbe.DataBlk := cache_entry.DataBlk; // Data only used for writebacks
746 tbe.Dirty := cache_entry.Dirty;
747 tbe.Sharers := false;
750 action(j_popTriggerQueue, "j", desc="Pop trigger queue.") {
751 triggerQueue_in.dequeue();
754 action(k_popMandatoryQueue, "k", desc="Pop mandatory queue.") {
755 mandatoryQueue_in.dequeue();
758 action(l_popForwardQueue, "l", desc="Pop forwareded request queue.") {
759 forwardToCache_in.dequeue();
762 action(hp_copyFromTBEToL2, "li", desc="Copy data from TBE to L2 cache entry.") {
763 assert(is_valid(cache_entry));
764 assert(is_valid(tbe));
765 cache_entry.Dirty := tbe.Dirty;
766 cache_entry.DataBlk := tbe.DataBlk;
769 action(nb_copyFromTBEToL1, "fu", desc="Copy data from TBE to L1 cache entry.") {
770 assert(is_valid(cache_entry));
771 assert(is_valid(tbe));
772 cache_entry.Dirty := tbe.Dirty;
773 cache_entry.DataBlk := tbe.DataBlk;
774 cache_entry.FromL2 := true;
777 action(m_decrementNumberOfMessages, "m", desc="Decrement the number of messages for which we're waiting") {
778 peek(responseToCache_in, ResponseMsg) {
779 assert(in_msg.Acks > 0);
780 assert(is_valid(tbe));
781 DPRINTF(RubySlicc, "Sender = %s\n", in_msg.Sender);
782 DPRINTF(RubySlicc, "SilentAcks = %d\n", in_msg.SilentAcks);
783 if (tbe.AppliedSilentAcks == false) {
784 tbe.NumPendingMsgs := tbe.NumPendingMsgs - in_msg.SilentAcks;
785 tbe.AppliedSilentAcks := true;
787 DPRINTF(RubySlicc, "%d\n", tbe.NumPendingMsgs);
788 tbe.NumPendingMsgs := tbe.NumPendingMsgs - in_msg.Acks;
789 DPRINTF(RubySlicc, "%d\n", tbe.NumPendingMsgs);
790 APPEND_TRANSITION_COMMENT(tbe.NumPendingMsgs);
791 APPEND_TRANSITION_COMMENT(in_msg.Sender);
792 tbe.LastResponder := in_msg.Sender;
793 if (tbe.InitialRequestTime != zero_time() && in_msg.InitialRequestTime != zero_time()) {
794 assert(tbe.InitialRequestTime == in_msg.InitialRequestTime);
796 if (in_msg.InitialRequestTime != zero_time()) {
797 tbe.InitialRequestTime := in_msg.InitialRequestTime;
799 if (tbe.ForwardRequestTime != zero_time() && in_msg.ForwardRequestTime != zero_time()) {
800 assert(tbe.ForwardRequestTime == in_msg.ForwardRequestTime);
802 if (in_msg.ForwardRequestTime != zero_time()) {
803 tbe.ForwardRequestTime := in_msg.ForwardRequestTime;
805 if (tbe.FirstResponseTime == zero_time()) {
806 tbe.FirstResponseTime := get_time();
810 action(uo_updateCurrentOwner, "uo", desc="When moving SS state, update current owner.") {
811 peek(responseToCache_in, ResponseMsg) {
812 assert(is_valid(tbe));
813 tbe.CurOwner := in_msg.Sender;
817 action(n_popResponseQueue, "n", desc="Pop response queue") {
818 responseToCache_in.dequeue();
821 action(ll_L2toL1Transfer, "ll", desc="") {
822 enqueue(triggerQueue_out, TriggerMsg, latency=l2_cache_hit_latency) {
823 out_msg.Address := address;
824 out_msg.Type := TriggerType:L2_to_L1;
828 action(o_checkForCompletion, "o", desc="Check if we have received all the messages required for completion") {
829 assert(is_valid(tbe));
830 if (tbe.NumPendingMsgs == 0) {
831 enqueue(triggerQueue_out, TriggerMsg) {
832 out_msg.Address := address;
834 out_msg.Type := TriggerType:ALL_ACKS;
836 out_msg.Type := TriggerType:ALL_ACKS_NO_SHARERS;
842 action(p_decrementNumberOfMessagesByOne, "p", desc="Decrement the number of messages for which we're waiting by one") {
843 assert(is_valid(tbe));
844 tbe.NumPendingMsgs := tbe.NumPendingMsgs - 1;
847 action(pp_incrementNumberOfMessagesByOne, "\p", desc="Increment the number of messages for which we're waiting by one") {
848 assert(is_valid(tbe));
849 tbe.NumPendingMsgs := tbe.NumPendingMsgs + 1;
852 action(q_sendDataFromTBEToCache, "q", desc="Send data from TBE to cache") {
853 peek(forwardToCache_in, RequestMsg) {
854 assert(in_msg.Requestor != machineID);
855 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
856 assert(is_valid(tbe));
857 out_msg.Address := address;
858 out_msg.Type := CoherenceResponseType:DATA;
859 out_msg.Sender := machineID;
860 out_msg.Destination.add(in_msg.Requestor);
861 DPRINTF(RubySlicc, "%s\n", out_msg.Destination);
862 out_msg.DataBlk := tbe.DataBlk;
863 out_msg.Dirty := tbe.Dirty;
864 if (in_msg.DirectedProbe) {
865 out_msg.Acks := machineCount(MachineType:L1Cache);
869 out_msg.SilentAcks := in_msg.SilentAcks;
870 out_msg.MessageSize := MessageSizeType:Response_Data;
871 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
872 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
877 action(sq_sendSharedDataFromTBEToCache, "sq", desc="Send shared data from TBE to cache, still the owner") {
878 peek(forwardToCache_in, RequestMsg) {
879 assert(in_msg.Requestor != machineID);
880 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
881 assert(is_valid(tbe));
882 out_msg.Address := address;
883 out_msg.Type := CoherenceResponseType:DATA_SHARED;
884 out_msg.Sender := machineID;
885 out_msg.Destination.add(in_msg.Requestor);
886 DPRINTF(RubySlicc, "%s\n", out_msg.Destination);
887 out_msg.DataBlk := tbe.DataBlk;
888 out_msg.Dirty := tbe.Dirty;
889 if (in_msg.DirectedProbe) {
890 out_msg.Acks := machineCount(MachineType:L1Cache);
894 out_msg.SilentAcks := in_msg.SilentAcks;
895 out_msg.MessageSize := MessageSizeType:Response_Data;
896 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
897 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
902 action(qm_sendDataFromTBEToCache, "qm", desc="Send data from TBE to cache, multiple sharers, still the owner") {
903 peek(forwardToCache_in, RequestMsg) {
904 enqueue(responseNetwork_out, ResponseMsg, latency=cache_response_latency) {
905 assert(is_valid(tbe));
906 out_msg.Address := address;
907 out_msg.Type := CoherenceResponseType:DATA_SHARED;
908 out_msg.Sender := machineID;
909 out_msg.Destination := in_msg.MergedRequestors;
910 DPRINTF(RubySlicc, "%s\n", out_msg.Destination);
911 out_msg.DataBlk := tbe.DataBlk;
912 out_msg.Dirty := tbe.Dirty;
913 out_msg.Acks := machineCount(MachineType:L1Cache);
914 out_msg.SilentAcks := in_msg.SilentAcks;
915 out_msg.MessageSize := MessageSizeType:Response_Data;
916 out_msg.InitialRequestTime := in_msg.InitialRequestTime;
917 out_msg.ForwardRequestTime := in_msg.ForwardRequestTime;
922 action(qq_sendDataFromTBEToMemory, "\q", desc="Send data from TBE to memory") {
923 enqueue(unblockNetwork_out, ResponseMsg, latency=cache_response_latency) {
924 assert(is_valid(tbe));
925 out_msg.Address := address;
926 out_msg.Sender := machineID;
927 out_msg.Destination.add(map_Address_to_Directory(address));
928 out_msg.Dirty := tbe.Dirty;
930 out_msg.Type := CoherenceResponseType:WB_DIRTY;
931 out_msg.DataBlk := tbe.DataBlk;
932 out_msg.MessageSize := MessageSizeType:Writeback_Data;
934 out_msg.Type := CoherenceResponseType:WB_CLEAN;
935 // NOTE: in a real system this would not send data. We send
936 // data here only so we can check it at the memory
937 out_msg.DataBlk := tbe.DataBlk;
938 out_msg.MessageSize := MessageSizeType:Writeback_Control;
943 action(r_setSharerBit, "r", desc="We saw other sharers") {
944 assert(is_valid(tbe));
948 action(s_deallocateTBE, "s", desc="Deallocate TBE") {
949 TBEs.deallocate(address);
953 action(t_sendExclusiveDataFromTBEToMemory, "t", desc="Send exclusive data from TBE to memory") {
954 enqueue(unblockNetwork_out, ResponseMsg, latency=cache_response_latency) {
955 assert(is_valid(tbe));
956 out_msg.Address := address;
957 out_msg.Sender := machineID;
958 out_msg.Destination.add(map_Address_to_Directory(address));
959 out_msg.DataBlk := tbe.DataBlk;
960 out_msg.Dirty := tbe.Dirty;
962 out_msg.Type := CoherenceResponseType:WB_EXCLUSIVE_DIRTY;
963 out_msg.DataBlk := tbe.DataBlk;
964 out_msg.MessageSize := MessageSizeType:Writeback_Data;
966 out_msg.Type := CoherenceResponseType:WB_EXCLUSIVE_CLEAN;
967 // NOTE: in a real system this would not send data. We send
968 // data here only so we can check it at the memory
969 out_msg.DataBlk := tbe.DataBlk;
970 out_msg.MessageSize := MessageSizeType:Writeback_Control;
975 action(u_writeDataToCache, "u", desc="Write data to cache") {
976 peek(responseToCache_in, ResponseMsg) {
977 assert(is_valid(cache_entry));
978 cache_entry.DataBlk := in_msg.DataBlk;
979 cache_entry.Dirty := in_msg.Dirty;
983 action(v_writeDataToCacheVerify, "v", desc="Write data to cache, assert it was same as before") {
984 peek(responseToCache_in, ResponseMsg) {
985 assert(is_valid(cache_entry));
986 DPRINTF(RubySlicc, "Cached Data Block: %s, Msg Data Block: %s\n",
987 cache_entry.DataBlk, in_msg.DataBlk);
988 assert(cache_entry.DataBlk == in_msg.DataBlk);
989 cache_entry.DataBlk := in_msg.DataBlk;
990 cache_entry.Dirty := in_msg.Dirty || cache_entry.Dirty;
994 action(gg_deallocateL1CacheBlock, "\g", desc="Deallocate cache block. Sets the cache to invalid, allowing a replacement in parallel with a fetch.") {
995 if (L1DcacheMemory.isTagPresent(address)) {
996 L1DcacheMemory.deallocate(address);
998 L1IcacheMemory.deallocate(address);
1000 unset_cache_entry();
1003 action(ii_allocateL1DCacheBlock, "\i", desc="Set L1 D-cache tag equal to tag of block B.") {
1004 if (is_invalid(cache_entry)) {
1005 set_cache_entry(L1DcacheMemory.allocate(address, new Entry));
1009 action(jj_allocateL1ICacheBlock, "\j", desc="Set L1 I-cache tag equal to tag of block B.") {
1010 if (is_invalid(cache_entry)) {
1011 set_cache_entry(L1IcacheMemory.allocate(address, new Entry));
1015 action(vv_allocateL2CacheBlock, "\v", desc="Set L2 cache tag equal to tag of block B.") {
1016 set_cache_entry(L2cacheMemory.allocate(address, new Entry));
1019 action(rr_deallocateL2CacheBlock, "\r", desc="Deallocate L2 cache block. Sets the cache to not present, allowing a replacement in parallel with a fetch.") {
1020 L2cacheMemory.deallocate(address);
1021 unset_cache_entry();
1024 action(uu_profileMiss, "\u", desc="Profile the demand miss") {
1025 peek(mandatoryQueue_in, RubyRequest) {
1026 if (L1IcacheMemory.isTagPresent(address)) {
1027 L1IcacheMemory.profileMiss(in_msg);
1028 } else if (L1DcacheMemory.isTagPresent(address)) {
1029 L1DcacheMemory.profileMiss(in_msg);
1031 if (L2cacheMemory.isTagPresent(address) == false) {
1032 L2cacheMemory.profileMiss(in_msg);
1037 action(zz_stallAndWaitMandatoryQueue, "\z", desc="Send the head of the mandatory queue to the back of the queue.") {
1038 stall_and_wait(mandatoryQueue_in, address);
1041 action(kd_wakeUpDependents, "kd", desc="wake-up dependents") {
1042 wakeUpBuffers(address);
1045 action(ka_wakeUpAllDependents, "ka", desc="wake-up all dependents") {
1049 //*****************************************************
1051 //*****************************************************
1053 // Transitions for Load/Store/L2_Replacement from transient states
1054 transition({IM, SM, ISM, OM, IS, SS, OI, MI, II, IT, ST, OT, MT, MMT}, {Store, L2_Replacement}) {
1055 zz_stallAndWaitMandatoryQueue;
1058 transition({M_W, MM_W}, {L2_Replacement}) {
1059 zz_stallAndWaitMandatoryQueue;
1062 transition({IM, IS, OI, MI, II, IT, ST, OT, MT, MMT}, {Load, Ifetch}) {
1063 zz_stallAndWaitMandatoryQueue;
1066 transition({IM, SM, ISM, OM, IS, SS, MM_W, M_W, OI, MI, II, IT, ST, OT, MT, MMT}, L1_to_L2) {
1067 zz_stallAndWaitMandatoryQueue;
1070 transition({IT, ST, OT, MT, MMT}, {Other_GETX, NC_DMA_GETS, Other_GETS, Merged_GETS, Other_GETS_No_Mig, Invalidate}) {
1074 // Transitions moving data between the L1 and L2 caches
1075 transition({I, S, O, M, MM}, L1_to_L2) {
1077 gg_deallocateL1CacheBlock;
1078 vv_allocateL2CacheBlock;
1081 ka_wakeUpAllDependents;
1084 transition(I, Trigger_L2_to_L1D, IT) {
1086 rr_deallocateL2CacheBlock;
1087 ii_allocateL1DCacheBlock;
1088 nb_copyFromTBEToL1; // Not really needed for state I
1091 zz_stallAndWaitMandatoryQueue;
1095 transition(S, Trigger_L2_to_L1D, ST) {
1097 rr_deallocateL2CacheBlock;
1098 ii_allocateL1DCacheBlock;
1102 zz_stallAndWaitMandatoryQueue;
1106 transition(O, Trigger_L2_to_L1D, OT) {
1108 rr_deallocateL2CacheBlock;
1109 ii_allocateL1DCacheBlock;
1113 zz_stallAndWaitMandatoryQueue;
1117 transition(M, Trigger_L2_to_L1D, MT) {
1119 rr_deallocateL2CacheBlock;
1120 ii_allocateL1DCacheBlock;
1124 zz_stallAndWaitMandatoryQueue;
1128 transition(MM, Trigger_L2_to_L1D, MMT) {
1130 rr_deallocateL2CacheBlock;
1131 ii_allocateL1DCacheBlock;
1135 zz_stallAndWaitMandatoryQueue;
1139 transition(I, Trigger_L2_to_L1I, IT) {
1141 rr_deallocateL2CacheBlock;
1142 jj_allocateL1ICacheBlock;
1146 zz_stallAndWaitMandatoryQueue;
1150 transition(S, Trigger_L2_to_L1I, ST) {
1152 rr_deallocateL2CacheBlock;
1153 jj_allocateL1ICacheBlock;
1157 zz_stallAndWaitMandatoryQueue;
1161 transition(O, Trigger_L2_to_L1I, OT) {
1163 rr_deallocateL2CacheBlock;
1164 jj_allocateL1ICacheBlock;
1168 zz_stallAndWaitMandatoryQueue;
1172 transition(M, Trigger_L2_to_L1I, MT) {
1174 rr_deallocateL2CacheBlock;
1175 jj_allocateL1ICacheBlock;
1179 zz_stallAndWaitMandatoryQueue;
1183 transition(MM, Trigger_L2_to_L1I, MMT) {
1185 rr_deallocateL2CacheBlock;
1186 jj_allocateL1ICacheBlock;
1190 zz_stallAndWaitMandatoryQueue;
1194 transition(IT, Complete_L2_to_L1, I) {
1196 kd_wakeUpDependents;
1199 transition(ST, Complete_L2_to_L1, S) {
1201 kd_wakeUpDependents;
1204 transition(OT, Complete_L2_to_L1, O) {
1206 kd_wakeUpDependents;
1209 transition(MT, Complete_L2_to_L1, M) {
1211 kd_wakeUpDependents;
1214 transition(MMT, Complete_L2_to_L1, MM) {
1216 kd_wakeUpDependents;
1219 // Transitions from Idle
1220 transition(I, Load, IS) {
1221 ii_allocateL1DCacheBlock;
1225 k_popMandatoryQueue;
1228 transition(I, Ifetch, IS) {
1229 jj_allocateL1ICacheBlock;
1233 k_popMandatoryQueue;
1236 transition(I, Store, IM) {
1237 ii_allocateL1DCacheBlock;
1241 k_popMandatoryQueue;
1244 transition(I, L2_Replacement) {
1245 rr_deallocateL2CacheBlock;
1246 ka_wakeUpAllDependents;
1249 transition(I, {Other_GETX, NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig, Invalidate}) {
1254 // Transitions from Shared
1255 transition({S, SM, ISM}, {Load, Ifetch}) {
1257 k_popMandatoryQueue;
1260 transition(S, Store, SM) {
1264 k_popMandatoryQueue;
1267 transition(S, L2_Replacement, I) {
1268 rr_deallocateL2CacheBlock;
1269 ka_wakeUpAllDependents;
1272 transition(S, {Other_GETX, Invalidate}, I) {
1277 transition(S, {NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig}) {
1282 // Transitions from Owned
1283 transition({O, OM, SS, MM_W, M_W}, {Load, Ifetch}) {
1285 k_popMandatoryQueue;
1288 transition(O, Store, OM) {
1291 p_decrementNumberOfMessagesByOne;
1293 k_popMandatoryQueue;
1296 transition(O, L2_Replacement, OI) {
1299 rr_deallocateL2CacheBlock;
1300 ka_wakeUpAllDependents;
1303 transition(O, {Other_GETX, Invalidate}, I) {
1308 transition(O, {NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig}) {
1313 transition(O, Merged_GETS) {
1314 em_sendDataSharedMultiple;
1318 // Transitions from Modified
1319 transition(MM, {Load, Ifetch}) {
1321 k_popMandatoryQueue;
1324 transition(MM, Store) {
1326 k_popMandatoryQueue;
1329 transition(MM, L2_Replacement, MI) {
1332 rr_deallocateL2CacheBlock;
1333 ka_wakeUpAllDependents;
1336 transition(MM, {Other_GETX, Invalidate}, I) {
1337 c_sendExclusiveData;
1341 transition(MM, Other_GETS, I) {
1342 c_sendExclusiveData;
1346 transition(MM, NC_DMA_GETS) {
1347 c_sendExclusiveData;
1351 transition(MM, Other_GETS_No_Mig, O) {
1356 transition(MM, Merged_GETS, O) {
1357 em_sendDataSharedMultiple;
1361 // Transitions from Dirty Exclusive
1362 transition(M, {Load, Ifetch}) {
1364 k_popMandatoryQueue;
1367 transition(M, Store, MM) {
1369 k_popMandatoryQueue;
1372 transition(M, L2_Replacement, MI) {
1375 rr_deallocateL2CacheBlock;
1376 ka_wakeUpAllDependents;
1379 transition(M, {Other_GETX, Invalidate}, I) {
1380 c_sendExclusiveData;
1384 transition(M, {Other_GETS, Other_GETS_No_Mig}, O) {
1389 transition(M, NC_DMA_GETS) {
1394 transition(M, Merged_GETS, O) {
1395 em_sendDataSharedMultiple;
1399 // Transitions from IM
1401 transition(IM, {Other_GETX, NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig, Invalidate}) {
1406 transition(IM, Ack) {
1407 m_decrementNumberOfMessages;
1408 o_checkForCompletion;
1412 transition(IM, Data, ISM) {
1414 m_decrementNumberOfMessages;
1415 o_checkForCompletion;
1419 transition(IM, Exclusive_Data, MM_W) {
1421 m_decrementNumberOfMessages;
1422 o_checkForCompletion;
1423 sx_external_store_hit;
1425 kd_wakeUpDependents;
1428 // Transitions from SM
1429 transition(SM, {NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig}) {
1434 transition(SM, {Other_GETX, Invalidate}, IM) {
1439 transition(SM, Ack) {
1440 m_decrementNumberOfMessages;
1441 o_checkForCompletion;
1445 transition(SM, {Data, Exclusive_Data}, ISM) {
1446 v_writeDataToCacheVerify;
1447 m_decrementNumberOfMessages;
1448 o_checkForCompletion;
1452 // Transitions from ISM
1453 transition(ISM, Ack) {
1454 m_decrementNumberOfMessages;
1455 o_checkForCompletion;
1459 transition(ISM, All_acks_no_sharers, MM) {
1460 sxt_trig_ext_store_hit;
1464 kd_wakeUpDependents;
1467 // Transitions from OM
1469 transition(OM, {Other_GETX, Invalidate}, IM) {
1471 pp_incrementNumberOfMessagesByOne;
1475 transition(OM, {NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig}) {
1480 transition(OM, Merged_GETS) {
1481 em_sendDataSharedMultiple;
1485 transition(OM, Ack) {
1486 m_decrementNumberOfMessages;
1487 o_checkForCompletion;
1491 transition(OM, {All_acks, All_acks_no_sharers}, MM) {
1492 sxt_trig_ext_store_hit;
1496 kd_wakeUpDependents;
1499 // Transitions from IS
1501 transition(IS, {Other_GETX, NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig, Invalidate}) {
1506 transition(IS, Ack) {
1507 m_decrementNumberOfMessages;
1508 o_checkForCompletion;
1512 transition(IS, Shared_Ack) {
1513 m_decrementNumberOfMessages;
1515 o_checkForCompletion;
1519 transition(IS, Data, SS) {
1521 m_decrementNumberOfMessages;
1522 o_checkForCompletion;
1523 hx_external_load_hit;
1524 uo_updateCurrentOwner;
1526 kd_wakeUpDependents;
1529 transition(IS, Exclusive_Data, M_W) {
1531 m_decrementNumberOfMessages;
1532 o_checkForCompletion;
1533 hx_external_load_hit;
1535 kd_wakeUpDependents;
1538 transition(IS, Shared_Data, SS) {
1541 m_decrementNumberOfMessages;
1542 o_checkForCompletion;
1543 hx_external_load_hit;
1544 uo_updateCurrentOwner;
1546 kd_wakeUpDependents;
1549 // Transitions from SS
1551 transition(SS, Ack) {
1552 m_decrementNumberOfMessages;
1553 o_checkForCompletion;
1557 transition(SS, Shared_Ack) {
1558 m_decrementNumberOfMessages;
1560 o_checkForCompletion;
1564 transition(SS, All_acks, S) {
1568 kd_wakeUpDependents;
1571 transition(SS, All_acks_no_sharers, S) {
1572 // Note: The directory might still be the owner, so that is why we go to S
1576 kd_wakeUpDependents;
1579 // Transitions from MM_W
1581 transition(MM_W, Store) {
1583 k_popMandatoryQueue;
1586 transition(MM_W, Ack) {
1587 m_decrementNumberOfMessages;
1588 o_checkForCompletion;
1592 transition(MM_W, All_acks_no_sharers, MM) {
1596 kd_wakeUpDependents;
1599 // Transitions from M_W
1601 transition(M_W, Store, MM_W) {
1603 k_popMandatoryQueue;
1606 transition(M_W, Ack) {
1607 m_decrementNumberOfMessages;
1608 o_checkForCompletion;
1612 transition(M_W, All_acks_no_sharers, M) {
1616 kd_wakeUpDependents;
1619 // Transitions from OI/MI
1621 transition({OI, MI}, {Other_GETX, Invalidate}, II) {
1622 q_sendDataFromTBEToCache;
1626 transition({OI, MI}, {NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig}, OI) {
1627 sq_sendSharedDataFromTBEToCache;
1631 transition({OI, MI}, Merged_GETS, OI) {
1632 qm_sendDataFromTBEToCache;
1636 transition(MI, Writeback_Ack, I) {
1637 t_sendExclusiveDataFromTBEToMemory;
1640 kd_wakeUpDependents;
1643 transition(OI, Writeback_Ack, I) {
1644 qq_sendDataFromTBEToMemory;
1647 kd_wakeUpDependents;
1650 // Transitions from II
1651 transition(II, {NC_DMA_GETS, Other_GETS, Other_GETS_No_Mig, Other_GETX, Invalidate}, II) {
1656 transition(II, Writeback_Ack, I) {
1660 kd_wakeUpDependents;
1663 transition(II, Writeback_Nack, I) {
1666 kd_wakeUpDependents;