Ok Fair enough, I have used state machines as variables in both simulation and in my build and I havent noticed any problems. Can you elaborate as to why you dont use them as variables?
If I change the procedure to not use the state machine:
PROCEDURE procedure_example ( SIGNAL clk_i : IN std_logic;
SIGNAL reset_i : IN std_logic;
SIGNAL empty : IN std_logic;
SIGNAL rdreq : OUT std_logic) IS
VARIABLE rdreq_ip : std_logic;
BEGIN
IF(reset_i = '1') THEN
rdreq <= '0';
rdreq_ip := '0';
ELSIF(clk_i = '1' AND clk_i'EVENT) THEN
IF(empty = '0' AND rdreq_ip = '0') THEN
rdreq <= '1';
rdreq_ip := '1';
ELSIF(rdreq_ip = '1') THEN
rdreq <= '0';
rdreq_ip := '0';
END IF;
END IF;
END PROCEDURE;
If I call this like I did with the previous procedure rdreq never gets set. I took both procedures and put them in processes and they behaved as expected. I am not sure what but im obviously missing some feature of procedures or am using them for the wrong purpose. It would be great to work out what im missing!
Thanks
James