114184Sgabeblack@google.com/*
214184Sgabeblack@google.com * Copyright (c) 2010-2015 Advanced Micro Devices, Inc.
314184Sgabeblack@google.com * All rights reserved.
414184Sgabeblack@google.com *
514184Sgabeblack@google.com * For use for simulation and test purposes only
614184Sgabeblack@google.com *
714184Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without
814184Sgabeblack@google.com * modification, are permitted provided that the following conditions are met:
914184Sgabeblack@google.com *
1014184Sgabeblack@google.com * 1. Redistributions of source code must retain the above copyright notice,
1114184Sgabeblack@google.com * this list of conditions and the following disclaimer.
1214184Sgabeblack@google.com *
1314184Sgabeblack@google.com * 2. Redistributions in binary form must reproduce the above copyright notice,
1414184Sgabeblack@google.com * this list of conditions and the following disclaimer in the documentation
1514184Sgabeblack@google.com * and/or other materials provided with the distribution.
1614184Sgabeblack@google.com *
1714184Sgabeblack@google.com * 3. Neither the name of the copyright holder nor the names of its
1814184Sgabeblack@google.com * contributors may be used to endorse or promote products derived from this
1914184Sgabeblack@google.com * software without specific prior written permission.
2014184Sgabeblack@google.com *
2114184Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2214184Sgabeblack@google.com * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2314184Sgabeblack@google.com * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2414184Sgabeblack@google.com * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
2514184Sgabeblack@google.com * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2614184Sgabeblack@google.com * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2714184Sgabeblack@google.com * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2814184Sgabeblack@google.com * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2914184Sgabeblack@google.com * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3014184Sgabeblack@google.com * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3114184Sgabeblack@google.com * POSSIBILITY OF SUCH DAMAGE.
3214184Sgabeblack@google.com *
3314184Sgabeblack@google.com * Authors: Lisa Hsu
3414184Sgabeblack@google.com */
3514184Sgabeblack@google.com
3614184Sgabeblack@google.commachine(MachineType:CorePair, "CP-like Core Coherence")
3714184Sgabeblack@google.com : Sequencer * sequencer;
3814184Sgabeblack@google.com   Sequencer * sequencer1;
3914184Sgabeblack@google.com   CacheMemory * L1Icache;
4014184Sgabeblack@google.com   CacheMemory * L1D0cache;
4114184Sgabeblack@google.com   CacheMemory * L1D1cache;
4214184Sgabeblack@google.com   CacheMemory * L2cache;     // func mem logic looks in this CacheMemory
4314184Sgabeblack@google.com   bool send_evictions := "False";
4414184Sgabeblack@google.com   Cycles issue_latency := 5;  // time to send data down to NB
4514184Sgabeblack@google.com   Cycles l2_hit_latency := 18;
4614184Sgabeblack@google.com
4714184Sgabeblack@google.com  // BEGIN Core Buffers
4814184Sgabeblack@google.com
4914184Sgabeblack@google.com  // To the Network
5014184Sgabeblack@google.com  MessageBuffer * requestFromCore, network="To", virtual_network="0", vnet_type="request";
5114184Sgabeblack@google.com  MessageBuffer * responseFromCore, network="To", virtual_network="2", vnet_type="response";
5214184Sgabeblack@google.com  MessageBuffer * unblockFromCore, network="To", virtual_network="4", vnet_type="unblock";
5314184Sgabeblack@google.com
5414184Sgabeblack@google.com  // From the Network
5514184Sgabeblack@google.com  MessageBuffer * probeToCore, network="From", virtual_network="0", vnet_type="request";
5614184Sgabeblack@google.com  MessageBuffer * responseToCore, network="From", virtual_network="2", vnet_type="response";
5714184Sgabeblack@google.com
5814184Sgabeblack@google.com  MessageBuffer * mandatoryQueue;
5914184Sgabeblack@google.com
6014184Sgabeblack@google.com  MessageBuffer * triggerQueue, ordered="true";
6114184Sgabeblack@google.com
6214184Sgabeblack@google.com  // END Core Buffers
6314184Sgabeblack@google.com
6414184Sgabeblack@google.com{
6514184Sgabeblack@google.com  // BEGIN STATES
6614184Sgabeblack@google.com  state_declaration(State, desc="Cache states", default="CorePair_State_I") {
6714184Sgabeblack@google.com
6814184Sgabeblack@google.com    // Base States
6914184Sgabeblack@google.com    I, AccessPermission:Invalid, desc="Invalid";
7014184Sgabeblack@google.com    S, AccessPermission:Read_Only, desc="Shared";
7114184Sgabeblack@google.com    E0, AccessPermission:Read_Write, desc="Exclusive with Cluster 0 ownership";
7214184Sgabeblack@google.com    E1, AccessPermission:Read_Write, desc="Exclusive with Cluster 1 ownership";
7314184Sgabeblack@google.com    Es, AccessPermission:Read_Write, desc="Exclusive in core";
7414184Sgabeblack@google.com    O, AccessPermission:Read_Only, desc="Owner state in core, both clusters and other cores may be sharing line";
7514184Sgabeblack@google.com    Ms, AccessPermission:Read_Write, desc="Modified in core, both clusters may be sharing line";
7614184Sgabeblack@google.com    M0, AccessPermission:Read_Write, desc="Modified with cluster ownership";
7714184Sgabeblack@google.com    M1, AccessPermission:Read_Write, desc="Modified with cluster ownership";
7814184Sgabeblack@google.com
7914184Sgabeblack@google.com    // Transient States
8014184Sgabeblack@google.com    I_M0, AccessPermission:Busy, desc="Invalid, issued RdBlkM, have not seen response yet";
8114184Sgabeblack@google.com    I_M1, AccessPermission:Busy, desc="Invalid, issued RdBlkM, have not seen response yet";
8214184Sgabeblack@google.com    I_M0M1, AccessPermission:Busy, desc="Was in I_M0, got a store request from other cluster as well";
8314184Sgabeblack@google.com    I_M1M0, AccessPermission:Busy, desc="Was in I_M1, got a store request from other cluster as well";
8414184Sgabeblack@google.com    I_M0Ms, AccessPermission:Busy, desc="Was in I_M0, got a load request from other cluster as well";
8514184Sgabeblack@google.com    I_M1Ms, AccessPermission:Busy, desc="Was in I_M1, got a load request from other cluster as well";
8614184Sgabeblack@google.com    I_E0S, AccessPermission:Busy, desc="Invalid, issued RdBlk, have not seen response yet";
8714184Sgabeblack@google.com    I_E1S, AccessPermission:Busy, desc="Invalid, issued RdBlk, have not seen response yet";
8814184Sgabeblack@google.com    I_ES, AccessPermission:Busy, desc="S_F got hit by invalidating probe, RdBlk response needs to go to both clusters";
8914184Sgabeblack@google.com
9014184Sgabeblack@google.com    IF_E0S, AccessPermission:Busy, desc="something got hit with Probe Invalidate, now just I_E0S but expecting a L2_to_L1D0 trigger, just drop when receive";
9114184Sgabeblack@google.com    IF_E1S, AccessPermission:Busy, desc="something got hit with Probe Invalidate, now just I_E1S but expecting a L2_to_L1D1 trigger, just drop when receive";
9214184Sgabeblack@google.com    IF_ES, AccessPermission:Busy, desc="same, but waiting for two fills";
9314184Sgabeblack@google.com    IF0_ES, AccessPermission:Busy, desc="same, but waiting for two fills, got one";
9414184Sgabeblack@google.com    IF1_ES, AccessPermission:Busy, desc="same, but waiting for two fills, got one";
9514184Sgabeblack@google.com    F_S0, AccessPermission:Busy, desc="same, but going to S0 when trigger received";
9614184Sgabeblack@google.com    F_S1, AccessPermission:Busy, desc="same, but going to S1 when trigger received";
9714184Sgabeblack@google.com
9814184Sgabeblack@google.com    ES_I, AccessPermission:Read_Only, desc="L2 replacement, waiting for clean writeback ack";
9914184Sgabeblack@google.com    MO_I, AccessPermission:Read_Only, desc="L2 replacement, waiting for dirty writeback ack";
10014184Sgabeblack@google.com    MO_S0, AccessPermission:Read_Only, desc="M/O got Ifetch Miss, must write back first, then send RdBlkS";
10114184Sgabeblack@google.com    MO_S1, AccessPermission:Read_Only, desc="M/O got Ifetch Miss, must write back first, then send RdBlkS";
10214184Sgabeblack@google.com    S_F0, AccessPermission:Read_Only,  desc="Shared, filling L1";
10314184Sgabeblack@google.com    S_F1, AccessPermission:Read_Only,  desc="Shared, filling L1";
10414184Sgabeblack@google.com    S_F, AccessPermission:Read_Only,   desc="Shared, filling L1";
10514184Sgabeblack@google.com    O_F0, AccessPermission:Read_Only,  desc="Owned, filling L1";
10614184Sgabeblack@google.com    O_F1, AccessPermission:Read_Only,  desc="Owned, filling L1";
10714184Sgabeblack@google.com    O_F,  AccessPermission:Read_Only,  desc="Owned, filling L1";
10814184Sgabeblack@google.com    Si_F0, AccessPermission:Read_Only, desc="Shared, filling icache";
10914184Sgabeblack@google.com    Si_F1, AccessPermission:Read_Only, desc="Shared, filling icache";
11014184Sgabeblack@google.com    S_M0, AccessPermission:Read_Only, desc="Shared, issued CtoD, have not seen response yet";
11114184Sgabeblack@google.com    S_M1, AccessPermission:Read_Only, desc="Shared, issued CtoD, have not seen response yet";
11214184Sgabeblack@google.com    O_M0, AccessPermission:Read_Only, desc="Shared, issued CtoD, have not seen response yet";
11314184Sgabeblack@google.com    O_M1, AccessPermission:Read_Only, desc="Shared, issued CtoD, have not seen response yet";
11414184Sgabeblack@google.com    S0, AccessPermission:Busy, desc="RdBlkS on behalf of cluster 0, waiting for response";
11514184Sgabeblack@google.com    S1, AccessPermission:Busy, desc="RdBlkS on behalf of cluster 1, waiting for response";
11614184Sgabeblack@google.com
11714184Sgabeblack@google.com    Es_F0, AccessPermission:Read_Write, desc="Es, Cluster read, filling";
11814184Sgabeblack@google.com    Es_F1, AccessPermission:Read_Write, desc="Es, Cluster read, filling";
11914184Sgabeblack@google.com    Es_F, AccessPermission:Read_Write,  desc="Es, other cluster read, filling";
12014184Sgabeblack@google.com    E0_F, AccessPermission:Read_Write, desc="E0, cluster read, filling";
12114184Sgabeblack@google.com    E1_F, AccessPermission:Read_Write, desc="...";
12214184Sgabeblack@google.com    E0_Es, AccessPermission:Read_Write, desc="...";
12314184Sgabeblack@google.com    E1_Es, AccessPermission:Read_Write, desc="...";
12414184Sgabeblack@google.com    Ms_F0, AccessPermission:Read_Write, desc="...";
12514184Sgabeblack@google.com    Ms_F1, AccessPermission:Read_Write, desc="...";
12614184Sgabeblack@google.com    Ms_F, AccessPermission:Read_Write,  desc="...";
12714184Sgabeblack@google.com    M0_F, AccessPermission:Read_Write, desc="...";
12814184Sgabeblack@google.com    M0_Ms, AccessPermission:Read_Write, desc="...";
12914184Sgabeblack@google.com    M1_F, AccessPermission:Read_Write, desc="...";
13014184Sgabeblack@google.com    M1_Ms, AccessPermission:Read_Write, desc="...";
13114184Sgabeblack@google.com
13214184Sgabeblack@google.com    I_C, AccessPermission:Invalid, desc="Invalid, but waiting for WBAck from NB from canceled writeback";
13314184Sgabeblack@google.com    S0_C, AccessPermission:Busy, desc="MO_S0 hit by invalidating probe, waiting for WBAck form NB for canceled WB";
13414184Sgabeblack@google.com    S1_C, AccessPermission:Busy, desc="MO_S1 hit by invalidating probe, waiting for WBAck form NB for canceled WB";
13514184Sgabeblack@google.com    S_C, AccessPermission:Busy, desc="S*_C got NB_AckS, still waiting for WBAck";
13614184Sgabeblack@google.com
13714184Sgabeblack@google.com  } // END STATES
13814184Sgabeblack@google.com
13914184Sgabeblack@google.com  // BEGIN EVENTS
14014184Sgabeblack@google.com  enumeration(Event, desc="CP Events") {
14114184Sgabeblack@google.com    // CP Initiated events
14214184Sgabeblack@google.com    C0_Load_L1miss,            desc="Cluster 0 load, L1 missed";
14314184Sgabeblack@google.com    C0_Load_L1hit,             desc="Cluster 0 load, L1 hit";
14414184Sgabeblack@google.com    C1_Load_L1miss,            desc="Cluster 1 load L1 missed";
14514184Sgabeblack@google.com    C1_Load_L1hit,             desc="Cluster 1 load L1 hit";
14614184Sgabeblack@google.com    Ifetch0_L1hit,             desc="Instruction fetch, hit in the L1";
14714184Sgabeblack@google.com    Ifetch1_L1hit,             desc="Instruction fetch, hit in the L1";
14814184Sgabeblack@google.com    Ifetch0_L1miss,            desc="Instruction fetch, missed in the L1";
14914184Sgabeblack@google.com    Ifetch1_L1miss,            desc="Instruction fetch, missed in the L1";
15014184Sgabeblack@google.com    C0_Store_L1miss,           desc="Cluster 0 store missed in L1";
15114184Sgabeblack@google.com    C0_Store_L1hit,            desc="Cluster 0 store hit in L1";
15214184Sgabeblack@google.com    C1_Store_L1miss,           desc="Cluster 1 store missed in L1";
15314184Sgabeblack@google.com    C1_Store_L1hit,            desc="Cluster 1 store hit in L1";
15414184Sgabeblack@google.com    // NB Initiated events
15514184Sgabeblack@google.com    NB_AckS,             desc="NB Ack to Core Request";
15614184Sgabeblack@google.com    NB_AckM,             desc="NB Ack to Core Request";
15714184Sgabeblack@google.com    NB_AckE,             desc="NB Ack to Core Request";
15814184Sgabeblack@google.com
15914184Sgabeblack@google.com    NB_AckWB,            desc="NB Ack for writeback";
16014184Sgabeblack@google.com
16114184Sgabeblack@google.com    // Memory System initiatied events
16214184Sgabeblack@google.com    L1I_Repl,           desc="Replace address from L1I"; // Presumed clean
16314184Sgabeblack@google.com    L1D0_Repl,           desc="Replace address from L1D0"; // Presumed clean
16414184Sgabeblack@google.com    L1D1_Repl,           desc="Replace address from L1D1"; // Presumed clean
16514184Sgabeblack@google.com    L2_Repl,            desc="Replace address from L2";
16614184Sgabeblack@google.com
16714184Sgabeblack@google.com    L2_to_L1D0,           desc="L1 fill from L2";
16814184Sgabeblack@google.com    L2_to_L1D1,           desc="L1 fill from L2";
16914184Sgabeblack@google.com    L2_to_L1I,           desc="L1 fill from L2";
17014184Sgabeblack@google.com
17114184Sgabeblack@google.com    // Probe Events
17214184Sgabeblack@google.com    PrbInvData,         desc="probe, return O or M data";
17314184Sgabeblack@google.com    PrbInv,             desc="probe, no need for data";
17414184Sgabeblack@google.com    PrbShrData,         desc="probe downgrade, return O or M data";
17514184Sgabeblack@google.com
17614184Sgabeblack@google.com  }  // END EVENTS
17714184Sgabeblack@google.com
17814184Sgabeblack@google.com  enumeration(RequestType, desc="To communicate stats from transitions to recordStats") {
17914184Sgabeblack@google.com    L1D0DataArrayRead,    desc="Read the data array";
18014184Sgabeblack@google.com    L1D0DataArrayWrite,   desc="Write the data array";
18114184Sgabeblack@google.com    L1D0TagArrayRead,     desc="Read the data array";
18214184Sgabeblack@google.com    L1D0TagArrayWrite,    desc="Write the data array";
18314184Sgabeblack@google.com    L1D1DataArrayRead,    desc="Read the data array";
18414184Sgabeblack@google.com    L1D1DataArrayWrite,   desc="Write the data array";
18514184Sgabeblack@google.com    L1D1TagArrayRead,     desc="Read the data array";
18614184Sgabeblack@google.com    L1D1TagArrayWrite,    desc="Write the data array";
18714184Sgabeblack@google.com    L1IDataArrayRead,     desc="Read the data array";
18814184Sgabeblack@google.com    L1IDataArrayWrite,    desc="Write the data array";
18914184Sgabeblack@google.com    L1ITagArrayRead,      desc="Read the data array";
19014184Sgabeblack@google.com    L1ITagArrayWrite,     desc="Write the data array";
19114184Sgabeblack@google.com    L2DataArrayRead,      desc="Read the data array";
19214184Sgabeblack@google.com    L2DataArrayWrite,     desc="Write the data array";
19314184Sgabeblack@google.com    L2TagArrayRead,       desc="Read the data array";
19414184Sgabeblack@google.com    L2TagArrayWrite,      desc="Write the data array";
19514184Sgabeblack@google.com  }
19614184Sgabeblack@google.com
19714184Sgabeblack@google.com
19814184Sgabeblack@google.com  // BEGIN STRUCTURE DEFINITIONS
19914184Sgabeblack@google.com
20014184Sgabeblack@google.com
20114184Sgabeblack@google.com  // Cache Entry
20214184Sgabeblack@google.com  structure(Entry, desc="...", interface="AbstractCacheEntry") {
20314184Sgabeblack@google.com    State CacheState,           desc="cache state";
20414184Sgabeblack@google.com    bool Dirty,                 desc="Is the data dirty (diff than memory)?";
20514184Sgabeblack@google.com    DataBlock DataBlk,          desc="data for the block";
20614184Sgabeblack@google.com    bool FromL2, default="false", desc="block just moved from L2";
20714184Sgabeblack@google.com  }
20814184Sgabeblack@google.com
20914184Sgabeblack@google.com  structure(TBE, desc="...") {
21014184Sgabeblack@google.com    State TBEState,             desc="Transient state";
21114184Sgabeblack@google.com    DataBlock DataBlk,       desc="data for the block, required for concurrent writebacks";
21214184Sgabeblack@google.com    bool Dirty,              desc="Is the data dirty (different than memory)?";
21314184Sgabeblack@google.com    int NumPendingMsgs,      desc="Number of acks/data messages that this processor is waiting for";
21414184Sgabeblack@google.com    bool Shared,             desc="Victim hit by shared probe";
21514184Sgabeblack@google.com   }
21614184Sgabeblack@google.com
21714184Sgabeblack@google.com  structure(TBETable, external="yes") {
21814184Sgabeblack@google.com    TBE lookup(Addr);
21914184Sgabeblack@google.com    void allocate(Addr);
22014184Sgabeblack@google.com    void deallocate(Addr);
22114184Sgabeblack@google.com    bool isPresent(Addr);
22214184Sgabeblack@google.com  }
22314184Sgabeblack@google.com
22414184Sgabeblack@google.com  TBETable TBEs, template="<CorePair_TBE>", constructor="m_number_of_TBEs";
22514184Sgabeblack@google.com
22614184Sgabeblack@google.com  void set_cache_entry(AbstractCacheEntry b);
22714184Sgabeblack@google.com  void unset_cache_entry();
22814184Sgabeblack@google.com  void set_tbe(TBE b);
22914184Sgabeblack@google.com  void unset_tbe();
23014184Sgabeblack@google.com  void wakeUpAllBuffers();
23114184Sgabeblack@google.com  void wakeUpBuffers(Addr a);
23214184Sgabeblack@google.com  Cycles curCycle();
23314184Sgabeblack@google.com  MachineID mapAddressToMachine(Addr addr, MachineType mtype);
23414184Sgabeblack@google.com
23514184Sgabeblack@google.com  // END STRUCTURE DEFINITIONS
23614184Sgabeblack@google.com
23714184Sgabeblack@google.com  // BEGIN INTERNAL FUNCTIONS
23814184Sgabeblack@google.com
23914184Sgabeblack@google.com  Tick clockEdge();
24014184Sgabeblack@google.com  Tick cyclesToTicks(Cycles c);
24114184Sgabeblack@google.com
24214184Sgabeblack@google.com  bool addressInCore(Addr addr) {
24314184Sgabeblack@google.com    return (L2cache.isTagPresent(addr) || L1Icache.isTagPresent(addr) || L1D0cache.isTagPresent(addr) || L1D1cache.isTagPresent(addr));
24414184Sgabeblack@google.com  }
24514184Sgabeblack@google.com
24614184Sgabeblack@google.com  Entry getCacheEntry(Addr address), return_by_pointer="yes" {
24714184Sgabeblack@google.com    Entry L2cache_entry := static_cast(Entry, "pointer", L2cache.lookup(address));
24814184Sgabeblack@google.com    return L2cache_entry;
24914184Sgabeblack@google.com  }
25014184Sgabeblack@google.com
25114184Sgabeblack@google.com  DataBlock getDataBlock(Addr addr), return_by_ref="yes" {
25214184Sgabeblack@google.com    TBE tbe := TBEs.lookup(addr);
25314184Sgabeblack@google.com    if(is_valid(tbe)) {
25414184Sgabeblack@google.com      return tbe.DataBlk;
25514184Sgabeblack@google.com    } else {
25614184Sgabeblack@google.com      return getCacheEntry(addr).DataBlk;
25714184Sgabeblack@google.com    }
25814184Sgabeblack@google.com  }
25914184Sgabeblack@google.com
26014184Sgabeblack@google.com  Entry getL1CacheEntry(Addr addr, int cluster), return_by_pointer="yes" {
26114184Sgabeblack@google.com    if (cluster == 0) {
26214184Sgabeblack@google.com      Entry L1D0_entry := static_cast(Entry, "pointer", L1D0cache.lookup(addr));
26314184Sgabeblack@google.com      return L1D0_entry;
26414184Sgabeblack@google.com    } else {
26514184Sgabeblack@google.com      Entry L1D1_entry := static_cast(Entry, "pointer", L1D1cache.lookup(addr));
26614184Sgabeblack@google.com      return L1D1_entry;
26714184Sgabeblack@google.com    }
26814184Sgabeblack@google.com  }
26914184Sgabeblack@google.com
27014184Sgabeblack@google.com  Entry getICacheEntry(Addr addr), return_by_pointer="yes" {
27114184Sgabeblack@google.com    Entry c_entry := static_cast(Entry, "pointer", L1Icache.lookup(addr));
27214184Sgabeblack@google.com    return c_entry;
27314184Sgabeblack@google.com  }
27414184Sgabeblack@google.com
27514184Sgabeblack@google.com  bool presentOrAvail2(Addr addr) {
27614184Sgabeblack@google.com    return L2cache.isTagPresent(addr) || L2cache.cacheAvail(addr);
27714184Sgabeblack@google.com  }
27814184Sgabeblack@google.com
27914184Sgabeblack@google.com  bool presentOrAvailI(Addr addr) {
28014184Sgabeblack@google.com    return L1Icache.isTagPresent(addr) || L1Icache.cacheAvail(addr);
28114184Sgabeblack@google.com  }
28214184Sgabeblack@google.com
28314184Sgabeblack@google.com  bool presentOrAvailD0(Addr addr) {
28414184Sgabeblack@google.com    return L1D0cache.isTagPresent(addr) || L1D0cache.cacheAvail(addr);
28514184Sgabeblack@google.com  }
28614184Sgabeblack@google.com
28714184Sgabeblack@google.com  bool presentOrAvailD1(Addr addr) {
28814184Sgabeblack@google.com    return L1D1cache.isTagPresent(addr) || L1D1cache.cacheAvail(addr);
28914184Sgabeblack@google.com  }
29014184Sgabeblack@google.com
29114184Sgabeblack@google.com  State getState(TBE tbe, Entry cache_entry, Addr addr) {
29214184Sgabeblack@google.com    if(is_valid(tbe)) {
29314184Sgabeblack@google.com      return tbe.TBEState;
29414184Sgabeblack@google.com    } else if (is_valid(cache_entry)) {
29514184Sgabeblack@google.com      return cache_entry.CacheState;
29614184Sgabeblack@google.com    }
29714184Sgabeblack@google.com    return State:I;
29814184Sgabeblack@google.com  }
29914184Sgabeblack@google.com
30014184Sgabeblack@google.com  void setState(TBE tbe, Entry cache_entry, Addr addr, State state) {
30114184Sgabeblack@google.com    if (is_valid(tbe)) {
30214184Sgabeblack@google.com      tbe.TBEState := state;
30314184Sgabeblack@google.com    }
30414184Sgabeblack@google.com
30514184Sgabeblack@google.com    if (is_valid(cache_entry)) {
30614184Sgabeblack@google.com      cache_entry.CacheState := state;
30714184Sgabeblack@google.com    }
30814184Sgabeblack@google.com  }
30914184Sgabeblack@google.com
31014184Sgabeblack@google.com  AccessPermission getAccessPermission(Addr addr) {
31114184Sgabeblack@google.com    TBE tbe := TBEs.lookup(addr);
31214184Sgabeblack@google.com    if(is_valid(tbe)) {
31314184Sgabeblack@google.com      return CorePair_State_to_permission(tbe.TBEState);
31414184Sgabeblack@google.com    }
31514184Sgabeblack@google.com
31614184Sgabeblack@google.com    Entry cache_entry := getCacheEntry(addr);
31714184Sgabeblack@google.com    if(is_valid(cache_entry)) {
31814184Sgabeblack@google.com      return CorePair_State_to_permission(cache_entry.CacheState);
31914184Sgabeblack@google.com    }
32014184Sgabeblack@google.com
32114184Sgabeblack@google.com    return AccessPermission:NotPresent;
32214184Sgabeblack@google.com  }
32314184Sgabeblack@google.com
32414184Sgabeblack@google.com  void functionalRead(Addr addr, Packet *pkt) {
32514184Sgabeblack@google.com    TBE tbe := TBEs.lookup(addr);
32614184Sgabeblack@google.com    if(is_valid(tbe)) {
32714184Sgabeblack@google.com      testAndRead(addr, tbe.DataBlk, pkt);
32814184Sgabeblack@google.com    } else {
32914184Sgabeblack@google.com      functionalMemoryRead(pkt);
33014184Sgabeblack@google.com    }
33114184Sgabeblack@google.com  }
33214184Sgabeblack@google.com
33314184Sgabeblack@google.com  int functionalWrite(Addr addr, Packet *pkt) {
33414184Sgabeblack@google.com    int num_functional_writes := 0;
33514184Sgabeblack@google.com
33614184Sgabeblack@google.com    TBE tbe := TBEs.lookup(addr);
33714184Sgabeblack@google.com    if(is_valid(tbe)) {
33814184Sgabeblack@google.com      num_functional_writes := num_functional_writes +
33914184Sgabeblack@google.com            testAndWrite(addr, tbe.DataBlk, pkt);
34014184Sgabeblack@google.com    }
34114184Sgabeblack@google.com
34214184Sgabeblack@google.com    num_functional_writes := num_functional_writes + functionalMemoryWrite(pkt);
34314184Sgabeblack@google.com    return num_functional_writes;
34414184Sgabeblack@google.com  }
34514184Sgabeblack@google.com
34614184Sgabeblack@google.com  void setAccessPermission(Entry cache_entry, Addr addr, State state) {
34714184Sgabeblack@google.com    if (is_valid(cache_entry)) {
34814184Sgabeblack@google.com      cache_entry.changePermission(CorePair_State_to_permission(state));
34914184Sgabeblack@google.com    }
35014184Sgabeblack@google.com  }
35114184Sgabeblack@google.com
35214184Sgabeblack@google.com  MachineType testAndClearLocalHit(Entry cache_entry) {
35314184Sgabeblack@google.com    assert(is_valid(cache_entry));
35414184Sgabeblack@google.com    if (cache_entry.FromL2) {
35514184Sgabeblack@google.com      cache_entry.FromL2 := false;
35614184Sgabeblack@google.com      return MachineType:L2Cache;
35714184Sgabeblack@google.com    } else {
35814184Sgabeblack@google.com      return MachineType:L1Cache;
35914184Sgabeblack@google.com    }
36014184Sgabeblack@google.com  }
36114184Sgabeblack@google.com
36214184Sgabeblack@google.com  void recordRequestType(RequestType request_type, Addr addr) {
36314184Sgabeblack@google.com    if (request_type == RequestType:L1D0DataArrayRead) {
36414184Sgabeblack@google.com        L1D0cache.recordRequestType(CacheRequestType:DataArrayRead, addr);
36514184Sgabeblack@google.com    } else if (request_type == RequestType:L1D0DataArrayWrite) {
36614184Sgabeblack@google.com        L1D0cache.recordRequestType(CacheRequestType:DataArrayWrite, addr);
36714184Sgabeblack@google.com    } else if (request_type == RequestType:L1D0TagArrayRead) {
36814184Sgabeblack@google.com        L1D0cache.recordRequestType(CacheRequestType:TagArrayRead, addr);
36914184Sgabeblack@google.com    } else if (request_type == RequestType:L1D0TagArrayWrite) {
37014184Sgabeblack@google.com        L1D0cache.recordRequestType(CacheRequestType:TagArrayWrite, addr);
37114184Sgabeblack@google.com    } else if (request_type == RequestType:L1D1DataArrayRead) {
37214184Sgabeblack@google.com        L1D1cache.recordRequestType(CacheRequestType:DataArrayRead, addr);
37314184Sgabeblack@google.com    } else if (request_type == RequestType:L1D1DataArrayWrite) {
37414184Sgabeblack@google.com        L1D1cache.recordRequestType(CacheRequestType:DataArrayWrite, addr);
37514184Sgabeblack@google.com    } else if (request_type == RequestType:L1D1TagArrayRead) {
37614184Sgabeblack@google.com        L1D1cache.recordRequestType(CacheRequestType:TagArrayRead, addr);
37714184Sgabeblack@google.com    } else if (request_type == RequestType:L1D1TagArrayWrite) {
37814184Sgabeblack@google.com        L1D1cache.recordRequestType(CacheRequestType:TagArrayWrite, addr);
37914184Sgabeblack@google.com    } else if (request_type == RequestType:L1IDataArrayRead) {
38014184Sgabeblack@google.com        L1Icache.recordRequestType(CacheRequestType:DataArrayRead, addr);
38114184Sgabeblack@google.com    } else if (request_type == RequestType:L1IDataArrayWrite) {
38214184Sgabeblack@google.com        L1Icache.recordRequestType(CacheRequestType:DataArrayWrite, addr);
38314184Sgabeblack@google.com    } else if (request_type == RequestType:L1ITagArrayRead) {
38414184Sgabeblack@google.com        L1Icache.recordRequestType(CacheRequestType:TagArrayRead, addr);
38514184Sgabeblack@google.com    } else if (request_type == RequestType:L1ITagArrayWrite) {
38614184Sgabeblack@google.com        L1Icache.recordRequestType(CacheRequestType:TagArrayWrite, addr);
38714184Sgabeblack@google.com    } else if (request_type == RequestType:L2DataArrayRead) {
38814184Sgabeblack@google.com        L2cache.recordRequestType(CacheRequestType:DataArrayRead, addr);
38914184Sgabeblack@google.com    } else if (request_type == RequestType:L2DataArrayWrite) {
39014184Sgabeblack@google.com        L2cache.recordRequestType(CacheRequestType:DataArrayWrite, addr);
39114184Sgabeblack@google.com    } else if (request_type == RequestType:L2TagArrayRead) {
39214184Sgabeblack@google.com        L2cache.recordRequestType(CacheRequestType:TagArrayRead, addr);
39314184Sgabeblack@google.com    } else if (request_type == RequestType:L2TagArrayWrite) {
39414184Sgabeblack@google.com        L2cache.recordRequestType(CacheRequestType:TagArrayWrite, addr);
39514184Sgabeblack@google.com    }
39614184Sgabeblack@google.com  }
39714184Sgabeblack@google.com
39814184Sgabeblack@google.com  bool checkResourceAvailable(RequestType request_type, Addr addr) {
39914184Sgabeblack@google.com    if (request_type == RequestType:L2DataArrayRead) {
40014184Sgabeblack@google.com      return L2cache.checkResourceAvailable(CacheResourceType:DataArray, addr);
40114184Sgabeblack@google.com    } else if (request_type == RequestType:L2DataArrayWrite) {
40214184Sgabeblack@google.com      return L2cache.checkResourceAvailable(CacheResourceType:DataArray, addr);
40314184Sgabeblack@google.com    } else if (request_type == RequestType:L2TagArrayRead) {
40414184Sgabeblack@google.com      return L2cache.checkResourceAvailable(CacheResourceType:TagArray, addr);
40514184Sgabeblack@google.com    } else if (request_type == RequestType:L2TagArrayWrite) {
40614184Sgabeblack@google.com      return L2cache.checkResourceAvailable(CacheResourceType:TagArray, addr);
40714184Sgabeblack@google.com    } else if  (request_type == RequestType:L1D0DataArrayRead) {
40814184Sgabeblack@google.com      return L1D0cache.checkResourceAvailable(CacheResourceType:DataArray, addr);
40914184Sgabeblack@google.com    } else if (request_type == RequestType:L1D0DataArrayWrite) {
41014184Sgabeblack@google.com      return L1D0cache.checkResourceAvailable(CacheResourceType:DataArray, addr);
41114184Sgabeblack@google.com    } else if (request_type == RequestType:L1D0TagArrayRead) {
41214184Sgabeblack@google.com      return L1D0cache.checkResourceAvailable(CacheResourceType:TagArray, addr);
41314184Sgabeblack@google.com    } else if (request_type == RequestType:L1D0TagArrayWrite) {
41414184Sgabeblack@google.com      return L1D0cache.checkResourceAvailable(CacheResourceType:TagArray, addr);
41514184Sgabeblack@google.com    } else if (request_type == RequestType:L1D1DataArrayRead) {
41614184Sgabeblack@google.com      return L1D1cache.checkResourceAvailable(CacheResourceType:DataArray, addr);
41714184Sgabeblack@google.com    } else if (request_type == RequestType:L1D1DataArrayWrite) {
41814184Sgabeblack@google.com      return L1D1cache.checkResourceAvailable(CacheResourceType:DataArray, addr);
41914184Sgabeblack@google.com    } else if (request_type == RequestType:L1D1TagArrayRead) {
42014184Sgabeblack@google.com      return L1D1cache.checkResourceAvailable(CacheResourceType:TagArray, addr);
42114184Sgabeblack@google.com    } else if (request_type == RequestType:L1D1TagArrayWrite) {
42214184Sgabeblack@google.com      return L1D1cache.checkResourceAvailable(CacheResourceType:TagArray, addr);
42314184Sgabeblack@google.com    } else if (request_type == RequestType:L1IDataArrayRead) {
42414184Sgabeblack@google.com      return L1Icache.checkResourceAvailable(CacheResourceType:DataArray, addr);
42514184Sgabeblack@google.com    } else if (request_type == RequestType:L1IDataArrayWrite) {
42614184Sgabeblack@google.com      return L1Icache.checkResourceAvailable(CacheResourceType:DataArray, addr);
42714184Sgabeblack@google.com    } else if (request_type == RequestType:L1ITagArrayRead) {
42814184Sgabeblack@google.com      return L1Icache.checkResourceAvailable(CacheResourceType:TagArray, addr);
42914184Sgabeblack@google.com    } else if (request_type == RequestType:L1ITagArrayWrite) {
43014184Sgabeblack@google.com      return L1Icache.checkResourceAvailable(CacheResourceType:TagArray, addr);
43114184Sgabeblack@google.com
43214184Sgabeblack@google.com    } else {
43314184Sgabeblack@google.com      return true;
43414184Sgabeblack@google.com    }
43514184Sgabeblack@google.com  }
43614184Sgabeblack@google.com
43714184Sgabeblack@google.com  // END INTERNAL FUNCTIONS
43814184Sgabeblack@google.com
43914184Sgabeblack@google.com  // ** OUT_PORTS **
44014184Sgabeblack@google.com
44114184Sgabeblack@google.com  out_port(requestNetwork_out, CPURequestMsg, requestFromCore);
44214184Sgabeblack@google.com  out_port(responseNetwork_out, ResponseMsg, responseFromCore);
44314184Sgabeblack@google.com  out_port(triggerQueue_out, TriggerMsg, triggerQueue);
44414184Sgabeblack@google.com  out_port(unblockNetwork_out, UnblockMsg, unblockFromCore);
44514184Sgabeblack@google.com
44614184Sgabeblack@google.com  // ** IN_PORTS **
44714184Sgabeblack@google.com
44814184Sgabeblack@google.com  in_port(triggerQueue_in, TriggerMsg, triggerQueue, block_on="addr") {
44914184Sgabeblack@google.com    if (triggerQueue_in.isReady(clockEdge())) {
45014184Sgabeblack@google.com      peek(triggerQueue_in, TriggerMsg) {
45114184Sgabeblack@google.com        Entry cache_entry := getCacheEntry(in_msg.addr);
45214184Sgabeblack@google.com        TBE tbe := TBEs.lookup(in_msg.addr);
45314184Sgabeblack@google.com
45414184Sgabeblack@google.com        if (in_msg.Type == TriggerType:L2_to_L1) {
45514184Sgabeblack@google.com          if (in_msg.Dest == CacheId:L1I) {
45614184Sgabeblack@google.com            trigger(Event:L2_to_L1I, in_msg.addr, cache_entry, tbe);
45714184Sgabeblack@google.com          } else if (in_msg.Dest == CacheId:L1D0) {
45814184Sgabeblack@google.com            trigger(Event:L2_to_L1D0, in_msg.addr, cache_entry, tbe);
45914184Sgabeblack@google.com          } else if (in_msg.Dest == CacheId:L1D1) {
46014184Sgabeblack@google.com            trigger(Event:L2_to_L1D1, in_msg.addr, cache_entry, tbe);
46114184Sgabeblack@google.com          } else {
46214184Sgabeblack@google.com            error("unexpected trigger dest");
46314184Sgabeblack@google.com          }
46414184Sgabeblack@google.com        }
46514184Sgabeblack@google.com      }
46614184Sgabeblack@google.com    }
46714184Sgabeblack@google.com  }
46814184Sgabeblack@google.com
46914184Sgabeblack@google.com
47014184Sgabeblack@google.com  in_port(probeNetwork_in, NBProbeRequestMsg, probeToCore) {
47114184Sgabeblack@google.com    if (probeNetwork_in.isReady(clockEdge())) {
47214184Sgabeblack@google.com      peek(probeNetwork_in, NBProbeRequestMsg, block_on="addr") {
47314184Sgabeblack@google.com        Entry cache_entry := getCacheEntry(in_msg.addr);
47414184Sgabeblack@google.com        TBE tbe := TBEs.lookup(in_msg.addr);
47514184Sgabeblack@google.com
47614184Sgabeblack@google.com        if (in_msg.Type == ProbeRequestType:PrbInv) {
47714184Sgabeblack@google.com          if (in_msg.ReturnData) {
47814184Sgabeblack@google.com            trigger(Event:PrbInvData, in_msg.addr, cache_entry, tbe);
47914184Sgabeblack@google.com          } else {
48014184Sgabeblack@google.com            trigger(Event:PrbInv, in_msg.addr, cache_entry, tbe);
48114184Sgabeblack@google.com          }
48214184Sgabeblack@google.com        } else if (in_msg.Type == ProbeRequestType:PrbDowngrade) {
48314184Sgabeblack@google.com          assert(in_msg.ReturnData);
48414184Sgabeblack@google.com          trigger(Event:PrbShrData, in_msg.addr, cache_entry, tbe);
48514184Sgabeblack@google.com        }
48614184Sgabeblack@google.com      }
48714184Sgabeblack@google.com    }
48814184Sgabeblack@google.com  }
48914184Sgabeblack@google.com
49014184Sgabeblack@google.com
49114184Sgabeblack@google.com  // ResponseNetwork
49214184Sgabeblack@google.com  in_port(responseToCore_in, ResponseMsg, responseToCore) {
49314184Sgabeblack@google.com    if (responseToCore_in.isReady(clockEdge())) {
49414184Sgabeblack@google.com      peek(responseToCore_in, ResponseMsg, block_on="addr") {
49514184Sgabeblack@google.com
49614184Sgabeblack@google.com        Entry cache_entry := getCacheEntry(in_msg.addr);
49714184Sgabeblack@google.com        TBE tbe := TBEs.lookup(in_msg.addr);
49814184Sgabeblack@google.com
49914184Sgabeblack@google.com        if (in_msg.Type == CoherenceResponseType:NBSysResp) {
50014184Sgabeblack@google.com          if (in_msg.State == CoherenceState:Modified) {
50114184Sgabeblack@google.com              trigger(Event:NB_AckM, in_msg.addr, cache_entry, tbe);
50214184Sgabeblack@google.com          } else if (in_msg.State == CoherenceState:Shared) {
50314184Sgabeblack@google.com            trigger(Event:NB_AckS, in_msg.addr, cache_entry, tbe);
50414184Sgabeblack@google.com          } else if (in_msg.State == CoherenceState:Exclusive) {
50514184Sgabeblack@google.com            trigger(Event:NB_AckE, in_msg.addr, cache_entry, tbe);
50614184Sgabeblack@google.com          }
50714184Sgabeblack@google.com        } else if (in_msg.Type == CoherenceResponseType:NBSysWBAck) {
50814184Sgabeblack@google.com          trigger(Event:NB_AckWB, in_msg.addr, cache_entry, tbe);
50914184Sgabeblack@google.com        } else {
51014184Sgabeblack@google.com          error("Unexpected Response Message to Core");
51114184Sgabeblack@google.com        }
51214184Sgabeblack@google.com      }
51314184Sgabeblack@google.com    }
51414184Sgabeblack@google.com  }
51514184Sgabeblack@google.com
51614184Sgabeblack@google.com  // Nothing from the Unblock Network
51714184Sgabeblack@google.com
51814184Sgabeblack@google.com  // Mandatory Queue
51914184Sgabeblack@google.com  in_port(mandatoryQueue_in, RubyRequest, mandatoryQueue, desc="...") {
52014184Sgabeblack@google.com    if (mandatoryQueue_in.isReady(clockEdge())) {
52114184Sgabeblack@google.com      peek(mandatoryQueue_in, RubyRequest, block_on="LineAddress") {
52214184Sgabeblack@google.com
52314184Sgabeblack@google.com        Entry cache_entry := getCacheEntry(in_msg.LineAddress);
52414184Sgabeblack@google.com        TBE tbe := TBEs.lookup(in_msg.LineAddress);
52514184Sgabeblack@google.com
52614184Sgabeblack@google.com        if (in_msg.Type == RubyRequestType:IFETCH) {
52714184Sgabeblack@google.com          // FETCH ACCESS
52814184Sgabeblack@google.com
52914184Sgabeblack@google.com          if (L1Icache.isTagPresent(in_msg.LineAddress)) {
53014184Sgabeblack@google.com            if (mod(in_msg.contextId, 2) == 0) {
53114184Sgabeblack@google.com              trigger(Event:Ifetch0_L1hit, in_msg.LineAddress, cache_entry, tbe);
53214184Sgabeblack@google.com            } else {
53314184Sgabeblack@google.com              trigger(Event:Ifetch1_L1hit, in_msg.LineAddress, cache_entry, tbe);
53414184Sgabeblack@google.com            }
53514184Sgabeblack@google.com          } else {
53614184Sgabeblack@google.com            if (presentOrAvail2(in_msg.LineAddress)) {
53714184Sgabeblack@google.com              if (presentOrAvailI(in_msg.LineAddress)) {
53814184Sgabeblack@google.com                if (mod(in_msg.contextId, 2) == 0) {
53914184Sgabeblack@google.com                  trigger(Event:Ifetch0_L1miss, in_msg.LineAddress, cache_entry,
54014184Sgabeblack@google.com                          tbe);
54114184Sgabeblack@google.com                } else {
54214184Sgabeblack@google.com                  trigger(Event:Ifetch1_L1miss, in_msg.LineAddress, cache_entry,
54314184Sgabeblack@google.com                          tbe);
54414184Sgabeblack@google.com                }
54514184Sgabeblack@google.com              } else {
54614184Sgabeblack@google.com                // Check if the line we want to evict is not locked
54714184Sgabeblack@google.com                Addr victim := L1Icache.cacheProbe(in_msg.LineAddress);
54814184Sgabeblack@google.com                check_on_cache_probe(mandatoryQueue_in, victim);
54914184Sgabeblack@google.com                trigger(Event:L1I_Repl, victim,
55014184Sgabeblack@google.com                        getCacheEntry(victim), TBEs.lookup(victim));
55114184Sgabeblack@google.com              }
55214184Sgabeblack@google.com            } else { // Not present or avail in L2
55314184Sgabeblack@google.com              Addr victim := L2cache.cacheProbe(in_msg.LineAddress);
55414184Sgabeblack@google.com              trigger(Event:L2_Repl, victim, getCacheEntry(victim),
55514184Sgabeblack@google.com                      TBEs.lookup(victim));
55614184Sgabeblack@google.com            }
55714184Sgabeblack@google.com          }
55814184Sgabeblack@google.com        } else {
55914184Sgabeblack@google.com          // DATA ACCESS
56014184Sgabeblack@google.com          if (mod(in_msg.contextId, 2) == 1) {
56114184Sgabeblack@google.com            if (L1D1cache.isTagPresent(in_msg.LineAddress)) {
56214184Sgabeblack@google.com              if (in_msg.Type == RubyRequestType:LD) {
56314184Sgabeblack@google.com                trigger(Event:C1_Load_L1hit, in_msg.LineAddress, cache_entry,
56414184Sgabeblack@google.com                        tbe);
56514184Sgabeblack@google.com              } else {
56614184Sgabeblack@google.com                // Stores must write through, make sure L2 avail.
56714184Sgabeblack@google.com                if (presentOrAvail2(in_msg.LineAddress)) {
56814184Sgabeblack@google.com                  trigger(Event:C1_Store_L1hit, in_msg.LineAddress, cache_entry,
56914184Sgabeblack@google.com                          tbe);
57014184Sgabeblack@google.com                } else {
57114184Sgabeblack@google.com                  Addr victim := L2cache.cacheProbe(in_msg.LineAddress);
57214184Sgabeblack@google.com                  trigger(Event:L2_Repl, victim, getCacheEntry(victim),
57314184Sgabeblack@google.com                          TBEs.lookup(victim));
57414184Sgabeblack@google.com                }
57514184Sgabeblack@google.com              }
57614184Sgabeblack@google.com            } else {
57714184Sgabeblack@google.com              if (presentOrAvail2(in_msg.LineAddress)) {
57814184Sgabeblack@google.com                if (presentOrAvailD1(in_msg.LineAddress)) {
57914184Sgabeblack@google.com                  if (in_msg.Type == RubyRequestType:LD) {
58014184Sgabeblack@google.com                    trigger(Event:C1_Load_L1miss, in_msg.LineAddress,
58114184Sgabeblack@google.com                            cache_entry, tbe);
58214184Sgabeblack@google.com                  } else {
58314184Sgabeblack@google.com                    trigger(Event:C1_Store_L1miss, in_msg.LineAddress,
58414184Sgabeblack@google.com                            cache_entry, tbe);
58514184Sgabeblack@google.com                  }
58614184Sgabeblack@google.com                } else {
58714184Sgabeblack@google.com                  // Check if the line we want to evict is not locked
58814184Sgabeblack@google.com                  Addr victim := L1D1cache.cacheProbe(in_msg.LineAddress);
58914184Sgabeblack@google.com                  check_on_cache_probe(mandatoryQueue_in, victim);
59014184Sgabeblack@google.com                  trigger(Event:L1D1_Repl, victim,
59114184Sgabeblack@google.com                          getCacheEntry(victim), TBEs.lookup(victim));
59214184Sgabeblack@google.com                }
59314184Sgabeblack@google.com              } else { // not present or avail in L2
59414184Sgabeblack@google.com                Addr victim := L2cache.cacheProbe(in_msg.LineAddress);
59514184Sgabeblack@google.com                trigger(Event:L2_Repl, victim, getCacheEntry(victim), TBEs.lookup(victim));
59614184Sgabeblack@google.com              }
59714184Sgabeblack@google.com            }
59814184Sgabeblack@google.com          } else {
59914184Sgabeblack@google.com            Entry L1D0cache_entry := getL1CacheEntry(in_msg.LineAddress, 0);
60014184Sgabeblack@google.com            if (is_valid(L1D0cache_entry)) {
60114184Sgabeblack@google.com              if (in_msg.Type == RubyRequestType:LD) {
60214184Sgabeblack@google.com                trigger(Event:C0_Load_L1hit, in_msg.LineAddress, cache_entry,
60314184Sgabeblack@google.com                    tbe);
60414184Sgabeblack@google.com              } else {
60514184Sgabeblack@google.com                if (presentOrAvail2(in_msg.LineAddress)) {
60614184Sgabeblack@google.com                  trigger(Event:C0_Store_L1hit, in_msg.LineAddress, cache_entry,
60714184Sgabeblack@google.com                      tbe);
60814184Sgabeblack@google.com                } else {
60914184Sgabeblack@google.com                  Addr victim := L2cache.cacheProbe(in_msg.LineAddress);
61014184Sgabeblack@google.com                  trigger(Event:L2_Repl, victim, getCacheEntry(victim),
61114184Sgabeblack@google.com                      TBEs.lookup(victim));
61214184Sgabeblack@google.com                }
61314184Sgabeblack@google.com              }
61414184Sgabeblack@google.com            } else {
61514184Sgabeblack@google.com              if (presentOrAvail2(in_msg.LineAddress)) {
61614184Sgabeblack@google.com                if (presentOrAvailD0(in_msg.LineAddress)) {
61714184Sgabeblack@google.com                  if (in_msg.Type == RubyRequestType:LD) {
61814184Sgabeblack@google.com                    trigger(Event:C0_Load_L1miss, in_msg.LineAddress,
61914184Sgabeblack@google.com                        cache_entry, tbe);
62014184Sgabeblack@google.com                  } else {
62114184Sgabeblack@google.com                    trigger(Event:C0_Store_L1miss, in_msg.LineAddress,
62214184Sgabeblack@google.com                            cache_entry, tbe);
62314184Sgabeblack@google.com                  }
62414184Sgabeblack@google.com                } else {
62514184Sgabeblack@google.com                  // Check if the line we want to evict is not locked
62614184Sgabeblack@google.com                  Addr victim := L1D0cache.cacheProbe(in_msg.LineAddress);
62714184Sgabeblack@google.com                  check_on_cache_probe(mandatoryQueue_in, victim);
62814184Sgabeblack@google.com                  trigger(Event:L1D0_Repl, victim, getCacheEntry(victim),
62914184Sgabeblack@google.com                          TBEs.lookup(victim));
63014184Sgabeblack@google.com                }
63114184Sgabeblack@google.com              } else {
63214184Sgabeblack@google.com                Addr victim := L2cache.cacheProbe(in_msg.LineAddress);
63314184Sgabeblack@google.com                trigger(Event:L2_Repl, victim, getCacheEntry(victim),
63414184Sgabeblack@google.com                        TBEs.lookup(victim));
63514184Sgabeblack@google.com              }
63614184Sgabeblack@google.com            }
63714184Sgabeblack@google.com          }
63814184Sgabeblack@google.com        }
63914184Sgabeblack@google.com      }
64014184Sgabeblack@google.com    }
64114184Sgabeblack@google.com  }
64214184Sgabeblack@google.com
64314184Sgabeblack@google.com
64414184Sgabeblack@google.com  // ACTIONS
64514184Sgabeblack@google.com  action(ii_invIcache, "ii", desc="invalidate iCache") {
64614184Sgabeblack@google.com    if (L1Icache.isTagPresent(address)) {
64714184Sgabeblack@google.com      L1Icache.deallocate(address);
64814184Sgabeblack@google.com    }
64914184Sgabeblack@google.com  }
65014184Sgabeblack@google.com
65114184Sgabeblack@google.com  action(i0_invCluster, "i0", desc="invalidate cluster 0") {
65214184Sgabeblack@google.com    if (L1D0cache.isTagPresent(address)) {
65314184Sgabeblack@google.com      L1D0cache.deallocate(address);
65414184Sgabeblack@google.com    }
65514184Sgabeblack@google.com  }
65614184Sgabeblack@google.com
65714184Sgabeblack@google.com  action(i1_invCluster, "i1", desc="invalidate cluster 1") {
65814184Sgabeblack@google.com    if (L1D1cache.isTagPresent(address)) {
65914184Sgabeblack@google.com      L1D1cache.deallocate(address);
66014184Sgabeblack@google.com    }
66114184Sgabeblack@google.com  }
66214184Sgabeblack@google.com
66314184Sgabeblack@google.com  action(ib_invBothClusters, "ib", desc="invalidate both clusters") {
66414184Sgabeblack@google.com    if (L1D0cache.isTagPresent(address)) {
66514184Sgabeblack@google.com      L1D0cache.deallocate(address);
66614184Sgabeblack@google.com    }
66714184Sgabeblack@google.com    if (L1D1cache.isTagPresent(address)) {
66814184Sgabeblack@google.com      L1D1cache.deallocate(address);
66914184Sgabeblack@google.com    }
67014184Sgabeblack@google.com  }
67114184Sgabeblack@google.com
67214184Sgabeblack@google.com  action(i2_invL2, "i2", desc="invalidate L2") {
67314184Sgabeblack@google.com    if(is_valid(cache_entry)) {
67414184Sgabeblack@google.com        L2cache.deallocate(address);
67514184Sgabeblack@google.com    }
67614184Sgabeblack@google.com    unset_cache_entry();
67714184Sgabeblack@google.com  }
67814184Sgabeblack@google.com
67914184Sgabeblack@google.com  action(mru_setMRU, "mru", desc="Update LRU state") {
68014184Sgabeblack@google.com    L2cache.setMRU(address);
68114184Sgabeblack@google.com  }
68214184Sgabeblack@google.com
68314184Sgabeblack@google.com  action(mruD1_setD1cacheMRU, "mruD1", desc="Update LRU state") {
68414184Sgabeblack@google.com    L1D1cache.setMRU(address);
68514184Sgabeblack@google.com  }
68614184Sgabeblack@google.com
68714184Sgabeblack@google.com  action(mruD0_setD0cacheMRU, "mruD0", desc="Update LRU state") {
68814184Sgabeblack@google.com    L1D0cache.setMRU(address);
68914184Sgabeblack@google.com  }
69014184Sgabeblack@google.com
69114184Sgabeblack@google.com  action(mruI_setIcacheMRU, "mruI", desc="Update LRU state") {
69214184Sgabeblack@google.com    L1Icache.setMRU(address);
69314184Sgabeblack@google.com  }
69414184Sgabeblack@google.com
69514184Sgabeblack@google.com  action(n_issueRdBlk, "n", desc="Issue RdBlk") {
69614184Sgabeblack@google.com    enqueue(requestNetwork_out, CPURequestMsg, issue_latency) {
69714184Sgabeblack@google.com      out_msg.addr := address;
69814184Sgabeblack@google.com      out_msg.Type := CoherenceRequestType:RdBlk;
69914184Sgabeblack@google.com      out_msg.Requestor := machineID;
70014184Sgabeblack@google.com      out_msg.Destination.add(mapAddressToMachine(address, MachineType:Directory));
70114184Sgabeblack@google.com      DPRINTF(RubySlicc,"%s\n",out_msg.Destination);
70214184Sgabeblack@google.com      out_msg.MessageSize := MessageSizeType:Request_Control;
70314184Sgabeblack@google.com      out_msg.InitialRequestTime := curCycle();
70414184Sgabeblack@google.com    }
70514184Sgabeblack@google.com  }
70614184Sgabeblack@google.com
70714184Sgabeblack@google.com  action(nM_issueRdBlkM, "nM", desc="Issue RdBlkM") {
70814184Sgabeblack@google.com    enqueue(requestNetwork_out, CPURequestMsg, issue_latency) {
70914184Sgabeblack@google.com      out_msg.addr := address;
71014184Sgabeblack@google.com      out_msg.Type := CoherenceRequestType:RdBlkM;
71114184Sgabeblack@google.com      out_msg.Requestor := machineID;
71214184Sgabeblack@google.com      out_msg.Destination.add(mapAddressToMachine(address, MachineType:Directory));
71314184Sgabeblack@google.com      out_msg.MessageSize := MessageSizeType:Request_Control;
71414184Sgabeblack@google.com      out_msg.InitialRequestTime := curCycle();
71514184Sgabeblack@google.com    }
71614184Sgabeblack@google.com  }
71714184Sgabeblack@google.com
71814184Sgabeblack@google.com  action(nS_issueRdBlkS, "nS", desc="Issue RdBlkS") {
71914184Sgabeblack@google.com    enqueue(requestNetwork_out, CPURequestMsg, issue_latency) {
72014184Sgabeblack@google.com      out_msg.addr := address;
72114184Sgabeblack@google.com      out_msg.Type := CoherenceRequestType:RdBlkS;
72214184Sgabeblack@google.com      out_msg.Requestor := machineID;
72314184Sgabeblack@google.com      out_msg.Destination.add(mapAddressToMachine(address, MachineType:Directory));
72414184Sgabeblack@google.com      out_msg.MessageSize := MessageSizeType:Request_Control;
72514184Sgabeblack@google.com      out_msg.InitialRequestTime := curCycle();
72614184Sgabeblack@google.com    }
72714184Sgabeblack@google.com  }
72814184Sgabeblack@google.com
72914184Sgabeblack@google.com  action(vd_victim, "vd", desc="Victimize M/O L2 Data") {
73014184Sgabeblack@google.com    enqueue(requestNetwork_out, CPURequestMsg, issue_latency) {
73114184Sgabeblack@google.com      out_msg.addr := address;
73214184Sgabeblack@google.com      out_msg.Requestor := machineID;
73314184Sgabeblack@google.com      assert(is_valid(cache_entry));
73414184Sgabeblack@google.com      out_msg.DataBlk := cache_entry.DataBlk;
73514184Sgabeblack@google.com      assert(cache_entry.Dirty);
73614184Sgabeblack@google.com      out_msg.Destination.add(mapAddressToMachine(address, MachineType:Directory));
73714184Sgabeblack@google.com      out_msg.MessageSize := MessageSizeType:Request_Control;
73814184Sgabeblack@google.com      out_msg.Type := CoherenceRequestType:VicDirty;
73914184Sgabeblack@google.com      out_msg.InitialRequestTime := curCycle();
74014184Sgabeblack@google.com      if (cache_entry.CacheState == State:O) {
74114184Sgabeblack@google.com        out_msg.Shared := true;
74214184Sgabeblack@google.com      } else {
74314184Sgabeblack@google.com        out_msg.Shared := false;
74414184Sgabeblack@google.com      }
74514184Sgabeblack@google.com    }
74614184Sgabeblack@google.com  }
74714184Sgabeblack@google.com
74814184Sgabeblack@google.com  action(vc_victim, "vc", desc="Victimize E/S L2 Data") {
74914184Sgabeblack@google.com    enqueue(requestNetwork_out, CPURequestMsg, issue_latency) {
75014184Sgabeblack@google.com      out_msg.addr := address;
75114184Sgabeblack@google.com      out_msg.Requestor := machineID;
75214184Sgabeblack@google.com      out_msg.Destination.add(mapAddressToMachine(address, MachineType:Directory));
75314184Sgabeblack@google.com      out_msg.MessageSize := MessageSizeType:Request_Control;
75414184Sgabeblack@google.com      out_msg.Type := CoherenceRequestType:VicClean;
75514184Sgabeblack@google.com      out_msg.InitialRequestTime := curCycle();
75614184Sgabeblack@google.com      if (cache_entry.CacheState == State:S) {
75714184Sgabeblack@google.com        out_msg.Shared := true;
75814184Sgabeblack@google.com      } else {
75914184Sgabeblack@google.com        out_msg.Shared := false;
76014184Sgabeblack@google.com      }
76114184Sgabeblack@google.com    }
76214184Sgabeblack@google.com  }
76314184Sgabeblack@google.com
76414184Sgabeblack@google.com  action(a0_allocateL1D, "a0", desc="Allocate L1D0 Block") {
76514184Sgabeblack@google.com    if (L1D0cache.isTagPresent(address) == false) {
76614184Sgabeblack@google.com      L1D0cache.allocateVoid(address, new Entry);
76714184Sgabeblack@google.com    }
76814184Sgabeblack@google.com  }
76914184Sgabeblack@google.com
77014184Sgabeblack@google.com  action(a1_allocateL1D, "a1", desc="Allocate L1D1 Block") {
77114184Sgabeblack@google.com    if (L1D1cache.isTagPresent(address) == false) {
77214184Sgabeblack@google.com      L1D1cache.allocateVoid(address, new Entry);
77314184Sgabeblack@google.com    }
77414184Sgabeblack@google.com  }
77514184Sgabeblack@google.com
77614184Sgabeblack@google.com  action(ai_allocateL1I, "ai", desc="Allocate L1I Block") {
77714184Sgabeblack@google.com    if (L1Icache.isTagPresent(address) == false) {
77814184Sgabeblack@google.com      L1Icache.allocateVoid(address, new Entry);
77914184Sgabeblack@google.com    }
78014184Sgabeblack@google.com  }
78114184Sgabeblack@google.com
78214184Sgabeblack@google.com  action(a2_allocateL2, "a2", desc="Allocate L2 Block") {
78314184Sgabeblack@google.com    if (is_invalid(cache_entry)) {
78414184Sgabeblack@google.com      set_cache_entry(L2cache.allocate(address, new Entry));
78514184Sgabeblack@google.com    }
78614184Sgabeblack@google.com  }
78714184Sgabeblack@google.com
78814184Sgabeblack@google.com  action(t_allocateTBE, "t", desc="allocate TBE Entry") {
78914184Sgabeblack@google.com    check_allocate(TBEs);
79014184Sgabeblack@google.com    assert(is_valid(cache_entry));
79114184Sgabeblack@google.com    TBEs.allocate(address);
79214184Sgabeblack@google.com    set_tbe(TBEs.lookup(address));
79314184Sgabeblack@google.com    tbe.DataBlk := cache_entry.DataBlk;  // Data only used for WBs
79414184Sgabeblack@google.com    tbe.Dirty := cache_entry.Dirty;
79514184Sgabeblack@google.com    tbe.Shared := false;
79614184Sgabeblack@google.com  }
79714184Sgabeblack@google.com
79814184Sgabeblack@google.com  action(d_deallocateTBE, "d", desc="Deallocate TBE") {
79914184Sgabeblack@google.com    TBEs.deallocate(address);
80014184Sgabeblack@google.com    unset_tbe();
80114184Sgabeblack@google.com  }
80214184Sgabeblack@google.com
80314184Sgabeblack@google.com  action(p_popMandatoryQueue, "pm", desc="Pop Mandatory Queue") {
80414184Sgabeblack@google.com    mandatoryQueue_in.dequeue(clockEdge());
80514184Sgabeblack@google.com  }
80614184Sgabeblack@google.com
80714184Sgabeblack@google.com  action(pr_popResponseQueue, "pr", desc="Pop Response Queue") {
80814184Sgabeblack@google.com    responseToCore_in.dequeue(clockEdge());
80914184Sgabeblack@google.com  }
81014184Sgabeblack@google.com
81114184Sgabeblack@google.com  action(pt_popTriggerQueue, "pt", desc="Pop Trigger Queue") {
81214184Sgabeblack@google.com    triggerQueue_in.dequeue(clockEdge());
81314184Sgabeblack@google.com  }
81414184Sgabeblack@google.com
81514184Sgabeblack@google.com  action(pp_popProbeQueue, "pp", desc="pop probe queue") {
81614184Sgabeblack@google.com    probeNetwork_in.dequeue(clockEdge());
81714184Sgabeblack@google.com  }
81814184Sgabeblack@google.com
81914184Sgabeblack@google.com  action(il0_loadDone, "il0", desc="Cluster 0 i load done") {
82014184Sgabeblack@google.com    Entry entry := getICacheEntry(address);
82114184Sgabeblack@google.com    Entry l2entry := getCacheEntry(address); // Used for functional accesses
82214184Sgabeblack@google.com    assert(is_valid(entry));
82314184Sgabeblack@google.com    // L2 supplies data (functional accesses only look in L2, ok because L1
82414184Sgabeblack@google.com    //                   writes through to L2)
82514184Sgabeblack@google.com    sequencer.readCallback(address,
82614184Sgabeblack@google.com                           l2entry.DataBlk,
82714184Sgabeblack@google.com                           true,
82814184Sgabeblack@google.com                           testAndClearLocalHit(entry));
82914184Sgabeblack@google.com  }
83014184Sgabeblack@google.com
83114184Sgabeblack@google.com  action(il1_loadDone, "il1", desc="Cluster 1 i load done") {
83214184Sgabeblack@google.com    Entry entry := getICacheEntry(address);
83314184Sgabeblack@google.com    Entry l2entry := getCacheEntry(address); // Used for functional accesses
83414184Sgabeblack@google.com    assert(is_valid(entry));
83514184Sgabeblack@google.com    // L2 supplies data (functional accesses only look in L2, ok because L1
83614184Sgabeblack@google.com    //                   writes through to L2)
83714184Sgabeblack@google.com    sequencer1.readCallback(address,
83814184Sgabeblack@google.com                            l2entry.DataBlk,
83914184Sgabeblack@google.com                            true,
84014184Sgabeblack@google.com                            testAndClearLocalHit(entry));
84114184Sgabeblack@google.com  }
84214184Sgabeblack@google.com
84314184Sgabeblack@google.com  action(l0_loadDone, "l0", desc="Cluster 0 load done") {
84414184Sgabeblack@google.com    Entry entry := getL1CacheEntry(address, 0);
84514184Sgabeblack@google.com    Entry l2entry := getCacheEntry(address); // Used for functional accesses
84614184Sgabeblack@google.com    assert(is_valid(entry));
84714184Sgabeblack@google.com    // L2 supplies data (functional accesses only look in L2, ok because L1
84814184Sgabeblack@google.com    //                   writes through to L2)
84914184Sgabeblack@google.com    sequencer.readCallback(address,
85014184Sgabeblack@google.com                           l2entry.DataBlk,
85114184Sgabeblack@google.com                           true,
85214184Sgabeblack@google.com                           testAndClearLocalHit(entry));
85314184Sgabeblack@google.com  }
85414184Sgabeblack@google.com
85514184Sgabeblack@google.com  action(l1_loadDone, "l1", desc="Cluster 1 load done") {
85614184Sgabeblack@google.com    Entry entry := getL1CacheEntry(address, 1);
85714184Sgabeblack@google.com    Entry l2entry := getCacheEntry(address); // Used for functional accesses
85814184Sgabeblack@google.com    assert(is_valid(entry));
85914184Sgabeblack@google.com    // L2 supplies data (functional accesses only look in L2, ok because L1
86014184Sgabeblack@google.com    //                   writes through to L2)
86114184Sgabeblack@google.com    sequencer1.readCallback(address,
86214184Sgabeblack@google.com                            l2entry.DataBlk,
86314184Sgabeblack@google.com                            true,
86414184Sgabeblack@google.com                            testAndClearLocalHit(entry));
86514184Sgabeblack@google.com  }
86614184Sgabeblack@google.com
86714184Sgabeblack@google.com  action(xl0_loadDone, "xl0", desc="Cluster 0 load done") {
86814184Sgabeblack@google.com    peek(responseToCore_in, ResponseMsg) {
86914184Sgabeblack@google.com      assert((machineIDToMachineType(in_msg.Sender) == MachineType:Directory) ||
87014184Sgabeblack@google.com              (machineIDToMachineType(in_msg.Sender) == MachineType:L3Cache));
87114184Sgabeblack@google.com      Entry l2entry := getCacheEntry(address); // Used for functional accesses
87214184Sgabeblack@google.com      DPRINTF(ProtocolTrace, "CP Load Done 0 -- address %s, data: %s\n", address, l2entry.DataBlk);
87314184Sgabeblack@google.com      // L2 supplies data (functional accesses only look in L2, ok because L1
87414184Sgabeblack@google.com      //                   writes through to L2)
87514184Sgabeblack@google.com      sequencer.readCallback(address,
87614184Sgabeblack@google.com                             l2entry.DataBlk,
87714184Sgabeblack@google.com                             false,
87814184Sgabeblack@google.com                             machineIDToMachineType(in_msg.Sender),
87914184Sgabeblack@google.com                             in_msg.InitialRequestTime,
88014184Sgabeblack@google.com                             in_msg.ForwardRequestTime,
88114184Sgabeblack@google.com                             in_msg.ProbeRequestStartTime);
88214184Sgabeblack@google.com    }
88314184Sgabeblack@google.com  }
88414184Sgabeblack@google.com
88514184Sgabeblack@google.com  action(xl1_loadDone, "xl1", desc="Cluster 1 load done") {
88614184Sgabeblack@google.com   peek(responseToCore_in, ResponseMsg) {
88714184Sgabeblack@google.com      assert((machineIDToMachineType(in_msg.Sender) == MachineType:Directory) ||
88814184Sgabeblack@google.com              (machineIDToMachineType(in_msg.Sender) == MachineType:L3Cache));
88914184Sgabeblack@google.com      Entry l2entry := getCacheEntry(address); // Used for functional accesses
89014184Sgabeblack@google.com      // L2 supplies data (functional accesses only look in L2, ok because L1
89114184Sgabeblack@google.com      //                   writes through to L2)
89214184Sgabeblack@google.com      sequencer1.readCallback(address,
89314184Sgabeblack@google.com                              l2entry.DataBlk,
89414184Sgabeblack@google.com                              false,
89514184Sgabeblack@google.com                              machineIDToMachineType(in_msg.Sender),
89614184Sgabeblack@google.com                              in_msg.InitialRequestTime,
89714184Sgabeblack@google.com                              in_msg.ForwardRequestTime,
89814184Sgabeblack@google.com                              in_msg.ProbeRequestStartTime);
89914184Sgabeblack@google.com    }
90014184Sgabeblack@google.com  }
90114184Sgabeblack@google.com
90214184Sgabeblack@google.com  action(xi0_loadDone, "xi0", desc="Cluster 0 i-load done") {
90314184Sgabeblack@google.com    peek(responseToCore_in, ResponseMsg) {
90414184Sgabeblack@google.com      assert((machineIDToMachineType(in_msg.Sender) == MachineType:Directory) ||
90514184Sgabeblack@google.com              (machineIDToMachineType(in_msg.Sender) == MachineType:L3Cache));
90614184Sgabeblack@google.com      Entry l2entry := getCacheEntry(address); // Used for functional accesses
90714184Sgabeblack@google.com      // L2 supplies data (functional accesses only look in L2, ok because L1
90814184Sgabeblack@google.com      //                   writes through to L2)
90914184Sgabeblack@google.com      sequencer.readCallback(address,
91014184Sgabeblack@google.com                             l2entry.DataBlk,
91114184Sgabeblack@google.com                             false,
91214184Sgabeblack@google.com                             machineIDToMachineType(in_msg.Sender),
91314184Sgabeblack@google.com                             in_msg.InitialRequestTime,
91414184Sgabeblack@google.com                             in_msg.ForwardRequestTime,
91514184Sgabeblack@google.com                             in_msg.ProbeRequestStartTime);
91614184Sgabeblack@google.com    }
91714184Sgabeblack@google.com  }
91814184Sgabeblack@google.com
91914184Sgabeblack@google.com  action(xi1_loadDone, "xi1", desc="Cluster 1 i-load done") {
92014184Sgabeblack@google.com    peek(responseToCore_in, ResponseMsg) {
92114184Sgabeblack@google.com      assert((machineIDToMachineType(in_msg.Sender) == MachineType:Directory) ||
92214184Sgabeblack@google.com              (machineIDToMachineType(in_msg.Sender) == MachineType:L3Cache));
92314184Sgabeblack@google.com      Entry l2entry := getCacheEntry(address); // Used for functional accesses
92414184Sgabeblack@google.com      // L2 supplies data (functional accesses only look in L2, ok because L1
92514184Sgabeblack@google.com      //                   writes through to L2)
92614184Sgabeblack@google.com      sequencer1.readCallback(address,
92714184Sgabeblack@google.com                              l2entry.DataBlk,
92814184Sgabeblack@google.com                              false,
92914184Sgabeblack@google.com                              machineIDToMachineType(in_msg.Sender),
93014184Sgabeblack@google.com                              in_msg.InitialRequestTime,
93114184Sgabeblack@google.com                              in_msg.ForwardRequestTime,
93214184Sgabeblack@google.com                              in_msg.ProbeRequestStartTime);
93314184Sgabeblack@google.com    }
93414184Sgabeblack@google.com  }
93514184Sgabeblack@google.com
93614184Sgabeblack@google.com  action(s0_storeDone, "s0", desc="Cluster 0 store done") {
93714184Sgabeblack@google.com    Entry entry := getL1CacheEntry(address, 0);
93814184Sgabeblack@google.com    assert(is_valid(entry));
93914184Sgabeblack@google.com    assert(is_valid(cache_entry));
94014184Sgabeblack@google.com    sequencer.writeCallback(address,
94114184Sgabeblack@google.com                            cache_entry.DataBlk,
94214184Sgabeblack@google.com                            true,
94314184Sgabeblack@google.com                            testAndClearLocalHit(entry));
94414184Sgabeblack@google.com    cache_entry.Dirty := true;
94514184Sgabeblack@google.com    entry.DataBlk := cache_entry.DataBlk;
94614184Sgabeblack@google.com    entry.Dirty := true;
94714184Sgabeblack@google.com    DPRINTF(RubySlicc, "%s\n", cache_entry.DataBlk);
94814184Sgabeblack@google.com  }
94914184Sgabeblack@google.com
95014184Sgabeblack@google.com  action(s1_storeDone, "s1", desc="Cluster 1 store done") {
95114184Sgabeblack@google.com    Entry entry := getL1CacheEntry(address, 1);
95214184Sgabeblack@google.com    assert(is_valid(entry));
95314184Sgabeblack@google.com    assert(is_valid(cache_entry));
95414184Sgabeblack@google.com    sequencer1.writeCallback(address,
95514184Sgabeblack@google.com                             cache_entry.DataBlk,
95614184Sgabeblack@google.com                             true,
95714184Sgabeblack@google.com                             testAndClearLocalHit(entry));
95814184Sgabeblack@google.com    cache_entry.Dirty := true;
95914184Sgabeblack@google.com    entry.Dirty := true;
96014184Sgabeblack@google.com    entry.DataBlk := cache_entry.DataBlk;
96114184Sgabeblack@google.com    DPRINTF(RubySlicc, "%s\n", cache_entry.DataBlk);
96214184Sgabeblack@google.com  }
96314184Sgabeblack@google.com
96414184Sgabeblack@google.com  action(xs0_storeDone, "xs0", desc="Cluster 0 store done") {
96514184Sgabeblack@google.com    peek(responseToCore_in, ResponseMsg) {
96614184Sgabeblack@google.com      Entry entry := getL1CacheEntry(address, 0);
96714184Sgabeblack@google.com      assert(is_valid(entry));
96814184Sgabeblack@google.com      assert(is_valid(cache_entry));
96914184Sgabeblack@google.com      assert((machineIDToMachineType(in_msg.Sender) == MachineType:Directory) ||
97014184Sgabeblack@google.com             (machineIDToMachineType(in_msg.Sender) == MachineType:L3Cache));
97114184Sgabeblack@google.com      sequencer.writeCallback(address,
97214184Sgabeblack@google.com                              cache_entry.DataBlk,
97314184Sgabeblack@google.com                              false,
97414184Sgabeblack@google.com                              machineIDToMachineType(in_msg.Sender),
97514184Sgabeblack@google.com                              in_msg.InitialRequestTime,
97614184Sgabeblack@google.com                              in_msg.ForwardRequestTime,
97714184Sgabeblack@google.com                              in_msg.ProbeRequestStartTime);
97814184Sgabeblack@google.com      cache_entry.Dirty := true;
97914184Sgabeblack@google.com      entry.Dirty := true;
98014184Sgabeblack@google.com      entry.DataBlk := cache_entry.DataBlk;
98114184Sgabeblack@google.com      DPRINTF(RubySlicc, "%s\n", cache_entry.DataBlk);
98214184Sgabeblack@google.com    }
98314184Sgabeblack@google.com  }
98414184Sgabeblack@google.com
98514184Sgabeblack@google.com  action(xs1_storeDone, "xs1", desc="Cluster 1 store done") {
98614184Sgabeblack@google.com    peek(responseToCore_in, ResponseMsg) {
98714184Sgabeblack@google.com      Entry entry := getL1CacheEntry(address, 1);
98814184Sgabeblack@google.com      assert(is_valid(entry));
98914184Sgabeblack@google.com      assert(is_valid(cache_entry));
99014184Sgabeblack@google.com      assert((machineIDToMachineType(in_msg.Sender) == MachineType:Directory) ||
99114184Sgabeblack@google.com             (machineIDToMachineType(in_msg.Sender) == MachineType:L3Cache));
99214184Sgabeblack@google.com      sequencer1.writeCallback(address,
99314184Sgabeblack@google.com                               cache_entry.DataBlk,
99414184Sgabeblack@google.com                               false,
99514184Sgabeblack@google.com                               machineIDToMachineType(in_msg.Sender),
99614184Sgabeblack@google.com                               in_msg.InitialRequestTime,
99714184Sgabeblack@google.com                               in_msg.ForwardRequestTime,
99814184Sgabeblack@google.com                               in_msg.ProbeRequestStartTime);
99914184Sgabeblack@google.com      cache_entry.Dirty := true;
100014184Sgabeblack@google.com      entry.Dirty := true;
100114184Sgabeblack@google.com      entry.DataBlk := cache_entry.DataBlk;
100214184Sgabeblack@google.com      DPRINTF(RubySlicc, "%s\n", cache_entry.DataBlk);
100314184Sgabeblack@google.com    }
100414184Sgabeblack@google.com  }
100514184Sgabeblack@google.com
100614184Sgabeblack@google.com  action(forward_eviction_to_cpu0, "fec0", desc="sends eviction information to processor0") {
100714184Sgabeblack@google.com    if (send_evictions) {
100814184Sgabeblack@google.com      DPRINTF(RubySlicc, "Sending invalidation for %s to the CPU\n", address);
100914184Sgabeblack@google.com      sequencer.evictionCallback(address);
101014184Sgabeblack@google.com    }
101114184Sgabeblack@google.com  }
101214184Sgabeblack@google.com
101314184Sgabeblack@google.com  action(forward_eviction_to_cpu1, "fec1", desc="sends eviction information to processor1") {
101414184Sgabeblack@google.com    if (send_evictions) {
101514184Sgabeblack@google.com      DPRINTF(RubySlicc, "Sending invalidation for %s to the CPU\n", address);
101614184Sgabeblack@google.com      sequencer1.evictionCallback(address);
101714184Sgabeblack@google.com    }
101814184Sgabeblack@google.com  }
101914184Sgabeblack@google.com
102014184Sgabeblack@google.com  action(ci_copyL2ToL1, "ci", desc="copy L2 data to L1") {
102114184Sgabeblack@google.com    Entry entry := getICacheEntry(address);
102214184Sgabeblack@google.com    assert(is_valid(entry));
102314184Sgabeblack@google.com    assert(is_valid(cache_entry));
102414184Sgabeblack@google.com    entry.Dirty := cache_entry.Dirty;
102514184Sgabeblack@google.com    entry.DataBlk := cache_entry.DataBlk;
102614184Sgabeblack@google.com    entry.FromL2 := true;
102714184Sgabeblack@google.com  }
102814184Sgabeblack@google.com
102914184Sgabeblack@google.com  action(c0_copyL2ToL1, "c0", desc="copy L2 data to L1") {
103014184Sgabeblack@google.com    Entry entry := getL1CacheEntry(address, 0);
103114184Sgabeblack@google.com    assert(is_valid(entry));
103214184Sgabeblack@google.com    assert(is_valid(cache_entry));
103314184Sgabeblack@google.com    entry.Dirty := cache_entry.Dirty;
103414184Sgabeblack@google.com    entry.DataBlk := cache_entry.DataBlk;
103514184Sgabeblack@google.com    entry.FromL2 := true;
103614184Sgabeblack@google.com  }
103714184Sgabeblack@google.com
103814184Sgabeblack@google.com  action(c1_copyL2ToL1, "c1", desc="copy L2 data to L1") {
103914184Sgabeblack@google.com    Entry entry := getL1CacheEntry(address, 1);
104014184Sgabeblack@google.com    assert(is_valid(entry));
104114184Sgabeblack@google.com    assert(is_valid(cache_entry));
104214184Sgabeblack@google.com    entry.Dirty := cache_entry.Dirty;
104314184Sgabeblack@google.com    entry.DataBlk := cache_entry.DataBlk;
104414184Sgabeblack@google.com    entry.FromL2 := true;
104514184Sgabeblack@google.com  }
104614184Sgabeblack@google.com
104714184Sgabeblack@google.com  action(fi_L2ToL1, "fi", desc="L2 to L1 inst fill") {
104814184Sgabeblack@google.com    enqueue(triggerQueue_out, TriggerMsg, l2_hit_latency) {
104914184Sgabeblack@google.com      out_msg.addr := address;
105014184Sgabeblack@google.com      out_msg.Type := TriggerType:L2_to_L1;
105114184Sgabeblack@google.com      out_msg.Dest := CacheId:L1I;
105214184Sgabeblack@google.com    }
105314184Sgabeblack@google.com  }
105414184Sgabeblack@google.com
105514184Sgabeblack@google.com  action(f0_L2ToL1, "f0", desc="L2 to L1 data fill") {
105614184Sgabeblack@google.com    enqueue(triggerQueue_out, TriggerMsg, l2_hit_latency) {
105714184Sgabeblack@google.com      out_msg.addr := address;
105814184Sgabeblack@google.com      out_msg.Type := TriggerType:L2_to_L1;
105914184Sgabeblack@google.com      out_msg.Dest := CacheId:L1D0;
106014184Sgabeblack@google.com    }
106114184Sgabeblack@google.com  }
106214184Sgabeblack@google.com
106314184Sgabeblack@google.com  action(f1_L2ToL1, "f1", desc="L2 to L1 data fill") {
106414184Sgabeblack@google.com    enqueue(triggerQueue_out, TriggerMsg, l2_hit_latency) {
106514184Sgabeblack@google.com      out_msg.addr := address;
106614184Sgabeblack@google.com      out_msg.Type := TriggerType:L2_to_L1;
106714184Sgabeblack@google.com      out_msg.Dest := CacheId:L1D1;
106814184Sgabeblack@google.com    }
106914184Sgabeblack@google.com  }
107014184Sgabeblack@google.com
107114184Sgabeblack@google.com  action(wi_writeIcache, "wi", desc="write data to icache (and l2)") {
107214184Sgabeblack@google.com    peek(responseToCore_in, ResponseMsg) {
107314184Sgabeblack@google.com      Entry entry := getICacheEntry(address);
107414184Sgabeblack@google.com      assert(is_valid(entry));
107514184Sgabeblack@google.com      assert(is_valid(cache_entry));
107614184Sgabeblack@google.com      entry.DataBlk := in_msg.DataBlk;
107714184Sgabeblack@google.com      entry.Dirty := in_msg.Dirty;
107814184Sgabeblack@google.com      cache_entry.DataBlk := in_msg.DataBlk;
107914184Sgabeblack@google.com      cache_entry.Dirty := in_msg.Dirty;
108014184Sgabeblack@google.com    }
108114184Sgabeblack@google.com  }
108214184Sgabeblack@google.com
108314184Sgabeblack@google.com  action(w0_writeDcache, "w0", desc="write data to dcache 0 (and l2)") {
108414184Sgabeblack@google.com    peek(responseToCore_in, ResponseMsg) {
108514184Sgabeblack@google.com      Entry entry := getL1CacheEntry(address, 0);
108614184Sgabeblack@google.com      assert(is_valid(entry));
108714184Sgabeblack@google.com      assert(is_valid(cache_entry));
108814184Sgabeblack@google.com      DPRINTF(ProtocolTrace, "CP writeD0: address %s, data: %s\n", address, in_msg.DataBlk);
108914184Sgabeblack@google.com      entry.DataBlk := in_msg.DataBlk;
109014184Sgabeblack@google.com      entry.Dirty := in_msg.Dirty;
109114184Sgabeblack@google.com      cache_entry.DataBlk := in_msg.DataBlk;
109214184Sgabeblack@google.com      cache_entry.Dirty := in_msg.Dirty;
109314184Sgabeblack@google.com    }
109414184Sgabeblack@google.com  }
109514184Sgabeblack@google.com
109614184Sgabeblack@google.com  action(w1_writeDcache, "w1", desc="write data to dcache 1 (and l2)") {
109714184Sgabeblack@google.com    peek(responseToCore_in, ResponseMsg) {
109814184Sgabeblack@google.com      Entry entry := getL1CacheEntry(address, 1);
109914184Sgabeblack@google.com      assert(is_valid(entry));
110014184Sgabeblack@google.com      assert(is_valid(cache_entry));
110114184Sgabeblack@google.com      entry.DataBlk := in_msg.DataBlk;
110214184Sgabeblack@google.com      entry.Dirty := in_msg.Dirty;
110314184Sgabeblack@google.com      cache_entry.DataBlk := in_msg.DataBlk;
110414184Sgabeblack@google.com      cache_entry.Dirty := in_msg.Dirty;
110514184Sgabeblack@google.com    }
110614184Sgabeblack@google.com  }
110714184Sgabeblack@google.com
110814184Sgabeblack@google.com  action(ss_sendStaleNotification, "ss", desc="stale data; nothing to writeback") {
110914184Sgabeblack@google.com    peek(responseToCore_in, ResponseMsg) {
111014184Sgabeblack@google.com      enqueue(responseNetwork_out, ResponseMsg, issue_latency) {
111114184Sgabeblack@google.com        out_msg.addr := address;
111214184Sgabeblack@google.com        out_msg.Type := CoherenceResponseType:StaleNotif;
111314184Sgabeblack@google.com        out_msg.Sender := machineID;
111414184Sgabeblack@google.com        out_msg.Destination.add(mapAddressToMachine(address, MachineType:Directory));
111514184Sgabeblack@google.com        out_msg.MessageSize := MessageSizeType:Response_Control;
111614184Sgabeblack@google.com        DPRINTF(RubySlicc, "%s\n", out_msg);
111714184Sgabeblack@google.com      }
111814184Sgabeblack@google.com    }
111914184Sgabeblack@google.com  }
112014184Sgabeblack@google.com
112114184Sgabeblack@google.com  action(wb_data, "wb", desc="write back data") {
112214184Sgabeblack@google.com    peek(responseToCore_in, ResponseMsg) {
112314184Sgabeblack@google.com      enqueue(responseNetwork_out, ResponseMsg, issue_latency) {
112414184Sgabeblack@google.com        out_msg.addr := address;
112514184Sgabeblack@google.com        out_msg.Type := CoherenceResponseType:CPUData;
112614184Sgabeblack@google.com        out_msg.Sender := machineID;
112714184Sgabeblack@google.com        out_msg.Destination.add(mapAddressToMachine(address, MachineType:Directory));
112814184Sgabeblack@google.com        out_msg.DataBlk := tbe.DataBlk;
112914184Sgabeblack@google.com        out_msg.Dirty := tbe.Dirty;
113014184Sgabeblack@google.com        if (tbe.Shared) {
113114184Sgabeblack@google.com          out_msg.NbReqShared := true;
113214184Sgabeblack@google.com        } else {
113314184Sgabeblack@google.com          out_msg.NbReqShared := false;
113414184Sgabeblack@google.com        }
113514184Sgabeblack@google.com        out_msg.State := CoherenceState:Shared; // faux info
113614184Sgabeblack@google.com        out_msg.MessageSize := MessageSizeType:Writeback_Data;
113714184Sgabeblack@google.com        DPRINTF(RubySlicc, "%s\n", out_msg);
113814184Sgabeblack@google.com      }
113914184Sgabeblack@google.com    }
114014184Sgabeblack@google.com  }
114114184Sgabeblack@google.com
114214184Sgabeblack@google.com  action(pi_sendProbeResponseInv, "pi", desc="send probe ack inv, no data") {
114314184Sgabeblack@google.com    enqueue(responseNetwork_out, ResponseMsg, issue_latency) {
114414184Sgabeblack@google.com      out_msg.addr := address;
114514184Sgabeblack@google.com      out_msg.Type := CoherenceResponseType:CPUPrbResp;  // L3 and CPUs respond in same way to probes
114614184Sgabeblack@google.com      out_msg.Sender := machineID;
114714184Sgabeblack@google.com      // will this always be ok? probably not for multisocket
114814184Sgabeblack@google.com      out_msg.Destination.add(mapAddressToMachine(address, MachineType:Directory));
114914184Sgabeblack@google.com      out_msg.Dirty := false;
115014184Sgabeblack@google.com      out_msg.Hit := false;
115114184Sgabeblack@google.com      out_msg.Ntsl := true;
115214184Sgabeblack@google.com      out_msg.State := CoherenceState:NA;
115314184Sgabeblack@google.com      out_msg.MessageSize := MessageSizeType:Response_Control;
115414184Sgabeblack@google.com    }
115514184Sgabeblack@google.com  }
115614184Sgabeblack@google.com
115714184Sgabeblack@google.com  action(pim_sendProbeResponseInvMs, "pim", desc="send probe ack inv, no data") {
115814184Sgabeblack@google.com    enqueue(responseNetwork_out, ResponseMsg, issue_latency) {
115914184Sgabeblack@google.com      out_msg.addr := address;
116014184Sgabeblack@google.com      out_msg.Type := CoherenceResponseType:CPUPrbResp;  // L3 and CPUs respond in same way to probes
116114184Sgabeblack@google.com      out_msg.Sender := machineID;
116214184Sgabeblack@google.com      // will this always be ok? probably not for multisocket
116314184Sgabeblack@google.com      out_msg.Destination.add(mapAddressToMachine(address, MachineType:Directory));
116414184Sgabeblack@google.com      out_msg.Dirty := false;
116514184Sgabeblack@google.com      out_msg.Ntsl := true;
116614184Sgabeblack@google.com      out_msg.Hit := false;
116714184Sgabeblack@google.com      out_msg.State := CoherenceState:NA;
116814184Sgabeblack@google.com      out_msg.MessageSize := MessageSizeType:Response_Control;
116914184Sgabeblack@google.com    }
117014184Sgabeblack@google.com  }
117114184Sgabeblack@google.com
117214184Sgabeblack@google.com  action(ph_sendProbeResponseHit, "ph", desc="send probe ack PrbShrData, no data") {
117314184Sgabeblack@google.com    enqueue(responseNetwork_out, ResponseMsg, issue_latency) {
117414184Sgabeblack@google.com      out_msg.addr := address;
117514184Sgabeblack@google.com      out_msg.Type := CoherenceResponseType:CPUPrbResp;  // L3 and CPUs respond in same way to probes
117614184Sgabeblack@google.com      out_msg.Sender := machineID;
117714184Sgabeblack@google.com      // will this always be ok? probably not for multisocket
117814184Sgabeblack@google.com      out_msg.Destination.add(mapAddressToMachine(address, MachineType:Directory));
117914184Sgabeblack@google.com      assert(addressInCore(address) || is_valid(tbe));
118014184Sgabeblack@google.com      out_msg.Dirty := false;  // only true if sending back data i think
118114184Sgabeblack@google.com      out_msg.Hit := true;
118214184Sgabeblack@google.com      out_msg.Ntsl := false;
118314184Sgabeblack@google.com      out_msg.State := CoherenceState:NA;
118414184Sgabeblack@google.com      out_msg.MessageSize := MessageSizeType:Response_Control;
118514184Sgabeblack@google.com    }
118614184Sgabeblack@google.com  }
118714184Sgabeblack@google.com
118814184Sgabeblack@google.com  action(pb_sendProbeResponseBackprobe, "pb", desc="send probe ack PrbShrData, no data, check for L1 residence") {
118914184Sgabeblack@google.com    enqueue(responseNetwork_out, ResponseMsg, issue_latency) {
119014184Sgabeblack@google.com      out_msg.addr := address;
119114184Sgabeblack@google.com      out_msg.Type := CoherenceResponseType:CPUPrbResp;  // L3 and CPUs respond in same way to probes
119214184Sgabeblack@google.com      out_msg.Sender := machineID;
119314184Sgabeblack@google.com      // will this always be ok? probably not for multisocket
119414184Sgabeblack@google.com      out_msg.Destination.add(mapAddressToMachine(address, MachineType:Directory));
119514184Sgabeblack@google.com      if (addressInCore(address)) {
119614184Sgabeblack@google.com        out_msg.Hit := true;
119714184Sgabeblack@google.com      } else {
119814184Sgabeblack@google.com        out_msg.Hit := false;
119914184Sgabeblack@google.com      }
120014184Sgabeblack@google.com      out_msg.Dirty := false;  // not sending back data, so def. not dirty
120114184Sgabeblack@google.com      out_msg.Ntsl := false;
120214184Sgabeblack@google.com      out_msg.State := CoherenceState:NA;
120314184Sgabeblack@google.com      out_msg.MessageSize := MessageSizeType:Response_Control;
120414184Sgabeblack@google.com    }
120514184Sgabeblack@google.com  }
120614184Sgabeblack@google.com
120714184Sgabeblack@google.com  action(pd_sendProbeResponseData, "pd", desc="send probe ack, with data") {
120814184Sgabeblack@google.com    enqueue(responseNetwork_out, ResponseMsg, issue_latency) {
120914184Sgabeblack@google.com      assert(is_valid(cache_entry));
121014184Sgabeblack@google.com      out_msg.addr := address;
121114184Sgabeblack@google.com      out_msg.Type := CoherenceResponseType:CPUPrbResp;
121214184Sgabeblack@google.com      out_msg.Sender := machineID;
121314184Sgabeblack@google.com      // will this always be ok? probably not for multisocket
121414184Sgabeblack@google.com      out_msg.Destination.add(mapAddressToMachine(address, MachineType:Directory));
121514184Sgabeblack@google.com      out_msg.DataBlk := cache_entry.DataBlk;
121614184Sgabeblack@google.com      assert(cache_entry.Dirty);
121714184Sgabeblack@google.com      out_msg.Dirty := true;
121814184Sgabeblack@google.com      out_msg.Hit := true;
121914184Sgabeblack@google.com      out_msg.State := CoherenceState:NA;
122014184Sgabeblack@google.com      out_msg.MessageSize := MessageSizeType:Response_Data;
122114184Sgabeblack@google.com    }
122214184Sgabeblack@google.com  }
122314184Sgabeblack@google.com
122414184Sgabeblack@google.com  action(pdm_sendProbeResponseDataMs, "pdm", desc="send probe ack, with data") {
122514184Sgabeblack@google.com    enqueue(responseNetwork_out, ResponseMsg, issue_latency) {
122614184Sgabeblack@google.com      assert(is_valid(cache_entry));
122714184Sgabeblack@google.com      out_msg.addr := address;
122814184Sgabeblack@google.com      out_msg.Type := CoherenceResponseType:CPUPrbResp;
122914184Sgabeblack@google.com      out_msg.Sender := machineID;
123014184Sgabeblack@google.com      // will this always be ok? probably not for multisocket
123114184Sgabeblack@google.com      out_msg.Destination.add(mapAddressToMachine(address, MachineType:Directory));
123214184Sgabeblack@google.com      out_msg.DataBlk := cache_entry.DataBlk;
123314184Sgabeblack@google.com      assert(cache_entry.Dirty);
123414184Sgabeblack@google.com      out_msg.Dirty := true;
123514184Sgabeblack@google.com      out_msg.Hit := true;
123614184Sgabeblack@google.com      out_msg.State := CoherenceState:NA;
123714184Sgabeblack@google.com      out_msg.MessageSize := MessageSizeType:Response_Data;
123814184Sgabeblack@google.com    }
123914184Sgabeblack@google.com  }
124014184Sgabeblack@google.com
124114184Sgabeblack@google.com  action(pdt_sendProbeResponseDataFromTBE, "pdt", desc="send probe ack with data") {
124214184Sgabeblack@google.com    enqueue(responseNetwork_out, ResponseMsg, issue_latency) {
124314184Sgabeblack@google.com      assert(is_valid(tbe));
124414184Sgabeblack@google.com      out_msg.addr := address;
124514184Sgabeblack@google.com      out_msg.Type := CoherenceResponseType:CPUPrbResp;
124614184Sgabeblack@google.com      out_msg.Sender := machineID;
124714184Sgabeblack@google.com      out_msg.Destination.add(mapAddressToMachine(address, MachineType:Directory));
124814184Sgabeblack@google.com      out_msg.DataBlk := tbe.DataBlk;
124914184Sgabeblack@google.com      assert(tbe.Dirty);
125014184Sgabeblack@google.com      out_msg.Dirty := true;
125114184Sgabeblack@google.com      out_msg.Hit := true;
125214184Sgabeblack@google.com      out_msg.State := CoherenceState:NA;
125314184Sgabeblack@google.com      out_msg.MessageSize := MessageSizeType:Response_Data;
125414184Sgabeblack@google.com    }
125514184Sgabeblack@google.com  }
125614184Sgabeblack@google.com
125714184Sgabeblack@google.com  action(s_setSharedFlip, "s", desc="hit by shared probe, status may be different") {
125814184Sgabeblack@google.com    assert(is_valid(tbe));
125914184Sgabeblack@google.com    tbe.Shared := true;
126014184Sgabeblack@google.com  }
126114184Sgabeblack@google.com
126214184Sgabeblack@google.com  action(uu_sendUnblock, "uu", desc="state changed, unblock") {
126314184Sgabeblack@google.com    enqueue(unblockNetwork_out, UnblockMsg, issue_latency) {
126414184Sgabeblack@google.com      out_msg.addr := address;
126514184Sgabeblack@google.com      out_msg.Destination.add(mapAddressToMachine(address, MachineType:Directory));
126614184Sgabeblack@google.com      out_msg.MessageSize := MessageSizeType:Unblock_Control;
126714184Sgabeblack@google.com      DPRINTF(RubySlicc, "%s\n", out_msg);
126814184Sgabeblack@google.com    }
126914184Sgabeblack@google.com  }
127014184Sgabeblack@google.com
127114184Sgabeblack@google.com  action(l2m_profileMiss, "l2m", desc="l2m miss profile") {
127214184Sgabeblack@google.com    ++L2cache.demand_misses;
127314184Sgabeblack@google.com  }
127414184Sgabeblack@google.com
127514184Sgabeblack@google.com  action(l10m_profileMiss, "l10m", desc="l10m miss profile") {
127614184Sgabeblack@google.com    ++L1D0cache.demand_misses;
127714184Sgabeblack@google.com  }
127814184Sgabeblack@google.com
127914184Sgabeblack@google.com  action(l11m_profileMiss, "l11m", desc="l11m miss profile") {
128014184Sgabeblack@google.com    ++L1D1cache.demand_misses;
128114184Sgabeblack@google.com  }
128214184Sgabeblack@google.com
128314184Sgabeblack@google.com  action(l1im_profileMiss, "l1lm", desc="l1im miss profile") {
128414184Sgabeblack@google.com    ++L1Icache.demand_misses;
128514184Sgabeblack@google.com  }
128614184Sgabeblack@google.com
128714184Sgabeblack@google.com  action(yy_recycleProbeQueue, "yy", desc="recycle probe queue") {
128814184Sgabeblack@google.com    probeNetwork_in.recycle(clockEdge(), cyclesToTicks(recycle_latency));
128914184Sgabeblack@google.com  }
129014184Sgabeblack@google.com
129114184Sgabeblack@google.com  action(xx_recycleResponseQueue, "xx", desc="recycle response queue") {
129214184Sgabeblack@google.com    responseToCore_in.recycle(clockEdge(), cyclesToTicks(recycle_latency));
129314184Sgabeblack@google.com  }
129414184Sgabeblack@google.com
129514184Sgabeblack@google.com  action(zz_recycleMandatoryQueue, "\z", desc="recycle mandatory queue") {
129614184Sgabeblack@google.com    mandatoryQueue_in.recycle(clockEdge(), cyclesToTicks(recycle_latency));
129714184Sgabeblack@google.com  }
129814184Sgabeblack@google.com
129914184Sgabeblack@google.com  // END ACTIONS
130014184Sgabeblack@google.com
130114184Sgabeblack@google.com  // BEGIN TRANSITIONS
130214184Sgabeblack@google.com
130314184Sgabeblack@google.com  // transitions from base
130414184Sgabeblack@google.com  transition(I, C0_Load_L1miss, I_E0S) {L1D0TagArrayRead, L2TagArrayRead} {
130514184Sgabeblack@google.com    // track misses, if implemented
130614184Sgabeblack@google.com    // since in I state, L2 miss as well
130714184Sgabeblack@google.com    l2m_profileMiss;
130814184Sgabeblack@google.com    l10m_profileMiss;
130914184Sgabeblack@google.com    a0_allocateL1D;
131014184Sgabeblack@google.com    a2_allocateL2;
131114184Sgabeblack@google.com    i1_invCluster;
131214184Sgabeblack@google.com    ii_invIcache;
131314184Sgabeblack@google.com    n_issueRdBlk;
131414184Sgabeblack@google.com    p_popMandatoryQueue;
131514184Sgabeblack@google.com  }
131614184Sgabeblack@google.com
131714184Sgabeblack@google.com  transition(I, C1_Load_L1miss, I_E1S) {L1D1TagArrayRead, L2TagArrayRead} {
131814184Sgabeblack@google.com    // track misses, if implemented
131914184Sgabeblack@google.com    // since in I state, L2 miss as well
132014184Sgabeblack@google.com    l2m_profileMiss;
132114184Sgabeblack@google.com    l11m_profileMiss;
132214184Sgabeblack@google.com    a1_allocateL1D;
132314184Sgabeblack@google.com    a2_allocateL2;
132414184Sgabeblack@google.com    i0_invCluster;
132514184Sgabeblack@google.com    ii_invIcache;
132614184Sgabeblack@google.com    n_issueRdBlk;
132714184Sgabeblack@google.com    p_popMandatoryQueue;
132814184Sgabeblack@google.com  }
132914184Sgabeblack@google.com
133014184Sgabeblack@google.com  transition(I, Ifetch0_L1miss, S0) {L1ITagArrayRead,L2TagArrayRead} {
133114184Sgabeblack@google.com    // track misses, if implemented
133214184Sgabeblack@google.com    // L2 miss as well
133314184Sgabeblack@google.com    l2m_profileMiss;
133414184Sgabeblack@google.com    l1im_profileMiss;
133514184Sgabeblack@google.com    ai_allocateL1I;
133614184Sgabeblack@google.com    a2_allocateL2;
133714184Sgabeblack@google.com    ib_invBothClusters;
133814184Sgabeblack@google.com    nS_issueRdBlkS;
133914184Sgabeblack@google.com    p_popMandatoryQueue;
134014184Sgabeblack@google.com  }
134114184Sgabeblack@google.com
134214184Sgabeblack@google.com  transition(I, Ifetch1_L1miss, S1) {L1ITagArrayRead, L2TagArrayRead} {
134314184Sgabeblack@google.com    // track misses, if implemented
134414184Sgabeblack@google.com    // L2 miss as well
134514184Sgabeblack@google.com    l2m_profileMiss;
134614184Sgabeblack@google.com    l1im_profileMiss;
134714184Sgabeblack@google.com    ai_allocateL1I;
134814184Sgabeblack@google.com    a2_allocateL2;
134914184Sgabeblack@google.com    ib_invBothClusters;
135014184Sgabeblack@google.com    nS_issueRdBlkS;
135114184Sgabeblack@google.com    p_popMandatoryQueue;
135214184Sgabeblack@google.com  }
135314184Sgabeblack@google.com
135414184Sgabeblack@google.com  transition(I, C0_Store_L1miss, I_M0) {L1D0TagArrayRead, L2TagArrayRead} {
135514184Sgabeblack@google.com    l2m_profileMiss;
135614184Sgabeblack@google.com    l10m_profileMiss;
135714184Sgabeblack@google.com    a0_allocateL1D;
135814184Sgabeblack@google.com    a2_allocateL2;
135914184Sgabeblack@google.com    i1_invCluster;
136014184Sgabeblack@google.com    ii_invIcache;
136114184Sgabeblack@google.com    nM_issueRdBlkM;
136214184Sgabeblack@google.com    p_popMandatoryQueue;
136314184Sgabeblack@google.com  }
136414184Sgabeblack@google.com
136514184Sgabeblack@google.com  transition(I, C1_Store_L1miss, I_M1) {L1D0TagArrayRead, L2TagArrayRead} {
136614184Sgabeblack@google.com    l2m_profileMiss;
136714184Sgabeblack@google.com    l11m_profileMiss;
136814184Sgabeblack@google.com    a1_allocateL1D;
136914184Sgabeblack@google.com    a2_allocateL2;
137014184Sgabeblack@google.com    i0_invCluster;
137114184Sgabeblack@google.com    ii_invIcache;
137214184Sgabeblack@google.com    nM_issueRdBlkM;
137314184Sgabeblack@google.com    p_popMandatoryQueue;
137414184Sgabeblack@google.com  }
137514184Sgabeblack@google.com
137614184Sgabeblack@google.com  transition(S, C0_Load_L1miss, S_F0) {L1D0TagArrayRead, L2TagArrayRead, L2DataArrayRead} {
137714184Sgabeblack@google.com    l10m_profileMiss;
137814184Sgabeblack@google.com    a0_allocateL1D;
137914184Sgabeblack@google.com    f0_L2ToL1;
138014184Sgabeblack@google.com    mru_setMRU;
138114184Sgabeblack@google.com    p_popMandatoryQueue;
138214184Sgabeblack@google.com  }
138314184Sgabeblack@google.com
138414184Sgabeblack@google.com  transition(S, C1_Load_L1miss, S_F1) {L1D1TagArrayRead,L2TagArrayRead, L2DataArrayRead} {
138514184Sgabeblack@google.com    l11m_profileMiss;
138614184Sgabeblack@google.com    a1_allocateL1D;
138714184Sgabeblack@google.com    f1_L2ToL1;
138814184Sgabeblack@google.com    mru_setMRU;
138914184Sgabeblack@google.com    p_popMandatoryQueue;
139014184Sgabeblack@google.com  }
139114184Sgabeblack@google.com
139214184Sgabeblack@google.com  transition(S, Ifetch0_L1miss, Si_F0) {L1ITagArrayRead, L2TagArrayRead, L2DataArrayRead} {
139314184Sgabeblack@google.com    l1im_profileMiss;
139414184Sgabeblack@google.com    ai_allocateL1I;
139514184Sgabeblack@google.com    fi_L2ToL1;
139614184Sgabeblack@google.com    mru_setMRU;
139714184Sgabeblack@google.com    p_popMandatoryQueue;
139814184Sgabeblack@google.com  }
139914184Sgabeblack@google.com
140014184Sgabeblack@google.com  transition(S, Ifetch1_L1miss, Si_F1) {L1ITagArrayRead,L2TagArrayRead, L2DataArrayRead} {
140114184Sgabeblack@google.com    l1im_profileMiss;
140214184Sgabeblack@google.com    ai_allocateL1I;
140314184Sgabeblack@google.com    fi_L2ToL1;
140414184Sgabeblack@google.com    mru_setMRU;
140514184Sgabeblack@google.com    p_popMandatoryQueue;
140614184Sgabeblack@google.com  }
140714184Sgabeblack@google.com
140814184Sgabeblack@google.com  transition({S}, {C0_Store_L1hit, C0_Store_L1miss}, S_M0) {L1D0TagArrayRead, L2TagArrayRead} {
140914184Sgabeblack@google.com    l2m_profileMiss;
141014184Sgabeblack@google.com    l10m_profileMiss;
141114184Sgabeblack@google.com    a0_allocateL1D;
141214184Sgabeblack@google.com    mruD0_setD0cacheMRU;
141314184Sgabeblack@google.com    i1_invCluster;
141414184Sgabeblack@google.com    ii_invIcache;
141514184Sgabeblack@google.com    nM_issueRdBlkM;
141614184Sgabeblack@google.com    p_popMandatoryQueue;
141714184Sgabeblack@google.com  }
141814184Sgabeblack@google.com
141914184Sgabeblack@google.com  transition({S}, {C1_Store_L1hit, C1_Store_L1miss}, S_M1) {L1D1TagArrayRead, L2TagArrayRead} {
142014184Sgabeblack@google.com    l2m_profileMiss;
142114184Sgabeblack@google.com    l11m_profileMiss;
142214184Sgabeblack@google.com    a1_allocateL1D;
142314184Sgabeblack@google.com    mruD1_setD1cacheMRU;
142414184Sgabeblack@google.com    i0_invCluster;
142514184Sgabeblack@google.com    ii_invIcache;
142614184Sgabeblack@google.com    nM_issueRdBlkM;
142714184Sgabeblack@google.com    p_popMandatoryQueue;
142814184Sgabeblack@google.com  }
142914184Sgabeblack@google.com
143014184Sgabeblack@google.com  transition(Es, C0_Load_L1miss, Es_F0) {L1D0TagArrayRead, L2TagArrayRead, L2DataArrayRead} {  // can this be folded with S_F?
143114184Sgabeblack@google.com    a0_allocateL1D;
143214184Sgabeblack@google.com    l10m_profileMiss;
143314184Sgabeblack@google.com    f0_L2ToL1;
143414184Sgabeblack@google.com    mru_setMRU;
143514184Sgabeblack@google.com    p_popMandatoryQueue;
143614184Sgabeblack@google.com  }
143714184Sgabeblack@google.com
143814184Sgabeblack@google.com  transition(Es, C1_Load_L1miss, Es_F1) {L1D1TagArrayRead, L2TagArrayRead, L2DataArrayRead} {  // can this be folded with S_F?
143914184Sgabeblack@google.com    l11m_profileMiss;
144014184Sgabeblack@google.com    a1_allocateL1D;
144114184Sgabeblack@google.com    f1_L2ToL1;
144214184Sgabeblack@google.com    mru_setMRU;
144314184Sgabeblack@google.com    p_popMandatoryQueue;
144414184Sgabeblack@google.com  }
144514184Sgabeblack@google.com
144614184Sgabeblack@google.com  transition(Es, Ifetch0_L1miss, S0) {L1ITagArrayRead, L1ITagArrayWrite, L2TagArrayRead, L2TagArrayWrite} {
144714184Sgabeblack@google.com    l1im_profileMiss;
144814184Sgabeblack@google.com    i2_invL2;
144914184Sgabeblack@google.com    ai_allocateL1I;
145014184Sgabeblack@google.com    a2_allocateL2;
145114184Sgabeblack@google.com    ib_invBothClusters;
145214184Sgabeblack@google.com    nS_issueRdBlkS;
145314184Sgabeblack@google.com    p_popMandatoryQueue;
145414184Sgabeblack@google.com  }
145514184Sgabeblack@google.com
145614184Sgabeblack@google.com  transition(Es, Ifetch1_L1miss, S1) {L1ITagArrayRead, L2TagArrayRead} {
145714184Sgabeblack@google.com    l1im_profileMiss;
145814184Sgabeblack@google.com    i2_invL2;
145914184Sgabeblack@google.com    ai_allocateL1I;
146014184Sgabeblack@google.com    a2_allocateL2;
146114184Sgabeblack@google.com    ib_invBothClusters;
146214184Sgabeblack@google.com    nS_issueRdBlkS;
146314184Sgabeblack@google.com    p_popMandatoryQueue;
146414184Sgabeblack@google.com  }
146514184Sgabeblack@google.com
146614184Sgabeblack@google.com  // THES SHOULD NOT BE INSTANTANEOUS BUT OH WELL FOR NOW
146714184Sgabeblack@google.com  transition(Es, {C0_Store_L1hit, C0_Store_L1miss}, M0) {L1D0TagArrayRead, L1D0TagArrayWrite, L1D0DataArrayWrite, L2TagArrayRead, L2TagArrayWrite, L2DataArrayWrite} {
146814184Sgabeblack@google.com    a0_allocateL1D;
146914184Sgabeblack@google.com    i1_invCluster;
147014184Sgabeblack@google.com    s0_storeDone;   // instantaneous L1/L2 dirty - no writethrough delay
147114184Sgabeblack@google.com    mruD0_setD0cacheMRU;
147214184Sgabeblack@google.com    mru_setMRU;
147314184Sgabeblack@google.com    p_popMandatoryQueue;
147414184Sgabeblack@google.com  }
147514184Sgabeblack@google.com
147614184Sgabeblack@google.com  transition(Es, {C1_Store_L1hit, C1_Store_L1miss}, M1) {L1D1TagArrayRead, L1D1TagArrayWrite, L1D1DataArrayWrite, L2TagArrayRead, L2TagArrayWrite, L2DataArrayWrite} {
147714184Sgabeblack@google.com    a1_allocateL1D;
147814184Sgabeblack@google.com    i0_invCluster;
147914184Sgabeblack@google.com    s1_storeDone;
148014184Sgabeblack@google.com    mruD1_setD1cacheMRU;
148114184Sgabeblack@google.com    mru_setMRU;
148214184Sgabeblack@google.com    p_popMandatoryQueue;
148314184Sgabeblack@google.com  }
148414184Sgabeblack@google.com
148514184Sgabeblack@google.com  transition(E0, C0_Load_L1miss, E0_F) {L1D0TagArrayRead,L2TagArrayRead, L2DataArrayRead} {
148614184Sgabeblack@google.com    l10m_profileMiss;
148714184Sgabeblack@google.com    a0_allocateL1D;
148814184Sgabeblack@google.com    f0_L2ToL1;
148914184Sgabeblack@google.com    mru_setMRU;
149014184Sgabeblack@google.com    p_popMandatoryQueue;
149114184Sgabeblack@google.com  }
149214184Sgabeblack@google.com
149314184Sgabeblack@google.com  transition(E0, C1_Load_L1miss, E0_Es) {L1D1TagArrayRead,  L2TagArrayRead, L2DataArrayRead} {
149414184Sgabeblack@google.com    l11m_profileMiss;
149514184Sgabeblack@google.com    a1_allocateL1D;
149614184Sgabeblack@google.com    f1_L2ToL1;
149714184Sgabeblack@google.com    mru_setMRU;
149814184Sgabeblack@google.com    p_popMandatoryQueue;
149914184Sgabeblack@google.com  }
150014184Sgabeblack@google.com
150114184Sgabeblack@google.com  transition(E0, Ifetch0_L1miss, S0) {L2TagArrayRead, L1ITagArrayRead} {
150214184Sgabeblack@google.com    l2m_profileMiss; // permissions miss, still issue RdBlkS
150314184Sgabeblack@google.com    l1im_profileMiss;
150414184Sgabeblack@google.com    i2_invL2;
150514184Sgabeblack@google.com    ai_allocateL1I;
150614184Sgabeblack@google.com    a2_allocateL2;
150714184Sgabeblack@google.com    i0_invCluster;
150814184Sgabeblack@google.com    nS_issueRdBlkS;
150914184Sgabeblack@google.com    p_popMandatoryQueue;
151014184Sgabeblack@google.com  }
151114184Sgabeblack@google.com
151214184Sgabeblack@google.com  transition(E0, Ifetch1_L1miss, S1) {L2TagArrayRead, L1ITagArrayRead} {
151314184Sgabeblack@google.com    l2m_profileMiss; // permissions miss, still issue RdBlkS
151414184Sgabeblack@google.com    l1im_profileMiss;
151514184Sgabeblack@google.com    i2_invL2;
151614184Sgabeblack@google.com    ai_allocateL1I;
151714184Sgabeblack@google.com    a2_allocateL2;
151814184Sgabeblack@google.com    i0_invCluster;
151914184Sgabeblack@google.com    nS_issueRdBlkS;
152014184Sgabeblack@google.com    p_popMandatoryQueue;
152114184Sgabeblack@google.com  }
152214184Sgabeblack@google.com
152314184Sgabeblack@google.com  transition(E0, {C0_Store_L1hit, C0_Store_L1miss}, M0) {L1D0TagArrayRead, L1D0DataArrayWrite, L1D0TagArrayWrite, L2TagArrayRead, L2DataArrayWrite, L2TagArrayWrite} {
152414184Sgabeblack@google.com    a0_allocateL1D;
152514184Sgabeblack@google.com    s0_storeDone;
152614184Sgabeblack@google.com    mruD0_setD0cacheMRU;
152714184Sgabeblack@google.com    mru_setMRU;
152814184Sgabeblack@google.com    p_popMandatoryQueue;
152914184Sgabeblack@google.com  }
153014184Sgabeblack@google.com
153114184Sgabeblack@google.com  transition(E0, C1_Store_L1miss, M1) {L1D1TagArrayRead, L1D1TagArrayWrite, L1D1TagArrayWrite, L2TagArrayRead, L2TagArrayWrite, L2DataArrayWrite} {
153214184Sgabeblack@google.com    l11m_profileMiss;
153314184Sgabeblack@google.com    a1_allocateL1D;
153414184Sgabeblack@google.com    i0_invCluster;
153514184Sgabeblack@google.com    s1_storeDone;
153614184Sgabeblack@google.com    mru_setMRU;
153714184Sgabeblack@google.com    p_popMandatoryQueue;
153814184Sgabeblack@google.com  }
153914184Sgabeblack@google.com
154014184Sgabeblack@google.com  transition(E1, C1_Load_L1miss, E1_F) {L1D1TagArrayRead, L2TagArrayRead, L2DataArrayRead} {
154114184Sgabeblack@google.com     l11m_profileMiss;
154214184Sgabeblack@google.com    a1_allocateL1D;
154314184Sgabeblack@google.com    f1_L2ToL1;
154414184Sgabeblack@google.com    mru_setMRU;
154514184Sgabeblack@google.com    p_popMandatoryQueue;
154614184Sgabeblack@google.com  }
154714184Sgabeblack@google.com
154814184Sgabeblack@google.com  transition(E1, C0_Load_L1miss, E1_Es) {L1D0TagArrayRead,  L2TagArrayRead, L2DataArrayRead} {
154914184Sgabeblack@google.com    l11m_profileMiss;
155014184Sgabeblack@google.com    a0_allocateL1D;
155114184Sgabeblack@google.com    f0_L2ToL1;
155214184Sgabeblack@google.com    mru_setMRU;
155314184Sgabeblack@google.com    p_popMandatoryQueue;
155414184Sgabeblack@google.com  }
155514184Sgabeblack@google.com
155614184Sgabeblack@google.com  transition(E1, Ifetch1_L1miss, S1) {L2TagArrayRead,  L1ITagArrayRead} {
155714184Sgabeblack@google.com    l2m_profileMiss; // permissions miss, still issue RdBlkS
155814184Sgabeblack@google.com    l1im_profileMiss;
155914184Sgabeblack@google.com    i2_invL2;
156014184Sgabeblack@google.com    ai_allocateL1I;
156114184Sgabeblack@google.com    a2_allocateL2;
156214184Sgabeblack@google.com    i1_invCluster;
156314184Sgabeblack@google.com    nS_issueRdBlkS;
156414184Sgabeblack@google.com    p_popMandatoryQueue;
156514184Sgabeblack@google.com  }
156614184Sgabeblack@google.com
156714184Sgabeblack@google.com  transition(E1, Ifetch0_L1miss, S0) {L2TagArrayRead, L1ITagArrayRead} {
156814184Sgabeblack@google.com    l2m_profileMiss; // permissions miss, still issue RdBlkS
156914184Sgabeblack@google.com    l1im_profileMiss;
157014184Sgabeblack@google.com    i2_invL2;
157114184Sgabeblack@google.com    ai_allocateL1I;
157214184Sgabeblack@google.com    a2_allocateL2;
157314184Sgabeblack@google.com    i1_invCluster;
157414184Sgabeblack@google.com    nS_issueRdBlkS;
157514184Sgabeblack@google.com    p_popMandatoryQueue;
157614184Sgabeblack@google.com  }
157714184Sgabeblack@google.com
157814184Sgabeblack@google.com  transition(E1, {C1_Store_L1hit, C1_Store_L1miss}, M1) {L1D1TagArrayRead, L2TagArrayRead, L2DataArrayWrite, L1D1TagArrayWrite, L2TagArrayWrite} {
157914184Sgabeblack@google.com    a1_allocateL1D;
158014184Sgabeblack@google.com    s1_storeDone;
158114184Sgabeblack@google.com    mruD1_setD1cacheMRU;
158214184Sgabeblack@google.com    mru_setMRU;
158314184Sgabeblack@google.com    p_popMandatoryQueue;
158414184Sgabeblack@google.com  }
158514184Sgabeblack@google.com
158614184Sgabeblack@google.com  transition(E1, C0_Store_L1miss, M0) {L1D0TagArrayRead, L2TagArrayRead, L2TagArrayWrite, L1D0TagArrayWrite, L1D0DataArrayWrite, L2DataArrayWrite} {
158714184Sgabeblack@google.com     l10m_profileMiss;
158814184Sgabeblack@google.com    a0_allocateL1D;
158914184Sgabeblack@google.com    i1_invCluster;
159014184Sgabeblack@google.com    s0_storeDone;
159114184Sgabeblack@google.com    mru_setMRU;
159214184Sgabeblack@google.com    p_popMandatoryQueue;
159314184Sgabeblack@google.com  }
159414184Sgabeblack@google.com
159514184Sgabeblack@google.com  transition({O}, {C0_Store_L1hit, C0_Store_L1miss}, O_M0) {L1D0TagArrayRead,L2TagArrayRead} {
159614184Sgabeblack@google.com    l2m_profileMiss; // permissions miss, still issue CtoD
159714184Sgabeblack@google.com    l10m_profileMiss;
159814184Sgabeblack@google.com    a0_allocateL1D;
159914184Sgabeblack@google.com    mruD0_setD0cacheMRU;
160014184Sgabeblack@google.com    i1_invCluster;
160114184Sgabeblack@google.com    ii_invIcache;
160214184Sgabeblack@google.com    nM_issueRdBlkM;
160314184Sgabeblack@google.com    p_popMandatoryQueue;
160414184Sgabeblack@google.com  }
160514184Sgabeblack@google.com
160614184Sgabeblack@google.com  transition({O}, {C1_Store_L1hit, C1_Store_L1miss}, O_M1) {L1D1TagArrayRead, L2TagArrayRead} {
160714184Sgabeblack@google.com    l2m_profileMiss; // permissions miss, still issue RdBlkS
160814184Sgabeblack@google.com     l11m_profileMiss;
160914184Sgabeblack@google.com    a1_allocateL1D;
161014184Sgabeblack@google.com    mruD1_setD1cacheMRU;
161114184Sgabeblack@google.com    i0_invCluster;
161214184Sgabeblack@google.com    ii_invIcache;
161314184Sgabeblack@google.com    nM_issueRdBlkM;
161414184Sgabeblack@google.com    p_popMandatoryQueue;
161514184Sgabeblack@google.com  }
161614184Sgabeblack@google.com
161714184Sgabeblack@google.com  transition(O, C0_Load_L1miss, O_F0) {L2TagArrayRead, L2DataArrayRead, L1D0TagArrayRead} {
161814184Sgabeblack@google.com    l10m_profileMiss;
161914184Sgabeblack@google.com    a0_allocateL1D;
162014184Sgabeblack@google.com    f0_L2ToL1;
162114184Sgabeblack@google.com    mru_setMRU;
162214184Sgabeblack@google.com    p_popMandatoryQueue;
162314184Sgabeblack@google.com  }
162414184Sgabeblack@google.com
162514184Sgabeblack@google.com  transition(O, C1_Load_L1miss, O_F1) {L2TagArrayRead, L2DataArrayRead, L1D1TagArrayRead} {
162614184Sgabeblack@google.com     l11m_profileMiss;
162714184Sgabeblack@google.com    a1_allocateL1D;
162814184Sgabeblack@google.com    f1_L2ToL1;
162914184Sgabeblack@google.com    mru_setMRU;
163014184Sgabeblack@google.com    p_popMandatoryQueue;
163114184Sgabeblack@google.com  }
163214184Sgabeblack@google.com
163314184Sgabeblack@google.com  transition(Ms, C0_Load_L1miss, Ms_F0) {L2TagArrayRead, L2DataArrayRead, L1D0TagArrayRead} {
163414184Sgabeblack@google.com    l10m_profileMiss;
163514184Sgabeblack@google.com    a0_allocateL1D;
163614184Sgabeblack@google.com    f0_L2ToL1;
163714184Sgabeblack@google.com    mru_setMRU;
163814184Sgabeblack@google.com    p_popMandatoryQueue;
163914184Sgabeblack@google.com  }
164014184Sgabeblack@google.com
164114184Sgabeblack@google.com  transition(Ms, C1_Load_L1miss, Ms_F1) {L2TagArrayRead, L2DataArrayRead, L1D1TagArrayRead} {
164214184Sgabeblack@google.com    l11m_profileMiss;
164314184Sgabeblack@google.com    a1_allocateL1D;
164414184Sgabeblack@google.com    f1_L2ToL1;
164514184Sgabeblack@google.com    mru_setMRU;
164614184Sgabeblack@google.com    p_popMandatoryQueue;
164714184Sgabeblack@google.com  }
164814184Sgabeblack@google.com
164914184Sgabeblack@google.com  transition({Ms, M0, M1, O}, Ifetch0_L1miss, MO_S0) {L1ITagArrayRead, L2DataArrayRead, L2TagArrayRead} {
165014184Sgabeblack@google.com    l2m_profileMiss;  // permissions miss
165114184Sgabeblack@google.com    l1im_profileMiss;
165214184Sgabeblack@google.com    ai_allocateL1I;
165314184Sgabeblack@google.com    t_allocateTBE;
165414184Sgabeblack@google.com    ib_invBothClusters;
165514184Sgabeblack@google.com    vd_victim;
165614184Sgabeblack@google.com//    i2_invL2;
165714184Sgabeblack@google.com    p_popMandatoryQueue;
165814184Sgabeblack@google.com  }
165914184Sgabeblack@google.com
166014184Sgabeblack@google.com  transition({Ms, M0, M1, O}, Ifetch1_L1miss, MO_S1) {L1ITagArrayRead, L2TagArrayRead, L2DataArrayRead } {
166114184Sgabeblack@google.com    l2m_profileMiss;  // permissions miss
166214184Sgabeblack@google.com     l1im_profileMiss;
166314184Sgabeblack@google.com    ai_allocateL1I;
166414184Sgabeblack@google.com    t_allocateTBE;
166514184Sgabeblack@google.com    ib_invBothClusters;
166614184Sgabeblack@google.com    vd_victim;
166714184Sgabeblack@google.com//    i2_invL2;
166814184Sgabeblack@google.com    p_popMandatoryQueue;
166914184Sgabeblack@google.com  }
167014184Sgabeblack@google.com
167114184Sgabeblack@google.com  transition(Ms, {C0_Store_L1hit, C0_Store_L1miss}, M0) {L1D0TagArrayRead, L1D0TagArrayWrite, L1D0DataArrayWrite, L2TagArrayRead, L2DataArrayWrite, L2TagArrayWrite} {
167214184Sgabeblack@google.com    a0_allocateL1D;
167314184Sgabeblack@google.com    i1_invCluster;
167414184Sgabeblack@google.com    s0_storeDone;
167514184Sgabeblack@google.com    mruD0_setD0cacheMRU;
167614184Sgabeblack@google.com    mru_setMRU;
167714184Sgabeblack@google.com    p_popMandatoryQueue;
167814184Sgabeblack@google.com  }
167914184Sgabeblack@google.com
168014184Sgabeblack@google.com  transition(Ms, {C1_Store_L1hit, C1_Store_L1miss}, M1) {L1D1TagArrayRead, L1D1TagArrayWrite, L1D1DataArrayWrite, L2TagArrayRead, L2DataArrayWrite, L2TagArrayWrite} {
168114184Sgabeblack@google.com    a1_allocateL1D;
168214184Sgabeblack@google.com    i0_invCluster;
168314184Sgabeblack@google.com    s1_storeDone;
168414184Sgabeblack@google.com    mruD1_setD1cacheMRU;
168514184Sgabeblack@google.com    mru_setMRU;
168614184Sgabeblack@google.com    p_popMandatoryQueue;
168714184Sgabeblack@google.com  }
168814184Sgabeblack@google.com
168914184Sgabeblack@google.com  transition(M0, C0_Load_L1miss, M0_F) {L1D0TagArrayRead, L2TagArrayRead, L2DataArrayRead} {
169014184Sgabeblack@google.com     l10m_profileMiss;
169114184Sgabeblack@google.com    a0_allocateL1D;
169214184Sgabeblack@google.com    f0_L2ToL1;
169314184Sgabeblack@google.com    mru_setMRU;
169414184Sgabeblack@google.com    p_popMandatoryQueue;
169514184Sgabeblack@google.com  }
169614184Sgabeblack@google.com
169714184Sgabeblack@google.com  transition(M0, C1_Load_L1miss, M0_Ms) {L2TagArrayRead, L2DataArrayRead,L1D0TagArrayRead} {
169814184Sgabeblack@google.com    l11m_profileMiss;
169914184Sgabeblack@google.com    a1_allocateL1D;
170014184Sgabeblack@google.com    f1_L2ToL1;
170114184Sgabeblack@google.com    mru_setMRU;
170214184Sgabeblack@google.com    p_popMandatoryQueue;
170314184Sgabeblack@google.com  }
170414184Sgabeblack@google.com
170514184Sgabeblack@google.com  transition(M0, {C0_Store_L1hit, C0_Store_L1miss}) {L1D0TagArrayRead,L1D0DataArrayWrite, L2DataArrayWrite, L2TagArrayRead} {
170614184Sgabeblack@google.com    a0_allocateL1D;
170714184Sgabeblack@google.com    s0_storeDone;
170814184Sgabeblack@google.com    mruD0_setD0cacheMRU;
170914184Sgabeblack@google.com    mru_setMRU;
171014184Sgabeblack@google.com    p_popMandatoryQueue;
171114184Sgabeblack@google.com  }
171214184Sgabeblack@google.com
171314184Sgabeblack@google.com  transition(M0, {C1_Store_L1hit, C1_Store_L1miss}, M1) {L1D1TagArrayRead, L1D1TagArrayWrite, L1D0DataArrayWrite, L2DataArrayWrite, L2TagArrayRead, L2TagArrayWrite} {
171414184Sgabeblack@google.com    a1_allocateL1D;
171514184Sgabeblack@google.com    i0_invCluster;
171614184Sgabeblack@google.com    s1_storeDone;
171714184Sgabeblack@google.com    mruD1_setD1cacheMRU;
171814184Sgabeblack@google.com    mru_setMRU;
171914184Sgabeblack@google.com    p_popMandatoryQueue;
172014184Sgabeblack@google.com  }
172114184Sgabeblack@google.com
172214184Sgabeblack@google.com  transition(M1, C0_Load_L1miss, M1_Ms) {L2TagArrayRead, L2DataArrayRead, L1D0TagArrayRead} {
172314184Sgabeblack@google.com    l10m_profileMiss;
172414184Sgabeblack@google.com    a0_allocateL1D;
172514184Sgabeblack@google.com    f0_L2ToL1;
172614184Sgabeblack@google.com    mru_setMRU;
172714184Sgabeblack@google.com    p_popMandatoryQueue;
172814184Sgabeblack@google.com  }
172914184Sgabeblack@google.com
173014184Sgabeblack@google.com  transition(M1, C1_Load_L1miss, M1_F) {L1D1TagArrayRead,L2TagArrayRead, L2DataArrayRead} {
173114184Sgabeblack@google.com    a1_allocateL1D;
173214184Sgabeblack@google.com    f1_L2ToL1;
173314184Sgabeblack@google.com    mru_setMRU;
173414184Sgabeblack@google.com    p_popMandatoryQueue;
173514184Sgabeblack@google.com  }
173614184Sgabeblack@google.com
173714184Sgabeblack@google.com  transition(M1, {C0_Store_L1hit, C0_Store_L1miss}, M0) {L1D0TagArrayRead, L1D0TagArrayWrite, L1D0DataArrayWrite, L2TagArrayRead, L2DataArrayWrite, L2TagArrayWrite} {
173814184Sgabeblack@google.com    a0_allocateL1D;
173914184Sgabeblack@google.com    i1_invCluster;
174014184Sgabeblack@google.com    s0_storeDone;
174114184Sgabeblack@google.com    mruD0_setD0cacheMRU;
174214184Sgabeblack@google.com    mru_setMRU;
174314184Sgabeblack@google.com    p_popMandatoryQueue;
174414184Sgabeblack@google.com  }
174514184Sgabeblack@google.com
174614184Sgabeblack@google.com  transition(M1, {C1_Store_L1hit, C1_Store_L1miss}) {L1D1TagArrayRead, L2TagArrayRead, L2DataArrayWrite} {
174714184Sgabeblack@google.com    a1_allocateL1D;
174814184Sgabeblack@google.com    s1_storeDone;
174914184Sgabeblack@google.com    mruD1_setD1cacheMRU;
175014184Sgabeblack@google.com    mru_setMRU;
175114184Sgabeblack@google.com    p_popMandatoryQueue;
175214184Sgabeblack@google.com  }
175314184Sgabeblack@google.com
175414184Sgabeblack@google.com  // end transitions from base
175514184Sgabeblack@google.com
175614184Sgabeblack@google.com  // Begin simple hit transitions
175714184Sgabeblack@google.com  transition({S, Es, E0, O, Ms, M0, O_F1, S_F1, Si_F0, Si_F1, Es_F1, E0_Es,
175814184Sgabeblack@google.com          Ms_F1, M0_Ms}, C0_Load_L1hit) {L1D0TagArrayRead, L1D0DataArrayRead} {
175914184Sgabeblack@google.com    // track hits, if implemented
176014184Sgabeblack@google.com    l0_loadDone;
176114184Sgabeblack@google.com    mruD0_setD0cacheMRU;
176214184Sgabeblack@google.com    p_popMandatoryQueue;
176314184Sgabeblack@google.com  }
176414184Sgabeblack@google.com
176514184Sgabeblack@google.com  transition({S, Es, E1, O, Ms, M1, O_F0, S_F0, Si_F0, Si_F1, Es_F0, E1_Es,
176614184Sgabeblack@google.com          Ms_F0, M1_Ms}, C1_Load_L1hit) {L1D1TagArrayRead, L1D1DataArrayRead} {
176714184Sgabeblack@google.com    // track hits, if implemented
176814184Sgabeblack@google.com    l1_loadDone;
176914184Sgabeblack@google.com    mruD1_setD1cacheMRU;
177014184Sgabeblack@google.com    p_popMandatoryQueue;
177114184Sgabeblack@google.com  }
177214184Sgabeblack@google.com
177314184Sgabeblack@google.com  transition({S, S_C, S_F0, S_F1, S_F}, Ifetch0_L1hit) {L1ITagArrayRead, L1IDataArrayRead} {
177414184Sgabeblack@google.com    // track hits, if implemented
177514184Sgabeblack@google.com    il0_loadDone;
177614184Sgabeblack@google.com    mruI_setIcacheMRU;
177714184Sgabeblack@google.com    p_popMandatoryQueue;
177814184Sgabeblack@google.com  }
177914184Sgabeblack@google.com
178014184Sgabeblack@google.com  transition({S, S_C, S_F0, S_F1, S_F}, Ifetch1_L1hit) {L1ITagArrayRead, L1IDataArrayWrite} {
178114184Sgabeblack@google.com    // track hits, if implemented
178214184Sgabeblack@google.com    il1_loadDone;
178314184Sgabeblack@google.com    mruI_setIcacheMRU;
178414184Sgabeblack@google.com    p_popMandatoryQueue;
178514184Sgabeblack@google.com  }
178614184Sgabeblack@google.com
178714184Sgabeblack@google.com  // end simple hit transitions
178814184Sgabeblack@google.com
178914184Sgabeblack@google.com  // Transitions from transient states
179014184Sgabeblack@google.com
179114184Sgabeblack@google.com  // recycles
179214184Sgabeblack@google.com  transition({I_M0, I_M0M1, I_M1M0, I_M0Ms, I_M1Ms, I_E0S, I_ES, IF_E0S, IF_ES,
179314184Sgabeblack@google.com          IF0_ES, IF1_ES, S_F0, S_F, O_F0, O_F, S_M0, O_M0, Es_F0, Es_F, E0_F,
179414184Sgabeblack@google.com          E1_Es, Ms_F0, Ms_F, M0_F, M1_Ms}, C0_Load_L1hit) {} {
179514184Sgabeblack@google.com    zz_recycleMandatoryQueue;
179614184Sgabeblack@google.com  }
179714184Sgabeblack@google.com
179814184Sgabeblack@google.com  transition({IF_E1S, F_S0, F_S1, ES_I, MO_I, MO_S0, MO_S1, Si_F0, Si_F1, S_M1,
179914184Sgabeblack@google.com          O_M1, S0, S1, I_C, S0_C, S1_C, S_C}, C0_Load_L1miss) {} {
180014184Sgabeblack@google.com    zz_recycleMandatoryQueue;
180114184Sgabeblack@google.com  }
180214184Sgabeblack@google.com
180314184Sgabeblack@google.com  transition({I_M1, I_M0M1, I_M1M0, I_M0Ms, I_M1Ms, I_E1S, I_ES, IF_E1S, IF_ES,
180414184Sgabeblack@google.com          IF0_ES, IF1_ES, S_F1, S_F, O_F1, O_F, S_M1, O_M1, Es_F1, Es_F, E1_F,
180514184Sgabeblack@google.com          E0_Es, Ms_F1, Ms_F, M0_Ms, M1_F}, C1_Load_L1hit) {} {
180614184Sgabeblack@google.com    zz_recycleMandatoryQueue;
180714184Sgabeblack@google.com  }
180814184Sgabeblack@google.com
180914184Sgabeblack@google.com  transition({IF_E0S, F_S0, F_S1, ES_I, MO_I, MO_S0, MO_S1, Si_F0, Si_F1, S_M0,
181014184Sgabeblack@google.com          O_M0, S0, S1, I_C, S0_C, S1_C, S_C},  C1_Load_L1miss) {} {
181114184Sgabeblack@google.com    zz_recycleMandatoryQueue;
181214184Sgabeblack@google.com  }
181314184Sgabeblack@google.com
181414184Sgabeblack@google.com  transition({F_S0, F_S1, MO_S0, MO_S1, Si_F0, Si_F1, S0, S1, S0_C, S1_C}, {Ifetch0_L1hit, Ifetch1_L1hit}) {} {
181514184Sgabeblack@google.com    zz_recycleMandatoryQueue;
181614184Sgabeblack@google.com  }
181714184Sgabeblack@google.com
181814184Sgabeblack@google.com  transition({I_M0, I_M1, I_M0M1, I_M1M0, I_M0Ms, I_M1Ms, I_E0S, I_E1S, I_ES,
181914184Sgabeblack@google.com          IF_E0S, IF_E1S, IF_ES, IF0_ES, IF1_ES, ES_I, MO_I, S_F0, S_F1, S_F,
182014184Sgabeblack@google.com          O_F0, O_F1, O_F, S_M0, S_M1, O_M0, O_M1, Es_F0, Es_F1, Es_F, E0_F,
182114184Sgabeblack@google.com          E1_F, E0_Es, E1_Es, Ms_F0, Ms_F1, Ms_F, M0_F, M0_Ms, M1_F, M1_Ms, I_C,
182214184Sgabeblack@google.com          S_C}, {Ifetch0_L1miss, Ifetch1_L1miss}) {} {
182314184Sgabeblack@google.com    zz_recycleMandatoryQueue;
182414184Sgabeblack@google.com  }
182514184Sgabeblack@google.com
182614184Sgabeblack@google.com  transition({I_E1S, IF_E1S, F_S0, F_S1, ES_I, MO_I, MO_S0, MO_S1, S_F1, O_F1,
182714184Sgabeblack@google.com          Si_F0, Si_F1, S_M1, O_M1, S0, S1, Es_F1, E1_F, E0_Es, Ms_F1, M0_Ms,
182814184Sgabeblack@google.com          M1_F, I_C, S0_C, S1_C, S_C}, {C0_Store_L1miss}) {} {
182914184Sgabeblack@google.com    zz_recycleMandatoryQueue;
183014184Sgabeblack@google.com  }
183114184Sgabeblack@google.com
183214184Sgabeblack@google.com  transition({I_E0S, IF_E0S, F_S0, F_S1, ES_I, MO_I, MO_S0, MO_S1 S_F0, O_F0,
183314184Sgabeblack@google.com          Si_F0, Si_F1, S_M0, O_M0, S0, S1, Es_F0, E0_F, E1_Es, Ms_F0, M0_F,
183414184Sgabeblack@google.com          M1_Ms, I_C, S0_C, S1_C, S_C}, {C1_Store_L1miss}) {} {
183514184Sgabeblack@google.com    zz_recycleMandatoryQueue;
183614184Sgabeblack@google.com  }
183714184Sgabeblack@google.com
183814184Sgabeblack@google.com  transition({I_M0, I_M0M1, I_M1M0, I_M0Ms, I_M1Ms, I_E0S, I_ES, IF_E0S, IF_ES,
183914184Sgabeblack@google.com          IF0_ES, IF1_ES, S_F0, S_F1, S_F, O_F0, O_F1, O_F, Si_F0, Si_F1, S_M0, O_M0, Es_F0, Es_F1, Es_F, E0_F, E0_Es, E1_Es, Ms_F0, Ms_F1, Ms_F, M0_F, M0_Ms, M1_Ms}, {C0_Store_L1hit}) {} {
184014184Sgabeblack@google.com    zz_recycleMandatoryQueue;
184114184Sgabeblack@google.com  }
184214184Sgabeblack@google.com
184314184Sgabeblack@google.com  transition({I_M1, I_M0M1, I_M1M0, I_M0Ms, I_M1Ms, I_E1S, I_ES, IF_E1S, IF_ES,
184414184Sgabeblack@google.com          IF0_ES, IF1_ES, S_F0, S_F1, S_F, O_F0, O_F1, O_F, Si_F0, Si_F1, S_M1,
184514184Sgabeblack@google.com          O_M1, Es_F0, Es_F1, Es_F, E1_F, E0_Es, E1_Es, Ms_F0, Ms_F1, Ms_F,
184614184Sgabeblack@google.com          M0_Ms, M1_F, M1_Ms}, {C1_Store_L1hit}) {} {
184714184Sgabeblack@google.com    zz_recycleMandatoryQueue;
184814184Sgabeblack@google.com  }
184914184Sgabeblack@google.com
185014184Sgabeblack@google.com  transition({I_M0, I_M0M1, I_M1M0, I_M0Ms, I_M1Ms, I_E0S, I_ES, IF_E0S, IF_ES,
185114184Sgabeblack@google.com          IF0_ES, IF1_ES, S_F0, S_F, O_F0, O_F, S_M0, O_M0, Es_F0, Es_F, E0_F,
185214184Sgabeblack@google.com          E1_Es, Ms_F0, Ms_F, M0_F, M1_Ms}, L1D0_Repl) {} {
185314184Sgabeblack@google.com    zz_recycleMandatoryQueue;
185414184Sgabeblack@google.com  }
185514184Sgabeblack@google.com
185614184Sgabeblack@google.com  transition({I_M1, I_M0M1, I_M1M0, I_M0Ms, I_M1Ms, I_E1S, I_ES, IF_E1S, IF_ES,
185714184Sgabeblack@google.com          IF0_ES, IF1_ES, S_F1, S_F, O_F1, O_F, S_M1, O_M1, Es_F1, Es_F, E1_F,
185814184Sgabeblack@google.com          E0_Es, Ms_F1, Ms_F, M0_Ms, M1_F}, L1D1_Repl) {} {
185914184Sgabeblack@google.com    zz_recycleMandatoryQueue;
186014184Sgabeblack@google.com  }
186114184Sgabeblack@google.com
186214184Sgabeblack@google.com  transition({F_S0, F_S1, MO_S0, MO_S1, Si_F0, Si_F1, S0, S1, S0_C, S1_C}, L1I_Repl) {} {
186314184Sgabeblack@google.com    zz_recycleMandatoryQueue;
186414184Sgabeblack@google.com  }
186514184Sgabeblack@google.com
186614184Sgabeblack@google.com  transition({S_C, S0_C, S1_C, S0, S1, Si_F0, Si_F1, I_M0, I_M1, I_M0M1, I_M1M0, I_M0Ms, I_M1Ms, I_E0S, I_E1S, I_ES, S_F0, S_F1, S_F, O_F0, O_F1, O_F, S_M0, O_M0, S_M1, O_M1, Es_F0, Es_F1, Es_F, E0_F, E1_F, E0_Es, E1_Es, Ms_F0, Ms_F1, Ms_F, M0_F, M0_Ms, M1_F, M1_Ms, MO_S0, MO_S1, IF_E0S, IF_E1S, IF_ES, IF0_ES, IF1_ES, F_S0, F_S1}, L2_Repl) {} {
186714184Sgabeblack@google.com    zz_recycleMandatoryQueue;
186814184Sgabeblack@google.com  }
186914184Sgabeblack@google.com
187014184Sgabeblack@google.com  transition({IF_E0S, IF_E1S, IF_ES, IF0_ES, IF1_ES, F_S0, F_S1}, {NB_AckS,
187114184Sgabeblack@google.com          PrbInvData, PrbInv, PrbShrData}) {} {
187214184Sgabeblack@google.com    yy_recycleProbeQueue;  // these should be resolved soon, but I didn't want to add more states, though technically they could be solved now, and probes really could be solved but i don't think it's really necessary.
187314184Sgabeblack@google.com  }
187414184Sgabeblack@google.com
187514184Sgabeblack@google.com  transition({IF_E0S, IF_E1S, IF_ES, IF0_ES, IF1_ES}, NB_AckE) {} {
187614184Sgabeblack@google.com    xx_recycleResponseQueue;  // these should be resolved soon, but I didn't want to add more states, though technically they could be solved now, and probes really could be solved but i don't think it's really necessary.
187714184Sgabeblack@google.com  }
187814184Sgabeblack@google.com
187914184Sgabeblack@google.com  transition({E0_Es, E1_F, Es_F1}, C0_Load_L1miss, Es_F) {L2DataArrayRead} {
188014184Sgabeblack@google.com    l10m_profileMiss;
188114184Sgabeblack@google.com    a0_allocateL1D;
188214184Sgabeblack@google.com    f0_L2ToL1;
188314184Sgabeblack@google.com    p_popMandatoryQueue;
188414184Sgabeblack@google.com  }
188514184Sgabeblack@google.com
188614184Sgabeblack@google.com  transition(S_F1, C0_Load_L1miss, S_F) {L2DataArrayRead} {
188714184Sgabeblack@google.com    l10m_profileMiss;
188814184Sgabeblack@google.com    a0_allocateL1D;
188914184Sgabeblack@google.com    f0_L2ToL1;
189014184Sgabeblack@google.com    p_popMandatoryQueue;
189114184Sgabeblack@google.com  }
189214184Sgabeblack@google.com
189314184Sgabeblack@google.com  transition(O_F1, C0_Load_L1miss, O_F) {L2DataArrayRead} {
189414184Sgabeblack@google.com    l10m_profileMiss;
189514184Sgabeblack@google.com    a0_allocateL1D;
189614184Sgabeblack@google.com    f0_L2ToL1;
189714184Sgabeblack@google.com    p_popMandatoryQueue;
189814184Sgabeblack@google.com  }
189914184Sgabeblack@google.com
190014184Sgabeblack@google.com  transition({Ms_F1, M0_Ms, M1_F}, C0_Load_L1miss, Ms_F) {L2DataArrayRead} {
190114184Sgabeblack@google.com    l10m_profileMiss;
190214184Sgabeblack@google.com    a0_allocateL1D;
190314184Sgabeblack@google.com    f0_L2ToL1;
190414184Sgabeblack@google.com    p_popMandatoryQueue;
190514184Sgabeblack@google.com  }
190614184Sgabeblack@google.com
190714184Sgabeblack@google.com  transition(I_M0, C1_Load_L1miss, I_M0Ms) {} {
190814184Sgabeblack@google.com    l2m_profileMiss;
190914184Sgabeblack@google.com    l11m_profileMiss;
191014184Sgabeblack@google.com    a1_allocateL1D;
191114184Sgabeblack@google.com    mru_setMRU;
191214184Sgabeblack@google.com    p_popMandatoryQueue;
191314184Sgabeblack@google.com  }
191414184Sgabeblack@google.com
191514184Sgabeblack@google.com  transition(I_M1, C0_Load_L1miss, I_M1Ms) {} {
191614184Sgabeblack@google.com    l2m_profileMiss;
191714184Sgabeblack@google.com    l10m_profileMiss;
191814184Sgabeblack@google.com    a0_allocateL1D;
191914184Sgabeblack@google.com    mru_setMRU;
192014184Sgabeblack@google.com    p_popMandatoryQueue;
192114184Sgabeblack@google.com  }
192214184Sgabeblack@google.com
192314184Sgabeblack@google.com  transition(I_M0, C1_Store_L1miss, I_M0M1) {} {
192414184Sgabeblack@google.com    l2m_profileMiss;
192514184Sgabeblack@google.com    l11m_profileMiss;
192614184Sgabeblack@google.com    a1_allocateL1D;
192714184Sgabeblack@google.com    mru_setMRU;
192814184Sgabeblack@google.com    p_popMandatoryQueue;
192914184Sgabeblack@google.com  }
193014184Sgabeblack@google.com
193114184Sgabeblack@google.com  transition(I_M1, C0_Store_L1miss, I_M1M0) {} {
193214184Sgabeblack@google.com    l2m_profileMiss;
193314184Sgabeblack@google.com    l10m_profileMiss;
193414184Sgabeblack@google.com    a0_allocateL1D;
193514184Sgabeblack@google.com    mru_setMRU;
193614184Sgabeblack@google.com    p_popMandatoryQueue;
193714184Sgabeblack@google.com  }
193814184Sgabeblack@google.com
193914184Sgabeblack@google.com  transition(I_E0S, C1_Load_L1miss, I_ES) {} {
194014184Sgabeblack@google.com    l2m_profileMiss;
194114184Sgabeblack@google.com    l11m_profileMiss;
194214184Sgabeblack@google.com    a1_allocateL1D;
194314184Sgabeblack@google.com    p_popMandatoryQueue;
194414184Sgabeblack@google.com  }
194514184Sgabeblack@google.com
194614184Sgabeblack@google.com  transition(I_E1S, C0_Load_L1miss, I_ES) {} {
194714184Sgabeblack@google.com    l2m_profileMiss;
194814184Sgabeblack@google.com    l10m_profileMiss;
194914184Sgabeblack@google.com    a0_allocateL1D;
195014184Sgabeblack@google.com    p_popMandatoryQueue;
195114184Sgabeblack@google.com  }
195214184Sgabeblack@google.com
195314184Sgabeblack@google.com  transition({E1_Es, E0_F, Es_F0}, C1_Load_L1miss, Es_F) {L2DataArrayRead} {
195414184Sgabeblack@google.com    l11m_profileMiss;
195514184Sgabeblack@google.com    a1_allocateL1D;
195614184Sgabeblack@google.com    f1_L2ToL1;
195714184Sgabeblack@google.com    p_popMandatoryQueue;
195814184Sgabeblack@google.com  }
195914184Sgabeblack@google.com
196014184Sgabeblack@google.com  transition(S_F0, C1_Load_L1miss, S_F) {L2DataArrayRead} {
196114184Sgabeblack@google.com    l11m_profileMiss;
196214184Sgabeblack@google.com    a1_allocateL1D;
196314184Sgabeblack@google.com    f1_L2ToL1;
196414184Sgabeblack@google.com    p_popMandatoryQueue;
196514184Sgabeblack@google.com  }
196614184Sgabeblack@google.com
196714184Sgabeblack@google.com  transition(O_F0, C1_Load_L1miss, O_F) {L2DataArrayRead} {
196814184Sgabeblack@google.com    l11m_profileMiss;
196914184Sgabeblack@google.com    a1_allocateL1D;
197014184Sgabeblack@google.com    f1_L2ToL1;
197114184Sgabeblack@google.com    p_popMandatoryQueue;
197214184Sgabeblack@google.com  }
197314184Sgabeblack@google.com
197414184Sgabeblack@google.com  transition({Ms_F0, M1_Ms, M0_F}, C1_Load_L1miss, Ms_F) { L2DataArrayRead} {
197514184Sgabeblack@google.com    l11m_profileMiss;
197614184Sgabeblack@google.com    a1_allocateL1D;
197714184Sgabeblack@google.com    f1_L2ToL1;
197814184Sgabeblack@google.com    p_popMandatoryQueue;
197914184Sgabeblack@google.com  }
198014184Sgabeblack@google.com
198114184Sgabeblack@google.com  transition({S, Es, E0, O, Ms, M0, O_F1, S_F1, Si_F0, Si_F1, Es_F1, E0_Es, Ms_F1, M0_Ms}, L1D0_Repl) {L1D0TagArrayRead} {
198214184Sgabeblack@google.com    i0_invCluster;
198314184Sgabeblack@google.com  }
198414184Sgabeblack@google.com
198514184Sgabeblack@google.com  transition({S, Es, E1, O, Ms, M1, O_F0, S_F0, Si_F0, Si_F1, Es_F0, E1_Es, Ms_F0, M1_Ms}, L1D1_Repl) {L1D1TagArrayRead} {
198614184Sgabeblack@google.com    i1_invCluster;
198714184Sgabeblack@google.com  }
198814184Sgabeblack@google.com
198914184Sgabeblack@google.com  transition({S, S_C, S_F0, S_F1}, L1I_Repl) {L1ITagArrayRead} {
199014184Sgabeblack@google.com    ii_invIcache;
199114184Sgabeblack@google.com  }
199214184Sgabeblack@google.com
199314184Sgabeblack@google.com  transition({S, E0, E1, Es}, L2_Repl, ES_I) {L2TagArrayRead, L2DataArrayRead, L1D0TagArrayRead, L1D1TagArrayRead} {
199414184Sgabeblack@google.com    forward_eviction_to_cpu0;
199514184Sgabeblack@google.com    forward_eviction_to_cpu1;
199614184Sgabeblack@google.com    t_allocateTBE;
199714184Sgabeblack@google.com    vc_victim;
199814184Sgabeblack@google.com    ib_invBothClusters;
199914184Sgabeblack@google.com    i2_invL2;
200014184Sgabeblack@google.com    ii_invIcache;
200114184Sgabeblack@google.com  }
200214184Sgabeblack@google.com
200314184Sgabeblack@google.com  transition({Ms, M0, M1, O}, L2_Repl, MO_I) {L2TagArrayRead, L2DataArrayRead, L1D0TagArrayRead, L1D1TagArrayRead} {
200414184Sgabeblack@google.com    forward_eviction_to_cpu0;
200514184Sgabeblack@google.com    forward_eviction_to_cpu1;
200614184Sgabeblack@google.com    t_allocateTBE;
200714184Sgabeblack@google.com    vd_victim;
200814184Sgabeblack@google.com    i2_invL2;
200914184Sgabeblack@google.com    ib_invBothClusters;  // nothing will happen for D0 on M1, vice versa
201014184Sgabeblack@google.com  }
201114184Sgabeblack@google.com
201214184Sgabeblack@google.com  transition(S0, NB_AckS, S) {L1D0DataArrayWrite, L1D0TagArrayWrite, L2DataArrayWrite, L2TagArrayWrite} {
201314184Sgabeblack@google.com    wi_writeIcache;
201414184Sgabeblack@google.com    xi0_loadDone;
201514184Sgabeblack@google.com    uu_sendUnblock;
201614184Sgabeblack@google.com    pr_popResponseQueue;
201714184Sgabeblack@google.com  }
201814184Sgabeblack@google.com
201914184Sgabeblack@google.com  transition(S1, NB_AckS, S) {L1D1DataArrayWrite, L1D1TagArrayWrite, L2DataArrayWrite, L2TagArrayWrite} {
202014184Sgabeblack@google.com    wi_writeIcache;
202114184Sgabeblack@google.com    xi1_loadDone;
202214184Sgabeblack@google.com    uu_sendUnblock;
202314184Sgabeblack@google.com    pr_popResponseQueue;
202414184Sgabeblack@google.com  }
202514184Sgabeblack@google.com
202614184Sgabeblack@google.com  transition(S0_C, NB_AckS, S_C) {L1D0DataArrayWrite,L2DataArrayWrite} {
202714184Sgabeblack@google.com    wi_writeIcache;
202814184Sgabeblack@google.com    xi0_loadDone;
202914184Sgabeblack@google.com    uu_sendUnblock;
203014184Sgabeblack@google.com    pr_popResponseQueue;
203114184Sgabeblack@google.com  }
203214184Sgabeblack@google.com
203314184Sgabeblack@google.com  transition(S1_C, NB_AckS, S_C) {L1D1DataArrayWrite, L2DataArrayWrite} {
203414184Sgabeblack@google.com    wi_writeIcache;
203514184Sgabeblack@google.com    xi1_loadDone;
203614184Sgabeblack@google.com    uu_sendUnblock;
203714184Sgabeblack@google.com    pr_popResponseQueue;
203814184Sgabeblack@google.com  }
203914184Sgabeblack@google.com
204014184Sgabeblack@google.com  transition(I_M0, NB_AckM, M0) {L1D0DataArrayWrite, L1D0TagArrayWrite,L2DataArrayWrite, L2TagArrayWrite} {
204114184Sgabeblack@google.com    w0_writeDcache;
204214184Sgabeblack@google.com    xs0_storeDone;
204314184Sgabeblack@google.com    uu_sendUnblock;
204414184Sgabeblack@google.com    pr_popResponseQueue;
204514184Sgabeblack@google.com  }
204614184Sgabeblack@google.com
204714184Sgabeblack@google.com  transition(I_M1, NB_AckM, M1) {L1D1DataArrayWrite, L1D1TagArrayWrite, L2DataArrayWrite, L2TagArrayWrite} {
204814184Sgabeblack@google.com    w1_writeDcache;
204914184Sgabeblack@google.com    xs1_storeDone;
205014184Sgabeblack@google.com    uu_sendUnblock;
205114184Sgabeblack@google.com    pr_popResponseQueue;
205214184Sgabeblack@google.com  }
205314184Sgabeblack@google.com
205414184Sgabeblack@google.com  // THESE MO->M1 should not be instantaneous but oh well for now.
205514184Sgabeblack@google.com  transition(I_M0M1, NB_AckM, M1) {L1D1DataArrayWrite, L1D1TagArrayWrite, L2DataArrayWrite, L2TagArrayWrite} {
205614184Sgabeblack@google.com    w0_writeDcache;
205714184Sgabeblack@google.com    xs0_storeDone;
205814184Sgabeblack@google.com    uu_sendUnblock;
205914184Sgabeblack@google.com    i0_invCluster;
206014184Sgabeblack@google.com    s1_storeDone;
206114184Sgabeblack@google.com    pr_popResponseQueue;
206214184Sgabeblack@google.com  }
206314184Sgabeblack@google.com
206414184Sgabeblack@google.com  transition(I_M1M0, NB_AckM, M0) {L1D0DataArrayWrite, L1D0TagArrayWrite, L2DataArrayWrite, L2TagArrayWrite} {
206514184Sgabeblack@google.com    w1_writeDcache;
206614184Sgabeblack@google.com    xs1_storeDone;
206714184Sgabeblack@google.com    uu_sendUnblock;
206814184Sgabeblack@google.com    i1_invCluster;
206914184Sgabeblack@google.com    s0_storeDone;
207014184Sgabeblack@google.com    pr_popResponseQueue;
207114184Sgabeblack@google.com  }
207214184Sgabeblack@google.com
207314184Sgabeblack@google.com  // Above shoudl be more like this, which has some latency to xfer to L1
207414184Sgabeblack@google.com  transition(I_M0Ms, NB_AckM, M0_Ms) {L1D0DataArrayWrite,L2DataArrayWrite} {
207514184Sgabeblack@google.com    w0_writeDcache;
207614184Sgabeblack@google.com    xs0_storeDone;
207714184Sgabeblack@google.com    uu_sendUnblock;
207814184Sgabeblack@google.com    f1_L2ToL1;
207914184Sgabeblack@google.com    pr_popResponseQueue;
208014184Sgabeblack@google.com  }
208114184Sgabeblack@google.com
208214184Sgabeblack@google.com  transition(I_M1Ms, NB_AckM, M1_Ms) {L1D1DataArrayWrite, L2DataArrayWrite} {
208314184Sgabeblack@google.com    w1_writeDcache;
208414184Sgabeblack@google.com    xs1_storeDone;
208514184Sgabeblack@google.com    uu_sendUnblock;
208614184Sgabeblack@google.com    f0_L2ToL1;
208714184Sgabeblack@google.com    pr_popResponseQueue;
208814184Sgabeblack@google.com  }
208914184Sgabeblack@google.com
209014184Sgabeblack@google.com  transition(I_E0S, NB_AckE, E0) {L1D0DataArrayWrite, L1D0TagArrayWrite, L2DataArrayWrite, L2TagArrayWrite} {
209114184Sgabeblack@google.com    w0_writeDcache;
209214184Sgabeblack@google.com    xl0_loadDone;
209314184Sgabeblack@google.com    uu_sendUnblock;
209414184Sgabeblack@google.com    pr_popResponseQueue;
209514184Sgabeblack@google.com  }
209614184Sgabeblack@google.com
209714184Sgabeblack@google.com  transition(I_E1S, NB_AckE, E1) {L1D1DataArrayWrite, L1D1TagArrayWrite, L2DataArrayWrite, L2TagArrayWrite} {
209814184Sgabeblack@google.com    w1_writeDcache;
209914184Sgabeblack@google.com    xl1_loadDone;
210014184Sgabeblack@google.com    uu_sendUnblock;
210114184Sgabeblack@google.com    pr_popResponseQueue;
210214184Sgabeblack@google.com  }
210314184Sgabeblack@google.com
210414184Sgabeblack@google.com  transition(I_ES, NB_AckE, Es) {L1D1DataArrayWrite, L1D1TagArrayWrite, L1D0DataArrayWrite, L1D0TagArrayWrite, L2DataArrayWrite, L2TagArrayWrite } {
210514184Sgabeblack@google.com    w0_writeDcache;
210614184Sgabeblack@google.com    xl0_loadDone;
210714184Sgabeblack@google.com    w1_writeDcache;
210814184Sgabeblack@google.com    xl1_loadDone;
210914184Sgabeblack@google.com    uu_sendUnblock;
211014184Sgabeblack@google.com    pr_popResponseQueue;
211114184Sgabeblack@google.com  }
211214184Sgabeblack@google.com
211314184Sgabeblack@google.com  transition(I_E0S, NB_AckS, S) {L1D0DataArrayWrite, L1D0TagArrayWrite,L2DataArrayWrite, L2TagArrayWrite} {
211414184Sgabeblack@google.com    w0_writeDcache;
211514184Sgabeblack@google.com    xl0_loadDone;
211614184Sgabeblack@google.com    uu_sendUnblock;
211714184Sgabeblack@google.com    pr_popResponseQueue;
211814184Sgabeblack@google.com  }
211914184Sgabeblack@google.com
212014184Sgabeblack@google.com  transition(I_E1S, NB_AckS, S) {L1D1TagArrayWrite, L1D1DataArrayWrite, L2TagArrayWrite, L2DataArrayWrite} {
212114184Sgabeblack@google.com    w1_writeDcache;
212214184Sgabeblack@google.com    xl1_loadDone;
212314184Sgabeblack@google.com    uu_sendUnblock;
212414184Sgabeblack@google.com    pr_popResponseQueue;
212514184Sgabeblack@google.com  }
212614184Sgabeblack@google.com
212714184Sgabeblack@google.com  transition(I_ES, NB_AckS, S) {L1D0TagArrayWrite, L1D0DataArrayWrite, L2TagArrayWrite,  L2DataArrayWrite} {
212814184Sgabeblack@google.com    w0_writeDcache;
212914184Sgabeblack@google.com    xl0_loadDone;
213014184Sgabeblack@google.com    w1_writeDcache;
213114184Sgabeblack@google.com    xl1_loadDone;
213214184Sgabeblack@google.com    uu_sendUnblock;
213314184Sgabeblack@google.com    pr_popResponseQueue;
213414184Sgabeblack@google.com  }
213514184Sgabeblack@google.com
213614184Sgabeblack@google.com  transition(S_F0, L2_to_L1D0, S) {L1D0TagArrayWrite, L1D0DataArrayWrite,  L2TagArrayWrite, L2DataArrayRead} {
213714184Sgabeblack@google.com    c0_copyL2ToL1;
213814184Sgabeblack@google.com    mru_setMRU;
213914184Sgabeblack@google.com    l0_loadDone;
214014184Sgabeblack@google.com    pt_popTriggerQueue;
214114184Sgabeblack@google.com  }
214214184Sgabeblack@google.com
214314184Sgabeblack@google.com  transition(S_F1, L2_to_L1D1, S) {L1D1TagArrayWrite, L1D1DataArrayWrite,  L2TagArrayWrite, L2DataArrayRead} {
214414184Sgabeblack@google.com    c1_copyL2ToL1;
214514184Sgabeblack@google.com    mru_setMRU;
214614184Sgabeblack@google.com    l1_loadDone;
214714184Sgabeblack@google.com    pt_popTriggerQueue;
214814184Sgabeblack@google.com  }
214914184Sgabeblack@google.com
215014184Sgabeblack@google.com  transition(Si_F0, L2_to_L1I, S) {L1ITagArrayWrite, L1IDataArrayWrite,  L2TagArrayWrite, L2DataArrayRead} {
215114184Sgabeblack@google.com    ci_copyL2ToL1;
215214184Sgabeblack@google.com    mru_setMRU;
215314184Sgabeblack@google.com    il0_loadDone;
215414184Sgabeblack@google.com    pt_popTriggerQueue;
215514184Sgabeblack@google.com  }
215614184Sgabeblack@google.com
215714184Sgabeblack@google.com  transition(Si_F1, L2_to_L1I, S) {L1ITagArrayWrite, L1IDataArrayWrite,  L2TagArrayWrite, L2DataArrayRead} {
215814184Sgabeblack@google.com    ci_copyL2ToL1;
215914184Sgabeblack@google.com    mru_setMRU;
216014184Sgabeblack@google.com    il1_loadDone;
216114184Sgabeblack@google.com    pt_popTriggerQueue;
216214184Sgabeblack@google.com  }
216314184Sgabeblack@google.com
216414184Sgabeblack@google.com  transition(S_F, L2_to_L1D0, S_F1) { L1D0DataArrayWrite, L2DataArrayRead} {
216514184Sgabeblack@google.com    c0_copyL2ToL1;
216614184Sgabeblack@google.com    mru_setMRU;
216714184Sgabeblack@google.com    l0_loadDone;
216814184Sgabeblack@google.com    pt_popTriggerQueue;
216914184Sgabeblack@google.com  }
217014184Sgabeblack@google.com
217114184Sgabeblack@google.com  transition(S_F, L2_to_L1D1, S_F0) { L1D1DataArrayWrite, L2DataArrayRead} {
217214184Sgabeblack@google.com    c1_copyL2ToL1;
217314184Sgabeblack@google.com    mru_setMRU;
217414184Sgabeblack@google.com    l1_loadDone;
217514184Sgabeblack@google.com    pt_popTriggerQueue;
217614184Sgabeblack@google.com  }
217714184Sgabeblack@google.com
217814184Sgabeblack@google.com  transition(O_F0, L2_to_L1D0, O) { L1D0DataArrayWrite, L1D0TagArrayWrite, L2TagArrayWrite, L2DataArrayRead} {
217914184Sgabeblack@google.com    c0_copyL2ToL1;
218014184Sgabeblack@google.com    mru_setMRU;
218114184Sgabeblack@google.com    l0_loadDone;
218214184Sgabeblack@google.com    pt_popTriggerQueue;
218314184Sgabeblack@google.com  }
218414184Sgabeblack@google.com
218514184Sgabeblack@google.com  transition(O_F1, L2_to_L1D1, O) {L1D1DataArrayWrite, L1D1TagArrayWrite, L2TagArrayWrite, L2DataArrayRead} {
218614184Sgabeblack@google.com    c1_copyL2ToL1;
218714184Sgabeblack@google.com    mru_setMRU;
218814184Sgabeblack@google.com    l1_loadDone;
218914184Sgabeblack@google.com    pt_popTriggerQueue;
219014184Sgabeblack@google.com  }
219114184Sgabeblack@google.com
219214184Sgabeblack@google.com  transition(O_F, L2_to_L1D0, O_F1) { L1D0DataArrayWrite, L2DataArrayRead} {
219314184Sgabeblack@google.com    c0_copyL2ToL1;
219414184Sgabeblack@google.com    mru_setMRU;
219514184Sgabeblack@google.com    l0_loadDone;
219614184Sgabeblack@google.com    pt_popTriggerQueue;
219714184Sgabeblack@google.com  }
219814184Sgabeblack@google.com
219914184Sgabeblack@google.com  transition(O_F, L2_to_L1D1, O_F0) { L1D1DataArrayWrite, L2DataArrayRead} {
220014184Sgabeblack@google.com    c1_copyL2ToL1;
220114184Sgabeblack@google.com    mru_setMRU;
220214184Sgabeblack@google.com    l1_loadDone;
220314184Sgabeblack@google.com    pt_popTriggerQueue;
220414184Sgabeblack@google.com  }
220514184Sgabeblack@google.com
220614184Sgabeblack@google.com  transition(M1_F, L2_to_L1D1, M1) {L1D1DataArrayWrite, L1D1TagArrayWrite, L2TagArrayWrite, L2DataArrayRead} {
220714184Sgabeblack@google.com    c1_copyL2ToL1;
220814184Sgabeblack@google.com    mru_setMRU;
220914184Sgabeblack@google.com    l1_loadDone;
221014184Sgabeblack@google.com    pt_popTriggerQueue;
221114184Sgabeblack@google.com  }
221214184Sgabeblack@google.com
221314184Sgabeblack@google.com  transition(M0_F, L2_to_L1D0, M0) {L1D0DataArrayWrite, L1D0TagArrayWrite, L2TagArrayWrite, L2DataArrayRead} {
221414184Sgabeblack@google.com    c0_copyL2ToL1;
221514184Sgabeblack@google.com    mru_setMRU;
221614184Sgabeblack@google.com    l0_loadDone;
221714184Sgabeblack@google.com    pt_popTriggerQueue;
221814184Sgabeblack@google.com  }
221914184Sgabeblack@google.com
222014184Sgabeblack@google.com  transition(Ms_F0, L2_to_L1D0, Ms) {L1D0DataArrayWrite, L1D0TagArrayWrite, L2TagArrayWrite, L2DataArrayRead} {
222114184Sgabeblack@google.com    c0_copyL2ToL1;
222214184Sgabeblack@google.com    mru_setMRU;
222314184Sgabeblack@google.com    l0_loadDone;
222414184Sgabeblack@google.com    pt_popTriggerQueue;
222514184Sgabeblack@google.com  }
222614184Sgabeblack@google.com
222714184Sgabeblack@google.com  transition(Ms_F1, L2_to_L1D1, Ms) {L1D1DataArrayWrite, L1D1TagArrayWrite, L2TagArrayWrite, L2DataArrayRead} {
222814184Sgabeblack@google.com    c1_copyL2ToL1;
222914184Sgabeblack@google.com    mru_setMRU;
223014184Sgabeblack@google.com    l1_loadDone;
223114184Sgabeblack@google.com    pt_popTriggerQueue;
223214184Sgabeblack@google.com  }
223314184Sgabeblack@google.com
223414184Sgabeblack@google.com  transition(Ms_F, L2_to_L1D0, Ms_F1) {L1D0DataArrayWrite, L2DataArrayRead} {
223514184Sgabeblack@google.com    c0_copyL2ToL1;
223614184Sgabeblack@google.com    mru_setMRU;
223714184Sgabeblack@google.com    l0_loadDone;
223814184Sgabeblack@google.com    pt_popTriggerQueue;
223914184Sgabeblack@google.com  }
224014184Sgabeblack@google.com
224114184Sgabeblack@google.com  transition(Ms_F, L2_to_L1D1, Ms_F0) {L1IDataArrayWrite, L2DataArrayRead} {
224214184Sgabeblack@google.com    c1_copyL2ToL1;
224314184Sgabeblack@google.com    mru_setMRU;
224414184Sgabeblack@google.com    l1_loadDone;
224514184Sgabeblack@google.com    pt_popTriggerQueue;
224614184Sgabeblack@google.com  }
224714184Sgabeblack@google.com
224814184Sgabeblack@google.com  transition(M1_Ms, L2_to_L1D0, Ms) {L1D0TagArrayWrite, L1D0DataArrayWrite, L2TagArrayWrite, L2DataArrayRead} {
224914184Sgabeblack@google.com    c0_copyL2ToL1;
225014184Sgabeblack@google.com    mru_setMRU;
225114184Sgabeblack@google.com    l0_loadDone;
225214184Sgabeblack@google.com    pt_popTriggerQueue;
225314184Sgabeblack@google.com  }
225414184Sgabeblack@google.com
225514184Sgabeblack@google.com  transition(M0_Ms, L2_to_L1D1, Ms) {L1D1TagArrayWrite, L1D1DataArrayWrite, L2TagArrayWrite, L2DataArrayRead} {
225614184Sgabeblack@google.com    c1_copyL2ToL1;
225714184Sgabeblack@google.com    mru_setMRU;
225814184Sgabeblack@google.com    l1_loadDone;
225914184Sgabeblack@google.com    pt_popTriggerQueue;
226014184Sgabeblack@google.com  }
226114184Sgabeblack@google.com
226214184Sgabeblack@google.com  transition(Es_F0, L2_to_L1D0, Es) {L1D0TagArrayWrite, L1D0DataArrayWrite, L2TagArrayWrite, L2DataArrayRead} {
226314184Sgabeblack@google.com    c0_copyL2ToL1;
226414184Sgabeblack@google.com    mru_setMRU;
226514184Sgabeblack@google.com    l0_loadDone;
226614184Sgabeblack@google.com    pt_popTriggerQueue;
226714184Sgabeblack@google.com  }
226814184Sgabeblack@google.com
226914184Sgabeblack@google.com  transition(Es_F1, L2_to_L1D1, Es) {L1D1TagArrayWrite, L1D1DataArrayWrite, L2TagArrayWrite, L2DataArrayRead} {
227014184Sgabeblack@google.com    c1_copyL2ToL1;
227114184Sgabeblack@google.com    mru_setMRU;
227214184Sgabeblack@google.com    l1_loadDone;
227314184Sgabeblack@google.com    pt_popTriggerQueue;
227414184Sgabeblack@google.com  }
227514184Sgabeblack@google.com
227614184Sgabeblack@google.com  transition(Es_F, L2_to_L1D0, Es_F1) {L2TagArrayRead, L2DataArrayRead} {
227714184Sgabeblack@google.com    c0_copyL2ToL1;
227814184Sgabeblack@google.com    mru_setMRU;
227914184Sgabeblack@google.com    l0_loadDone;
228014184Sgabeblack@google.com    pt_popTriggerQueue;
228114184Sgabeblack@google.com  }
228214184Sgabeblack@google.com
228314184Sgabeblack@google.com  transition(Es_F, L2_to_L1D1, Es_F0) {L2TagArrayRead, L2DataArrayRead} {
228414184Sgabeblack@google.com    c1_copyL2ToL1;
228514184Sgabeblack@google.com    mru_setMRU;
228614184Sgabeblack@google.com    l1_loadDone;
228714184Sgabeblack@google.com    pt_popTriggerQueue;
228814184Sgabeblack@google.com  }
228914184Sgabeblack@google.com
229014184Sgabeblack@google.com  transition(E0_F, L2_to_L1D0, E0) {L2TagArrayRead, L2DataArrayRead} {
229114184Sgabeblack@google.com    c0_copyL2ToL1;
229214184Sgabeblack@google.com    mru_setMRU;
229314184Sgabeblack@google.com    l0_loadDone;
229414184Sgabeblack@google.com    pt_popTriggerQueue;
229514184Sgabeblack@google.com  }
229614184Sgabeblack@google.com
229714184Sgabeblack@google.com  transition(E1_F, L2_to_L1D1, E1) {L2TagArrayRead, L2DataArrayRead} {
229814184Sgabeblack@google.com    c1_copyL2ToL1;
229914184Sgabeblack@google.com    mru_setMRU;
230014184Sgabeblack@google.com    l1_loadDone;
230114184Sgabeblack@google.com    pt_popTriggerQueue;
230214184Sgabeblack@google.com  }
230314184Sgabeblack@google.com
230414184Sgabeblack@google.com  transition(E1_Es, L2_to_L1D0, Es) {L2TagArrayRead, L2DataArrayRead} {
230514184Sgabeblack@google.com    c0_copyL2ToL1;
230614184Sgabeblack@google.com    mru_setMRU;
230714184Sgabeblack@google.com    l0_loadDone;
230814184Sgabeblack@google.com    pt_popTriggerQueue;
230914184Sgabeblack@google.com  }
231014184Sgabeblack@google.com
231114184Sgabeblack@google.com  transition(E0_Es, L2_to_L1D1, Es) {L2TagArrayRead, L2DataArrayRead} {
231214184Sgabeblack@google.com    c1_copyL2ToL1;
231314184Sgabeblack@google.com    mru_setMRU;
231414184Sgabeblack@google.com    l1_loadDone;
231514184Sgabeblack@google.com    pt_popTriggerQueue;
231614184Sgabeblack@google.com  }
231714184Sgabeblack@google.com
231814184Sgabeblack@google.com  transition(IF_E0S, L2_to_L1D0, I_E0S) {} {
231914184Sgabeblack@google.com    pt_popTriggerQueue;
232014184Sgabeblack@google.com  }
232114184Sgabeblack@google.com
232214184Sgabeblack@google.com  transition(IF_E1S, L2_to_L1D1, I_E1S) {} {
232314184Sgabeblack@google.com    pt_popTriggerQueue;
232414184Sgabeblack@google.com  }
232514184Sgabeblack@google.com
232614184Sgabeblack@google.com  transition(IF_ES, L2_to_L1D0, IF1_ES) {} {
232714184Sgabeblack@google.com    pt_popTriggerQueue;
232814184Sgabeblack@google.com  }
232914184Sgabeblack@google.com
233014184Sgabeblack@google.com  transition(IF_ES, L2_to_L1D1, IF0_ES) {} {
233114184Sgabeblack@google.com    pt_popTriggerQueue;
233214184Sgabeblack@google.com  }
233314184Sgabeblack@google.com
233414184Sgabeblack@google.com  transition(IF0_ES, L2_to_L1D0, I_ES) {} {
233514184Sgabeblack@google.com    pt_popTriggerQueue;
233614184Sgabeblack@google.com  }
233714184Sgabeblack@google.com
233814184Sgabeblack@google.com  transition(IF1_ES, L2_to_L1D1, I_ES) {} {
233914184Sgabeblack@google.com    pt_popTriggerQueue;
234014184Sgabeblack@google.com  }
234114184Sgabeblack@google.com
234214184Sgabeblack@google.com  transition(F_S0, L2_to_L1I, S0) {} {
234314184Sgabeblack@google.com    pt_popTriggerQueue;
234414184Sgabeblack@google.com  }
234514184Sgabeblack@google.com
234614184Sgabeblack@google.com  transition(F_S1, L2_to_L1I, S1) {} {
234714184Sgabeblack@google.com    pt_popTriggerQueue;
234814184Sgabeblack@google.com  }
234914184Sgabeblack@google.com
235014184Sgabeblack@google.com  transition({S_M0, O_M0}, NB_AckM, M0) {L1D0TagArrayWrite, L1D0DataArrayWrite, L2DataArrayWrite, L2TagArrayWrite} {
235114184Sgabeblack@google.com    mru_setMRU;
235214184Sgabeblack@google.com    xs0_storeDone;
235314184Sgabeblack@google.com    uu_sendUnblock;
235414184Sgabeblack@google.com    pr_popResponseQueue;
235514184Sgabeblack@google.com  }
235614184Sgabeblack@google.com
235714184Sgabeblack@google.com  transition({S_M1, O_M1}, NB_AckM, M1) {L1D1TagArrayWrite, L1D1DataArrayWrite, L2DataArrayWrite, L2TagArrayWrite} {
235814184Sgabeblack@google.com    mru_setMRU;
235914184Sgabeblack@google.com    xs1_storeDone;
236014184Sgabeblack@google.com    uu_sendUnblock;
236114184Sgabeblack@google.com    pr_popResponseQueue;
236214184Sgabeblack@google.com  }
236314184Sgabeblack@google.com
236414184Sgabeblack@google.com  transition(MO_I, NB_AckWB, I) {L2TagArrayWrite} {
236514184Sgabeblack@google.com    wb_data;
236614184Sgabeblack@google.com    d_deallocateTBE;
236714184Sgabeblack@google.com    pr_popResponseQueue;
236814184Sgabeblack@google.com  }
236914184Sgabeblack@google.com
237014184Sgabeblack@google.com  transition(ES_I, NB_AckWB, I) {L2TagArrayWrite} {
237114184Sgabeblack@google.com    wb_data;
237214184Sgabeblack@google.com    d_deallocateTBE;
237314184Sgabeblack@google.com    pr_popResponseQueue;
237414184Sgabeblack@google.com  }
237514184Sgabeblack@google.com
237614184Sgabeblack@google.com  transition(MO_S0, NB_AckWB, S0) {L2TagArrayWrite} {
237714184Sgabeblack@google.com    wb_data;
237814184Sgabeblack@google.com    i2_invL2;
237914184Sgabeblack@google.com    a2_allocateL2;
238014184Sgabeblack@google.com    d_deallocateTBE; // FOO
238114184Sgabeblack@google.com    nS_issueRdBlkS;
238214184Sgabeblack@google.com    pr_popResponseQueue;
238314184Sgabeblack@google.com  }
238414184Sgabeblack@google.com
238514184Sgabeblack@google.com  transition(MO_S1, NB_AckWB, S1) {L2TagArrayWrite} {
238614184Sgabeblack@google.com    wb_data;
238714184Sgabeblack@google.com    i2_invL2;
238814184Sgabeblack@google.com    a2_allocateL2;
238914184Sgabeblack@google.com    d_deallocateTBE; // FOO
239014184Sgabeblack@google.com    nS_issueRdBlkS;
239114184Sgabeblack@google.com    pr_popResponseQueue;
239214184Sgabeblack@google.com  }
239314184Sgabeblack@google.com
239414184Sgabeblack@google.com  // Writeback cancel "ack"
239514184Sgabeblack@google.com  transition(I_C, NB_AckWB, I) {L2TagArrayWrite} {
239614184Sgabeblack@google.com    ss_sendStaleNotification;
239714184Sgabeblack@google.com    d_deallocateTBE;
239814184Sgabeblack@google.com    pr_popResponseQueue;
239914184Sgabeblack@google.com  }
240014184Sgabeblack@google.com
240114184Sgabeblack@google.com  transition(S0_C, NB_AckWB, S0) {L2TagArrayWrite} {
240214184Sgabeblack@google.com    ss_sendStaleNotification;
240314184Sgabeblack@google.com    pr_popResponseQueue;
240414184Sgabeblack@google.com  }
240514184Sgabeblack@google.com
240614184Sgabeblack@google.com  transition(S1_C, NB_AckWB, S1) {L2TagArrayWrite} {
240714184Sgabeblack@google.com    ss_sendStaleNotification;
240814184Sgabeblack@google.com    pr_popResponseQueue;
240914184Sgabeblack@google.com  }
241014184Sgabeblack@google.com
241114184Sgabeblack@google.com  transition(S_C, NB_AckWB, S) {L2TagArrayWrite} {
241214184Sgabeblack@google.com    ss_sendStaleNotification;
241314184Sgabeblack@google.com    pr_popResponseQueue;
241414184Sgabeblack@google.com  }
241514184Sgabeblack@google.com
241614184Sgabeblack@google.com  // Begin Probe Transitions
241714184Sgabeblack@google.com
241814184Sgabeblack@google.com  transition({Ms, M0, M1, O}, PrbInvData, I) {L2TagArrayRead, L2TagArrayWrite, L2DataArrayRead} {
241914184Sgabeblack@google.com    forward_eviction_to_cpu0;
242014184Sgabeblack@google.com    forward_eviction_to_cpu1;
242114184Sgabeblack@google.com    pd_sendProbeResponseData;
242214184Sgabeblack@google.com    i2_invL2;
242314184Sgabeblack@google.com    ib_invBothClusters;
242414184Sgabeblack@google.com    pp_popProbeQueue;
242514184Sgabeblack@google.com  }
242614184Sgabeblack@google.com
242714184Sgabeblack@google.com  transition({Es, E0, E1, S, I}, PrbInvData, I) {L2TagArrayRead, L2TagArrayWrite} {
242814184Sgabeblack@google.com    forward_eviction_to_cpu0;
242914184Sgabeblack@google.com    forward_eviction_to_cpu1;
243014184Sgabeblack@google.com    pi_sendProbeResponseInv;
243114184Sgabeblack@google.com    i2_invL2;
243214184Sgabeblack@google.com    ib_invBothClusters;
243314184Sgabeblack@google.com    ii_invIcache;  // only relevant for S
243414184Sgabeblack@google.com    pp_popProbeQueue;
243514184Sgabeblack@google.com  }
243614184Sgabeblack@google.com
243714184Sgabeblack@google.com  transition(S_C, PrbInvData, I_C) {L2TagArrayWrite} {
243814184Sgabeblack@google.com    t_allocateTBE;
243914184Sgabeblack@google.com    forward_eviction_to_cpu0;
244014184Sgabeblack@google.com    forward_eviction_to_cpu1;
244114184Sgabeblack@google.com    pi_sendProbeResponseInv;
244214184Sgabeblack@google.com    i2_invL2;
244314184Sgabeblack@google.com    ib_invBothClusters;
244414184Sgabeblack@google.com    ii_invIcache;
244514184Sgabeblack@google.com    pp_popProbeQueue;
244614184Sgabeblack@google.com  }
244714184Sgabeblack@google.com
244814184Sgabeblack@google.com  transition(I_C, PrbInvData, I_C) {} {
244914184Sgabeblack@google.com    pi_sendProbeResponseInv;
245014184Sgabeblack@google.com    ib_invBothClusters;
245114184Sgabeblack@google.com    pp_popProbeQueue;
245214184Sgabeblack@google.com  }
245314184Sgabeblack@google.com
245414184Sgabeblack@google.com  transition({Ms, M0, M1, O, Es, E0, E1, S, I}, PrbInv, I) {L2TagArrayRead, L2TagArrayWrite} {
245514184Sgabeblack@google.com    forward_eviction_to_cpu0;
245614184Sgabeblack@google.com    forward_eviction_to_cpu1;
245714184Sgabeblack@google.com    pi_sendProbeResponseInv;
245814184Sgabeblack@google.com    i2_invL2; // nothing will happen in I
245914184Sgabeblack@google.com    ib_invBothClusters;
246014184Sgabeblack@google.com    ii_invIcache;
246114184Sgabeblack@google.com    pp_popProbeQueue;
246214184Sgabeblack@google.com  }
246314184Sgabeblack@google.com
246414184Sgabeblack@google.com  transition(S_C, PrbInv, I_C) {L2TagArrayWrite} {
246514184Sgabeblack@google.com    t_allocateTBE;
246614184Sgabeblack@google.com    forward_eviction_to_cpu0;
246714184Sgabeblack@google.com    forward_eviction_to_cpu1;
246814184Sgabeblack@google.com    pi_sendProbeResponseInv;
246914184Sgabeblack@google.com    i2_invL2;
247014184Sgabeblack@google.com    ib_invBothClusters;
247114184Sgabeblack@google.com    ii_invIcache;
247214184Sgabeblack@google.com    pp_popProbeQueue;
247314184Sgabeblack@google.com  }
247414184Sgabeblack@google.com
247514184Sgabeblack@google.com  transition(I_C, PrbInv, I_C) {} {
247614184Sgabeblack@google.com    pi_sendProbeResponseInv;
247714184Sgabeblack@google.com    ib_invBothClusters;
247814184Sgabeblack@google.com    ii_invIcache;
247914184Sgabeblack@google.com    pp_popProbeQueue;
248014184Sgabeblack@google.com  }
248114184Sgabeblack@google.com
248214184Sgabeblack@google.com  transition({Ms, M0, M1, O}, PrbShrData, O) {L2TagArrayRead, L2TagArrayWrite, L2DataArrayRead} {
248314184Sgabeblack@google.com    pd_sendProbeResponseData;
248414184Sgabeblack@google.com    pp_popProbeQueue;
248514184Sgabeblack@google.com  }
248614184Sgabeblack@google.com
248714184Sgabeblack@google.com  transition({Es, E0, E1, S}, PrbShrData, S) {L2TagArrayRead, L2TagArrayWrite} {
248814184Sgabeblack@google.com    ph_sendProbeResponseHit;
248914184Sgabeblack@google.com    pp_popProbeQueue;
249014184Sgabeblack@google.com  }
249114184Sgabeblack@google.com
249214184Sgabeblack@google.com  transition(S_C, PrbShrData) {} {
249314184Sgabeblack@google.com    ph_sendProbeResponseHit;
249414184Sgabeblack@google.com    pp_popProbeQueue;
249514184Sgabeblack@google.com  }
249614184Sgabeblack@google.com
249714184Sgabeblack@google.com  transition({I, I_C}, PrbShrData) {L2TagArrayRead} {
249814184Sgabeblack@google.com    pb_sendProbeResponseBackprobe;
249914184Sgabeblack@google.com    pp_popProbeQueue;
250014184Sgabeblack@google.com  }
250114184Sgabeblack@google.com
250214184Sgabeblack@google.com  transition({I_M0, I_E0S}, {PrbInv, PrbInvData}) {} {
250314184Sgabeblack@google.com    pi_sendProbeResponseInv;
250414184Sgabeblack@google.com    ib_invBothClusters;  // must invalidate current data (only relevant for I_M0)
250514184Sgabeblack@google.com    a0_allocateL1D;  // but make sure there is room for incoming data when it arrives
250614184Sgabeblack@google.com    pp_popProbeQueue;
250714184Sgabeblack@google.com  }
250814184Sgabeblack@google.com
250914184Sgabeblack@google.com  transition({I_M1, I_E1S}, {PrbInv, PrbInvData}) {} {
251014184Sgabeblack@google.com    pi_sendProbeResponseInv;
251114184Sgabeblack@google.com    ib_invBothClusters; // must invalidate current data (only relevant for I_M1)
251214184Sgabeblack@google.com    a1_allocateL1D;  // but make sure there is room for incoming data when it arrives
251314184Sgabeblack@google.com    pp_popProbeQueue;
251414184Sgabeblack@google.com  }
251514184Sgabeblack@google.com
251614184Sgabeblack@google.com  transition({I_M0M1, I_M1M0, I_M0Ms, I_M1Ms, I_ES}, {PrbInv, PrbInvData, PrbShrData}) {} {
251714184Sgabeblack@google.com    pi_sendProbeResponseInv;
251814184Sgabeblack@google.com    ib_invBothClusters;
251914184Sgabeblack@google.com    a0_allocateL1D;
252014184Sgabeblack@google.com    a1_allocateL1D;
252114184Sgabeblack@google.com    pp_popProbeQueue;
252214184Sgabeblack@google.com  }
252314184Sgabeblack@google.com
252414184Sgabeblack@google.com  transition({I_M0, I_E0S, I_M1, I_E1S}, PrbShrData) {} {
252514184Sgabeblack@google.com    pb_sendProbeResponseBackprobe;
252614184Sgabeblack@google.com    pp_popProbeQueue;
252714184Sgabeblack@google.com  }
252814184Sgabeblack@google.com
252914184Sgabeblack@google.com  transition(ES_I, PrbInvData, I_C) {} {
253014184Sgabeblack@google.com    pi_sendProbeResponseInv;
253114184Sgabeblack@google.com    ib_invBothClusters;
253214184Sgabeblack@google.com    ii_invIcache;
253314184Sgabeblack@google.com    pp_popProbeQueue;
253414184Sgabeblack@google.com  }
253514184Sgabeblack@google.com
253614184Sgabeblack@google.com  transition(MO_I, PrbInvData, I_C) {} {
253714184Sgabeblack@google.com    pdt_sendProbeResponseDataFromTBE;
253814184Sgabeblack@google.com    ib_invBothClusters;
253914184Sgabeblack@google.com    ii_invIcache;
254014184Sgabeblack@google.com    pp_popProbeQueue;
254114184Sgabeblack@google.com  }
254214184Sgabeblack@google.com
254314184Sgabeblack@google.com  transition(MO_I, PrbInv, I_C) {} {
254414184Sgabeblack@google.com    pi_sendProbeResponseInv;
254514184Sgabeblack@google.com    ib_invBothClusters;
254614184Sgabeblack@google.com    ii_invIcache;
254714184Sgabeblack@google.com    pp_popProbeQueue;
254814184Sgabeblack@google.com  }
254914184Sgabeblack@google.com
255014184Sgabeblack@google.com  transition(ES_I, PrbInv, I_C) {} {
255114184Sgabeblack@google.com    pi_sendProbeResponseInv;
255214184Sgabeblack@google.com    ib_invBothClusters;
255314184Sgabeblack@google.com    ii_invIcache;
255414184Sgabeblack@google.com    pp_popProbeQueue;
255514184Sgabeblack@google.com  }
255614184Sgabeblack@google.com
255714184Sgabeblack@google.com  transition(ES_I, PrbShrData, ES_I) {} {
255814184Sgabeblack@google.com    ph_sendProbeResponseHit;
255914184Sgabeblack@google.com    s_setSharedFlip;
256014184Sgabeblack@google.com    pp_popProbeQueue;
256114184Sgabeblack@google.com  }
256214184Sgabeblack@google.com
256314184Sgabeblack@google.com  transition(MO_I, PrbShrData, MO_I) {} {
256414184Sgabeblack@google.com    pdt_sendProbeResponseDataFromTBE;
256514184Sgabeblack@google.com    s_setSharedFlip;
256614184Sgabeblack@google.com    pp_popProbeQueue;
256714184Sgabeblack@google.com  }
256814184Sgabeblack@google.com
256914184Sgabeblack@google.com  transition(MO_S0, PrbInvData, S0_C) {L2TagArrayWrite} {
257014184Sgabeblack@google.com    forward_eviction_to_cpu0;
257114184Sgabeblack@google.com    forward_eviction_to_cpu1;
257214184Sgabeblack@google.com    pdt_sendProbeResponseDataFromTBE;
257314184Sgabeblack@google.com    i2_invL2;
257414184Sgabeblack@google.com    a2_allocateL2;
257514184Sgabeblack@google.com    d_deallocateTBE;
257614184Sgabeblack@google.com    nS_issueRdBlkS;
257714184Sgabeblack@google.com    pp_popProbeQueue;
257814184Sgabeblack@google.com  }
257914184Sgabeblack@google.com
258014184Sgabeblack@google.com  transition(MO_S1, PrbInvData, S1_C) {L2TagArrayWrite} {
258114184Sgabeblack@google.com    forward_eviction_to_cpu0;
258214184Sgabeblack@google.com    forward_eviction_to_cpu1;
258314184Sgabeblack@google.com    pdt_sendProbeResponseDataFromTBE;
258414184Sgabeblack@google.com    i2_invL2;
258514184Sgabeblack@google.com    a2_allocateL2;
258614184Sgabeblack@google.com    d_deallocateTBE;
258714184Sgabeblack@google.com    nS_issueRdBlkS;
258814184Sgabeblack@google.com    pp_popProbeQueue;
258914184Sgabeblack@google.com  }
259014184Sgabeblack@google.com
259114184Sgabeblack@google.com  transition(MO_S0, PrbInv, S0_C) {L2TagArrayWrite} {
259214184Sgabeblack@google.com    forward_eviction_to_cpu0;
259314184Sgabeblack@google.com    forward_eviction_to_cpu1;
259414184Sgabeblack@google.com    pi_sendProbeResponseInv;
259514184Sgabeblack@google.com    i2_invL2;
259614184Sgabeblack@google.com    a2_allocateL2;
259714184Sgabeblack@google.com    d_deallocateTBE;
259814184Sgabeblack@google.com    nS_issueRdBlkS;
259914184Sgabeblack@google.com    pp_popProbeQueue;
260014184Sgabeblack@google.com  }
260114184Sgabeblack@google.com
260214184Sgabeblack@google.com  transition(MO_S1, PrbInv, S1_C) {L2TagArrayWrite} {
260314184Sgabeblack@google.com    forward_eviction_to_cpu0;
260414184Sgabeblack@google.com    forward_eviction_to_cpu1;
260514184Sgabeblack@google.com    pi_sendProbeResponseInv;
260614184Sgabeblack@google.com    i2_invL2;
260714184Sgabeblack@google.com    a2_allocateL2;
260814184Sgabeblack@google.com    d_deallocateTBE;
260914184Sgabeblack@google.com    nS_issueRdBlkS;
261014184Sgabeblack@google.com    pp_popProbeQueue;
261114184Sgabeblack@google.com  }
261214184Sgabeblack@google.com
261314184Sgabeblack@google.com  transition({MO_S0, MO_S1}, PrbShrData) {} {
261414184Sgabeblack@google.com    pdt_sendProbeResponseDataFromTBE;
261514184Sgabeblack@google.com    s_setSharedFlip;
261614184Sgabeblack@google.com    pp_popProbeQueue;
261714184Sgabeblack@google.com  }
261814184Sgabeblack@google.com
261914184Sgabeblack@google.com  transition({S_F0, Es_F0, E0_F, E1_Es}, {PrbInvData, PrbInv}, IF_E0S) {}{
262014184Sgabeblack@google.com    forward_eviction_to_cpu0;
262114184Sgabeblack@google.com    forward_eviction_to_cpu1;
262214184Sgabeblack@google.com    pi_sendProbeResponseInv;
262314184Sgabeblack@google.com    // invalidate everything you've got
262414184Sgabeblack@google.com    ib_invBothClusters;
262514184Sgabeblack@google.com    ii_invIcache;
262614184Sgabeblack@google.com    i2_invL2;
262714184Sgabeblack@google.com    // but make sure you have room for what you need from the fill
262814184Sgabeblack@google.com    a0_allocateL1D;
262914184Sgabeblack@google.com    a2_allocateL2;
263014184Sgabeblack@google.com    n_issueRdBlk;
263114184Sgabeblack@google.com    pp_popProbeQueue;
263214184Sgabeblack@google.com  }
263314184Sgabeblack@google.com
263414184Sgabeblack@google.com  transition({S_F1, Es_F1, E1_F, E0_Es}, {PrbInvData, PrbInv}, IF_E1S) {} {
263514184Sgabeblack@google.com    forward_eviction_to_cpu0;
263614184Sgabeblack@google.com    forward_eviction_to_cpu1;
263714184Sgabeblack@google.com    pi_sendProbeResponseInv;
263814184Sgabeblack@google.com    // invalidate everything you've got
263914184Sgabeblack@google.com    ib_invBothClusters;
264014184Sgabeblack@google.com    ii_invIcache;
264114184Sgabeblack@google.com    i2_invL2;
264214184Sgabeblack@google.com    // but make sure you have room for what you need from the fill
264314184Sgabeblack@google.com    a1_allocateL1D;
264414184Sgabeblack@google.com    a2_allocateL2;
264514184Sgabeblack@google.com    n_issueRdBlk;
264614184Sgabeblack@google.com    pp_popProbeQueue;
264714184Sgabeblack@google.com  }
264814184Sgabeblack@google.com
264914184Sgabeblack@google.com  transition({S_F, Es_F}, {PrbInvData, PrbInv}, IF_ES) {} {
265014184Sgabeblack@google.com    forward_eviction_to_cpu0;
265114184Sgabeblack@google.com    forward_eviction_to_cpu1;
265214184Sgabeblack@google.com    pi_sendProbeResponseInv;
265314184Sgabeblack@google.com    // invalidate everything you've got
265414184Sgabeblack@google.com    ib_invBothClusters;
265514184Sgabeblack@google.com    ii_invIcache;
265614184Sgabeblack@google.com    i2_invL2;
265714184Sgabeblack@google.com    // but make sure you have room for what you need from the fill
265814184Sgabeblack@google.com    a0_allocateL1D;
265914184Sgabeblack@google.com    a1_allocateL1D;
266014184Sgabeblack@google.com    a2_allocateL2;
266114184Sgabeblack@google.com    n_issueRdBlk;
266214184Sgabeblack@google.com    pp_popProbeQueue;
266314184Sgabeblack@google.com  }
266414184Sgabeblack@google.com
266514184Sgabeblack@google.com  transition(Si_F0, {PrbInvData, PrbInv}, F_S0) {} {
266614184Sgabeblack@google.com    forward_eviction_to_cpu0;
266714184Sgabeblack@google.com    forward_eviction_to_cpu1;
266814184Sgabeblack@google.com    pi_sendProbeResponseInv;
266914184Sgabeblack@google.com    ib_invBothClusters;
267014184Sgabeblack@google.com    ii_invIcache;
267114184Sgabeblack@google.com    i2_invL2;
267214184Sgabeblack@google.com    ai_allocateL1I;
267314184Sgabeblack@google.com    a2_allocateL2;
267414184Sgabeblack@google.com    nS_issueRdBlkS;
267514184Sgabeblack@google.com    pp_popProbeQueue;
267614184Sgabeblack@google.com  }
267714184Sgabeblack@google.com
267814184Sgabeblack@google.com  transition(Si_F1, {PrbInvData, PrbInv}, F_S1) {} {
267914184Sgabeblack@google.com    forward_eviction_to_cpu0;
268014184Sgabeblack@google.com    forward_eviction_to_cpu1;
268114184Sgabeblack@google.com    pi_sendProbeResponseInv;
268214184Sgabeblack@google.com    ib_invBothClusters;
268314184Sgabeblack@google.com    ii_invIcache;
268414184Sgabeblack@google.com    i2_invL2;
268514184Sgabeblack@google.com    ai_allocateL1I;
268614184Sgabeblack@google.com    a2_allocateL2;
268714184Sgabeblack@google.com    nS_issueRdBlkS;
268814184Sgabeblack@google.com    pp_popProbeQueue;
268914184Sgabeblack@google.com  }
269014184Sgabeblack@google.com
269114184Sgabeblack@google.com  transition({Es_F0, E0_F, E1_Es}, PrbShrData, S_F0) {} {
269214184Sgabeblack@google.com    ph_sendProbeResponseHit;
269314184Sgabeblack@google.com    pp_popProbeQueue;
269414184Sgabeblack@google.com  }
269514184Sgabeblack@google.com
269614184Sgabeblack@google.com  transition({Es_F1, E1_F, E0_Es}, PrbShrData, S_F1) {} {
269714184Sgabeblack@google.com    ph_sendProbeResponseHit;
269814184Sgabeblack@google.com    pp_popProbeQueue;
269914184Sgabeblack@google.com  }
270014184Sgabeblack@google.com
270114184Sgabeblack@google.com  transition(Es_F, PrbShrData, S_F) {} {
270214184Sgabeblack@google.com    ph_sendProbeResponseHit;
270314184Sgabeblack@google.com    pp_popProbeQueue;
270414184Sgabeblack@google.com  }
270514184Sgabeblack@google.com
270614184Sgabeblack@google.com  transition({S_F0, S_F1, S_F, Si_F0, Si_F1}, PrbShrData) {} {
270714184Sgabeblack@google.com    ph_sendProbeResponseHit;
270814184Sgabeblack@google.com    pp_popProbeQueue;
270914184Sgabeblack@google.com  }
271014184Sgabeblack@google.com
271114184Sgabeblack@google.com  transition(S_M0, PrbInvData, I_M0) {} {
271214184Sgabeblack@google.com    forward_eviction_to_cpu0;
271314184Sgabeblack@google.com    forward_eviction_to_cpu1;
271414184Sgabeblack@google.com    pim_sendProbeResponseInvMs;
271514184Sgabeblack@google.com    ib_invBothClusters;
271614184Sgabeblack@google.com    ii_invIcache;
271714184Sgabeblack@google.com    i2_invL2;
271814184Sgabeblack@google.com    a0_allocateL1D;
271914184Sgabeblack@google.com    a2_allocateL2;
272014184Sgabeblack@google.com    pp_popProbeQueue;
272114184Sgabeblack@google.com  }
272214184Sgabeblack@google.com
272314184Sgabeblack@google.com  transition(O_M0, PrbInvData, I_M0) {L2DataArrayRead} {
272414184Sgabeblack@google.com    forward_eviction_to_cpu0;
272514184Sgabeblack@google.com    forward_eviction_to_cpu1;
272614184Sgabeblack@google.com    pdm_sendProbeResponseDataMs;
272714184Sgabeblack@google.com    ib_invBothClusters;
272814184Sgabeblack@google.com    ii_invIcache;
272914184Sgabeblack@google.com    i2_invL2;
273014184Sgabeblack@google.com    a0_allocateL1D;
273114184Sgabeblack@google.com    a2_allocateL2;
273214184Sgabeblack@google.com    pp_popProbeQueue;
273314184Sgabeblack@google.com  }
273414184Sgabeblack@google.com
273514184Sgabeblack@google.com  transition({S_M0, O_M0}, {PrbInv}, I_M0) {} {
273614184Sgabeblack@google.com    forward_eviction_to_cpu0;
273714184Sgabeblack@google.com    forward_eviction_to_cpu1;
273814184Sgabeblack@google.com    pim_sendProbeResponseInvMs;
273914184Sgabeblack@google.com    ib_invBothClusters;
274014184Sgabeblack@google.com    ii_invIcache;
274114184Sgabeblack@google.com    i2_invL2;
274214184Sgabeblack@google.com    a0_allocateL1D;
274314184Sgabeblack@google.com    a2_allocateL2;
274414184Sgabeblack@google.com    pp_popProbeQueue;
274514184Sgabeblack@google.com  }
274614184Sgabeblack@google.com
274714184Sgabeblack@google.com  transition(S_M1, PrbInvData, I_M1) {} {
274814184Sgabeblack@google.com    forward_eviction_to_cpu0;
274914184Sgabeblack@google.com    forward_eviction_to_cpu1;
275014184Sgabeblack@google.com    pim_sendProbeResponseInvMs;
275114184Sgabeblack@google.com    ib_invBothClusters;
275214184Sgabeblack@google.com    ii_invIcache;
275314184Sgabeblack@google.com    i2_invL2;
275414184Sgabeblack@google.com    a1_allocateL1D;
275514184Sgabeblack@google.com    a2_allocateL2;
275614184Sgabeblack@google.com    pp_popProbeQueue;
275714184Sgabeblack@google.com  }
275814184Sgabeblack@google.com
275914184Sgabeblack@google.com  transition(O_M1, PrbInvData, I_M1) {} {
276014184Sgabeblack@google.com    forward_eviction_to_cpu0;
276114184Sgabeblack@google.com    forward_eviction_to_cpu1;
276214184Sgabeblack@google.com    pdm_sendProbeResponseDataMs;
276314184Sgabeblack@google.com    ib_invBothClusters;
276414184Sgabeblack@google.com    ii_invIcache;
276514184Sgabeblack@google.com    i2_invL2;
276614184Sgabeblack@google.com    a1_allocateL1D;
276714184Sgabeblack@google.com    a2_allocateL2;
276814184Sgabeblack@google.com    pp_popProbeQueue;
276914184Sgabeblack@google.com  }
277014184Sgabeblack@google.com
277114184Sgabeblack@google.com  transition({S_M1, O_M1}, {PrbInv}, I_M1) {} {
277214184Sgabeblack@google.com    forward_eviction_to_cpu0;
277314184Sgabeblack@google.com    forward_eviction_to_cpu1;
277414184Sgabeblack@google.com    pim_sendProbeResponseInvMs;
277514184Sgabeblack@google.com    ib_invBothClusters;
277614184Sgabeblack@google.com    ii_invIcache;
277714184Sgabeblack@google.com    i2_invL2;
277814184Sgabeblack@google.com    a1_allocateL1D;
277914184Sgabeblack@google.com    a2_allocateL2;
278014184Sgabeblack@google.com    pp_popProbeQueue;
278114184Sgabeblack@google.com  }
278214184Sgabeblack@google.com
278314184Sgabeblack@google.com  transition({S0, S0_C}, {PrbInvData, PrbInv}) {} {
278414184Sgabeblack@google.com    forward_eviction_to_cpu0;
278514184Sgabeblack@google.com    forward_eviction_to_cpu1;
278614184Sgabeblack@google.com    pi_sendProbeResponseInv;
278714184Sgabeblack@google.com    ib_invBothClusters;
278814184Sgabeblack@google.com    ii_invIcache;
278914184Sgabeblack@google.com    i2_invL2;
279014184Sgabeblack@google.com    ai_allocateL1I;
279114184Sgabeblack@google.com    a2_allocateL2;
279214184Sgabeblack@google.com    pp_popProbeQueue;
279314184Sgabeblack@google.com  }
279414184Sgabeblack@google.com
279514184Sgabeblack@google.com  transition({S1, S1_C}, {PrbInvData, PrbInv}) {}  {
279614184Sgabeblack@google.com    forward_eviction_to_cpu0;
279714184Sgabeblack@google.com    forward_eviction_to_cpu1;
279814184Sgabeblack@google.com    pi_sendProbeResponseInv;
279914184Sgabeblack@google.com    ib_invBothClusters;
280014184Sgabeblack@google.com    ii_invIcache;
280114184Sgabeblack@google.com    i2_invL2;
280214184Sgabeblack@google.com    ai_allocateL1I;
280314184Sgabeblack@google.com    a2_allocateL2;
280414184Sgabeblack@google.com    pp_popProbeQueue;
280514184Sgabeblack@google.com  }
280614184Sgabeblack@google.com
280714184Sgabeblack@google.com  transition({S_M0, S_M1}, PrbShrData) {} {
280814184Sgabeblack@google.com    ph_sendProbeResponseHit;
280914184Sgabeblack@google.com    pp_popProbeQueue;
281014184Sgabeblack@google.com  }
281114184Sgabeblack@google.com
281214184Sgabeblack@google.com  transition({O_M0, O_M1}, PrbShrData) {L2DataArrayRead} {
281314184Sgabeblack@google.com    pd_sendProbeResponseData;
281414184Sgabeblack@google.com    pp_popProbeQueue;
281514184Sgabeblack@google.com  }
281614184Sgabeblack@google.com
281714184Sgabeblack@google.com  transition({S0, S1, S0_C, S1_C}, PrbShrData) {} {
281814184Sgabeblack@google.com    pb_sendProbeResponseBackprobe;
281914184Sgabeblack@google.com    pp_popProbeQueue;
282014184Sgabeblack@google.com  }
282114184Sgabeblack@google.com
282214184Sgabeblack@google.com  transition({Ms_F0, M0_F, M1_Ms, O_F0}, PrbInvData, IF_E0S) { L2DataArrayRead} {
282314184Sgabeblack@google.com    forward_eviction_to_cpu0;
282414184Sgabeblack@google.com    forward_eviction_to_cpu1;
282514184Sgabeblack@google.com    pd_sendProbeResponseData;
282614184Sgabeblack@google.com    ib_invBothClusters;
282714184Sgabeblack@google.com    i2_invL2;
282814184Sgabeblack@google.com    a0_allocateL1D;
282914184Sgabeblack@google.com    a2_allocateL2;
283014184Sgabeblack@google.com    n_issueRdBlk;
283114184Sgabeblack@google.com    pp_popProbeQueue;
283214184Sgabeblack@google.com  }
283314184Sgabeblack@google.com
283414184Sgabeblack@google.com  transition({Ms_F1, M1_F, M0_Ms, O_F1}, PrbInvData, IF_E1S) {L2DataArrayRead} {
283514184Sgabeblack@google.com    forward_eviction_to_cpu0;
283614184Sgabeblack@google.com    forward_eviction_to_cpu1;
283714184Sgabeblack@google.com    pd_sendProbeResponseData;
283814184Sgabeblack@google.com    ib_invBothClusters;
283914184Sgabeblack@google.com    i2_invL2;
284014184Sgabeblack@google.com    a1_allocateL1D;
284114184Sgabeblack@google.com    a2_allocateL2;
284214184Sgabeblack@google.com    n_issueRdBlk;
284314184Sgabeblack@google.com    pp_popProbeQueue;
284414184Sgabeblack@google.com  }
284514184Sgabeblack@google.com
284614184Sgabeblack@google.com  transition({Ms_F, O_F}, PrbInvData, IF_ES) {L2DataArrayRead} {
284714184Sgabeblack@google.com    forward_eviction_to_cpu0;
284814184Sgabeblack@google.com    forward_eviction_to_cpu1;
284914184Sgabeblack@google.com    pd_sendProbeResponseData;
285014184Sgabeblack@google.com    ib_invBothClusters;
285114184Sgabeblack@google.com    i2_invL2;
285214184Sgabeblack@google.com    a0_allocateL1D;
285314184Sgabeblack@google.com    a1_allocateL1D;
285414184Sgabeblack@google.com    a2_allocateL2;
285514184Sgabeblack@google.com    n_issueRdBlk;
285614184Sgabeblack@google.com    pp_popProbeQueue;
285714184Sgabeblack@google.com  }
285814184Sgabeblack@google.com
285914184Sgabeblack@google.com  transition({Ms_F0, M0_F, M1_Ms, O_F0}, PrbInv, IF_E0S) {} {
286014184Sgabeblack@google.com    forward_eviction_to_cpu0;
286114184Sgabeblack@google.com    forward_eviction_to_cpu1;
286214184Sgabeblack@google.com    pi_sendProbeResponseInv;
286314184Sgabeblack@google.com    ib_invBothClusters;
286414184Sgabeblack@google.com    i2_invL2;
286514184Sgabeblack@google.com    a0_allocateL1D;
286614184Sgabeblack@google.com    a2_allocateL2;
286714184Sgabeblack@google.com    n_issueRdBlk;
286814184Sgabeblack@google.com    pp_popProbeQueue;
286914184Sgabeblack@google.com  }
287014184Sgabeblack@google.com
287114184Sgabeblack@google.com  transition({Ms_F1, M1_F, M0_Ms, O_F1}, PrbInv, IF_E1S) {} {
287214184Sgabeblack@google.com    forward_eviction_to_cpu0;
287314184Sgabeblack@google.com    forward_eviction_to_cpu1;
287414184Sgabeblack@google.com    pi_sendProbeResponseInv;
287514184Sgabeblack@google.com    ib_invBothClusters;
287614184Sgabeblack@google.com    i2_invL2;
287714184Sgabeblack@google.com    a1_allocateL1D;
287814184Sgabeblack@google.com    a2_allocateL2;
287914184Sgabeblack@google.com    n_issueRdBlk;
288014184Sgabeblack@google.com    pp_popProbeQueue;
288114184Sgabeblack@google.com  }
288214184Sgabeblack@google.com
288314184Sgabeblack@google.com  transition({Ms_F, O_F}, PrbInv, IF_ES) {} {
288414184Sgabeblack@google.com    forward_eviction_to_cpu0;
288514184Sgabeblack@google.com    forward_eviction_to_cpu1;
288614184Sgabeblack@google.com    pi_sendProbeResponseInv;
288714184Sgabeblack@google.com    ib_invBothClusters;
288814184Sgabeblack@google.com    i2_invL2;
288914184Sgabeblack@google.com    a0_allocateL1D;
289014184Sgabeblack@google.com    a1_allocateL1D;
289114184Sgabeblack@google.com    a2_allocateL2;
289214184Sgabeblack@google.com    n_issueRdBlk;
289314184Sgabeblack@google.com    pp_popProbeQueue;
289414184Sgabeblack@google.com  }
289514184Sgabeblack@google.com
289614184Sgabeblack@google.com  transition({Ms_F0, M0_F, M1_Ms}, PrbShrData, O_F0) {L2DataArrayRead} {
289714184Sgabeblack@google.com    pd_sendProbeResponseData;
289814184Sgabeblack@google.com    pp_popProbeQueue;
289914184Sgabeblack@google.com  }
290014184Sgabeblack@google.com
290114184Sgabeblack@google.com  transition({Ms_F1, M1_F, M0_Ms}, PrbShrData, O_F1) {} {
290214184Sgabeblack@google.com  }
290314184Sgabeblack@google.com
290414184Sgabeblack@google.com  transition({Ms_F}, PrbShrData, O_F) {L2DataArrayRead} {
290514184Sgabeblack@google.com    pd_sendProbeResponseData;
290614184Sgabeblack@google.com    pp_popProbeQueue;
290714184Sgabeblack@google.com  }
290814184Sgabeblack@google.com
290914184Sgabeblack@google.com  transition({O_F0, O_F1, O_F}, PrbShrData) {L2DataArrayRead} {
291014184Sgabeblack@google.com    pd_sendProbeResponseData;
291114184Sgabeblack@google.com    pp_popProbeQueue;
291214184Sgabeblack@google.com  }
291314184Sgabeblack@google.com
291414184Sgabeblack@google.com  // END TRANSITIONS
291514184Sgabeblack@google.com}
291614184Sgabeblack@google.com
291714184Sgabeblack@google.com
2918