Methods of implementing state machines using embedded processors. The
designer specifies the logical footprint of the state machine in a
formalism that can be transformed into hardware. This approach decouples
the designer from the design, so that a state machine can be moved
between embedded processors (e.g., between a hard processor and a soft
processor), without any modifications to the code. One or more
source-to-source transformations can be performed to improve the run-time
performance of the state machine. These transformations can include the
insertion of one or more jump addresses directly into the code, bypassing
the standard lookup table approach for memory addressing, and
consequently speeding up the execution of the code. The jump addresses
can include, for example, a jump address for the start of each state
machine, and/or a jump address for each state within the state machines.