I need to read data from a SRAM in one step (something like READ_RAM(addr) that returns the value stored in the SRAM at the "addr" address). Is it possible create a function/procedure that integrates a Finite State Machine?
A FSM is a sequential piece of circuitry, and functions are combinational only, so a function cannot represent by itself a FSM. However, the combinational paths of the FSM can be represented with functions. Typical examples are coding the next state or the outputs based on the current state and inputs. It is a very clean way of coding a FSM.
A procedure, on the other hand, can contain sequential statements, but when they do they are mostly used for testbenches using
wait statements, which are not synthesizable.