摘要 |
According to one embodiment (300) a ternary CAM can include rules stored in CAM locations, where each rule includes match criteria. CAM locations determine priority among various rules. An input value can be matched against stored rules according to the match criteria. In an update operation (300) the CAM can receive a new rule (302). The new rule can be checked for overlap against currently stored rules (304). Rules overlap if an input value exists that can match both rules. If the new rule does not overlap any other rules, it can be added to any free location in the CAM. If the rule overlaps one or more existing rules, the new rule can be stored in an available location that with the appropriate priority with respect to the stored overlapping rules. If no such available location exists, a new set of CAM locations can be randomly selected, and the new rule and all overlapping rules can be written into the selected locations according to priority value.
|