The invention belongs to the technical field of
digital circuit design, and particularly relates to a TCAM (
ternary content addressable memory)-based quick matching search method, which comprises the following steps of: combining a
block RAM (
random access memory) and a distributed RAM to construct a TCAM; according to the length of the search word, dividing the search word into a plurality of search sub-words according to bits; according to the length of a search sub-word, inputting the search sub-word into a sub-
block RAM or a sub-distributed RAM,
processing results of a plurality of sub-RAMs, inputting the processed results into an
encoder, and outputting a matching address by the
encoder; and searching a corresponding operation in the RAM of the matched address and executing the operation. Compared with the prior art, the method has the advantages that the
Block RAM (BRAM) and the LUTRAM in the FPGA are comprehensively utilized to optimize the method for dividing the
search words, the BRAM and the LUTRAM are flexibly combined, the optimized composite TCAM (OC-TCAM) which is closer to or even fits the number of bits of the
search words is achieved, and consumption of storage resources is greatly reduced.