Altera_Forum
Honored Contributor
17 years agoStarting Process from another
Hi,
i got a design using two state machine. The first process is starting the second process and then it wait until its done. Both processes are clocked on the rising edge of the same clock. The Code is like this: PROCESS(clk, reset) BEGIN IF reset= ' 1' THEN Start_S <= '0'; ELSIF rising_edge(clk) THEN CASE state IS WHEN start => Start_S <= '1'; state <= wait_on_ready; WHEN wait_on_ready => Start_S <= '0' IF Done_S = '1' THEN state <= start; ELSE state <= wait_on_ready; END IF; END CASE; END IF; END PROCESS; PROCESS(clk, reset) BEGIN IF reset= ' 1' THEN done_S <= '0'; ELSIF rising_edge(clk) THEN CASE state IS WHEN wait_on_start => Done_S <= '0'; IF start_S = '1' THEN state <= do_someting; ELSE state <= wait_on_start; END IF; WHEN do_someting => ..... state <= set_done; WHEN set_done => done_S <= '1'; state <= wait_on_start; END CASE; END IF; END PROCESS; Now my question: Is it ok to turn on the Start_S (Done_S) Signals with the rising edge of the clock and turn them of with the next rising edge? Does the other process definitly get the signals high value when looking at them at the rising edge of clk or do i have to turn on the Signals for two clks? Or is it good practice to clock the second process with the negative edge? Thanks in advance, Patrick