Code refactor

This commit is contained in:
2022-12-17 21:10:14 +01:00
parent 3e173e9008
commit d286704b8a
3 changed files with 76 additions and 73 deletions

View File

@@ -64,7 +64,7 @@ begin
if clk'event and clk='1' then
if rst = '1' then
interrupt <= '0';
old_input <= (others => '0');
old_input <= buttons & switches;
else
if buttons & switches /= old_input
then

View File

@@ -112,17 +112,28 @@ BEGIN
stimuli: process
begin
rst <= '0';
sw <= x"000F";
wait for CLK_PERIOD;
rst <= '1';
sw <= x"000F";
wait for 3us;
btn0 <= "00100"; -- freq
-- btn0 <= "00001"; -- add
-- btn0 <= "00100"; -- freq
btn0 <= "00001"; -- add
-- btn0 <= "00010"; -- clear
wait for 50us;
sw <= x"000A";
btn0 <= "00000";
btn1 <= "00001"; -- add
wait for 50us;
btn0 <= "00100"; -- freq
wait for 50us;
btn0 <= "00010"; -- clear
wait for 300us;
wait for 100us;
assert false report "Simulation terminated!" severity failure;
end process stimuli;