Error detection and correction in ternary content addressable memory (TCAM)
Granted 12 Sep 2017 · 2 office actions
Current assignee: Synopsys · originally Marvell Technology Group Ltd.
Law firm: Law firm · Log in to unlock
Attorney: Attorney · Log in to unlock
Inventors: Michael Anthony Zampaglione, Thomas Robert Wik · Examiner: Daniel McMahon · AU 2117 · TC 2100
Life of the application
15 dated eventsAbstract
A ternary content addressable memory (TCAM) is disclosed. The TCAM includes a memory array, a data match module, and compare circuitry. The memory array stores a data entry for a data word and a corresponding duplicate data entry for the data word. The data match module compares the data entry to an input word to produce a first match output, and compares the duplicate data entry to the input word to produce a second match output. The compare circuitry compares the first match output and the second match output.
Description
7 parts›CROSS REFERENCE TO RELATED APPLICATIONS
This application claims the benefit of U.S. Provisional Application No. 61/884,689, filed Sep. 30, 2013, which is incorporated by reference in its entirety.
›BACKGROUND OF THE INVENTION
1. Field of the Invention
This invention relates generally to content addressable memory (CAM). More particularly, it relates to real-time error detection and/or correction in ternary content addressable memory (TCAM).
2. Description of the Related Art
Content addressable memory (CAM) is a type of memory unit in which the data stored is addressable by its content. During a compare operation, the CAM compares an input word with the words stored in the CAM. The CAM determines whether each entry is a match or a mismatch to the input word. If a match to the input word is found, the CAM may return a list of one or more storage addresses of the entries that matched the input word and/or one or more data words associated with the entries that matched the input word.
A ternary CAM (TCAM) is a type of CAM in which the bits stored in a data entry can have three different values for purposes of matching to the input word (e.g., 1, 0, and X or don't care). Some TCAMs implement the third bit value by adding a mask bit for every bit in the data word, where the mask bit specifies whether the corresponding bit in the data word is an X (i.e., whether a bit in the data entry is a “care” or “don't care”).
Errors may be introduced into entries in a TCAM (e.g., by ionizing radiation). In certain applications, the soft error rates (SER) in TCAMs can exceed acceptable limits for many applications given the large number of bits stored by TCAMs.
›SUMMARY OF THE INVENTION
The present invention overcomes the limitations of the prior art by providing error correction circuitry and/or duplicate entries to entries in a TCAM. When performing a compare operation in a TCAM, the results of the compare operation of an entry can be compared to the results of the compare operation of the corresponding duplicate entry. If a mismatch is observed, the TCAM determines that an error may be present in the entry and/or duplicate entry. The TCAM or other external circuitry can then perform actions to correct the error. Once the error is corrected, the TCAM may complete the compare operation with the correct data entry.
The error correction circuitry can be used to correct errors in an entry of the TCAM. Depending on the error correcting code used by the TCAM, single bit errors or multiple bit errors may be detected and/or corrected without the need of retrieving the data to be corrected from an external source.
›BRIEF DESCRIPTION OF THE DRAWINGS
The invention has other advantages and features which will be more readily apparent from the following detailed description of the invention and the appended claims, when taken in conjunction with the accompanying drawings, in which:
FIG. 1A is a block diagram of a ternary content addressable memory (TCAM) with duplicate entries, according to one embodiment of the invention.
FIG. 1B is a flow chart showing steps for determining in real-time, whether an entry in a TCAM is corrupted, according to one embodiment of the invention.
FIG. 2 is a block diagram of a TCAM with duplicate entries and error correction, according to one embodiment of the invention.
FIG. 3 is a block diagram of a TCAM with sub-divided data entries, according to another embodiment of the invention.
FIG. 4 is a block diagram of a TCAM with shared ECC data, according to another embodiment of the invention.
›DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS · 1 of 3
FIG. 1A is a block diagram of a ternary content addressable memory (TCAM) with duplicate entries, according to one embodiment of the invention. The TCAM of FIG. 1A includes a memory array 100 , logic circuitry 150 and an interface 140 . The memory array 100 contains data organized as words (which are shown as rows in FIG. 1A ). The logic 150 contains auxiliary circuitry for the TCAM. The interface 140 provides an interface for communication between the TCAM and other components.
For purposes of illustration, assume that the TCAM is used to store 144-bit data word D. Since each bit can take one of three states (0, 1, X) for purposes of the TCAM, each data entry in the TCAM occupies two rows, denoted as A and B in FIG. 1A . Thus, 144-bit data word D 0 is stored as a data entry 110 in the TCAM that includes 144-bit row A 0 and 144-bit row B 0 , data D 1 is stored as a data entry that includes 144-bit row A 1 and 144-bit row B 1 , and so on.
The two rows A and B can be mapped to the three states 0,1,X in different ways. In one approach, row A contains the actual data word D and row B contains corresponding mask bits. Table 1 shows this mapping. When the mask bit is off (B=0), then no masking occurs and the data (A=0 or A=1) is used for purposes of TCAM comparison. When the mask bit is on (B=1), then the corresponding data bit is ignored for purposes of TCAM comparison.
Table 2 shows an alternate approach to map A and B bits of a data entry to the TCAM comparison state.
In FIG. 1A , the memory array 100 also stores duplicate entries 120 of the A and B entries. The duplicate entries are denoted by the ′ symbol. Thus, A 0 ′ and B 0 ′ are duplicate entries of A 0 and B 0 , respectively. A 1 ′ and B 1 ′ are duplicate entries of A 1 and B 1 , and so on. FIG. 1A shows a logical arrangement of the memory array. Different physical layouts are possible. For example, in some embodiments, to decrease the likelihood of both the data entry 110 and the duplicate data entry 120 being affected by the same ionizing radiation event, the duplicate entry 120 is physically separated from the corresponding base entry 110 by at least a minimum spacing (e.g., separated by at least four entries).
The logic 150 includes read/write circuitry 160 , a data match module 165 , XOR circuitry 170 (or other compare circuitry), and an error correction code priority encoder (ECC PE) 180 . The read/write circuitry 160 reads data from the memory array 100 and writes data to the memory array 100 , via the interface 140 . The read/write circuitry 160 may also read and write data not shown in FIG. 1A . For example, data entry 110 may be an index to other data words. The read/write circuitry 160 may also read and write those other data words.
In the example shown in FIG. 1A , assume that the TCAM requires one cycle to read one physical 144-bit word and one cycle to write one physical 144-bit word. In that case, writing a data entry 110 and its duplicate entry 120 would require four cycles, one each to write A 0 , B 0 , A 0 ′ and B 0 ′. Reading the data entry would require four cycles, two cycles to read a data entry 110 and two cycles to read its duplicate entry 120 . In an alternate embodiment, the TCAM is designed so that 144-bit words are stored into corresponding rows simultaneously. That is, writing data to A 0 would also automatically write the same data to A 0 ′ during the same cycle. In that case, writing a data entry 110 and its duplicate entry 120 would require only two cycles. Reading the data stored in data entry 110 would require two cycles, because the base data is only 144 bits.
The content comparison function of the TCAM is performed by the data match module 165 . The data match module 165 compares the data entries 110 to an input word, taking into account both the data and the mask stored in the data entry 110 . In some embodiments, the data match module 165 compares an input word to every data entry 110 of the TCAM in parallel and generates a match output for every data entry 110 indicating whether the input word matched the data entry. The data match module 165 also compares an input word to the duplicate data entries 120 and generates match outputs for the duplicate data entries.
The duplicate data entries can be used to facilitate the real-time detection of errors in the memory array 100 , as shown in FIG. 1B . This might occur, for example, if bits are flipped due to ionizing radiation. In FIG. 1B , input word D is received by the TCAM. It is compared 153 to a data entry (A 0 , B 0 , for example) and also compared 155 to its corresponding duplicate data entry (A 0 ′, B 0 ′).
The outputs of the two compare operations 153 , 155 are compared 156 by the XOR 170 to determine whether the two match operations 153 , 155 produced the same result. Since the data entry 110 and corresponding duplicate data entry 120 should be the same, the outputs of their compare operations to the input word should also be the same. If XOR determines that this is the case, then the TCAM can operate as normal since the data entries are good. Otherwise, if the XOR 170 determines that there is a mismatch between the outputs of the two compare operations, a flag may be set 157 indicating the presence of an error in either the data entry 110 or in the corresponding duplicate data entry 120 .
Additionally, the ECC PE 180 may determine 158 the address of the inconsistent compare operation result. That is, ECC PE 180 determines the address of the (A 0 , B 0 ) and (A 0 ′, B 0 ′) so that the inconsistency can be resolved. In one approach, the address determined by the ECC PE 180 is used to correct 159 the detected error. For example, the uncorrupted data may be retrieved from an external data source and reloaded to the data entry 110 and the corresponding duplicate data entry 120 . The TCAM content compare can then be run again against the good data entries. The TCAM can be designed so that flagging 157 a possible error occurs as part of the TCAM content comparison function. In this way, possible errors are flagged early, which leads to earlier correction of those errors. This in turn reduces the delay in completing the TCAM content comparison function.
›DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS · 2 of 3
FIG. 2 is a block diagram of a TCAM with duplicate entries and error correction, according to one embodiment of the invention. The TCAM of FIG. 2 is similar to that shown in FIG. 1A , except that it also includes error correction within the TCAM. The logic 150 additionally includes error correction code (ECC) circuitry 190 , which implements the error correction. The memory array further stores ECC data 210 corresponding to the data entries 110 , 120 . In the example shown in FIG. 2 , the ECC data ECCA 0 corresponds to row A 0 , ECCB 0 corresponds to row B 0 , etc.
If the main data is 144 bits and Hamming code correction is used, then the ECC data may be 9 bits. Thus, 9-bit Hamming code ECCA 0 is calculated by ECC circuitry 190 for 144-bits of row A 0 , 9-bit Hamming code ECCB 0 is calculated by ECC circuitry 190 for 144-bits of row B 0 , and so on, including for the duplicate entries 120 . By using Hamming codes, the ECC circuitry 190 may be able to correct one bit errors and detect two bit errors. In other embodiments, other error correcting codes that are capable of detecting and/or correcting one or more bit errors may be used.
The write, compare and read functions of the TCAM in FIG. 2 may be modified relative to the TCAM in FIG. 1A , in the following ways. Upon writing data to the memory array 100 , the ECC circuitry 190 calculates the corresponding EEC data 210 which is also stored in the memory array. For example, when the 144 bits of row A 0 are written to the memory array 100 , the ECC circuitry 190 calculates the 9 bit Hamming code which is written as ECCA 0 to the memory array.
Upon readout, data may be read out in the same fashion as previously. Alternately, the ECC code 210 can also be checked as part of readout. For example, upon readout of row A 0 , that data may be checked by the ECC circuitry 190 against ECCA 0 to confirm the integrity of the data. If an error is indicated, the ECC circuitry 190 may be able to correct the error (e.g., in the case of 1-bit errors for the Hamming code example) or may simply flag the error for correction elsewhere.
In one approach, the content compare function for the TCAM proceeds initially in the same manner as for the TCAM of FIG. 1A , for example according to FIG. 1B . An input word D is matched against a data entry (A 0 , B 0 ) and against its duplicate entry (A 0 ′, B 0 ′). However, unlike in FIG. 1A , if the two matches have different results, the error may be corrected (step 159 of FIG. 1B ) internally within the TCAM in certain instances. The ECC circuitry 190 may perform a scrub operation to correct or detect the error. For example, rows A 0 , B 0 , A 0 ′, B 0 ′ may be checked by the ECC circuitry 190 against their corresponding error codes ECCA 0 , ECCB 0 , ECCA 0 ′, ECCB 0 ′ to correct and/or identify errors. The TCAM may be designed so that these checks proceed in parallel. If the encoding/decoding of error bits takes a long time, these operations may also be pipelined.
In some embodiments, the ECC circuitry 190 determines whether a correctable error exists in rows A 0 , B 0 , A 0 ′, B 0 ′ using their corresponding error codes ECCA 0 , ECCB 0 , ECCA 0 ′, ECCB 0 ′. For instance, a correctable error is a 1-bit error for the Hamming code described hereinabove. If the ECC circuitry 190 determines that one or more rows A 0 , B 0 , A 0 ′, B 0 ′ contain a correctable error, the ECC circuitry 190 corrects the row using the corresponding error code.
The ECC circuitry 190 further determines whether a non-correctable error exists in rows A 0 , B 0 , A 0 ′, B 0 ′. For instance, a non-correctable error is a 2-bit error for the Hamming code described hereinabove. If the ECC circuitry 190 determines that one or more rows A 0 , B 0 , A 0 ′, B 0 ′ contain a non-correctable error, the ECC circuitry 190 may retrieve the data word stored in rows A 0 , B 0 , A 0 ′, B 0 ′ from an external source and replace the row that contains a non-correctable error with the retrieved data word. Alternatively, if the ECC circuitry 190 determines that a row contains a non-correctable error, the ECC circuitry 190 may replace the contents of the row containing the non-correctable error based on the contents of the other rows that were determined not to contain errors.
If XOR 170 determines that the two match operations 153 , 155 of FIG. 1B have different results and the ECC circuitry 190 determines that none of the rows A 0 , B 0 , A 0 ′, B 0 ′ have an error, the ECC circuitry 190 may retrieve the data word stored in rows A 0 , B 0 , A 0 ′, B 0 ′ from an external source and replace every row A 0 , B 0 , A 0 ′, B 0 ′ with the retrieved data word. The ECC circuitry 190 may determine that none of the rows A 0 , B 0 , A 0 ′, B 0 ′ have an error if any of rows A 0 , B 0 , A 0 ′, B 0 ′ contain a non-detectable error. For instance, a non-detectable error is a 3-bit error for the Hamming code described hereinabove.
The present invention advantageously enables the real-time detection of errors in entries of a TCAM. The use of duplicate data entries 120 allow the detection of errors that otherwise would not be detected in real-time. Additionally, the storage of ECC data 210 within the TCAM enable local correction and/or detection of errors without the need to retrieve the uncorrupted data from an external source. As a result, the error correction and detection features are self contained in a TCAM module without the need of external modules or components.
To decrease the likelihood of multiple bit errors, the entries of the TCAM may be divided into multiple segments, as shown in FIG. 3 . In this example, each data row is divided into two sub-entries, each associated with its own ECC data. The old data row A 0 is divided into sub-entries A 0 x and A 0 y . The ECC code for A 0 x is stored as ECCA 0 x , and the ECC code for A 0 y is stored as ECCA 0 y . By doing this, the TCAM is able to correct single bit errors and detect double bit errors in each sub-entry. Additionally, the bits of the data rows and/or sub-entries may be physically placed in locations that reduce the likelihood of double bit errors.
›DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS · 3 of 3
Other implementations may use other arrangements of duplicate data entries and ECC data internal to the TCAM. For example, FIG. 4 is a block diagram of a TCAM with shared ECC data, according to another embodiment of the invention. In this example, the data entries 110 and their duplicates 120 are stored in the same row. A single ECC data 210 is used for both. In one implementation, ECCA 0 is the 9-bit Hamming code for the 144-bits A 0 . Since A 0 ′ is a duplicate of A 0 (at least initially, upon writing to the TCAM), the same 9-bit ECCA 0 is also the Hamming code for A 0 ′. In an alternate design, A 0 and A 0 ′ are treated as a single 288-bit word and ECCA 0 is the Hamming code for the 288-bit word.
One advantage of implementing the duplicate data entries 120 and/or the ECC data 210 and associated logic circuitry internally to the TCAM is that operations can be done internally within the TCAM, without the overhead of having to cross the interface 140 .
In another aspect, TCAMs may be provided as macro blocks for inclusion into larger chip designs. Thus, one company may be designing a chip that requires TCAMs. Instead of designing the TCAMs itself, the company (customer) licenses TCAM macro blocks from an IP vendor. The IP vendor may provide a TCAM macro block that already provides for the duplicate data entries 120 and/or the ECC data 210 and associated logic circuitry. This will save the customer time because he does not have to design these components or integrate them with a TCAM that does not have them. The IP vendor may also be able to come up with better overall designs since he may be able to better integrate the duplicate data entries 120 and/or the ECC data 210 with the rest of the TCAM.
In some embodiments, the IP vendor may provide a TCAM compiler to generate the design of a TCAM based on parameters specified by the customer. For example, the customer may specify the number of bits per word, the number of entries or words in the TCAM, etc. The customer may also specify if error detection and/or correction is desired. The memory compiler then generates the data entries 110 , the duplicate data entries 120 and/or the ECC data 210 and associated logic circuitry.
In some implementations of the TCAM, certain logic components may be implemented as macro blocks, which typically are laid out by hand and provided by the IP vendor. Other components may be implemented as a wrapper, which typically is synthesized from RTL and may be provided by either the IP vendor or the customer. For instance, the read/write circuitry 160 , the data match module 165 , and the XOR 170 often is included as part of a TCAM macro block, while the ECC PE 180 may be included as part of the wrapper. In another example, the ECC 190 may also be included in the wrapper. In yet another example, the read/write circuitry 160 , the data match module 165 , the XOR 170 , the ECC PE 180 , and the ECC 190 are all included in the TCAM macro block.
In yet another aspect, the TCAM compiler may generate a single word to store the data entry 110 , 120 and the ECC data 210 . For instance, if the data entry 110 , 120 is 144-bits long, and the ECC data 210 is 9-bits long, the TCAM compiler may generate a 153-bit long row to store both the data entry 110 , 120 and the ECC data 210 . That is, both row A and row B are increased by the number of bits in the ECC data 210 (e.g., row A and row B are generated as 153-bit long rows).
In some embodiments, to exclude the ECC data 210 from the compare operation, a mask is generated to mask out the bits of the ECC data 210 . The mask can be generated internally in the TCAM or external by a wrapper. Alternatively, the TCAM memory elements for the ECC data bits may be modified to remove the ECC data bits from the compare operation. For instance, the bits from the ECC data 210 may be disconnected from the line performing the compare operation of the data entry 110 , 120 , or the ECC data bits may be modified by removing the logic components that perform the compare operation.
In another embodiment, the ECC data 210 may be stored in a word that is separate from the data entries 110 , 120 . For instance, two memory arrays, one 144-bits wide and another 9-bits wide may be included to store the data entries 110 , 120 and the ECC data 210 respectively. In one embodiment, the memory array storing the ECC data 210 is implemented as an SRAM memory array.
Although the detailed description contains many specifics, these should not be construed as limiting the scope of the invention but merely as illustrating different examples and aspects of the invention. It should be appreciated that the scope of the invention includes other embodiments not discussed in detail above. Various other modifications, changes and variations which will be apparent to those skilled in the art may be made in the arrangement, operation and details of the method and apparatus of the present invention disclosed herein without departing from the spirit and scope of the invention.
›Tables in the description — 2
| A (data) | B (mask) | state |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 0 | 1 |
| 0 | 1 | X |
| 1 | 1 | X |
| A | B | state |
|---|---|---|
| 0 | 1 | 0 |
| 1 | 0 | 1 |
| 0 | 0 | X |
| 1 | 1 | not used |
Claims as granted
18 claimsLog in to read the claims of this application.
Log in to unlockClassifications
5 codes- G11C29/00
- G06F11/10
- H03M13/09
- H03M13/13
- H03M13/19
Claim changes
SoonSee which claims were amended, added or cancelled during examination, with every added and removed word marked.
The published claims of this application are not paired with the granted ones in what we hold.
File wrapper
See the full prosecution history — every USPTO and applicant action on this file, in order.
Log in to unlockDocuments
Log in to open the documents of this file: the application as filed, every office action and response, the notice of allowance.
Log in to unlockChain of title
See the full assignment history — every owner this patent has passed through, with recordation dates and reel/frame numbers.
Log in to unlock