Maxwell077
Advanced Member level 4
- Joined
- Sep 18, 2009
- Messages
- 115
- Helped
- 15
- Reputation
- 32
- Reaction score
- 11
- Trophy points
- 1,298
- Location
- Puerto Rico
- Activity points
- 2,029
Hi;
I have observed unusual behavior in my state machine.
Let me explain what's happenning.
I have 6 states and they are one-hot encoded by synthesis tool.
idle : 000001
2nd_st : 000010
3rd_st : 000100
4th_st : 001000
5th_st : 010000
6th_st : 100000
After reset, state goes to idle(000001), and pulled down reset pin state goes to 2nd_st and waits for interrupt.
After interrupt is occured, state goes to unknown and un-encoded state - "000000" and waits there forever.
There is "others" clause in my code and normally state should be directed to idle, but it is not.
I couldn't find any reason why state goes to unknown state. Code is not working because of this issue.
Any help would be appriciated.
Thanks
I have observed unusual behavior in my state machine.
Let me explain what's happenning.
I have 6 states and they are one-hot encoded by synthesis tool.
idle : 000001
2nd_st : 000010
3rd_st : 000100
4th_st : 001000
5th_st : 010000
6th_st : 100000
After reset, state goes to idle(000001), and pulled down reset pin state goes to 2nd_st and waits for interrupt.
After interrupt is occured, state goes to unknown and un-encoded state - "000000" and waits there forever.
There is "others" clause in my code and normally state should be directed to idle, but it is not.
I couldn't find any reason why state goes to unknown state. Code is not working because of this issue.
Any help would be appriciated.
Thanks
Code:
process(ft245ClkOut)
begin
if falling_edge(ft245ClkOut) then
if syncRst = '1' then
currState <= idle;
s_pixel_wdata <= (others => '0');
pre_pixel_we <= '0';
else
pre_pixel_we <= pixel_we;
case currState is
when idle =>
currState <= checkForPixelRdy;
s_pixel_wdata <= (others => '0');
pre_pixel_we <= '0';
when checkForPixelRdy =>
if pre_pixel_we = '0' and pixel_we = '1' then
currState <= checkForTxBuff;
s_pixel_wdata <= pixel_wdata;
else
currState <= checkForPixelRdy;
end if;
when checkForTxBuff =>
if ft245TxFull = '0' then
currState <= sendPixelBigEndian;
else
currState <= checkForTxBuff;
end if;
when sendPixelBigEndian =>
currState <= writeDone;
when writeDone =>
currState <= sendPixelLittleEndian;
when sendPixelLittleEndian =>
currState <= checkForPixelRdy;
when others =>
currState <= idle;
s_pixel_wdata <= (others => '0');
pre_pixel_we <= '0';
end case;
end if;
end if;
end process;