tb_AsyncInput.vhd


1
--------------------------------------------------------------------------------
2
-- Engineer: Lothar Miller
3
--
4
-- Create Date:   13:43:19 08/13/2008
5
-- Design Name:   AsyncInput
6
--------------------------------------------------------------------------------
7
LIBRARY ieee;
8
USE ieee.std_logic_1164.ALL;
9
USE ieee.std_logic_unsigned.all;
10
USE ieee.numeric_std.ALL;
11
12
ENTITY tb_AsyncInput_vhd IS
13
END tb_AsyncInput_vhd;
14
15
ARCHITECTURE behavior OF tb_AsyncInput_vhd IS 
16
17
  -- Component Declaration for the Unit Under Test (UUT)
18
  COMPONENT AsyncInput
19
  PORT(
20
    clk : IN std_logic;
21
    inp : IN std_logic;          
22
    outp : OUT std_logic
23
    );
24
  END COMPONENT;
25
26
  --Inputs
27
  SIGNAL clk :  std_logic := '0';
28
  SIGNAL inp :  std_logic := '0';
29
30
  --Outputs
31
  SIGNAL outp :  std_logic;
32
33
BEGIN
34
35
  -- Instantiate the Unit Under Test (UUT)
36
  uut: AsyncInput PORT MAP(
37
    clk => clk,
38
    inp => inp,
39
    outp => outp
40
  );
41
42
  clk <= not clk after 10 ns;
43
44
  tb : PROCESS
45
  BEGIN
46
    for I in 0 to 10 loop
47
      inp <= '0';
48
      wait for 105 ns;
49
      inp <= '1';
50
      wait for 2 ns;
51
    end loop;
52
    
53
    for I in 0 to 10 loop
54
      inp <= '0';
55
      wait for 50 ns;
56
      inp <= '1';
57
      wait for 47 ns;
58
    end loop;
59
    
60
    wait; -- will wait forever
61
  END PROCESS;
62
63
END;