Übungen der VHDL-Einführung
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_top_entity.vhd 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. library std;
  4. use std.env.all;
  5. library work;
  6. use work.test_utility.all;
  7. entity test_top_entity is
  8. generic( GUI_MODE : boolean; CHECK_RESULTS : boolean );
  9. end entity test_top_entity;
  10. architecture test of test_top_entity is
  11. signal CLK : std_logic := '0';
  12. signal RESET : std_logic := '1';
  13. signal CNT : std_logic_vector(6 downto 0);
  14. begin
  15. u_top_entity : entity work.top_entity
  16. port map (
  17. CLK => CLK,
  18. RESET => RESET,
  19. CNT => CNT
  20. );
  21. CLK <= not CLK after 10 ns;
  22. p_reset : process( CLK )
  23. begin
  24. if falling_edge( CLK ) then
  25. RESET <= '0';
  26. end if;
  27. end process p_reset;
  28. p_run : process
  29. begin
  30. wait until falling_edge( RESET );
  31. for i in 0 to 128 loop
  32. wait until rising_edge( CLK );
  33. end loop;
  34. wait until rising_edge( CLK );
  35. assert_eq( CNT, "0111000" );
  36. if ( GUI_MODE ) then
  37. std.env.stop;
  38. else
  39. std.env.finish;
  40. end if;
  41. end process p_run;
  42. end architecture test;