Method and apparatus for determining a longest prefix match in a content addressable memory device
First Claim
1. A method of determining the location of an entry in one of plurality of depth cascaded content addressable memory (CAM) devices, each CAM device having a plurality of ternary CAM cells, wherein the located entry has the most unmasked bits among the CAM cells of all CAM devices, the method comprising:
- determining which locations in each CAM device match comparand data;
determining the largest number of unmasked mask bits among the matching entries in each CAM device; and
comparing the largest numbers of mask bits of each of the CAM devices.
9 Assignments
0 Petitions
Accused Products
Abstract
A method and apparatus for determining a longest prefix match in a content addressable memory (CAM) device is described. The CAM device includes a CAM array that may be arbitrarily loaded with CIDR addresses that are not prearranged prior to their entry into the CAM device. For one embodiment, the CAM array is a ternary CAM array that includes CAM cells storing CAM data, mask cells storing prefix mask data for the corresponding CAM cells, a CAM match line for indicating a match between a search key and the CAM data (as masked by the prefix mask data), prefix match lines, and prefix logic circuits for comparing the CAM match line with the prefix mask data. The prefix logic circuits determine the longest prefix among the CAM locations that match the search key, regardless of where the matching locations are logically located in the CAM array. The longest prefix is then compared against the prefix mask data stored in the mask cells to determine the location in the CAM array that stores the CIDR address corresponding to the longest prefix. The CAM index or address of the matching CIDR address may then be output from the CAM device. Additionally and/or alternatively, additional or associated data stored at the CAM index may be accessed. The additional or associated data may be, for example, routing information for the stored CIDR address.
141 Citations
36 Claims
-
1. A method of determining the location of an entry in one of plurality of depth cascaded content addressable memory (CAM) devices, each CAM device having a plurality of ternary CAM cells, wherein the located entry has the most unmasked bits among the CAM cells of all CAM devices, the method comprising:
-
determining which locations in each CAM device match comparand data;
determining the largest number of unmasked mask bits among the matching entries in each CAM device; and
comparing the largest numbers of mask bits of each of the CAM devices.
-
-
2. A method of operating a content addressable memory (CAM) device, comprising:
-
writing CAM data into CAM cells of a CAM array;
decoding mask data;
writing the decoded mask data into mask cells of the CAM array;
determining the logical states of a first plurality of match lines in response to comparing comparand data with the CAM data; and
logically comparing the states of the first match lines with the decoded mask data to determine the decoded mask data that has the most unmasked bits. - View Dependent Claims (3, 4, 5, 6)
-
-
7. A content addressable memory (CAM) device comprising:
-
a CAM array having a plurality of CAM cells and a plurality of mask cells, where each mask cell is coupled to a corresponding CAM cell;
cascade logic coupled to the CAM array;
a plurality of first inputs coupled to the cascade logic, the first inputs for receiving first mask input data; and
a first compare circuit coupled to the first inputs for comparing first mask input data with internal mask data. - View Dependent Claims (8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)
-
-
19. A system comprising:
-
a first content addressable memory (CAM) device having;
a first plurality of mask inputs; and
a first plurality of mask outputs; and
a second CAM device comprising;
a first plurality of mask inputs coupled to the first plurality of mask outputs of the first CAM device; and
a first plurality of mask outputs coupled to the first plurality of mask inputs of the first CAM device. - View Dependent Claims (20, 21, 22, 23, 24, 25, 26)
-
-
27. A content addressable memory (CAM) device comprising:
-
a ternary CAM array for storing mask data; and
encoding logic for receiving and encoding the mask data, wherein the ternary CAM array is configured to store CAM data and wherein the CAM device further comprises;
a first plurality of inputs for receiving comparand data to be compared with the CAM data; and
a second independent plurality of inputs for receiving mask data to be stored in the ternary CAM array. - View Dependent Claims (28)
-
-
29. A content addressable memory (CAM) device comprising:
-
a ternary CAM array for storing mask data; and
encoding logic for receiving and encoding the mask data wherein the ternary CAM array comprises;
a first plurality of memory cells for storing first data;
a first plurality of compare circuits for comparing the first data with search data to generate first comparison results;
a second plurality of memory cells for storing the mask data corresponding to the first data;
a second plurality of compare circuits for comparing a longest mask data with the mask data to generate second comparison results;
a plurality of first match lines coupled to the first compare circuits to receive the first comparison results;
a plurality of masking circuits coupled to the first compare circuits and the second memory cells;
a plurality of prefix signal lines; and
a plurality of prefix logic circuits each having a first input coupled to one of the first match lines, a second input coupled to receive the mask data from one of the second memory cells, and an output coupled to one of the plurality of prefix signal lines. - View Dependent Claims (30, 31, 32, 33, 34, 35, 36)
-
Specification