source: firmware/FTM/Lightpulser_interface/Basic_Version/Lightpulser_interface_Basic_tb.vhd@ 16834

Last change on this file since 16834 was 11513, checked in by vogler, 13 years ago
lightpulser interface modified to reduce LED current and light output
File size: 5.8 KB
Line 
1--------------------------------------------------------------------------------
2-- Company:
3-- Engineer:
4--
5-- Create Date: 10:12:21 07/21/2011
6-- Design Name:
7-- Module Name: /home/pavogler/ISDC_repos/firmware/FTM/Lightpulser_interface/Basic_Version//Lightpulser_interface_Basic_tb.vhd
8-- Project Name: Lightpulser_Basic
9-- Target Device:
10-- Tool versions:
11-- Description:
12--
13-- VHDL Test Bench Created by ISE for module: Lightpulser_interface_Basic
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--------------------------------------------------------------------------------
28LIBRARY ieee;
29USE ieee.std_logic_1164.ALL;
30USE ieee.std_logic_unsigned.all;
31USE ieee.numeric_std.ALL;
32
33ENTITY Lightpulser_interface_Basic_tb IS
34END Lightpulser_interface_Basic_tb;
35
36ARCHITECTURE behavior OF Lightpulser_interface_Basic_tb IS
37
38 -- Component Declaration for the Unit Under Test (UUT)
39
40 COMPONENT Lightpulser_interface_Basic
41 PORT(
42 clk_50 : IN std_logic;
43 Cal_0_p : OUT std_logic;
44 Cal_0_n : OUT std_logic;
45 Cal_1_p : OUT std_logic;
46 Cal_1_n : OUT std_logic;
47 Cal_2_p : OUT std_logic;
48 Cal_2_n : OUT std_logic;
49 Cal_3_p : OUT std_logic;
50 Cal_3_n : OUT std_logic;
51 Cal_4_p : OUT std_logic;
52 Cal_4_n : OUT std_logic;
53 Cal_5_p : OUT std_logic;
54 Cal_5_n : OUT std_logic;
55 Cal_6_p : OUT std_logic;
56 Cal_6_n : OUT std_logic;
57 Cal_7_p : OUT std_logic;
58 Cal_7_n : OUT std_logic;
59 LP1_ampl : IN std_logic_vector(15 downto 0);
60 LP2_ampl : IN std_logic_vector(15 downto 0);
61 LP1_pulse : IN std_logic;
62 LP2_pulse : IN std_logic;
63 start_config : IN std_logic;
64 config_started : OUT std_logic;
65 config_done : OUT std_logic
66 );
67 END COMPONENT;
68
69
70 --Inputs
71 signal clk_50 : std_logic := '0';
72 signal LP1_ampl : std_logic_vector(15 downto 0) := (others => '0');
73 signal LP2_ampl : std_logic_vector(15 downto 0) := (others => '0');
74 signal LP1_pulse : std_logic := '0';
75 signal LP2_pulse : std_logic := '0';
76 signal start_config : std_logic := '0';
77
78 --Outputs
79 signal Cal_0_p : std_logic;
80 signal Cal_0_n : std_logic;
81 signal Cal_1_p : std_logic;
82 signal Cal_1_n : std_logic;
83 signal Cal_2_p : std_logic;
84 signal Cal_2_n : std_logic;
85 signal Cal_3_p : std_logic;
86 signal Cal_3_n : std_logic;
87 signal Cal_4_p : std_logic;
88 signal Cal_4_n : std_logic;
89 signal Cal_5_p : std_logic;
90 signal Cal_5_n : std_logic;
91 signal Cal_6_p : std_logic;
92 signal Cal_6_n : std_logic;
93 signal Cal_7_p : std_logic;
94 signal Cal_7_n : std_logic;
95 signal config_started : std_logic;
96 signal config_done : std_logic;
97
98 -- Clock period definitions
99 constant clk_50_period : time := 20 ns;
100
101BEGIN
102
103 -- Instantiate the Unit Under Test (UUT)
104 uut: Lightpulser_interface_Basic PORT MAP (
105 clk_50 => clk_50,
106 Cal_0_p => Cal_0_p,
107 Cal_0_n => Cal_0_n,
108 Cal_1_p => Cal_1_p,
109 Cal_1_n => Cal_1_n,
110 Cal_2_p => Cal_2_p,
111 Cal_2_n => Cal_2_n,
112 Cal_3_p => Cal_3_p,
113 Cal_3_n => Cal_3_n,
114 Cal_4_p => Cal_4_p,
115 Cal_4_n => Cal_4_n,
116 Cal_5_p => Cal_5_p,
117 Cal_5_n => Cal_5_n,
118 Cal_6_p => Cal_6_p,
119 Cal_6_n => Cal_6_n,
120 Cal_7_p => Cal_7_p,
121 Cal_7_n => Cal_7_n,
122 LP1_ampl => LP1_ampl,
123 LP2_ampl => LP2_ampl,
124 LP1_pulse => LP1_pulse,
125 LP2_pulse => LP2_pulse,
126 start_config => start_config,
127 config_started => config_started,
128 config_done => config_done
129 );
130
131 -- Clock process definitions
132 clk_50_process :process
133 begin
134 clk_50 <= '0';
135 wait for clk_50_period/2;
136 clk_50 <= '1';
137 wait for clk_50_period/2;
138 end process;
139
140
141
142 -- Stimulus process
143 stim_proc: process
144 begin
145 -- hold reset state for 100 ms.
146 -- wait for 100 ms;
147
148 wait for clk_50_period*10;
149
150 -- insert stimulus here
151
152
153
154 -- init input signals
155 start_config <= '0';
156 LP1_pulse <= '0';
157 LP2_pulse <= '0';
158
159
160
161 -- latch settings
162 LP1_ampl <= "1000000000001000";
163 LP2_ampl <= "0100000000010000";
164
165
166 wait for clk_50_period*5;
167 start_config <= '1';
168 wait for clk_50_period*1;
169 start_config <= '0';
170
171
172 wait for clk_50_period*5;
173
174
175 -- trigger lightpulses
176
177 -- LP1: mirror dish
178 LP1_pulse <= '1';
179 wait for clk_50_period*5;
180 LP1_pulse <= '0';
181
182 -- LP2: shutter
183 LP2_pulse <= '1';
184 wait for clk_50_period*5;
185 LP2_pulse <= '0';
186
187
188
189
190
191 -- second cyclus
192 wait for clk_50_period*10;
193
194
195 -- latch settings
196 LP1_ampl <= "1100000001111111";
197 LP2_ampl <= "0000000000000000";
198
199 wait for clk_50_period*5;
200 start_config <= '1';
201 wait for clk_50_period*1;
202 start_config <= '0';
203
204
205 wait for clk_50_period*5;
206
207 -- trigger lightpulses
208
209 -- LP1: mirror dish
210 LP1_pulse <= '1';
211 wait for clk_50_period*2;
212 LP1_pulse <= '0';
213
214 -- LP2: shutter
215 LP2_pulse <= '1';
216 wait for clk_50_period*2;
217 LP2_pulse <= '0';
218
219
220 wait;
221 end process;
222
223END;
Note: See TracBrowser for help on using the repository browser.