TCAM-based not logic
11683039 · 2023-06-20
Assignee
Inventors
- Sohail A Syed (San Jose, CA, US)
- Hillel Gazit (Palo Alto, CA, US)
- Hon Luu (San Jose, CA, US)
- Pranab Ghosh (Pleasonton, CA, US)
Cpc classification
International classification
H03K19/20
ELECTRICITY
Abstract
A NOT logic circuit is provided comprising: one or more memory devices; wherein a first memory address location of the one or more memory devices stores first content data, wherein the first content data includes a first ternary value and a corresponding first priority value, wherein the first ternary value includes a continuous sequence of X-state values that represent a first range of non-X ternary values; wherein a second memory address of the one or more memory device stores second content data that includes a second ternary value and a corresponding second priority value, wherein the second ternary value includes a continuous sequence of non-X state values represent a non-X ternary value that is within the first range of non-X ternary values; an interface is coupled to receive a ternary value from a processing device; comparator circuitry operable to compare a received ternary key with the outputted first ternary value and to compare the received ternary key with the outputted second ternary value; priority encoder logic operable to, return the outputted first priority value on a condition that the received ternary key matches the first ternary value and the received ternary key does not match second ternary value, and return the outputted second priority value on a condition that the received ternary key matches the first ternary value and that the received ternary key matches the second ternary value; and detection logic operable to send a return to the processing device on a condition of a return of the first priority value.
Claims
1. A NOT logic circuit comprising: one or more memory devices; wherein a first memory address location of the one or more memory devices stores first content data, wherein the first content data includes a first ternary value and a corresponding first priority value, wherein the first ternary value includes a continuous sequence of X-state values that represent a first range of non-X ternary values; wherein a second memory address of the one or more memory device stores second content data that includes a second ternary value and a corresponding second priority value, wherein the second ternary value includes a continuous sequence of non-X state values represent a non-X ternary value that is within the first range of non-X ternary values; an interface is coupled to receive a ternary value from a processing device; comparator circuitry operable to compare a received ternary key with the outputted first ternary value and to compare the received ternary key with the outputted second ternary value; priority encoder logic operable to, return the outputted first priority value on a condition that the received ternary key matches the first ternary value and the received ternary key does not match second ternary value, and return the outputted second priority value on a condition that the received ternary key matches the first ternary value and that the received ternary key matches the second ternary value; and detection logic operable to send a return to the processing device on a condition of a return of the first priority value.
2. The NOT logic circuit of claim 1 further including: the detection logic operable to send no priority value to the processing device on a condition that of a return of the second priority value.
3. The NOT logic circuit of claim 1 further including: memory control logic operable to cause output of the first content data from the first memory address location and to cause output of the second content data from the second memory address location.
4. A method to use one or more memory devices to perform a NOT logic function comprising: storing first content data at a first memory address location of the one or more memory devices, wherein the first content data includes a first ternary value and a corresponding first priority value, wherein the first ternary value includes a continuous sequence of X-state values that represent a first range of non-X ternary values; storing second content data at a second memory address of the one or more memory device stores, wherein the second content data includes a second ternary value, wherein the second ternary value includes a continuous sequence of non-X state values represent a non-X ternary value that is within the first range of non-X ternary values; receiving a ternary value from a processing device; using a comparator circuit to compare a received ternary key with the stored first ternary value; using the comparator circuit to compare the received ternary key with the stored second ternary value; sending the stored first priority value to the processing device on a condition that the received ternary key matches the first ternary value and the received ternary key does not match second ternary value.
5. The method of claim 4 further including: sending no priority value to the processing device on a condition that the received ternary key matches the first ternary value and the received ternary key matches second ternary value.
Description
BRIEF DESCRIPTION OF DRAWINGS
(1) In the drawings, which are not necessarily drawn to scale, like numerals may describe similar components in different views. Like numerals having different letter suffixes may represent different instances of similar components. Some embodiments are illustrated by way of example, and not limitation, in the figures of the accompanying drawings in which:
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
DETAILED DESCRIPTION
(13) Network Device:
(14)
(15) The network device 500 includes a processing device 510, which receives the packets or portions of packets on an input port or interface 520. In some implementations, the processing device 510 comprises a network processor. The processing device 510 parses incoming packet information to identify relevant data fields that provide information for handling network operations, such as routing and forwarding. The processing device 510 can be coupled with a TCAM-based search engine 540, hereinafter referred to as the “TCAM system” 540, which assists in determining appropriate actions to take in response to receipt of packets over a network. The processing device 510 extracts information from the packets, referred to as key information 560. The key information is used to identify rules that determine appropriate actions to take in response to the received packets. The key information represents data bits within a packet that indicate packet information such as network addresses or portions thereof, port numbers, other header and trailer information, or combinations thereof, for example. The processing device 510 can generate key information, also referred as a “key”, that includes ternary value bits, which can have any of three states, logic 0, logic 1, or X (“don't care”), to represent the binary bits extracted from a packet. In general, ternary value bits within a key that represent a logic value 0 or a logic value 1 contribute to identifying a rule that determines an action to take based upon a packet represented by the key, and ternary value bits within a key that represent an X state do not contribute to identifying a rule that determines an action take based upon the packet represented by the key.
(16) The processing device 510 sends ternary key information 560 to the TCAM system 540, which stores rules associated with such key information that indicate corresponding action to take. In an example processing device 510 the rules include priority values that indicate output ports to use to output packets received by the processing device 510. More particularly, in response to receipt of key information 560 corresponding to a packet, the TCAM system 540 returns one or more corresponding priority value rules 570 identified using the key information 560. Based upon a returned priority value, the processing device 510 determines an output port from among output ports 530.sub.1-530.sub.m on which to forward packet information, for example. Alternatively, the processing device 510 may determine to drop a received packet. The network processor 540 may determine to drop a packet if the TCAM system 540 determines that there is no match for a received key, for example. The TCAM system 540 includes one or more memory devices to store keys in association with corresponding priority values 570. Matches between previously stored keys and keys provided by the processing device 510, in response to received packets, are searched to identify priority values to use to route or switch the received packets.
(17)
(18)
(19) TCAM System
(20)
(21) The memory control logic 824 controls access to the memory devices 830.sub.0-830.sub.15. During a write operation, the memory control logic 824 determines a memory location at which to store a ternary value and an associated priority value. Different ternary values and corresponding priority values can be written to the same segment within different memory devices. For example, a memory segment can consist of one or more wordlines. A first ternary value and a corresponding first priority value may be written to a wordline1 835.sub.0 in the first memory device 830.sub.0; a second ternary value and a corresponding second priority value may be written to a wordline1 835.sub.1 in the second memory device 830.sub.1; and a sixteenth ternary value and corresponding sixteenth priority value may be written to a wordline1 835.sub.15 in a sixteenth memory device 830.sub.15.
(22) During a read operation, the memory control logic 824 can simultaneously access multiple memory locations within two or more of the memory the devices 830.sub.0-830.sub.15 to search for a match with a received ternary key value. More particularly, during a read operation, the memory controller 824 causes read access of content data from common memory segments, e.g., wordline1, at one or more of the memory devices. Corresponding output buffer circuits 840.sub.0-840.sub.15 receive content data output by the one or more memory devices. The content data includes stored ternary values and corresponding priority value information written previously to the accessed memory segments of the one or more memory devices. Corresponding comparators 850.sub.0-850.sub.15 compare stored ternary values output to corresponding buffers 840.sub.0-840.sub.15 with a ternary key value received at the input interface 810 and provide signals on corresponding match lines M.sub.0-M.sub.15, indicating whether a match is detected. For example, a first comparator 850.sub.0 provides a match signal on a first match line M.sub.0 indicating whether there is a match between a received ternary key value and a ternary value that is output from memory segment 835.sub.0 to the output to buffer circuit 840.sub.0. On a condition that a match is determined, a priority value output to buffer circuit 840.sub.0 is provided to the detection circuit 880. Thus, a priority value portion of the content data at memory segment 835.sub.0 is provided on output line O.sub.0 to the detection circuit 880 on a condition that the stored ternary value portion of the content data stored at memory segment 235.sub.0 matches the received key value. Conversely, on a condition that there is not a match between a received ternary key value and a ternary value that is output from memory segment 835.sub.0 then the priority value portion of the content data at memory segment 835.sub.0 is not provided on output line O.sub.0 to the detection circuit 880.
(23) Similarly, a second comparator 850.sub.1 provides a match signal on a second match line M.sub.1 indicating whether there is a match between a received ternary key value and a ternary value that is output from memory segment 835.sub.1 to the output to buffer circuit 840.sub.1. On a condition that a match is determined, a priority value output to buffer circuit 840.sub.1 is provided to the detection circuit 880. Thus, a priority value portion of the content data at memory segment 835.sub.1 is provided on output line O.sub.1 to the detection circuit 880 on a condition that the stored ternary value portion of the content data stored at memory segment 235.sub.1 matches the received key value. Conversely, on a condition that there is not a match between a received ternary key value and a ternary value that is output from memory segment 835.sub.1 then the priority value portion of the content data at memory segment 835.sub.1 is not provided on output line O.sub.1 to the detection circuit 880.
(24)
(25) Referring again to
(26) TCAM-Based NOT Logic:
(27)
(28) In the first example configuration the TCAM system 540 is configured to perform the logic function: if a received ternary key value is NOT AAA, then use a priority value P1. The compressed continuous ternary value pattern XXX defines a continuous range of ternary values. The XXX ternary value pattern is referred to as continuous because there are no non-X state (i.e. ternary logic state 0 or ternary logic 1 state) values intervening between any X values in the continuous sequence. The compressed ternary value pattern represents a continuous sequence of ternary values, 000-111. The exception ternary value AAA is a value included within the defined range 000-111.
(29) The first memory device 830.sub.0 stores the example compressed continuous ternary value pattern XXX and the corresponding first priority value P1 at memory segment 835.sub.0. The second memory device 830.sub.1 stores the example exception ternary value AAA and a corresponding second priority value P2 at memory segment 835.sub.1. For compactness of disclosure in this example, it is assumed that the first and second memory devices 830.sub.0, 830.sub.1 each store only three ternary values per memory segment 835.sub.0, 835.sub.1 and that the received key value also includes only three ternary values.
(30) The first priority value P1 comprises a numerical value having a magnitude. The second priority value P2 also comprises a numerical value having a magnitude. The second priority value is also referred to herein as an exception priority value. The second priority value P2 has a magnitude that is larger than a magnitude of the first priority value P1. As explained above, in an example TCAM system 540, the second priority value P2 has the largest magnitude out of all priority values stored in the TCAM system 540.
(31) As explained above with reference to
(32) On a condition that a key value received at input 810 is received having a ternary value AAA, then the received key value will match both the stored value XXX and the stored value AAA. The first comparator 850.sub.0 determines a key match with the ternary value XXX stored at memory device 830.sub.0 at the memory segment 835.sub.0 that also stores the first priority value P1. The second comparator 850.sub.1 determines a key match with the ternary value AAA stored at memory device 230.sub.1 at the memory segment 835.sub.1 that also stores the second priority value P2. The priority block 875 causes the second priority value P2 to be provided for return to the processing device 510. Since the second/exception priority value P2 equals the exception value (max), the detection circuit 880 causes no return of the second priority value P2.
(33) Conversely, on a condition that a key value received at input 810 has a ternary value other than AAA, then the received key value will match only the stored value XXX.
(34) The first comparator 850.sub.0 determines a key match with the ternary value XXX stored at memory device 830.sub.0 at the memory segment 835.sub.0 that also stores the first priority value P1. The second comparator 850.sub.1 determines no key match with the ternary value AAA stored at memory device 830.sub.1 at the memory segment 835.sub.1 that also stores the first priority value P2. The priority block 875 causes the first priority value P1 to be provided for return to the processing device 510. The first memory device 830.sub.0 outputs only the first priority value P1. The priority block 875 causes the first priority value P1 to be provided for return to the processing device 510. Since the first priority value P12 does meet the exception condition, the detection circuit 880 does not causes no return of the first priority value P1.
(35) Thus, it will be appreciated that only two ternary values need be stored and that only two comparisons are required to determine whether a received key value does not match a designated key value within a continuous range of key values. One comparison determines that the received key value matches the sequence of X states that span the range. A second comparison determines whether the received key value also matches a designated exception value, e.g., AAA, within the range of the X-state sequence. The match with the X state range identifies a first priority value that can be used to specify a rule, e.g., to specify an output port to use to send a message, and a match with the exception value can be used to negate the rule, e.g., to specify that a message should not be sent for a received key that matches a designated exception value. Moreover, it will be appreciated that a received key can represent a network address, a protocol or a combination thereof, for example.
(36)
(37) On a condition that a search value 1023.sub.10 (i.e., 0000000111111111) is received (i.e., the NOT condition is met), the detection circuit 880 causes no return of a priority value. Thus, the detection circuit 880 indicates a match between a received search value and the exception value 0000000111111111 in response to a return the second priority value P2.
(38) Conversely, on a condition of receiving any search value less than 1024.sub.10, other than 1023.sub.10 (i.e., the NOT condition is not met) then detection circuit 880 returns the first priority value P1 to the processing device 510. Thus, the detection circuit 880 indicates a match between a received search value and the continuous X state ternary value pattern 0000000XXXXXXXXX in response to a return the first priority value P1. The above description is presented to enable any person skilled in the art to make and use ternary content addressable memory to perform a NOT logic operation. Various modifications to the examples will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of the invention. For example, although an algorithmic TCAM is disclosed in detail herein, the principles of the invention also apply to cell based TCAM. In the preceding description, numerous details are set forth for the purpose of explanation. However, one of ordinary skill in the art will realize that the invention might be practiced without the use of these specific details. In other instances, well-known processes are shown in block diagram form in order not to obscure the description of the invention with unnecessary detail. Identical reference numerals may be used to represent different views of the same or similar item in different drawings. Thus, the foregoing description and drawings of embodiments in accordance with the present invention are merely illustrative of the principles of the invention. Therefore, it will be understood that various modifications can be made to the embodiments by those skilled in the art without departing from the spirit and scope of the invention, which is defined in the appended claims.