1 | --------------------------------------------------------------------------------
|
2 | -- Company:
|
3 | -- Engineer:
|
4 | --
|
5 | -- Create Date: 21:56:48 05/01/2011
|
6 | -- Design Name:
|
7 | -- Module Name: I:/ISE_Projekte/Ampelsteuerung/test.vhd
|
8 | -- Project Name: Ampelsteuerung
|
9 | -- Target Device:
|
10 | -- Tool versions:
|
11 | -- Description:
|
12 | --
|
13 | -- VHDL Test Bench Created by ISE for module: Main
|
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 test IS
|
36 | END test;
|
37 |
|
38 | ARCHITECTURE behavior OF test IS
|
39 |
|
40 | -- Component Declaration for the Unit Under Test (UUT)
|
41 |
|
42 | COMPONENT Main
|
43 | PORT(
|
44 | CLK : IN bit;
|
45 | RESET : IN bit;
|
46 | HS1 : IN bit;
|
47 | HS2 : IN bit;
|
48 | NS1 : IN bit;
|
49 | NS2 : IN bit;
|
50 | FH : IN bit;
|
51 | FN : IN bit;
|
52 | BLINK : IN bit;
|
53 | GRH : OUT bit;
|
54 | GEH : OUT bit;
|
55 | RH : OUT bit;
|
56 | GRN : OUT bit;
|
57 | GEN : OUT bit;
|
58 | RN : OUT bit;
|
59 | GFH : OUT bit;
|
60 | RFH : OUT bit;
|
61 | GFN : OUT bit;
|
62 | RFN : OUT bit;
|
63 | CNT_OUT : OUT std_logic_vector(4 downto 0);
|
64 | ANZEIGE : OUT bit_vector(3 downto 0)
|
65 | );
|
66 | END COMPONENT;
|
67 |
|
68 |
|
69 | --Inputs
|
70 | signal CLK : bit := '0';
|
71 | signal RESET : bit := '0';
|
72 | signal HS1 : bit := '0';
|
73 | signal HS2 : bit := '0';
|
74 | signal NS1 : bit := '0';
|
75 | signal NS2 : bit := '0';
|
76 | signal FH : bit := '0';
|
77 | signal FN : bit := '0';
|
78 | signal BLINK : bit := '0';
|
79 |
|
80 | --Outputs
|
81 | signal GRH : bit;
|
82 | signal GEH : bit;
|
83 | signal RH : bit;
|
84 | signal GRN : bit;
|
85 | signal GEN : bit;
|
86 | signal RN : bit;
|
87 | signal GFH : bit;
|
88 | signal RFH : bit;
|
89 | signal GFN : bit;
|
90 | signal RFN : bit;
|
91 | signal CNT_OUT : std_logic_vector(4 downto 0);
|
92 | signal ANZEIGE : bit_vector(3 downto 0);
|
93 |
|
94 | -- Clock period definitions
|
95 | constant CLK_period : time := 10 ns;
|
96 |
|
97 | BEGIN
|
98 |
|
99 | -- Instantiate the Unit Under Test (UUT)
|
100 | uut: Main PORT MAP (
|
101 | CLK => CLK,
|
102 | RESET => RESET,
|
103 | HS1 => HS1,
|
104 | HS2 => HS2,
|
105 | NS1 => NS1,
|
106 | NS2 => NS2,
|
107 | FH => FH,
|
108 | FN => FN,
|
109 | BLINK => BLINK,
|
110 | GRH => GRH,
|
111 | GEH => GEH,
|
112 | RH => RH,
|
113 | GRN => GRN,
|
114 | GEN => GEN,
|
115 | RN => RN,
|
116 | GFH => GFH,
|
117 | RFH => RFH,
|
118 | GFN => GFN,
|
119 | RFN => RFN,
|
120 | CNT_OUT => CNT_OUT,
|
121 | ANZEIGE => ANZEIGE
|
122 | );
|
123 |
|
124 | -- Clock process definitions
|
125 | CLK_process :process
|
126 | begin
|
127 | CLK <= '0';
|
128 | wait for CLK_period/2;
|
129 | CLK <= '1';
|
130 | wait for CLK_period/2;
|
131 | end process;
|
132 |
|
133 |
|
134 | -- Stimulus process
|
135 | stim_proc: process
|
136 | begin
|
137 | -- hold reset state for 100 ns.
|
138 | wait for 100 ns;
|
139 |
|
140 | wait for CLK_period*10;
|
141 |
|
142 | -- insert stimulus here
|
143 | RESET <= '0', '1' after 20 ms, '0' after 100 ms;
|
144 | --BLINK <= '0', '1' after 20 ms, '0' after 20000 ms;
|
145 | wait;
|
146 | end process;
|
147 |
|
148 | END;
|