Apparatus and method to prevent overwriting of modified cache entries prior to write back
AssigneeSun Mocrosystems, Inc.
InventorsAnuradha N. Moudgal, Belliappa M. Kuttanna
Life of this patent
Estimating the term…
Abstract
A hazard control circuit for a cache controller that prevents overwriting of modified cache data without write back. The cache controller controls a non-blocking, N-way set associative cache that uses a write-back cache-coherency protocol. The hazard control circuit prevents data loss by deferring assignment until after completion of a pending fill for that way. The hazard control circuit of the present invention includes a transit hazard buffer, a stall assertion circuit and a way assignment circuit.
Claims11
Hazard control circuitry for a cache controller using a write-back invalidate protocol, the cache controller controlling a non-blocking, N-way set associative cache having a multiplicity of indexes, the hazard control circuitry comprising:
- a buffer operative with the cache controller for tracking pending cache accesses, the buffer having an entry for each pending cache access, each entry including an index identifier, an index counter, and a set of index lock bits, the index identifier identifying an index of the cache to be accessed by the pending cache access, the index counter indicating a number of pending cache accesses to the identified index, the index counter being decremented for each pending cache access to the identified index, the index counter being incremented for each completed cache access to the identified index, the set of index lock bits indicating for the identified index whether each way is locked;
- and
- a stall assertion circuit coupled to the buffer for asserting a stall signal coupled to the cache controller, the stall assertion circuit asserting the stall signal whenever a first index counter for a first index indicates that there are N cache accesses pending for the first index, assertion of the stall signal causing the cache controller to stall selection of cache access requests.
A method of preventing overwriting of modified data stored in a way of a first cache index of a non-blocking, N-way set associative cache without a write back, the cache having a plurality of cache indexes comprising the first cache index and a plurality of lock bits comprising a first set of lock bits associated with the first cache index, the cache being associated with a processor of a multi-processor system, the method comprising:
- a) receiving a first cache access request for the first cache index;
- b) in response to receiving the first cache access request, updating a first index counter associated with the first cache index;
- c) initiating a stall of the cache controller if the first index counter indicates that N cache access requests are pending for the first cache index, causing the cache controller to stall selection of cache access requests;
- d) updating the first index counter for each completed cache access to the first cache index;
- and
- e) setting the first set of lock bits to indicate whether each way of the first cache index is locked.
A method of preventing overwriting of modified data stored in a way of a first cache index of a non-blocking, N-way set associative cache without a write back, the cache having a multiplicity of indexes, the cache being associated with a processor of a multi-processor system using a write-invalidate protocol using a modified state and an invalid state, the method comprising the steps of:
- a) receiving notice of a first cache access request for the first cache index;
- b) in response to receiving the notice, updating a first index counter associated with the first cache index;
- c) initiating a stall of the cache controller if the first index counter indicates that N cache access requests are pending for the first cache index;
- d) assigning a first way of the first cache index when the first cache access request misses using a first set of lock bits associated with the first cache index, the first set of lock bits including a bit for each way of the N-way set associative cache, each bit of the first set of lock bits indicating whether an associated way is available;
- and
- e) locking a first bit of the first set of lock bits.
Hazard control circuitry for a cache controller using a write-invalidate cache-coherency protocol, the cache controller controlling a non-blocking, N-way set associative cache having a multiplicity of indexes, the hazard control circuitry comprising:
- a) a buffer operative with the cache controller for tracking pending cache accesses, the buffer having an entry for each pending cache access, each entry including an index identifier, an index counter, and a set of index lock bits, the index identifier identifying an index of the cache to be accessed by the pending cache access, the index counter indicating a number of pending cache accesses to the identified index, the index counter being decremented for each pending cache access to the identified index, the index counter being incremented for each completed cache access to the identified index, the set of index lock bits indicating for the identified index whether each way is available for a fill;
- b) a stall assertion circuit coupled to the buffer for asserting a stall signal coupled to the cache controller, the stall assertion circuit asserting the stall signal whenever a first index counter for a first index indicates that there are N cache accesses pending for the first index, assertion of the stall signal causing the cache controller to stall selection of cache access requests, the stall assertion circuit deasserting the stall signal when the index counter indicates that there are no longer N cache accesses pending for the first index;
- and
- c) an assignment circuit for assigning a way of the first index for a cache access request, the assignment circuit being coupled to the set of index lock bits, the assignment circuit assigning an unlocked way of the first index for a cache access request to the first index.
Hazard control circuitry for a cache controller using a write-back invalidate protocol, the cache controller controlling a non-blocking, N-way set associative cache having a multiplicity of indexes, the hazard control circuitry comprising:
- a buffer operative with the cache controller for tracking pending cache accesses, the buffer having an entry for each pending cache access, each entry including an index identifier, an index counter, and a set of index lock bits, the index identifier identifying an index of the cache to be accessed by the pending cache access, the index counter indicating a number of pending cache accesses to the identified index, the index counter being updated in a first manner for each pending cache access to the identified index, the index counter being updated in a second manner for each completed cache access to the identified index, the set of index lock bits indicating for the identified index whether each way is locked;
- and
- a stall assertion circuit coupled to the buffer for asserting a stall signal coupled to the cache controller, the stall assertion circuit asserting the stall signal whenever a first index counter for a first index indicates that there are N cache accesses pending for the first index, assertion of the stall signal causing the cache controller to stall selection of cache access requests.
Dependencies are inferred from the claim text.