Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- begin -- process p _state_machine
- if ext_reset = '1 ' then -- asynchronous reset (active high)
- gamelogic_state <= IDLE;
- elsif clk25'event and clk25 = '1' then -- rising clock edge
- case gamelogic_state is
- when IDLE =>
- if tick = ' 1' then
- gamelogic_state <= CHECK;
- end if;
- when CHECK =>
- if (check_done_int = '1') and (nochange_int = '1') and (crashed_int =
- '0') then
- gamelogic_state <= HEAD_DATA;
- elsif (check_done_int = '1') and (nochange_int = '0') and (crashed_int =
- '0') then
- gamelogic_state <= CORNER;
- elsif (crashed_int = '1') then
- gamelogic_state <= RESET;
- else
- gamelogic_state <= CHECK;
- end if;
- when HEAD_DATA =>
- if (head_addr_done_int = '1') then
- gamelogic_state <= HEAD_WRITE;
- end if;
- when HEAD_WRITE =>
- if (head_done_int = ' 1') then
- gamelogic_state <= IDLE;
- end if;
- when CORNER =>
- if (corner_done_int = '1') then
- gamelogic_state <= IDLE;
- end if;
- when TAIL_READ =>
- if (tailread_done_int = '1') then
- gamelogic_state <= TAIL_WRITE;
- elsif (tail_done_int = '1') then
- gamelogic_state <= SCORE;
- end if;
- when TAIL_WRITE =>
- if (tailwrite_done_int = '1') then
- gamelogic_state <= SCORE;
- end if;
- when SCORE =>
- if (score_done_int = '1') then
- gamelogic_state <= IDLE;
- end if;
- when RESET =>
- if (reset_done_int = '1') then
- gamelogic_state <= IDLE;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement