N
Nigel Noldsworth
Hello there,
I have the following process for the combinatory logic of a state
machine. However during simulation it seems to me that when
rising_edge of the clock, the process is not triggered with "state"
signal assuming that sda (not on the sensitivity list) = 1. Hence the
state machine stays into idle mode. I was guessing that rising_edge of
the clock, that same value is being assigned to "state" signal and
this assignment will wake up the process. It seems I'm wrong. Can you
please shade some light please ?
receive : process (state, count) is
variable i : natural;
begin -- process receive
case state is
when IDLE =>
count <= 0;
storage <= (others => '0');
val <= '0';
--
if sda = '1' then
nxt_state <= CAPTURE;
else
nxt_state <= IDLE;
end if;
when CAPTURE =>
........
sync_receive : process (clock, reset)
begin
if reset = '0' then
state <= IDLE;
output <= (others => '0');
elsif clock'event and clock = '1' then
if enable = '1' then
state <= nxt_state;
output <= storage;
end if;
end if;
end process sync_receive;
I have the following process for the combinatory logic of a state
machine. However during simulation it seems to me that when
rising_edge of the clock, the process is not triggered with "state"
signal assuming that sda (not on the sensitivity list) = 1. Hence the
state machine stays into idle mode. I was guessing that rising_edge of
the clock, that same value is being assigned to "state" signal and
this assignment will wake up the process. It seems I'm wrong. Can you
please shade some light please ?
receive : process (state, count) is
variable i : natural;
begin -- process receive
case state is
when IDLE =>
count <= 0;
storage <= (others => '0');
val <= '0';
--
if sda = '1' then
nxt_state <= CAPTURE;
else
nxt_state <= IDLE;
end if;
when CAPTURE =>
........
sync_receive : process (clock, reset)
begin
if reset = '0' then
state <= IDLE;
output <= (others => '0');
elsif clock'event and clock = '1' then
if enable = '1' then
state <= nxt_state;
output <= storage;
end if;
end if;
end process sync_receive;