tb.vhd 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. entity tb is
  4. end entity;
  5. architecture beh of tb is
  6. component generic_counter is
  7. generic (
  8. counter_bits : integer
  9. );
  10. port
  11. (
  12. clk : in std_logic;
  13. res : in std_logic;
  14. en : in std_logic;
  15. cnt : out std_logic_vector (counter_bits -1 downto 0)
  16. );
  17. end component;
  18. signal clock, enable_counter, reset : std_logic;
  19. signal counter_value : std_logic_vector(7 downto 0)
  20. begin
  21. --ha_instance : ha port map (q => a, w => b, e => o, r => c);
  22. --ha_instance : ha port map (a => q, b => w, o => e, c => r);
  23. --ha_instance : ha port map (q, w, e, r);
  24. cnt_i1 :
  25. generic map(
  26. counter_bits => 8
  27. )
  28. port map(
  29. clk => clock,
  30. rst => reset,
  31. en => enable_counter,
  32. cnt => counter_value
  33. );
  34. process is
  35. begin
  36. clk <= not clk;
  37. wait for 10 ns;
  38. assert false report "end of simulation";
  39. wait;
  40. end process;
  41. process is
  42. begin
  43. report "Shit!";
  44. wait until r = '1';
  45. report "It happened!";
  46. for i in 3 to 6 loop
  47. report "Currently at " & integer'image(i);
  48. wait for 1 ns;
  49. end loop;
  50. report "At end of test process!";
  51. wait;
  52. end process;
  53. -- Invalid report in concurrent statement
  54. --report "when is this?";
  55. end architecture;