Advertisement
LucaSkywalker

Counter3_tb.vhd

Oct 31st, 2020
621
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.49 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.std_logic_1164.all;
  3. use IEEE.std_logic_arith.all;
  4. use IEEE.std_logic_misc.all;
  5. use IEEE.std_logic_unsigned.all;
  6.  
  7. ENTITY Counter3_tb IS
  8. END Counter3_tb;
  9.  
  10. ARCHITECTURE behavior OF Counter3_tb IS
  11.     COMPONENT Counter3 PORT(    Input : IN  std_logic;
  12.                                         Clk : IN  std_logic;
  13.                                         Rst : IN  std_logic;
  14.                                         Output : OUT  std_logic);
  15.     END COMPONENT;
  16.     signal Input : std_logic := '0';
  17.     signal Clk : std_logic := '0';
  18.     signal Rst : std_logic := '0';
  19.     signal Output : std_logic;
  20.     constant Clk_period : time := 10 ns;
  21.     BEGIN
  22.    uut: Counter3 PORT MAP (
  23.           Input => Input,
  24.           Clk => Clk,
  25.           Rst => Rst,
  26.           Output => Output);
  27.              
  28.    Clk_process :process
  29.    begin
  30.         Clk <= '0';
  31.         wait for Clk_period/2;
  32.         Clk <= '1';
  33.         wait for Clk_period/2;
  34.    end process;
  35.  
  36.    stim_proc: process
  37.    begin       
  38.       RST <= '1';
  39.         WAIT FOR 8 NS;
  40.         RST <= '0';
  41.         Input <= '0';
  42.         WAIT FOR 10 NS;
  43.         Input <= '1';
  44.         WAIT FOR 10 NS;
  45.         Input <= '1';
  46.         WAIT FOR 10 NS;
  47.         Input <= '0';
  48.         WAIT FOR 10 NS;
  49.         Input <= '1';
  50.         WAIT FOR 10 NS;
  51.         Input <= '0';
  52.         WAIT FOR 10 NS;
  53.         Input <= '1';
  54.         WAIT FOR 10 NS;
  55.         Input <= '1';
  56.         WAIT FOR 10 NS;
  57.         Input <= '0';
  58.         WAIT FOR 10 NS;
  59.         Input <= '0';
  60.         WAIT FOR 10 NS;
  61.         Input <= '1';
  62.         WAIT FOR 10 NS;
  63.         Input <= '0';
  64.         WAIT FOR 10 NS;
  65.         Input <= '1';
  66.         WAIT FOR 10 NS;
  67.         Input <= '1';
  68.         WAIT FOR 10 NS;
  69.         Input <= '1';
  70.         WAIT FOR 10 NS;
  71.         Input <= '0';
  72.       wait;
  73.    end process;
  74. END;
  75.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement