Altera_Forum
Honored Contributor
15 years agomulticycle instruction FSM with nios and the done variable
I have been trying for weeks to figure out how the done variable works and it seems like it has no effect whatsoever on the program. Can anyone explain how it works.
Here's an example i've been working on: if (reset = '1') then state <= s0; ELSIF (clk'EVENT AND clk = '1') THEN CASE state IS WHEN s0 => IF (start = '1' AND n = '0') THEN io_148194546 <= dataa; io_277277265 <= datab; state <= s0; done <= '1'; ELSIF (start = '1' AND n = '1') THEN io_109970892 <= dataa; io_19111827 <= datab; state <= s1; done <= '1'; ELSE state <= s0; done <= '0'; END IF; WHEN s1 => result <= io_1298736395; done <= '1'; state <= s0; WHEN OTHERS => report "Invalid State"; END CASE; END IF; END PROCESS; When I do something like: ALT_CI_CI_HARDWARE_INST(0,2,4); y = ALT_CI_CI_HARDWARE_INST(1,5,8); i can't the result from the past operation in y. So if i want to get the actualy value of y, i need to do something like ALT_CI_CI_HARDWARE_INST(0,2,4); y = ALT_CI_CI_HARDWARE_INST(1,5,8); y = ALT_CI_CI_HARDWARE_INST(1,5,8); Thanks