-- State declaration type t_state is (IDLE, READ_DATA, WRITE_DATA, ERROR); signal s_current_state, s_next_state : t_state; -- Process 1: State Register process(clk) begin if rising_edge(clk) then if (rst = '1') then s_current_state <= IDLE; else s_current_state <= s_next_state; end if; end if; end process; -- Process 2: Next State and Output Logic process(all) begin -- Default assignments to prevent latches s_next_state <= s_current_state; o_ready <= '0'; case s_current_state is when IDLE => o_ready <= '1'; if (i_start = '1') then s_next_state <= READ_DATA; end if; when READ_DATA => if (i_done = '1') then s_next_state <= WRITE_DATA; end if; when others => s_next_state <= IDLE; end case; end process; Use code with caution. 6. Advanced VHDL Features for High-Efficiency Code
process blocks contain sequential statements, but the process itself executes concurrently relative to the rest of the architecture. Inside a process, statements describe the behavior of a specific block of hardware, not a step-by-step software recipe. 2. Structural Principles and Design Organization effective coding with vhdl principles and best practice pdf