Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3.  
  4. entity mod_m_counter_tb is
  5. end mod_m_counter_tb;
  6.  
  7. architecture tb of mod_m_counter_tb is
  8.  
  9. component mod_m_counter
  10. port ( clk,reset : in std_logic;
  11. to_m_in : in std_logic_vector(17 downto 0);
  12. max_tick : out std_logic
  13. );
  14. end component;
  15.  
  16. --inputs
  17. signal clk, reset : std_logic;
  18. signal to_m_in : std_logic_vector (17 downto 0);
  19. --outputs
  20. signal max_tick: std_logic;
  21.  
  22. constant clk_period : time := 10 ns;
  23.  
  24. begin
  25. uut: entity work.mod_m_counter(arch)
  26. port map(clk=>clk, reset=>reset,to_m_in=>to_m_in,
  27. max_tick=>max_tick);
  28.  
  29. --**************************
  30. -- clock
  31. --**************************
  32. clk_process: process
  33. begin
  34. clk <= '0';
  35. wait for clk_period/2;
  36. clk <= '1';
  37. wait for clk_period/2;
  38. end process;
  39.  
  40. stim_proc: process
  41. begin
  42. to_m_in <= "000000000000000000";
  43. reset <= '0';
  44. wait for clk_period*2;
  45. reset <= '0';
  46.  
  47. to_m_in <= "000000000000000011";
  48.  
  49. wait for clk_period*4;
  50.  
  51.  
  52. end process ;
  53. end tb;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement