Testbench-Digitaluhr.vhd


1
--------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer:
4
--
5
-- Create Date:   22:03:08 12/16/2014
6
-- Design Name:   
7
-- Module Name:   Z:/Documents/VHDL/Praktikum5_Albers-Wallner/Testbench-Digitaluhr.vhd
8
-- Project Name:  Praktikum5_Albers-Wallner
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- VHDL Test Bench Created by ISE for module: Digitaluhr
14
-- 
15
-- Dependencies:
16
-- 
17
-- Revision:
18
-- Revision 0.01 - File Created
19
-- Additional Comments:
20
--
21
-- Notes: 
22
-- This testbench has been automatically generated using types std_logic and
23
-- std_logic_vector for the ports of the unit under test.  Xilinx recommends
24
-- that these types always be used for the top-level I/O of a design in order
25
-- to guarantee that the testbench will bind correctly to the post-implementation 
26
-- simulation model.
27
--------------------------------------------------------------------------------
28
LIBRARY ieee;
29
USE ieee.std_logic_1164.ALL;
30
 
31
-- Uncomment the following library declaration if using
32
-- arithmetic functions with Signed or Unsigned values
33
--USE ieee.numeric_std.ALL;
34
 
35
ENTITY Testbench_Digitaluhr IS
36
END Testbench_Digitaluhr;
37
 
38
ARCHITECTURE behavior OF Testbench_Digitaluhr IS 
39
 
40
    -- Component Declaration for the Unit Under Test (UUT)
41
 
42
    COMPONENT Digitaluhr
43
    PORT(
44
         clk : IN  std_logic;
45
         reset : IN  std_logic;
46
         stunde : IN  std_logic;
47
         mode : IN  std_logic_vector(1 downto 0);
48
         o_std_z : OUT  std_logic_vector(3 downto 0);
49
         o_std_e : OUT  std_logic_vector(3 downto 0);
50
         o_min_z : OUT  std_logic_vector(3 downto 0);
51
         o_min_e : OUT  std_logic_vector(3 downto 0);
52
         o_sec_z : OUT  std_logic_vector(3 downto 0);
53
         o_sec_e : OUT  std_logic_vector(3 downto 0);
54
         i_std_z : IN  std_logic_vector(3 downto 0);
55
         i_std_e : IN  std_logic_vector(3 downto 0);
56
         i_min_z : IN  std_logic_vector(3 downto 0);
57
         i_min_e : IN  std_logic_vector(3 downto 0);
58
         i_sec_z : IN  std_logic_vector(3 downto 0);
59
         i_sec_e : IN  std_logic_vector(3 downto 0)
60
        );
61
    END COMPONENT;
62
    
63
64
   --Inputs
65
   signal clk : std_logic := '0';
66
   signal reset : std_logic := '0';
67
   signal stunde : std_logic := '0';
68
   signal mode : std_logic_vector(1 downto 0) := (others => '0');
69
   signal i_std_z : std_logic_vector(3 downto 0) := (others => '0');
70
   signal i_std_e : std_logic_vector(3 downto 0) := (others => '0');
71
   signal i_min_z : std_logic_vector(3 downto 0) := (others => '0');
72
   signal i_min_e : std_logic_vector(3 downto 0) := (others => '0');
73
   signal i_sec_z : std_logic_vector(3 downto 0) := (others => '0');
74
   signal i_sec_e : std_logic_vector(3 downto 0) := (others => '0');
75
76
   --Outputs
77
   signal o_std_z : std_logic_vector(3 downto 0);
78
   signal o_std_e : std_logic_vector(3 downto 0);
79
   signal o_min_z : std_logic_vector(3 downto 0);
80
   signal o_min_e : std_logic_vector(3 downto 0);
81
   signal o_sec_z : std_logic_vector(3 downto 0);
82
   signal o_sec_e : std_logic_vector(3 downto 0);
83
  
84
85
   -- Clock period definitions
86
   constant clk_period : time := 1 ns;
87
 
88
BEGIN
89
 
90
  -- Instantiate the Unit Under Test (UUT)
91
   uut: Digitaluhr PORT MAP (
92
          clk => clk,
93
          reset => reset,
94
          stunde => stunde,
95
          mode => mode,
96
          o_std_z => o_std_z,
97
          o_std_e => o_std_e,
98
          o_min_z => o_min_z,
99
          o_min_e => o_min_e,
100
          o_sec_z => o_sec_z,
101
          o_sec_e => o_sec_e,
102
          i_std_z => i_std_z,
103
          i_std_e => i_std_e,
104
          i_min_z => i_min_z,
105
          i_min_e => i_min_e,
106
          i_sec_z => i_sec_z,
107
          i_sec_e => i_sec_e
108
        );
109
110
   -- Clock process definitions
111
   clk_process :process
112
   begin
113
    clk <= '0';
114
    wait for clk_period/2;
115
    clk <= '1';
116
    wait for clk_period/2;
117
   end process;
118
 
119
120
   -- Stimulus process
121
   stim_proc: process
122
   begin    
123
      -- hold reset state for 100 ns.
124
  --    wait for 100 ns;  
125
126
      -- wait for clk_period*10;
127
128
      -- insert stimulus here 
129
    
130
  --  reset <= '0';
131
    mode <= "01";
132
    stunde <= '0';
133
    i_sec_e <= "0010"; 
134
    i_sec_z <= "0001";
135
    i_min_e <= "0100";
136
    i_min_z <= "0010";
137
    i_std_e <= "0100";
138
    i_std_z <= "0000";
139
140
      wait;
141
   end process;
142
143
END;