Claims
- 1. A master-slave cache system comprising:
- a master cache for storing data from a memory, the master cache being arranged as a plurality of cache lines each containing a cache line of data, wherein a datum in the master cache is only valid when all data in an entire cache line containing the datum is present in the master cache, the master cache not allowing a subset of the cache line to be valid;
- a slave cache for supplying data to a pipeline of a processor, the slave cache being arranged as a plurality of cache lines each containing a cache line of data, wherein a single datum in a first cache line in the plurality of cache lines is capable of being valid when other data in the first cache line are not valid, the slave cache allowing a subset of any cache line to be valid;
- slave sub-line valid means coupled to each cache line in the slave cache, for indicating a valid portion of a cache line which contains valid data and for indicating an invalid portion of the cache line which does not contain valid data, the invalid portion of the cache line not being useable by the pipeline of the processor; and
- transfer means, coupled between the master cache and the slave cache, for transferring a datum comprising a sub-line of data for a requesting cache line from the master cache to the slave cache, the transfer means including sub-line valid transfer means, coupled to the slave sub-line valid means, for transferring to the master cache a sub-line valid indication of the valid portion of the requesting cache line,
- whereby the sub-line valid indication of the valid portion of the requesting cache line in the slave cache is sent from the slave cache to the master cache.
- 2. The master-slave cache system of claim 1 further comprising:
- update means, in the master cache, receiving the sub-line valid indication from the slave cache, for updating the sub-line valid indication to generate an updated sub-line valid indication, the updated sub-line valid indication having an indication of an additional portion of the requesting cache line being valid when an other pending request in the master cache is a request to transfer the additional portion of the requesting cache line to the slave cache,
- whereby the sub-line valid indication is sent from the slave cache to the master cache, the master cache updating the sub-line valid indication for the additional portion of the requesting cache line transferred by the other pending request.
- 3. The master-slave cache system of claim 1 wherein the sub-line valid indication from the slave cache comprises a plurality of sub-line valid bits, each sub-line valid bit in the plurality of sub-line valid bits for indicating when a sub-line portion of the cache line contains a valid datum.
- 4. The master-slave cache system of claim 2 wherein the transfer means further comprises:
- return means for returning data from the master cache to the slave cache, the return means also returning to the slave cache the updated sub-line valid indication from the update means, the slave cache including means for writing the returning data and means for writing the updated sub-line valid indication to the slave cache in response to the return means.
- 5. The master-slave cache system of claim 4 wherein the transfer means further comprises:
- address transfer means for transferring a miss address from the slave cache to the master cache, the miss address comprising
- (a) a slave-index portion for selecting a selected cache line in the slave cache and
- (b) a slave-tag portion of the miss address for comparing to a slave-tag stored with the selected cache line in the slave cache,
- wherein a miss occurs when the slave-tag portion does not match the slave-tag stored in the slave cache with the selected cache line, the miss also occurring when data identified by the miss address is in the invalid portion of the cache line.
- 6. The master-slave cache system of claim 5 wherein the update means in the master cache comprises:
- slave-index compare means receiving a pending miss address for the other pending request in the master cache and receiving the miss address for the requesting cache line from the transfer means, for comparing a slave-index portion of the pending miss address to the slave-index portion of the miss address, the update means updating the sub-line valid indication when a slave-index match is detected but not updating the sub-line valid indication when no match is detected,
- whereby the sub-line valid indication from the slave cache is updated in the master cache when slave-index portions of miss addresses match.
- 7. The master-slave cache system of claim 6 wherein the update means in the master cache further comprises:
- slave-tag compare means receiving the pending miss address for the other pending request in the master cache and receiving the miss address from the transfer means, for comparing a slave-tag portion of the pending miss address to the slave-tag portion of the miss address; and wherein
- (a) the update means includes means for validating the sub-line valid indication for the additional portion of the requesting cache line when a tag match is detected and the slave-index match is detected;
- (b) the update means includes means for invalidating the sub-line valid indication for portions of the cache line other than a portion identified by the miss address when the slave-index match is detected but the tag match is not detected;
- (c) the update means not updating the sub-line valid indication when the slave-index match is not detected,
- whereby the slave-index match and the tag match determine how the sub-line valid indication is updated in the master cache before being returned to the slave cache.
- 8. The master-slave cache system of claim 7 wherein data includes instructions and operands, the pipeline comprises an instruction pipeline and an execution pipeline, the slave cache comprising:
- a slave instruction cache for supplying instructions to the instruction pipeline of the processor, the slave cache being arranged as a plurality of cache lines each containing a cache line of instructions, wherein a single instruction in a first cache line is capable of being valid when other instructions in the first cache line are not valid, the slave instruction cache allowing a subset of any cache line to be valid; and
- a slave operand cache for supplying operands to the execution pipeline of the processor, the slave cache being arranged as a plurality of cache lines each containing a cache line of operands, wherein a single operand in a second cache line is capable of being valid when other operands in the second cache line are not valid, the slave operand cache allowing a subset of any cache line to be valid.
- 9. The master-slave cache system of claim 8 further comprising
- a plurality of slave-instruction-cache valid indicators, in the master cache, for indicating that at least a portion of a corresponding slave cache line in the slave instruction cache contains valid data, the corresponding slave cache containing data also present in a corresponding master cache line in the master cache, the plurality of slave-instruction cache indicators also identifying a location in the master cache of the corresponding master cache line,
- whereby the plurality of slave-instruction-cache valid indicators in master cache contain information on a subset of cache lines in the master cache having a corresponding slave cache line in the slave cache containing a copy of at least a portion of the data in the corresponding master cache line.
- 10. The master-slave cache system of claim 9 further comprising:
- locating means for locating the corresponding master cache line for the miss address of the requesting cache line from the slave cache;
- means for modifying a slave-instruction-cache valid indicator for the corresponding master cache line identified by the locating means, the means for modifying including means for resetting the slave-instruction-cache valid indicator when the miss occurred because the slave-tag in the slave cache did not match the slave-tag portion of the miss address.
- 11. The master-slave cache system of claim 10 wherein the transfer means further comprises:
- means for transferring an overlapping master-index portion of the slave-tag from the slave cache to the master cache, the overlapping master-index portion of the slave-tag being a portion of the slave-tag which contains master-index address bits which are used to select a cache line in the master cache,
- wherein the master cache uses more bits in the miss address for selecting a cache line in the master cache than a number of bits used by the slave cache to select a cache line in the slave cache, the master-index having more address bits than the slave-index.
- 12. The master-slave cache system of claim 11 wherein the transfer means further comprises:
- means for transferring a block number stored with the corresponding slave cache line in the slave cache to the master cache,
- wherein the master cache comprises a set-associative cache having a plurality of associate blocks, wherein the master-index portion of the miss address selects a plurality of cache lines, the master-index portion selecting a cache line from each block in the plurality of associate blocks,
- wherein the locating means receives the block number from the transfer means, the locating means including means for selecting a corresponding block from the plurality of associate blocks in the master cache,
- wherein the return means further comprises block means for transmitting an identification of a current block in the plurality of associate blocks, the current block containing the data from the master cache to the slave cache returned by the return means, the slave cache also including means for writing as the block number the identification of the current block in the plurality of associate blocks, for writing the block number to the slave cache in response to the return means,
- whereby the slave cache stores as the block number the identification of the current block in the master cache and sends this block number to the master cache to aid in identifying a location of the corresponding master cache line.
- 13. A method of processing a cache miss in a master-slave cache comprising the steps of:
- detecting the cache miss in a slave cache which receives a miss address from a processor, the miss address having a slave-tag portion and a slave-index portion,
- selecting a selected cache line in the slave cache using the slave-index portion;
- reading old sub-line valid bits from the selected cache line;
- invalidating the old sub-line valid bits transmitted to a master cache when the slave-tag portion does not match a slave-tag stored in the selected cache line;
- transmitting the miss address and the old sub-line valid bits from the slave cache to the master cache;
- updating the old sub-line valid bits transmitted to the master cache when other pending transfers in the master cache have a slave-index portion of a pending miss address that matches the slave-index portion of the miss address and generating updated sub-line valid bits;
- reading a sub-line of data located at the miss address from a data array in the master cache;
- receiving other new requests after the miss address is received;
- scanning the other new requests for a matching new request having a new miss address with a slave-index portion that matches the slave-index portion of the miss address;
- comparing the slave-tag portion of the new miss address for a matching new request to the slave-tag portion of the miss address and signaling a slave-tag match when slave-tag portions match;
- invalidating sub-line valid bits for the matching new request when the slave-tag match is not signaled for a matching line;
- validating an additional sub-line valid bit for the matching line when the slave-tag match is signaled for the matching line, the additional sub-line valid bit corresponding to the sub-line indicated by the miss address;
- sending the sub-line of data from the data array in the master cache to the slave cache and sending the updated sub-line valid bits to the slave cache; and
- writing the sub-line of data and the updated sub-line valid bits to the selected cache line in the slave cache,
- whereby the sub-line valid bits in the slave cache are updated by the master cache.
- 14. The method of claim 13 further comprising the step of:
- setting a current sub-line valid bit in the updated sub-line valid bits, the current sub-line valid bit being for a current sub-line indicated by the miss address.
- 15. The method of claim 13 wherein the slave cache does not write to its own sub-line valid bits except in response to the master cache sending the updated sub-line valid bits to the slave cache,
- whereby the slave cache cannot update its own sub-line valid bits unless directed by the master cache.
- 16. The method of claim 15 wherein the step of reading the sub-line of data located at the miss address from the data array in the master cache includes the step of reading a master-line valid bit for a master-cache line containing the sub-line of data, the master-line valid bit indicating when the entire master-cache line is valid, the master cache not allowing a partial cache line containing just one sub-line of data to be read, the master cache only allowing a full cache line to be valid.
- 17. The method of claim 15 wherein sub-lines of data are transferred from the master cache to the slave cache in a sequence determined by the processor generating miss addresses to sub-lines.
- 18. A cache system comprising:
- a master cache having a plurality of master cache lines, each master cache line having all sub-lines of data valid for access or all of the sub-lines of data not valid for access;
- a slave cache, coupled to the master cache and coupled to a processor, having a plurality of slave cache lines, each slave cache line having a plurality of sub-lines of data individually marked valid or invalid by sub-line valid bits for each slave cache line;
- a slave miss requester, detecting when a requested data item is not present in the slave cache, for transmitting a miss address and sub-line valid bits from the slave cache to the master cache;
- a transfer pipeline in the master cache, receiving the miss address and the sub-line valid bits from the slave miss requester, for reading the requested data item from the master cache and updating the sub-line valid bits; and
- a slave writer, receiving the miss address, the requested data item, and the sub-line valid bits updated by the transfer pipeline, for writing the requested data item, a tag portion of the miss address, and the sub-line valid bits updated by the transfer pipeline to a selected cache line in the slave cache, the selected cache line selected by a slave-index portion of the miss address,
- whereby although the master cache does not have sub-line validity, the master cache updates the sub-line valid bits received from the slave cache and has updated sub-line valid bits written back to the slave cache with the requested data item.
- 19. The cache system of claim 18 wherein the transfer pipeline in the master cache includes compare means for comparing in parallel a slave-index portion of the miss address for a request in the transfer pipeline to slave-index portions of other requests in the transfer pipeline, the transfer pipeline updating the sub-line valid bits when the compare means detects a match in the slave-index portions.
- 20. The cache system of claim 19 wherein the slave cache is a direct-mapped cache while the master cache is a set-associative cache, the master cache being larger than the slave cache, the master cache processing external snoop requests that hit in the slave cache by writing an invalid cache line to the slave cache, the invalid cache line having all sub-line valid bits marked as invalid.
- 21. The cache system of claim 18 wherein the plurality of sub-lines of data are transferred from the master cache to the slave cache in an arbitrary order, the arbitrary order being a different order for different lines in the slave cache.
BACKGROUND OF THE INVENTION--RELATED APPLICATION
This is a continuation-in-part (CIP) of "Master-Slave Cache System", Ser. No. 08/267,658, filed Jun. 29, 1994 now U.S. Pat. No. 5, 551,001.
US Referenced Citations (8)
Continuation in Parts (1)
|
Number |
Date |
Country |
Parent |
267658 |
Jun 1994 |
|