ECC (Error Correction Code) verification method and device for storage array
By separately calculating the ECC values of the row mapping data and column mapping data of the storage array, the problem of storage space occupation and increase in computing units when the amount of data is large in the existing technology is solved, and efficient verification and error location of two-dimensional data are achieved. , saving ECC computing resources.
Patent Information
- Application Number
- CN202410085672.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-22
- Publication Date
- 2024-09-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing technology, the ECC verification method in the memory needs to take out all the data at one time for calculation, which leads to a large temporary storage space and is not suitable for two-dimensional data. The calculation unit increases with the increase of data.
By separately calculating the row mapping data and column mapping data of the storage array, and calculating the row ECC value and column ECC value, the verification of two-dimensional data is realized, the ECC calculation unit is saved, and the number of calculation units is guaranteed to be fixed.
It solves the storage space occupation problem when the amount of data is large. It is suitable for two-dimensional data, locates 1-bit errors, and indicates the rows and columns where 2-bit errors are located, saving the software and hardware overhead of ECC calculations.
Smart Images

Figure CN118711642A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ECC algorithms, and in particular to an ECC checking method and device for a storage array. Background Art
[0002] The ECC check method based on Hamming code is a commonly used method for checking memory data. This method is often used in OTP, flash, SRAM and other memories. Hamming code divides valid information into several groups according to a certain rule, and arranges a check bit in each group for verification through XOR operation to obtain a specific ECC check code. In the memory, the pre-calculated ECC check code is often stored in the memory. When reading data, the ECC is calculated for the data, and the calculated ECC check code is compared with the pre-stored check code to find out whether there is an error in the data and correct the error.
[0003] The existing technology adopts a concurrent calculation method, taking out all the data and putting them into temporary storage, and calculating the ECC check code; after the check code is compared, if a 1-bit error is found, the error is corrected and the data is sent out; if there is no error, the data is sent out directly; if multiple bit errors are found, the data is discarded.
[0004] The existing methods have the following problems: 1) All the data used to calculate ECC needs to be taken out and put into temporary storage at one time. When the amount of data calculated is large, a large amount of temporary storage space is required; 2) It is only applicable to the calculation of one-dimensional data, not two-dimensional data. The two-dimensional data needs to be converted into one-dimensional data before calculation; 3) The number of computing units used for ECC calculation increases proportionally with the increase of data.
[0005] Based on this technical background, the present invention studies an ECC checking method and device for a storage array. Summary of the invention
[0006] In view of the deficiencies in the prior art, the present invention proposes an ECC checking method and device for a storage array. The method calculates row mapping data and column mapping data for the data stored in the storage array, and calculates row ECC values and column ECC values for the row mapping data and column mapping data, respectively, thereby solving the problem in the prior art that all data needs to be retrieved at one time. The method is particularly suitable for two-dimensional data. The method greatly saves ECC calculation units and, at the same time, ensures that the number of ECC calculation units is fixed and does not increase with the increase of calculated data.
[0007] In order to achieve the above object, the first aspect of the present invention provides an ECC checking method for a storage array, comprising: Calculate row mapping data and column mapping data based on the data stored in the storage array; Calculate a row ECC value and a column ECC value based on the row mapping data and the column mapping data respectively; Perform ECC checks on the row ECC value and the column ECC value respectively to determine whether an error exists, and locate or indicate an error if an error exists.
[0008] A second aspect of the present invention provides an ECC checking device for a storage array used in the above method, comprising: A row ECC calculation unit, configured to calculate a row ECC value based on received data; a row ECC comparison unit, electrically connected to the row ECC calculation unit, and configured to compare the row ECC value with an expected row ECC value; An address resolution unit is provided with an address input port; a column ECC calculation unit, electrically connected to the address resolution unit, and configured to calculate a column ECC value based on the received data; a column ECC comparison unit, electrically connected to the column ECC calculation unit, for comparing the column ECC value with an expected column ECC value; The error judgment unit is provided with an error output port, which is electrically connected to the row ECC comparison unit and the column ECC comparison unit respectively.
[0009] The beneficial effects of the present invention include: (1) The ECC checking method for a storage array proposed in the present invention calculates row mapping data and column mapping data for the data stored in the storage array, and calculates row ECC values and column ECC values for the row mapping data and column mapping data, respectively, thereby solving the problem of the prior art that all data needs to be retrieved at one time. The method is particularly suitable for two-dimensional data. The method greatly saves ECC calculation units and at the same time ensures that the number of ECC calculation units is fixed and does not increase with the increase of calculated data.
[0010] (2) The ECC checking method for a storage array proposed in the present invention can locate the position of the error bit through ECC checking when there is a 1-bit error; and indicate the row and / or column where the error bit is located through ECC checking when there is a 2-bit error.
[0011] (3) The ECC check device for the storage array proposed in the present invention obtains row mapping data by iterative calculation based on the received grouped data, and obtains the column mapping bits of all rows and their ECC values, thereby solving the problem in the prior art that all data needs to be input at one time to calculate the ECC value, and saving the software and hardware overhead of calculating the ECC value.
[0012] Other features and advantages of the present invention will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The above and other objects, features and advantages of the present invention will become more apparent through a more detailed description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, wherein like reference numerals generally represent like components throughout the exemplary embodiments of the present invention.
[0014] Figure 1 The present invention is a flowchart of the ECC checking method for a storage array.
[0015] Figure 2 The figure is a schematic diagram of the structure of the ECC checking device of the storage array proposed by the present invention.
[0016] Figure 3 The present invention provides a flowchart of calculating the ECC value in a specific implementation manner of the ECC checking device for the storage array.
[0017] Figure 4 The following is a flow chart of ECC value calculation in a specific implementation manner of the ECC checking device for a storage array proposed by the present invention.
[0018] Description of reference numerals: 1-row ECC calculation unit, 2-column ECC calculation unit, 3-address resolution unit, 4-row ECC comparison unit, 5-column ECC comparison unit, 6-error judgment unit; 101-external valid flag input signal, 102-external input data, 103-external address signal, 104-1-bit error indication signal, 105-2-bit error indication signal, 106-error row output indication signal, 107-error column output indication signal; Rx-column mapping data, RP-column ECC value, Cx-row mapping data, CP-row ECC value. DETAILED DESCRIPTION
[0019] The preferred embodiments of the present invention will be described in more detail below. Although the preferred embodiments of the present invention are described below, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0020] In the present invention, unless otherwise specified, the directional words used, such as "upper and lower", generally refer to the upper and lower parts of the device in normal use, and "inside and outside" refer to the outline of the device. In addition, the terms "first, second, third" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first, second, third" may explicitly or implicitly include one or more of the features. In the description of the present invention, "multiple" means two or more, unless otherwise clearly and specifically defined.
[0021] The present invention provides an ECC checking method for a storage array, such as Figure 1 As shown, including: Calculate row mapping data Cx and column mapping data Rx based on the data stored in the storage array; Based on the row mapping data Cx and the column mapping data Rx, a row ECC value CP and a column ECC value RP are calculated respectively; Perform ECC check on the row ECC value CP and the column ECC value RP respectively to determine whether there is an error, and locate or indicate an error if there is an error.
[0022] In the present invention, the data stored in the storage array are calculated into row mapping data Cx and column mapping data Rx, and the row ECC value CP and the column ECC value RP are calculated for the row mapping data Cx and the column mapping data Rx, respectively, which solves the problem of the prior art that all data needs to be taken out at one time. The method is particularly suitable for two-dimensional data. The method greatly saves ECC calculation units and, at the same time, ensures that the number of ECC calculation units is fixed and does not increase with the increase of calculated data.
[0023] According to the present invention, respectively calculating row mapping data Cx and column mapping data Rx based on data stored in the storage array includes: Perform bitwise XOR operation on the data stored in each column of the storage array to obtain the row mapping bit of the column, and arrange the row mapping bits of all columns in address order to obtain row mapping data Cx; A bitwise XOR operation is performed on the data stored in each row of the storage array to obtain the column mapping bit of the row, and the column mapping bits of all rows are arranged in address order to obtain column mapping data Rx.
[0024] According to the present invention, if there is an error, locating or indicating it includes: If there is a 1-bit error, the error bit position is located through ECC checking; If there is a 2-bit error, the row and / or column where the error bit is located is indicated by ECC checking.
[0025] In the present invention, if there is a 1-bit error, the position of the erroneous bit can be located through ECC checking; if there is a 2-bit error, the row and / or column where the erroneous bit is located can be indicated through ECC checking.
[0026] The present invention also provides an ECC checking device for a storage array used in the above method, comprising: A row ECC calculation unit 1, configured to calculate a row ECC value CP based on received data; The row ECC comparison unit 4 is electrically connected to the row ECC calculation unit 1 and is used to compare the row ECC value CP with the expected row ECC value CP; The address resolution unit 3 is provided with an address input port; A column ECC calculation unit 2, electrically connected to the address resolution unit 3, for calculating a column ECC value RP based on the received data; a column ECC comparison unit 5, electrically connected to the column ECC calculation unit 2, for comparing the column ECC value RP with the expected column ECC value RP; The error judgment unit 6 is provided with an error output port, which is electrically connected to the row ECC comparison unit 4 and the column ECC comparison unit 5 respectively.
[0027] According to the present invention, the row ECC calculation unit 1 and the column ECC calculation unit 2 are each provided with a respective data input port and a data valid flag input port; The data input ports of the row ECC calculation unit 1 and the column ECC calculation unit 2 are electrically connected to each other for receiving external input data 102 together; The data valid flag input ports of the row ECC calculation unit 1 and the column ECC calculation unit 2 are electrically connected to each other for jointly receiving an external valid flag input signal 101; The address parsing unit 3 is used to parse the received external address signal 103 into a column address signal and send it to the column ECC calculation unit 2 .
[0028] According to the present invention, calculating the row ECC value CP based on the received data includes: Calculate the row mapping data Cx based on the received data, and perform ECC check calculation on the row mapping data Cx to obtain the row ECC value CP; The column ECC value RP calculated based on the received data includes: The column mapping data Rx is calculated based on the received data, and the column mapping data Rx is subjected to an ECC check calculation to obtain a column ECC value RP.
[0029] According to the present invention, calculating the row mapping data Cx based on the received data includes: Based on the received data, iterative calculation is performed to obtain row mapping data Cx; Calculating the column mapping data Rx based on the received data and performing ECC check calculation on the column mapping data Rx to obtain the column ECC value RP includes: Based on the received data, the column mapping bits and the ECC value of each row are calculated, and the column mapping bits and the ECC values of all rows are obtained by iterative calculation; The ECC values of all rows are used as the column ECC value RP.
[0030] Preferably, the termination condition of the iterative calculation is that the data valid flag input ports of the row ECC calculation unit 1 and the column ECC calculation unit 2 jointly receive a flag signal indicating that the last set of externally inputted data has been input and completed.
[0031] Preferably, the method further comprises: the error output port comprises a 1-bit error output port, a 2-bit error output port, an error row output port and an error column output port.
[0032] According to the present invention, after the 1-bit error output port outputs an indication signal, the error row output port and the error column output port respectively indicate and output the row number and column number where the 1-bit error is located; The 2-bit error output port is used to indicate the presence of a 2-bit error in the output.
[0033] In the present invention, row mapping data Cx is obtained by iterative calculation based on the received grouped data, and column mapping bits and ECC values of all rows are obtained, thereby solving the problem in the prior art of needing to input all data at once to calculate the ECC value CP, and saving the software and hardware overhead of calculating the ECC value.
[0034] The present invention is described in more detail below through a specific embodiment. Example 1
[0035] This embodiment provides an ECC checking method for a storage array, which specifically includes the following steps: According to Table 1, a Hamming code is constructed for a two-dimensional storage matrix; wherein, Cx is the row mapping data of the matrix, and the mapping relationship is as follows: Cx[0] = D[0][0]^D[1][0]^ D[2][0]^ …… ^ D
[254] [0]^ D
[255] [0]. Cx[1] = D[0][1]^D[1][1]^ D[2][1]^ …… ^ D
[254] [1]^ D
[255] [1]. … Cx[7] = D[0][7]^D[1][7]^ D[2][7]^ …… ^ D
[254] [7]^ D
[255] [7]. Rx is the column mapping data of the matrix, and the mapping relationship is as follows: Rx[0] = D[0][1]^D[0][2]^D[0][3]^D[0][4]^D[0][5]^D[0][6]^D[0][7]; Rx[1] = D[1][1]^D[1][2]^D[1][3]^D[1][4]^D[1][5]^D[1][6]^D[1][7]; … Rx
[255] = D
[255] [1]^D
[255] [2]^D
[255] [3]^D
[255] [4]^D
[255] [5]^D
[255] [6]^D
[255] [7]; Table 1 Matrix mapping construction method , Calculate ECC values CP and RP for row mapping data Cx and column mapping data Rx respectively; During verification, the row ECC value is calculated with the expected row ECC value, and the column ECC value is calculated with the expected column ECC value to determine whether there is an error. If there is a 1-bit error, the row ECC value calculation result can directly obtain the row where the error is located, and the column ECC value calculation result can directly obtain the column where the error is located, so the position of the error bit can be accurately located. If there is a 2-bit error, the calculation result of the row or column ECC will reflect the 2-bit error.
[0036] like Figure 2 As shown, this embodiment provides an ECC check of a storage array, including: A row ECC calculation unit 1, configured to calculate a row ECC value CP based on received data; The row ECC comparison unit 4 is electrically connected to the row ECC calculation unit 1 and is used to compare the row ECC value CP with the expected row ECC value CP; The address resolution unit 3 is provided with an address input port; A column ECC calculation unit 2, electrically connected to the address resolution unit 3, for calculating a column ECC value RP based on the received data; a column ECC comparison unit 5, electrically connected to the column ECC calculation unit 2, for comparing the column ECC value RP with the expected column ECC value RP; The error judgment unit 6 is provided with an error output port and is electrically connected to the row ECC comparison unit 4 and the column ECC comparison unit 5 respectively; In this embodiment, the row ECC calculation unit 1 and the column ECC calculation unit 2 are both provided with respective data input ports and data valid flag input ports; The data input ports of the row ECC calculation unit 1 and the column ECC calculation unit 2 are electrically connected to each other for receiving external input data 102 together; The data valid flag input ports of the row ECC calculation unit 1 and the column ECC calculation unit 2 are electrically connected to each other for jointly receiving an external valid flag input signal 101; The address parsing unit 3 is used to parse the received external address signal 103 into a column address signal and send it to the column ECC calculation unit 2; In this embodiment, calculating the row ECC value CP based on the received data includes: Calculate the row mapping data Cx based on the received data, and perform ECC check calculation on the row mapping data Cx to obtain the row ECC value CP; The column ECC value RP calculated based on the received data includes: Column mapping data Rx is calculated based on the received data, and ECC check calculation is performed on the column mapping data Rx to obtain a column ECC value RP; In this embodiment, the row mapping data Cx is calculated based on the received data and includes: Based on the received data, iterative calculation is performed to obtain row mapping data Cx; Calculating the column mapping data Rx based on the received data and performing ECC check calculation on the column mapping data Rx to obtain the column ECC value RP includes: Based on the received data, the column mapping bits and the ECC value of each row are calculated, and the column mapping bits and the ECC values of all rows are obtained by iterative calculation; The calculation process of row ECC value and column ECC value is as follows: Figure 3 and Figure 4 As shown; The ECC values of all rows are used as column ECC values RP; In this embodiment, the termination condition of the iterative calculation is that the data valid flag input ports of the row ECC calculation unit 1 and the column ECC calculation unit 2 jointly receive a flag signal indicating that the last set of externally inputted data has been inputted. In this embodiment, it also includes: the error output port includes a 1-bit error output port, a 2-bit error output port, an error row output port and an error column output port; When the 1-bit error output port outputs an indication signal, the error row output port and the error column output port respectively indicate and output the row number and column number where the 1-bit error is located; The 2-bit error output port is used to indicate the presence of a 2-bit error in the output.
[0037] The ECC checking method for the storage array proposed in this embodiment calculates the row mapping data and the column mapping data of the data stored in the storage array, and calculates the row ECC value and the column ECC value of the row mapping data and the column mapping data respectively, which solves the problem of the prior art that all data needs to be retrieved at one time, and is particularly suitable for two-dimensional data. The method greatly saves ECC calculation units, and at the same time, ensures that the number of ECC calculation units is fixed and does not increase with the increase of calculated data.
[0038] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments.
Claims
1. An ECC checking method for a storage array, characterized in that: include: Calculate row mapping data and column mapping data based on the data stored in the storage array; Calculate a row ECC value and a column ECC value based on the row mapping data and the column mapping data respectively; Perform ECC checks on the row ECC value and the column ECC value respectively to determine whether an error exists, and locate or indicate an error if an error exists.
2. The method according to claim 1, characterized in that: Calculating row mapping data and column mapping data based on the data stored in the storage array includes: Performing bitwise XOR operation on the data stored in each column of the storage array to obtain the row mapping bit of the column, and arranging the row mapping bits of all columns in address order to obtain row mapping data; A bitwise XOR operation is performed on the data stored in each row of the storage array to obtain the column mapping bit of the row, and the column mapping bits of all rows are arranged in address order to obtain column mapping data.
3. The method according to claim 2, characterized in that If there is an error, the location or indication includes: If there is a 1-bit error, locate the error bit position through the ECC check; If there is a 2-bit error, the row and / or column where the error bit is located is indicated by the ECC check.
4. An ECC check device for a storage array used in the method according to any one of claims 1 to 3, characterized in that: include: A row ECC calculation unit, configured to calculate a row ECC value based on received data; a row ECC comparison unit, electrically connected to the row ECC calculation unit, and configured to compare the row ECC value with an expected row ECC value; An address resolution unit is provided with an address input port; a column ECC calculation unit, electrically connected to the address resolution unit, and configured to calculate a column ECC value based on the received data; a column ECC comparison unit, electrically connected to the column ECC calculation unit, for comparing the column ECC value with an expected column ECC value; The error judgment unit is provided with an error output port, which is electrically connected to the row ECC comparison unit and the column ECC comparison unit respectively.
5. The device according to claim 4, characterized in that The row ECC calculation unit and the column ECC calculation unit are each provided with a respective data input port and a data valid flag input port; The data input ports of the row ECC calculation unit and the column ECC calculation unit are electrically connected to each other for receiving external input data together; The data valid flag input ports of the row ECC calculation unit and the column ECC calculation unit are electrically connected to each other for jointly receiving an external valid flag input signal; The address parsing unit is used to parse the received external address signal into a column address signal and send the signal to the column ECC calculation unit.
6. The device according to claim 5, characterized in that The row ECC value calculated based on the received data includes: Calculate the row mapping data based on the received data, and perform ECC check calculation on the row mapping data to obtain the row ECC value; The column ECC value calculated based on the received data includes: Column mapping data is calculated based on the received data, and an ECC check is performed on the column mapping data to obtain a column ECC value.
7. The device according to claim 6, characterized in that The row mapping data calculated based on the received data includes: Based on the received data, iterative calculation is performed to obtain row mapping data; Calculating the column mapping data based on the received data and performing ECC check on the column mapping data to obtain the column ECC value includes: Based on the received data, the column mapping bits and the ECC value of each row are calculated, and the column mapping bits and the ECC values of all rows are obtained by iterative calculation; The ECC values of all rows are used as column ECC values.
8. The device according to claim 7, characterized in that The termination condition of the iterative calculation is that the data valid flag input ports of the row ECC calculation unit and the column ECC calculation unit jointly receive a flag signal indicating that the last group of data input from the external input is completed.
9. The device according to claim 4, characterized in that Also includes: The error output ports include a 1-bit error output port, a 2-bit error output port, an error row output port and an error column output port.
10. The device according to claim 9, characterized in that When the 1-bit error output port outputs an indication signal, the error row output port and the error column output port respectively indicate and output the row number and column number where the 1-bit error is located; The 2-bit error output port is used to indicate the presence of a 2-bit error in the output.
Citation Information
Patent Citations
Memory device, memory system, and operation method thereof
CN108345514A
A NAND Flash controller with an error detection and correction mechanism
CN109036493A
Controller and operating method thereof
CN113536401A
Memory using error-correcting codes to correct stored data in background
US20030046630A1
