CN-121979462-A - Storage method of check data of cache equipment
Abstract
The invention relates to the technical field of storage and discloses a storage method of check data of cache equipment, which comprises the steps of receiving a write-in request aiming at a target logical address, and carrying out feature extraction operation on the target logical address to generate a rotary displacement factor; traversing a plurality of candidate data paths in the cache group, calculating a corresponding candidate check path physical index value by using the physical index value and the rotary displacement factor, detecting the occupation state of the candidate data paths and the corresponding candidate check path physical index value, determining a target data path and a target check path according to the occupation state, and writing data and generated check codes into the target data path and the target check path respectively. The invention establishes the strong mapping of the check storage position and the logic address, forcedly causes check failure when address addressing is wrong, prevents silent errors and improves the storage safety of check data of the cache equipment.
Inventors
- SU FANGHONG
- JIANG SONG
- CHENG FEI
Assignees
- 四川乐为科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260407
Claims (10)
- 1. The method for storing the check data of the cache device is characterized by comprising the following steps: receiving a write-in request aiming at a target logic address, and carrying out feature extraction operation on the target logic address to generate a rotary displacement factor; Traversing a plurality of candidate data paths in a cache set, and calculating a candidate check path physical index value corresponding to each candidate data path by using the physical index value of each candidate data path and the rotary displacement factor aiming at each candidate data path; Detecting the occupation state of each candidate data path and the physical index value of the candidate check path corresponding to each candidate data path; determining a target data path and a target check path corresponding to the target data path from the plurality of candidate data paths according to the occupied state; And writing the data corresponding to the writing request into the target data path, and writing the check code of the data corresponding to the writing request into the target check path.
- 2. The method for storing check data of a cache device according to claim 1, wherein the step of performing a feature extraction operation on the target logical address to generate a disclination factor comprises: equally dividing the binary sequence of the target logical address according to the link number index bit width to obtain a plurality of segment data; And performing bitwise exclusive OR operation on the plurality of segmented data to obtain an operation result, and performing modulo operation on the operation result aiming at the number of the associated ways of the cache set to obtain the rotary displacement factor.
- 3. The method for storing check data in a cache device according to claim 1, wherein the step of calculating the physical index value of the candidate check way corresponding to each candidate data way by using the physical index value of each candidate data way and the disclination factor comprises: Adding the physical index value of the candidate data path and the rotary displacement factor to obtain an intermediate sum value; and performing modulo operation on the intermediate sum value aiming at the number of the links of the cache set to obtain the candidate check link physical index value.
- 4. The method for storing check data in a cache device according to claim 1, wherein the step of detecting an occupancy state of each of the candidate data ways and a candidate check way physical index value corresponding to each of the candidate data ways includes: determining the physical availability state of the candidate data path according to the valid bit and the replacement priority of the candidate data path; Reading the valid bit and the storage label of the physical position pointed by the candidate check path physical index value, and determining that the candidate check path physical index value has a logic address attribution conflict state under the condition that the valid bit of the physical position pointed by the candidate check path physical index value is logic true and the storage label is inconsistent with the label of the target logic address; And confirming the physical availability state and the logical address attribution conflict state as the occupied state.
- 5. The method for storing check data in a cache device according to claim 4, wherein the step of determining a target data way and a target check way corresponding to the target data way from the plurality of candidate data ways according to the occupancy state includes: the candidate data paths of which the physical availability states meet idle conditions or alternative conditions and the logical address attribution conflict states do not exist are classified into a preferred set; Classifying the candidate data paths, for which the physical availability status satisfies the idle condition or the alternative condition but the logical address attribution conflict exists, into a sub-selection set; selecting the target data path from the preferred set if the preferred set is not empty; And selecting the target data path from the secondary selection set and generating an effective conflict processing signal under the condition that the preferred set is empty and the secondary selection set is not empty.
- 6. The method for storing check data of a cache device according to claim 5, wherein the step of writing the data corresponding to the write request to the target data path further comprises: reading old logic address labels stored in the target check path in response to the conflict processing signal being in an effective state; reconstructing an old logical address according to the old logical address tag and the index value of the current cache set, and performing the feature extraction operation on the old logical address to generate an old rotary displacement factor; calculating a physical index value of a victim data path by using the old rotary displacement factor and the physical index value of the target check path; And setting the valid bit of the data path pointed by the physical index value of the victim data path to be in an invalid state.
- 7. The method of storing check data for a cache device of claim 6, wherein the step of calculating a victim data way physical index value using the old disclination factor and a physical index value of the target check way comprises: calculating the difference value of the physical index value of the target check path minus the old rotary displacement factor; And performing modulo operation on the number of links after adding the number of links to the difference value to obtain the physical index value of the victim data link.
- 8. The method for storing check data of a cache device according to claim 1, further comprising a reading step, the reading step comprising: receiving a read request aiming at a read logical address, and positioning a read data path physical index value matched with a read logical address label in a data array; Performing the feature extraction operation on the read logical address to generate a read disclination factor; and adding the read data path physical index value and the read rotary displacement factor, and then performing modulo operation on the number of the links to obtain a read check path physical index value.
- 9. The method for storing check data of a cache device according to claim 8, wherein the reading step further comprises: reading a read check code from a physical position pointed by the read check path physical index value, and performing integrity verification on data read from the physical position pointed by the read data path physical index value by utilizing the read check code.
- 10. The method for storing check data of a cache device according to claim 9, wherein the step of performing integrity verification on the data read from the physical location pointed to by the read data path physical index value by using the read check code comprises: Reading a storage label associated with a physical position pointed by the physical index value of the read check path, and comparing the storage label with the label of the read logical address; if the storage label is inconsistent with the label of the read logical address, judging that an address addressing error occurs; And when the storage tag is identical to the tag of the read logical address, but the read check code is not identical to a new check value calculated from data read from a physical location pointed to by the read data path physical index value, determining that a data bit flip error has occurred.
Description
Storage method of check data of cache equipment Technical Field The invention relates to the technical field of storage, in particular to a method for storing check data of cache equipment. Background The cache device is used as a high-speed storage component in the computer architecture and is used for temporarily storing data and instructions frequently accessed by the processor so as to make up for the delay of the read-write speed of the main memory. In order to ensure the reliability of the data in the storage array during the residence period, the cache device generally adopts a storage method of checking the data, that is, when the data is written, a corresponding check code is generated by using a coding circuit, and the check code and the data are written into a storage unit together. The verification data serve as references for integrity verification in a subsequent reading process, and are used for detecting possible bit flipping or signal interference errors in the storage medium, so as to ensure that data output to a request end are not distorted. In existing cache device applications, the storage of the check data generally follows a static binding principle based on physical location. In the cache of the group association or direct mapping structure, a fixed correspondence exists between the physical space for storing the check code and the physical space for storing the data. When the cache device executes the write operation, the controller writes the data into the selected physical data path and directly writes the corresponding check code into the fixed physical check path attached to the data path. This design makes the physical attribution of the check code entirely dependent on the physical slot into which the data falls, rather than the logical address attribute of the data itself. However, this storage approach relying only on physical location binding has significant technical drawbacks in dealing with address addressing errors. Because the storage position of the check data is not strongly associated with the logic address of the data, when the address decoder or the word line driving circuit of the cache device fails and the actual read-write operation deviates to the wrong physical address, the cache device can read the wrong heterologous data and the check code originally generated for the heterologous data. In this case, the result calculated by the conventional verification logic still matches, so that erroneous judgment data is valid. This difficulty in identifying addressing errors through a verification mechanism results in the cache device being very prone to returning erroneous data to the requesting end without triggering any alarms when faced with hardware addressing failures. Therefore, the invention provides a storage method of check data of a cache device, which solves the defects in the prior art. Disclosure of Invention Aiming at the defects of the prior art, the invention provides a storage method of check data of cache equipment, which solves the problem that address addressing errors of the cache equipment are difficult to identify due to static binding of the check data and physical positions in the prior art. In order to achieve the purpose, the invention is realized by the following technical scheme that the method for storing the check data of the cache equipment comprises the following steps: receiving a write-in request aiming at a target logic address, and carrying out feature extraction operation on the target logic address to generate a rotary displacement factor; Traversing a plurality of candidate data paths in a cache set, and calculating a candidate check path physical index value corresponding to each candidate data path by using the physical index value of each candidate data path and the rotary displacement factor aiming at each candidate data path; Detecting the occupation state of each candidate data path and the physical index value of the candidate check path corresponding to each candidate data path; determining a target data path and a target check path corresponding to the target data path from the plurality of candidate data paths according to the occupied state; And writing the data corresponding to the writing request into the target data path, and writing the check code of the data corresponding to the writing request into the target check path. Preferably, the step of performing a feature extraction operation on the target logical address to generate a disclination factor includes: equally dividing the binary sequence of the target logical address according to the link number index bit width to obtain a plurality of segment data; And performing bitwise exclusive OR operation on the plurality of segmented data to obtain an operation result, and performing modulo operation on the operation result aiming at the number of the associated ways of the cache set to obtain the rotary displacement factor. Preferably, the step of calculating th