Hi everyone,
I try to construct this statemachine as described in VHDL below: (the machine is supposed to set the hold as soon as the trig-signal is asserted (initialized only when all signals have been low for a clock-cycle) and go low when both the read and holdoff signals have been asserted for some time...
------------------------------------------ entity holdoffcontroller is Port ( clk : in std_logic; reset : in std_logic; save : in std_logic; trig : in std_logic; read : in std_logic; holdoff : in std_logic; hold : out std_logic; state : out std_logic_vector(4 downto 0)); end holdoffcontroller;
architecture Behavioral of holdoffcontroller is constant stateStart : std_logic_vector(4 downto 0) := "00001"; constant stateWait : std_logic_vector(4 downto 0) := "00010"; constant stateTrigger : std_logic_vector(4 downto 0) := "00100"; constant stateHold : std_logic_vector(4 downto 0) := "01000"; constant stateRead : std_logic_vector(4 downto 0) := "10000"; begin
STATEMACHINE: block signal current_state, next_state : std_logic_vector(4 downto 0) := stateStart; begin stateRegister : process(clk, reset) begin if reset = '1' then current_state