diff options
Diffstat (limited to 'src/mem/protocol/MOESI_CMP_token-L1cache.sm')
-rw-r--r-- | src/mem/protocol/MOESI_CMP_token-L1cache.sm | 140 |
1 files changed, 70 insertions, 70 deletions
diff --git a/src/mem/protocol/MOESI_CMP_token-L1cache.sm b/src/mem/protocol/MOESI_CMP_token-L1cache.sm index 89b21e2f6..935fe03c7 100644 --- a/src/mem/protocol/MOESI_CMP_token-L1cache.sm +++ b/src/mem/protocol/MOESI_CMP_token-L1cache.sm @@ -142,7 +142,7 @@ machine(L1Cache, "Token protocol") // TBE fields structure(TBE, desc="...") { - Address address, desc="Physical address for this TBE"; + Address Addr, desc="Physical address for this TBE"; State TBEState, desc="Transient state"; int IssueCount, default="0", desc="The number of times we've issued a request for this line."; Address PC, desc="Program counter of request"; @@ -151,7 +151,7 @@ machine(L1Cache, "Token protocol") bool ExternalResponse, default="false", desc="Response came from an external controller"; bool IsAtomic, default="false", desc="Request was an atomic request"; - AccessType AccessType, desc="Type of request (used for profiling)"; + AccessType TypeOfAccess, desc="Type of request (used for profiling)"; Cycles IssueTime, desc="Time the request was issued"; RubyAccessMode AccessMode, desc="user/supervisor access type"; PrefetchBit Prefetch, desc="Is this a prefetch request"; @@ -485,47 +485,47 @@ machine(L1Cache, "Token protocol") // Persistent Network in_port(persistentNetwork_in, PersistentMsg, persistentToL1Cache, rank=3) { if (persistentNetwork_in.isReady()) { - peek(persistentNetwork_in, PersistentMsg, block_on="Address") { + peek(persistentNetwork_in, PersistentMsg, block_on="Addr") { assert(in_msg.Destination.isElement(machineID)); // Apply the lockdown or unlockdown message to the table if (in_msg.Type == PersistentRequestType:GETX_PERSISTENT) { - persistentTable.persistentRequestLock(in_msg.Address, in_msg.Requestor, AccessType:Write); + persistentTable.persistentRequestLock(in_msg.Addr, in_msg.Requestor, AccessType:Write); } else if (in_msg.Type == PersistentRequestType:GETS_PERSISTENT) { - persistentTable.persistentRequestLock(in_msg.Address, in_msg.Requestor, AccessType:Read); + persistentTable.persistentRequestLock(in_msg.Addr, in_msg.Requestor, AccessType:Read); } else if (in_msg.Type == PersistentRequestType:DEACTIVATE_PERSISTENT) { - persistentTable.persistentRequestUnlock(in_msg.Address, in_msg.Requestor); + persistentTable.persistentRequestUnlock(in_msg.Addr, in_msg.Requestor); } else { error("Unexpected message"); } // React to the message based on the current state of the table - Entry cache_entry := getCacheEntry(in_msg.Address); - TBE tbe := L1_TBEs[in_msg.Address]; + Entry cache_entry := getCacheEntry(in_msg.Addr); + TBE tbe := L1_TBEs[in_msg.Addr]; - if (persistentTable.isLocked(in_msg.Address)) { - if (persistentTable.findSmallest(in_msg.Address) == machineID) { + if (persistentTable.isLocked(in_msg.Addr)) { + if (persistentTable.findSmallest(in_msg.Addr) == machineID) { // Our Own Lock - this processor is highest priority - trigger(Event:Own_Lock_or_Unlock, in_msg.Address, + trigger(Event:Own_Lock_or_Unlock, in_msg.Addr, cache_entry, tbe); } else { - if (persistentTable.typeOfSmallest(in_msg.Address) == AccessType:Read) { + if (persistentTable.typeOfSmallest(in_msg.Addr) == AccessType:Read) { if (getTokens(cache_entry) == 1 || getTokens(cache_entry) == (max_tokens() / 2) + 1) { - trigger(Event:Persistent_GETS_Last_Token, in_msg.Address, + trigger(Event:Persistent_GETS_Last_Token, in_msg.Addr, cache_entry, tbe); } else { - trigger(Event:Persistent_GETS, in_msg.Address, + trigger(Event:Persistent_GETS, in_msg.Addr, cache_entry, tbe); } } else { - trigger(Event:Persistent_GETX, in_msg.Address, + trigger(Event:Persistent_GETX, in_msg.Addr, cache_entry, tbe); } } } else { // Unlock case - no entries in the table - trigger(Event:Own_Lock_or_Unlock, in_msg.Address, + trigger(Event:Own_Lock_or_Unlock, in_msg.Addr, cache_entry, tbe); } } @@ -535,43 +535,43 @@ machine(L1Cache, "Token protocol") // Response Network in_port(responseNetwork_in, ResponseMsg, responseToL1Cache, rank=2) { if (responseNetwork_in.isReady()) { - peek(responseNetwork_in, ResponseMsg, block_on="Address") { + peek(responseNetwork_in, ResponseMsg, block_on="Addr") { assert(in_msg.Destination.isElement(machineID)); - Entry cache_entry := getCacheEntry(in_msg.Address); - TBE tbe := L1_TBEs[in_msg.Address]; + Entry cache_entry := getCacheEntry(in_msg.Addr); + TBE tbe := L1_TBEs[in_msg.Addr]; // Mark TBE flag if response received off-chip. Use this to update average latency estimate if ( machineIDToMachineType(in_msg.Sender) == MachineType:L2Cache ) { - if (in_msg.Sender == mapAddressToRange(in_msg.Address, + if (in_msg.Sender == mapAddressToRange(in_msg.Addr, MachineType:L2Cache, l2_select_low_bit, l2_select_num_bits)) { // came from an off-chip L2 cache if (is_valid(tbe)) { - // L1_TBEs[in_msg.Address].ExternalResponse := true; - // profile_offchipL2_response(in_msg.Address); + // L1_TBEs[in_msg.Addr].ExternalResponse := true; + // profile_offchipL2_response(in_msg.Addr); } } else { - // profile_onchipL2_response(in_msg.Address ); + // profile_onchipL2_response(in_msg.Addr ); } } else if ( machineIDToMachineType(in_msg.Sender) == MachineType:Directory ) { if (is_valid(tbe)) { setExternalResponse(tbe); - // profile_memory_response( in_msg.Address); + // profile_memory_response( in_msg.Addr); } } else if ( machineIDToMachineType(in_msg.Sender) == MachineType:L1Cache) { //if (isLocalProcessor(machineID, in_msg.Sender) == false) { //if (is_valid(tbe)) { // tbe.ExternalResponse := true; - // profile_offchipL1_response(in_msg.Address ); + // profile_offchipL1_response(in_msg.Addr ); //} //} //else { - // profile_onchipL1_response(in_msg.Address ); + // profile_onchipL1_response(in_msg.Addr ); //} } else { error("unexpected SenderMachine"); @@ -581,21 +581,21 @@ machine(L1Cache, "Token protocol") if (getTokens(cache_entry) + in_msg.Tokens != max_tokens()) { if (in_msg.Type == CoherenceResponseType:ACK) { assert(in_msg.Tokens < (max_tokens() / 2)); - trigger(Event:Ack, in_msg.Address, cache_entry, tbe); + trigger(Event:Ack, in_msg.Addr, cache_entry, tbe); } else if (in_msg.Type == CoherenceResponseType:DATA_OWNER) { - trigger(Event:Data_Owner, in_msg.Address, cache_entry, tbe); + trigger(Event:Data_Owner, in_msg.Addr, cache_entry, tbe); } else if (in_msg.Type == CoherenceResponseType:DATA_SHARED) { assert(in_msg.Tokens < (max_tokens() / 2)); - trigger(Event:Data_Shared, in_msg.Address, cache_entry, tbe); + trigger(Event:Data_Shared, in_msg.Addr, cache_entry, tbe); } else { error("Unexpected message"); } } else { if (in_msg.Type == CoherenceResponseType:ACK) { assert(in_msg.Tokens < (max_tokens() / 2)); - trigger(Event:Ack_All_Tokens, in_msg.Address, cache_entry, tbe); + trigger(Event:Ack_All_Tokens, in_msg.Addr, cache_entry, tbe); } else if (in_msg.Type == CoherenceResponseType:DATA_OWNER || in_msg.Type == CoherenceResponseType:DATA_SHARED) { - trigger(Event:Data_All_Tokens, in_msg.Address, cache_entry, tbe); + trigger(Event:Data_All_Tokens, in_msg.Addr, cache_entry, tbe); } else { error("Unexpected message"); } @@ -607,40 +607,40 @@ machine(L1Cache, "Token protocol") // Request Network in_port(requestNetwork_in, RequestMsg, requestToL1Cache) { if (requestNetwork_in.isReady()) { - peek(requestNetwork_in, RequestMsg, block_on="Address") { + peek(requestNetwork_in, RequestMsg, block_on="Addr") { assert(in_msg.Destination.isElement(machineID)); - Entry cache_entry := getCacheEntry(in_msg.Address); - TBE tbe := L1_TBEs[in_msg.Address]; + Entry cache_entry := getCacheEntry(in_msg.Addr); + TBE tbe := L1_TBEs[in_msg.Addr]; if (in_msg.Type == CoherenceRequestType:GETX) { if (in_msg.isLocal) { - trigger(Event:Transient_Local_GETX, in_msg.Address, + trigger(Event:Transient_Local_GETX, in_msg.Addr, cache_entry, tbe); } else { - trigger(Event:Transient_GETX, in_msg.Address, + trigger(Event:Transient_GETX, in_msg.Addr, cache_entry, tbe); } } else if (in_msg.Type == CoherenceRequestType:GETS) { if (getTokens(cache_entry) == 1 || getTokens(cache_entry) == (max_tokens() / 2) + 1) { if (in_msg.isLocal) { - trigger(Event:Transient_Local_GETS_Last_Token, in_msg.Address, + trigger(Event:Transient_Local_GETS_Last_Token, in_msg.Addr, cache_entry, tbe); } else { - trigger(Event:Transient_GETS_Last_Token, in_msg.Address, + trigger(Event:Transient_GETS_Last_Token, in_msg.Addr, cache_entry, tbe); } } else { if (in_msg.isLocal) { - trigger(Event:Transient_Local_GETS, in_msg.Address, + trigger(Event:Transient_Local_GETS, in_msg.Addr, cache_entry, tbe); } else { - trigger(Event:Transient_GETS, in_msg.Address, + trigger(Event:Transient_GETS, in_msg.Addr, cache_entry, tbe); } } @@ -740,7 +740,7 @@ machine(L1Cache, "Token protocol") // Issue a persistent request if possible if (okToIssueStarving(address, machineID) && (starving == false)) { enqueue(persistentNetwork_out, PersistentMsg, latency = l1_request_latency) { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Type := PersistentRequestType:GETS_PERSISTENT; out_msg.Requestor := machineID; out_msg.Destination.broadcast(MachineType:L1Cache); @@ -766,7 +766,7 @@ machine(L1Cache, "Token protocol") starving := true; if (tbe.IssueCount == 0) { - //profile_persistent_prediction(address, tbe.AccessType); + //profile_persistent_prediction(address, tbe.TypeOfAccess); } // Update outstanding requests @@ -793,7 +793,7 @@ machine(L1Cache, "Token protocol") } else { // Make a normal request enqueue(requestNetwork_out, RequestMsg, latency = l1_request_latency) { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Type := CoherenceRequestType:GETS; out_msg.Requestor := machineID; out_msg.Destination.add(mapAddressToRange(address, @@ -813,7 +813,7 @@ machine(L1Cache, "Token protocol") // send to other local L1s, with local bit set enqueue(requestNetwork_out, RequestMsg, latency = l1_request_latency) { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Type := CoherenceRequestType:GETS; out_msg.Requestor := machineID; // @@ -861,7 +861,7 @@ machine(L1Cache, "Token protocol") // Issue a persistent request if possible if ( okToIssueStarving(address, machineID) && (starving == false)) { enqueue(persistentNetwork_out, PersistentMsg, latency = l1_request_latency) { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Type := PersistentRequestType:GETX_PERSISTENT; out_msg.Requestor := machineID; out_msg.Destination.broadcast(MachineType:L1Cache); @@ -891,7 +891,7 @@ machine(L1Cache, "Token protocol") outstandingPersistentRequests := outstandingPersistentRequests + 1; if (tbe.IssueCount == 0) { - //profile_persistent_prediction(address, tbe.AccessType); + //profile_persistent_prediction(address, tbe.TypeOfAccess); } // Increment IssueCount @@ -914,7 +914,7 @@ machine(L1Cache, "Token protocol") } else { // Make a normal request enqueue(requestNetwork_out, RequestMsg, latency = l1_request_latency) { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Type := CoherenceRequestType:GETX; out_msg.Requestor := machineID; @@ -936,7 +936,7 @@ machine(L1Cache, "Token protocol") // send to other local L1s too enqueue(requestNetwork_out, RequestMsg, latency = l1_request_latency) { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Type := CoherenceRequestType:GETX; out_msg.Requestor := machineID; out_msg.isLocal := true; @@ -977,7 +977,7 @@ machine(L1Cache, "Token protocol") peek(responseNetwork_in, ResponseMsg) { // FIXME, should use a 3rd vnet enqueue(responseNetwork_out, ResponseMsg, latency="1") { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Type := in_msg.Type; out_msg.Sender := machineID; out_msg.Destination.add(map_Address_to_Directory(address)); @@ -992,7 +992,7 @@ machine(L1Cache, "Token protocol") action(c_ownedReplacement, "c", desc="Issue writeback") { assert(is_valid(cache_entry)); enqueue(responseNetwork_out, ResponseMsg, latency = l1_response_latency) { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Sender := machineID; out_msg.Destination.add(mapAddressToRange(address, @@ -1017,7 +1017,7 @@ machine(L1Cache, "Token protocol") assert(is_valid(cache_entry)); assert (cache_entry.Tokens > 0); enqueue(responseNetwork_out, ResponseMsg, latency = l1_response_latency) { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Sender := machineID; out_msg.Destination.add(mapAddressToRange(address, @@ -1040,7 +1040,7 @@ machine(L1Cache, "Token protocol") assert(is_valid(cache_entry)); if (cache_entry.Tokens > 0) { enqueue(responseNetwork_out, ResponseMsg, latency = l1_response_latency) { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Sender := machineID; out_msg.Destination.add(mapAddressToRange(address, @@ -1066,7 +1066,7 @@ machine(L1Cache, "Token protocol") assert(is_valid(cache_entry)); peek(requestNetwork_in, RequestMsg) { enqueue(responseNetwork_out, ResponseMsg, latency = l1_response_latency) { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Type := CoherenceResponseType:DATA_SHARED; out_msg.Sender := machineID; out_msg.Destination.add(in_msg.Requestor); @@ -1090,7 +1090,7 @@ machine(L1Cache, "Token protocol") peek(requestNetwork_in, RequestMsg) { if (cache_entry.Tokens > (N_tokens + (max_tokens() / 2))) { enqueue(responseNetwork_out, ResponseMsg, latency = l1_response_latency) { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Type := CoherenceResponseType:DATA_SHARED; out_msg.Sender := machineID; out_msg.Destination.add(in_msg.Requestor); @@ -1108,7 +1108,7 @@ machine(L1Cache, "Token protocol") } else if (cache_entry.Tokens > 1) { enqueue(responseNetwork_out, ResponseMsg, latency = l1_response_latency) { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Type := CoherenceResponseType:DATA_SHARED; out_msg.Sender := machineID; out_msg.Destination.add(in_msg.Requestor); @@ -1132,7 +1132,7 @@ machine(L1Cache, "Token protocol") peek(requestNetwork_in, RequestMsg) { assert(is_valid(cache_entry)); enqueue(responseNetwork_out, ResponseMsg, latency = l1_response_latency) { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Type := CoherenceResponseType:DATA_OWNER; out_msg.Sender := machineID; out_msg.Destination.add(in_msg.Requestor); @@ -1155,7 +1155,7 @@ machine(L1Cache, "Token protocol") assert(is_valid(cache_entry)); if (cache_entry.Tokens > 0) { enqueue(responseNetwork_out, ResponseMsg, latency = l1_response_latency) { - out_msg.Address := address; + out_msg.Addr := address; if (cache_entry.Tokens > (max_tokens() / 2)) { out_msg.Type := CoherenceResponseType:DATA_OWNER; } else { @@ -1177,7 +1177,7 @@ machine(L1Cache, "Token protocol") assert(is_valid(cache_entry)); assert(cache_entry.Tokens > 0); enqueue(responseNetwork_out, ResponseMsg, latency = l1_response_latency) { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Type := CoherenceResponseType:DATA_OWNER; out_msg.Sender := machineID; out_msg.Destination.add(persistentTable.findSmallest(address)); @@ -1196,7 +1196,7 @@ machine(L1Cache, "Token protocol") assert(cache_entry.Tokens > 0); if (cache_entry.Tokens > 1) { enqueue(responseNetwork_out, ResponseMsg, latency = l1_response_latency) { - out_msg.Address := address; + out_msg.Addr := address; if (cache_entry.Tokens > (max_tokens() / 2)) { out_msg.Type := CoherenceResponseType:DATA_OWNER; } else { @@ -1226,7 +1226,7 @@ machine(L1Cache, "Token protocol") assert(is_valid(cache_entry)); assert(cache_entry.Tokens > ((max_tokens() / 2) + 1)); enqueue(responseNetwork_out, ResponseMsg, latency = l1_response_latency) { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Type := CoherenceResponseType:DATA_OWNER; out_msg.Sender := machineID; out_msg.Destination.add(persistentTable.findSmallest(address)); @@ -1251,7 +1251,7 @@ machine(L1Cache, "Token protocol") assert(is_valid(cache_entry)); assert(cache_entry.Tokens == ((max_tokens() / 2) + 1)); enqueue(responseNetwork_out, ResponseMsg, latency = l1_response_latency) { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Type := CoherenceResponseType:DATA_OWNER; out_msg.Sender := machineID; out_msg.Destination.add(persistentTable.findSmallest(address)); @@ -1271,7 +1271,7 @@ machine(L1Cache, "Token protocol") // assert(persistentTable.findSmallest(address) != id); // Make sure we never bounce tokens to ourself // FIXME, should use a 3rd vnet in some cases enqueue(responseNetwork_out, ResponseMsg, latency="1") { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Type := in_msg.Type; out_msg.Sender := machineID; out_msg.Destination.add(persistentTable.findSmallest(address)); @@ -1343,7 +1343,7 @@ machine(L1Cache, "Token protocol") tbe.IssueCount := 0; peek(mandatoryQueue_in, RubyRequest) { tbe.PC := in_msg.ProgramCounter; - tbe.AccessType := cache_request_type_to_access_type(in_msg.Type); + tbe.TypeOfAccess := cache_request_type_to_access_type(in_msg.Type); if (in_msg.Type == RubyRequestType:ATOMIC) { tbe.IsAtomic := true; } @@ -1391,7 +1391,7 @@ machine(L1Cache, "Token protocol") action(p_informL2AboutTokenLoss, "p", desc="Inform L2 about loss of all tokens") { enqueue(responseNetwork_out, ResponseMsg, latency = l1_response_latency) { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Type := CoherenceResponseType:INV; out_msg.Tokens := 0; out_msg.Sender := machineID; @@ -1410,7 +1410,7 @@ machine(L1Cache, "Token protocol") assert(is_valid(cache_entry)); assert(in_msg.Tokens != 0); DPRINTF(RubySlicc, "L1 received tokens for address: %s, tokens: %d\n", - in_msg.Address, in_msg.Tokens); + in_msg.Addr, in_msg.Tokens); cache_entry.Tokens := cache_entry.Tokens + in_msg.Tokens; DPRINTF(RubySlicc, "%d\n", cache_entry.Tokens); @@ -1427,7 +1427,7 @@ machine(L1Cache, "Token protocol") // assert(starving == true); outstandingRequests := outstandingRequests - 1; enqueue(persistentNetwork_out, PersistentMsg, latency = l1_request_latency) { - out_msg.Address := address; + out_msg.Addr := address; out_msg.Type := PersistentRequestType:DEACTIVATE_PERSISTENT; out_msg.Requestor := machineID; out_msg.Destination.broadcast(MachineType:L1Cache); @@ -1459,13 +1459,13 @@ machine(L1Cache, "Token protocol") // Profile //if (tbe.WentPersistent) { - // profile_token_retry(address, tbe.AccessType, 2); + // profile_token_retry(address, tbe.TypeOfAccess, 2); //} //else { - // profile_token_retry(address, tbe.AccessType, 1); + // profile_token_retry(address, tbe.TypeOfAccess, 1); //} - //profile_token_retry(address, tbe.AccessType, tbe.IssueCount); + //profile_token_retry(address, tbe.TypeOfAccess, tbe.IssueCount); L1_TBEs.deallocate(address); unset_tbe(); } @@ -1475,7 +1475,7 @@ machine(L1Cache, "Token protocol") if (cache_entry.Tokens > 0) { peek(requestNetwork_in, RequestMsg) { enqueue(responseNetwork_out, ResponseMsg, latency = l1_response_latency) { - out_msg.Address := address; + out_msg.Addr := address; if (cache_entry.Tokens > (max_tokens() / 2)) { out_msg.Type := CoherenceResponseType:DATA_OWNER; } else { |