next up previous contents
Next: Processing L2 tag array Up: Processing L1 cache actions Previous: Handling REPLY type

Handling COHE type

 

The types of incoming COHE transactions understood by the L1 cache are COPYBACK, COPYBACK_INVL, INVL, and WRB (as indicated by the req_type field of the message). The first three are described as coherence transactions in Section 12.2. The latter is used to enforce inclusion on the L2 replacement of an exclusive line. (Note that the L1 cache cannot receive a COHE_REPLY from any module.)

Step 1: Determining if COHE hits in cache or matches an MSHR

If the message being handled is an incoming COHE transaction, L1ProcessTagReq starts by calling notpres and notpres_mshr to determine the status of the line in the cache. For COHE messages, notpres_mshr starts out by checking to see if the line is being held in any of the outstanding MSHRs.

Step 1a: Behavior of notpres_mshr when COHE does not match MSHR

If the incoming coherence message does not match any MSHR, the function immediately returns NOMSHR to indicate that no MSHR was involved in the transaction.

Step 1b: Behavior of notpres_mshr when COHE matches MSHR

If a COHE matches an MSHR, the response of notpres_mshr depends upon the type of MSHR and the type of coherence transaction.

Step 1b/i: Matching MSHR is for a read miss

If the MSHR is for a read miss, the reply may come back in either shared or exclusive state. Thus, the type of COHE determines whether or not this message can be processed.

If the coherence message demands a copyback (COPYBACK or COPYBACK_INVL), the directory still considered this cache to be the owner of the line at the time of the message. Thus, the cache either had previously been the owner or is going to be the owner because of an exclusive REPLY. Because of the latter possibility, this response must be a NACK_PEND so that the sender can either retry the coherence message, reprocess the original REQUEST that caused the coherence message, or simply drop the COHE (in the case of WRB subset enforcement messages where the L2 cache request is already stalling at an MSHR). notpres_mshr returns a response of MSHR_COAL.

If the coherence message does not require a copyback (INVL or WRB), the invalidation message can be merged with the MSHR for later processing. In the case of an INVL, the message can receive a positive acknowledgment of REPLY (indicating that the COHE will be acted upon). If the incoming COHE is a WRB, the response is sent as a negative acknowledgment to the L2 cache (indicating to the L2 cache that no data is being provided by the L1). In the INVL case, notpres_mshr returns MSHR_COAL, while the WRB case sees a return value of NOMSHR.

Step 1b/ii: Matching MSHR is for a write miss or upgrade

If the MSHR is for a write miss or upgrade, however, the message must be handled differently.

If the request demands a data copyback from a write-back cache, the request must be sent back with a NACK_PEND. If the request is a type that seeks a data copyback, but the cache is write-through, the request is handled by acknowledging the message and handling it later. In either case, this function returns MSHR_COAL.

On the other hand, if the request does not demand a data copyback, it must have originated before the private request was serviced. Thus, the coherence action can be done immediately and returned with a NACK. If the line was being upgraded, it can still be unlocked and invalidated here: the directory must convert the processor's UPGRADE request to a READ_OWN when it realizes that the processor doesn't actually have the line it wants. notpres_mshr returns MSHR_FWD.

Step 2: Processing based on the results of notpres_mshr

If notpres_mshr returns NOMSHR, the response depends on whether or not the line is in cache. If the line is a cache miss, the COHE is NACKed. If the line is a cache hit and the COHE message is of type WRB, the message is NACKed if the line is held in a state other than PR_DY and positively acknowledged if the line is in PR_DY. Either way, the line is invalidated. If the access is a cache hit and not a WRB, the cache line state is changed according to the results of the coherence function and the message is positively acknowledged. In each of the NOMSHR cases, SpecLoadBufCohe is called if the coherence type indicates an invalidation, even if the line is not present in the L1 cache (as such a message may indicate an L2 invalidation or replacement).

If notpres_mshr returns MSHR_COAL, L1ProcessTagReq first sends the coherence message to SpecLoadBufCohe if the system implements speculative load execution and the message conveys an invalidation. If the cache is write-through or the COHE does not demand a copyback, it is positively acknowledged. Otherwise, the COHE will receive a NACK_PEND response.

If notpres_mshr returns MSHR_FWD, the COHE receives a response of either NACK_PEND (for WRB requests) or NACK (for other message types). If the request indicates an invalidation and the system implements speculative load execution, L1ProcessTagReq sends the coherence message to SpecLoadBufCohe. Additionally, if the line is present in the cache, this case removes the mshr_out field from the line and invalidates it, thus removing the line from the cache even in a case formerly considered an upgrade.

In all of the above cases for COHE messages, L1ProcessTagReq returns success if the COHE_REPLY can be sent down immediately. If not, the cache will try to resend the COHE_REPLY until it is accepted by its port.


next up previous contents
Next: Processing L2 tag array Up: Processing L1 cache actions Previous: Handling REPLY type

Vijay Sadananda Pai
Thu Aug 7 14:18:56 CDT 1997