dejo, hace 9 meses sr @T4V0 I use Notepad to write scripts.I don't think it works that way with the code written like this **library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity tb_Kitchen_Timer is end tb_Kitchen_Timer; architecture tb of tb_Kitchen_Timer is signal clk : std_logic := '0'; signal reset : std_logic := '0'; signal start : std_logic := '0'; signal stop : std_logic := '0'; signal adjust_interval_up : std_logic := '0'; signal adjust_interval_down : std_logic := '0'; signal alarm : std_logic; constant TbPeriod : time := 10 ns; signal TbClock : std_logic := '0'; signal TbSimEnded : std_logic := '0'; begin dut : entity work.Kitchen_Timer port map ( clk => clk, reset => reset, start => start, stop => stop, adjust_interval_up => adjust_interval_up, adjust_interval_down => adjust_interval_down, alarm => alarm ) TbClock <= not TbClock after TbPeriod/2 when TbSimEnded /= '1' else '0'; -- Clock generation clk <= TbClock; stimuli : process variable num_ticks : natural; begin -- Reset generation reset <= '1'; wait for 20 ns; reset <= '0'; wait for 20 ns; -- Start the timer start <= '1'; wait for 20 ns; start <= '0'; stop <= '1'; -- Adjust interval up and down adjust_interval_up <= '1'; wait for 10 ns; start <= '1'; stop <= '0'; adjust_interval_up <= '0'; wait for 30 ns; start <= '0'; stop <= '1'; adjust_interval_down <= '1'; wait for 10 ns; start <= '1'; stop <= '0'; adjust_interval_down <= '0'; wait for 20 ns; start <= '0'; stop <= '1'; adjust_interval_up <= '1'; wait for 600 ns; start <= '1'; stop <= '0'; adjust_interval_up <= '0'; -- Wait for the timer to reach the alarm interval (60 clocks) wait for 600 ns; -- Simulate for the required time -- Stop the timer start <= '0'; stop <= '1'; wait for 100 ns; -- Stop the clock and terminate the simulation TbSimEnded <= '1'; wait; end process; end tb; **
@T4V0 I use Notepad to write scripts.I don't think it works that way with the code written like this
**library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity tb_Kitchen_Timer is end tb_Kitchen_Timer; architecture tb of tb_Kitchen_Timer is signal clk : std_logic := '0'; signal reset : std_logic := '0'; signal start : std_logic := '0'; signal stop : std_logic := '0'; signal adjust_interval_up : std_logic := '0'; signal adjust_interval_down : std_logic := '0'; signal alarm : std_logic; constant TbPeriod : time := 10 ns; signal TbClock : std_logic := '0'; signal TbSimEnded : std_logic := '0'; begin dut : entity work.Kitchen_Timer port map ( clk => clk, reset => reset, start => start, stop => stop, adjust_interval_up => adjust_interval_up, adjust_interval_down => adjust_interval_down, alarm => alarm ) TbClock <= not TbClock after TbPeriod/2 when TbSimEnded /= '1' else '0'; -- Clock generation clk <= TbClock; stimuli : process variable num_ticks : natural; begin -- Reset generation reset <= '1'; wait for 20 ns; reset <= '0'; wait for 20 ns; -- Start the timer start <= '1'; wait for 20 ns; start <= '0'; stop <= '1'; -- Adjust interval up and down adjust_interval_up <= '1'; wait for 10 ns; start <= '1'; stop <= '0'; adjust_interval_up <= '0'; wait for 30 ns; start <= '0'; stop <= '1'; adjust_interval_down <= '1'; wait for 10 ns; start <= '1'; stop <= '0'; adjust_interval_down <= '0'; wait for 20 ns; start <= '0'; stop <= '1'; adjust_interval_up <= '1'; wait for 600 ns; start <= '1'; stop <= '0'; adjust_interval_up <= '0'; -- Wait for the timer to reach the alarm interval (60 clocks) wait for 600 ns; -- Simulate for the required time -- Stop the timer start <= '0'; stop <= '1'; wait for 100 ns; -- Stop the clock and terminate the simulation TbSimEnded <= '1'; wait; end process; end tb; **