T
Timo Gerber
Hi,
i hve a huge problem with my FSM. It's the implentation of an
transmitting module with handshake signals:
I try to transfer 3 data_blocks which are registered in a seperate process.
The problem occurs in state "block2"
In the sim, the valid signal is assigen, while the output signal is not
changing, although they are assigned at the same time.
PROCESS (clk, areset)
BEGIN
IF areset = '0' THEN
state <= idle;
ELSIF clk'EVENT AND clk = '1' THEN
CASE state IS
WHEN idle => test_state <= 0;
valid <= '0';
IF start = '1' AND accept = '0' THEN
valid <= '1';
output <= data_block1;
state <= block1; ELSE
state <= idle;
END IF;
WHEN block1 => test_state <= 1;
IF accept = '0' THEN
state <= block1;
ELSIF accept = '1' THEN
state <= block1_wait;
valid <= '0';
output(13 downto 0) <= (OTHERS => '0');
END IF;
WHEN block1_wait => test_state <= 2;
IF accept = '0' THEN
state <= block2;
valid <= '1';
output <= data_block2;
ELSE
state <= block1_wait;
END IF;
WHEN block2 =>
test_state <= 3;
IF accept = '0' THEN
state <= block2;
ELSIF accept = '1' THEN
valid <= '0';
output(13 downto 0) <= (OTHERS => '0');
state <= block2_wait;
END IF;
WHEN block2_wait => test_state <= 4;
IF accept = '0' THEN
valid <= '1';
output <= data_block3;
state <= block3;
ELSE
state <= block2_wait;
END IF;
WHEN block3 => test_state <= 5;
IF accept = '0' THEN
state <= block3;
ELSIF accept = '1' THEN
valid <= '0';
output(13 downto 0) <= (OTHERS => '0'); -- BIG PROBLEM HERE!
state <= block3_wait;
END IF;
WHEN block3_wait => test_state <= 6;
state <= idle;
WHEN OTHERS =>
state <= idle;
END CASE;
END IF;
END PROCESS;
i hve a huge problem with my FSM. It's the implentation of an
transmitting module with handshake signals:
I try to transfer 3 data_blocks which are registered in a seperate process.
The problem occurs in state "block2"
In the sim, the valid signal is assigen, while the output signal is not
changing, although they are assigned at the same time.
PROCESS (clk, areset)
BEGIN
IF areset = '0' THEN
state <= idle;
ELSIF clk'EVENT AND clk = '1' THEN
CASE state IS
WHEN idle => test_state <= 0;
valid <= '0';
IF start = '1' AND accept = '0' THEN
valid <= '1';
output <= data_block1;
state <= block1; ELSE
state <= idle;
END IF;
WHEN block1 => test_state <= 1;
IF accept = '0' THEN
state <= block1;
ELSIF accept = '1' THEN
state <= block1_wait;
valid <= '0';
output(13 downto 0) <= (OTHERS => '0');
END IF;
WHEN block1_wait => test_state <= 2;
IF accept = '0' THEN
state <= block2;
valid <= '1';
output <= data_block2;
ELSE
state <= block1_wait;
END IF;
WHEN block2 =>
test_state <= 3;
IF accept = '0' THEN
state <= block2;
ELSIF accept = '1' THEN
valid <= '0';
output(13 downto 0) <= (OTHERS => '0');
state <= block2_wait;
END IF;
WHEN block2_wait => test_state <= 4;
IF accept = '0' THEN
valid <= '1';
output <= data_block3;
state <= block3;
ELSE
state <= block2_wait;
END IF;
WHEN block3 => test_state <= 5;
IF accept = '0' THEN
state <= block3;
ELSIF accept = '1' THEN
valid <= '0';
output(13 downto 0) <= (OTHERS => '0'); -- BIG PROBLEM HERE!
state <= block3_wait;
END IF;
WHEN block3_wait => test_state <= 6;
state <= idle;
WHEN OTHERS =>
state <= idle;
END CASE;
END IF;
END PROCESS;