Patent ID: 7173452

Claim:
A re-programmable finite state machine (â€œRFSMâ€) comprising: a content addressable memory (â€œCAMâ€) comprising a compare register adapted to store a status vector to be matched, the compare register coupled for receiving a current state vector and an input vector which together comprise the status vector, a status mask register adapted to store a status mask, and to generate a masked status vector as a function of the status vector and the status mask, a compare array adapted to store a re-programmable plurality of compare vectors for a plurality of finite state machines, and to generate as an output a match vector as a function of respective bits of said masked status vector and said compare vectors, and a match mask register adapted to store a match mask, and to generate a masked match vector as a function of the match vector and the match mask, the masked match vector containing the compare vectors for a particular one of the plurality of finite state machines; an output array adapted to store a re-programmable plurality of control vectors, and to select for output one of said control vectors as a function of said masked match vector, a first portion of said selected control vector comprising the next state vector of said status vector and a second portion of said selected control vector comprising an output vector, the next state vector of the control vector coupled to the CAM for generating a next status vector for the CAM; a programming port coupled to the status mask register and the match mask register for selectively loading the status mask into the status mask register and loading the match mask into the match mask register; a context controller coupled to the RFSM through the programming port; and a context memory coupled to the RFSM through the context controller, the context memory storing the status mask and match mask for a plurality of Finite State Machines (FSMs); wherein the context controller downloads the status mask and match mask for a particular FSM in response to a context switch request signal; and wherein the particular one of the plurality of finite state machines is determined based on a selection of the status mask and the match mask.