source: firmware/FAD/FACT_FAD_20MHz_VAR_PS/FACT_FAD_lib/hdl/fad_main_struct.vhd@ 10074

Last change on this file since 10074 was 10074, checked in by neise, 12 years ago
added LED controller
File size: 32.8 KB
Line 
1-- VHDL Entity FACT_FAD_lib.FAD_main.symbol
2--
3-- Created:
4-- by - dneise.UNKNOWN (E5B-LABOR6)
5-- at - 15:02:55 04.01.2011
6--
7-- Generated by Mentor Graphics' HDL Designer(TM) 2009.2 (Build 10)
8--
9LIBRARY ieee;
10USE ieee.std_logic_1164.all;
11USE ieee.std_logic_arith.all;
12LIBRARY FACT_FAD_lib;
13USE FACT_FAD_lib.fad_definitions.all;
14
15ENTITY FAD_main IS
16 GENERIC(
17 RAMADDRWIDTH64b : integer := 12
18 );
19 PORT(
20 CLK : IN std_logic;
21 SROUT_in_0 : IN std_logic;
22 SROUT_in_1 : IN std_logic;
23 SROUT_in_2 : IN std_logic;
24 SROUT_in_3 : IN std_logic;
25 adc_data_array : IN adc_data_array_type;
26 adc_otr_array : IN std_logic_vector (3 DOWNTO 0);
27 board_id : IN std_logic_vector (3 DOWNTO 0);
28 crate_id : IN std_logic_vector (1 DOWNTO 0);
29 trigger : IN std_logic;
30 wiz_int : IN std_logic;
31 CLK25_OUT : OUT std_logic;
32 CLK25_PSOUT : OUT std_logic;
33 CLK50_OUT : OUT std_logic;
34 CLK_25_PS : OUT std_logic;
35 CLK_50 : OUT std_logic;
36 DCM_locked : OUT std_logic;
37 LOCKED_extraOUT : OUT std_logic;
38 PSCLK_OUT : OUT std_logic;
39 PSDONE_extraOUT : OUT std_logic;
40 PSEN_OUT : OUT std_logic;
41 PSINCDEC_OUT : OUT std_logic;
42 PS_DIR_IN : OUT std_logic;
43 PS_DO_IN : OUT std_logic;
44 RSRLOAD : OUT std_logic := '0';
45 SRCLK : OUT std_logic := '0';
46 SRIN_out : OUT std_logic := '0';
47 adc_clk_en : OUT std_logic := '0';
48 adc_oeb : OUT std_logic := '1';
49 amber : OUT std_logic;
50 dac_cs : OUT std_logic;
51 denable : OUT std_logic := '0'; -- default domino wave off
52 drs_channel_id : OUT std_logic_vector (3 DOWNTO 0) := (others => '0');
53 drs_dwrite : OUT std_logic := '1';
54 green : OUT std_logic;
55 led : OUT std_logic_vector (7 DOWNTO 0) := (OTHERS => '0');
56 mosi : OUT std_logic := '0';
57 offset : OUT std_logic_vector (7 DOWNTO 0) := (OTHERS => '0');
58 ready : OUT std_logic := '0';
59 red : OUT std_logic;
60 sclk : OUT std_logic;
61 sensor_cs : OUT std_logic_vector (3 DOWNTO 0);
62 -- status:
63 shifting : OUT std_logic := '0';
64 wiz_addr : OUT std_logic_vector (9 DOWNTO 0);
65 wiz_cs : OUT std_logic := '1';
66 wiz_rd : OUT std_logic := '1';
67 wiz_reset : OUT std_logic := '1';
68 wiz_wr : OUT std_logic := '1';
69 sio : INOUT std_logic;
70 wiz_data : INOUT std_logic_vector (15 DOWNTO 0)
71 );
72
73-- Declarations
74
75END FAD_main ;
76
77--
78-- VHDL Architecture FACT_FAD_lib.FAD_main.struct
79--
80-- Created:
81-- by - dneise.UNKNOWN (E5B-LABOR6)
82-- at - 15:02:55 04.01.2011
83--
84-- Generated by Mentor Graphics' HDL Designer(TM) 2009.2 (Build 10)
85--
86library ieee;
87use ieee.std_logic_1164.all;
88use IEEE.STD_LOGIC_ARITH.all;
89use ieee.STD_LOGIC_UNSIGNED.all;
90
91library fact_fad_lib;
92use fact_fad_lib.fad_definitions.all;
93
94library UNISIM;
95use UNISIM.VComponents.all;
96USE IEEE.NUMERIC_STD.all;
97USE IEEE.std_logic_signed.all;
98
99LIBRARY FACT_FAD_lib;
100
101ARCHITECTURE struct OF FAD_main IS
102
103 -- Architecture declarations
104
105 -- Internal signal declarations
106 SIGNAL CLK_25 : std_logic;
107 SIGNAL SRCLK1 : std_logic := '0';
108 SIGNAL adc_data_array_int : adc_data_array_type;
109 SIGNAL adc_otr : std_logic_vector(3 DOWNTO 0);
110 SIGNAL addr_out : std_logic_vector(RAMADDRWIDTH64b-1 DOWNTO 0);
111 SIGNAL config_addr : std_logic_vector(7 DOWNTO 0);
112 SIGNAL config_busy : std_logic;
113 SIGNAL config_data : std_logic_vector(15 DOWNTO 0);
114 SIGNAL config_data_valid : std_logic;
115 SIGNAL config_rd_en : std_logic;
116 SIGNAL config_ready : std_logic;
117 SIGNAL config_ready_cm : std_logic;
118 SIGNAL config_ready_spi : std_logic;
119 -- --
120 SIGNAL config_rw_ack : std_logic := '0';
121 -- --
122 SIGNAL config_rw_ready : std_logic := '0';
123 SIGNAL config_start : std_logic := '0';
124 SIGNAL config_start_cm : std_logic;
125 SIGNAL config_start_spi : std_logic := '0';
126 SIGNAL config_started : std_logic;
127 SIGNAL config_started_cu : std_logic := '0';
128 SIGNAL config_started_mm : std_logic;
129 SIGNAL config_started_spi : std_logic := '0';
130 SIGNAL config_wr_en : std_logic;
131 SIGNAL dac_array : dac_array_type;
132 SIGNAL data_out : std_logic_vector(63 DOWNTO 0);
133 SIGNAL drs_address : std_logic_vector(3 DOWNTO 0) := (others => '0');
134 SIGNAL drs_address_mode : std_logic;
135 SIGNAL drs_channel_internal : std_logic_vector(3 DOWNTO 0) := (others => '0');
136 SIGNAL drs_clk_en : std_logic := '0';
137 SIGNAL drs_read_s_cell : std_logic := '0';
138 SIGNAL drs_read_s_cell_ready : std_logic;
139 SIGNAL drs_s_cell_array : drs_s_cell_array_type;
140 SIGNAL drs_srin_data : std_logic_vector(7 DOWNTO 0) := (others => '0');
141 SIGNAL dwrite : std_logic := '1';
142 SIGNAL dwrite_enable : std_logic := '1';
143 SIGNAL new_config : std_logic := '0';
144 SIGNAL package_length : std_logic_vector(15 DOWNTO 0);
145 SIGNAL ps_direction : std_logic := '1'; -- default phase shift upwards
146 SIGNAL ps_do_phase_shift : std_logic := '0'; --pulse this to phase shift once
147 SIGNAL ps_reset : std_logic := '0'; -- pulse this to reset the variable phase shift
148 SIGNAL ram_addr : std_logic_vector(RAMADDRWIDTH64b+1 DOWNTO 0);
149 SIGNAL ram_data : std_logic_vector(15 DOWNTO 0);
150 SIGNAL ram_start_addr : std_logic_vector(RAMADDRWIDTH64b-1 DOWNTO 0);
151 SIGNAL ram_write_ea : std_logic;
152 SIGNAL ram_write_ready : std_logic := '0';
153 -- --
154 SIGNAL ram_write_ready_ack : std_logic := '0';
155 SIGNAL roi_array : roi_array_type;
156 SIGNAL roi_max : roi_max_type;
157 SIGNAL s_trigger : std_logic;
158 SIGNAL sclk1 : std_logic;
159 SIGNAL sclk_enable : std_logic;
160 SIGNAL sensor_array : sensor_array_type;
161 SIGNAL sensor_ready : std_logic;
162 SIGNAL socks_connected : std_logic;
163 SIGNAL socks_waiting : std_logic;
164 SIGNAL srclk_enable : std_logic := '0';
165 SIGNAL srin_write_ack : std_logic := '0';
166 SIGNAL srin_write_ready : std_logic := '0';
167 SIGNAL start_srin_write_8b : std_logic;
168 SIGNAL trigger_id : std_logic_vector(47 DOWNTO 0);
169 SIGNAL trigger_out : std_logic;
170 SIGNAL wiz_ack : std_logic;
171 SIGNAL wiz_busy : std_logic;
172 SIGNAL wiz_number_of_channels : std_logic_vector(3 DOWNTO 0) := (others => '0');
173 SIGNAL wiz_ram_start_addr : std_logic_vector(RAMADDRWIDTH64b+1 DOWNTO 0) := (others => '0');
174 SIGNAL wiz_write_ea : std_logic := '0';
175 SIGNAL wiz_write_end : std_logic := '0';
176 SIGNAL wiz_write_header : std_logic := '0';
177 SIGNAL wiz_write_length : std_logic_vector(16 DOWNTO 0) := (others => '0');
178 SIGNAL write_ea : std_logic_vector(0 DOWNTO 0) := "0";
179
180 -- Implicit buffer signal declarations
181 SIGNAL CLK_25_PS_internal : std_logic;
182 SIGNAL CLK_50_internal : std_logic;
183
184
185 -- Component Declarations
186 COMPONENT adc_buffer
187 PORT (
188 adc_data_array : IN adc_data_array_type;
189 adc_otr_array : IN std_logic_vector (3 DOWNTO 0);
190 clk_ps : IN std_logic;
191 adc_data_array_int : OUT adc_data_array_type;
192 adc_otr : OUT std_logic_vector (3 DOWNTO 0)
193 );
194 END COMPONENT;
195 COMPONENT clock_generator_var_ps
196 PORT (
197 CLK : IN std_logic ;
198 RST_IN : IN std_logic ;
199 direction : IN std_logic ;
200 do_shift : IN std_logic ;
201 CLK_25 : OUT std_logic ;
202 CLK_25_PS : OUT std_logic ;
203 CLK_50 : OUT std_logic ;
204 DCM_locked : OUT std_logic ;
205 LOCKED_extraOUT : OUT std_logic ;
206 PSCLK_OUT : OUT std_logic ;
207 PSDONE_extraOUT : OUT std_logic ;
208 PSEN_OUT : OUT std_logic ;
209 PSINCDEC_OUT : OUT std_logic ;
210 offset : OUT std_logic_vector (7 DOWNTO 0) := (OTHERS => '0');
211 ready : OUT std_logic := '0';
212 -- status:
213 shifting : OUT std_logic := '0'
214 );
215 END COMPONENT;
216 COMPONENT control_unit
217 PORT (
218 clk : IN STD_LOGIC ;
219 config_addr : IN std_logic_vector (7 DOWNTO 0);
220 config_rd_en : IN std_logic ;
221 config_start : IN std_logic ;
222 config_wr_en : IN std_logic ;
223 config_busy : OUT std_logic ;
224 config_data_valid : OUT std_logic ;
225 config_ready : OUT std_logic ;
226 -- --
227 config_rw_ack : OUT std_logic := '0';
228 -- --
229 config_rw_ready : OUT std_logic := '0';
230 config_started : OUT std_logic := '0';
231 dac_array : OUT dac_array_type ;
232 roi_array : OUT roi_array_type ;
233 config_data : INOUT std_logic_vector (15 DOWNTO 0)
234 );
235 END COMPONENT;
236 COMPONENT dataRAM_64b_16b_width14_5
237 PORT (
238 clka : IN std_logic ;
239 dina : IN std_logic_VECTOR (63 DOWNTO 0);
240 addra : IN std_logic_VECTOR (14 DOWNTO 0);
241 wea : IN std_logic_VECTOR (0 DOWNTO 0);
242 clkb : IN std_logic ;
243 addrb : IN std_logic_VECTOR (16 DOWNTO 0);
244 doutb : OUT std_logic_VECTOR (15 DOWNTO 0)
245 );
246 END COMPONENT;
247 COMPONENT data_generator
248 GENERIC (
249 RAM_ADDR_WIDTH : integer := 12
250 );
251 PORT (
252 -- led : OUT std_logic_vector (7 DOWNTO 0) := (OTHERS => '0');
253 clk : IN std_logic ;
254 data_out : OUT std_logic_vector (63 DOWNTO 0);
255 addr_out : OUT std_logic_vector (RAM_ADDR_WIDTH-1 DOWNTO 0);
256 write_ea : OUT std_logic_vector (0 DOWNTO 0) := "0";
257 ram_start_addr : IN std_logic_vector (RAM_ADDR_WIDTH-1 DOWNTO 0);
258 ram_write_ea : IN std_logic ;
259 ram_write_ready : OUT std_logic := '0';
260 -- --
261 ram_write_ready_ack : IN std_logic ;
262 -- --
263 config_start_mm : OUT std_logic := '0';
264 -- --
265 config_start_cm : OUT std_logic := '0';
266 -- --
267 config_start_spi : OUT std_logic := '0';
268 config_ready_mm : IN std_logic ;
269 config_ready_cm : IN std_logic ;
270 config_ready_spi : IN std_logic ;
271 config_started_mm : IN std_logic ;
272 config_started_cm : IN std_logic ;
273 config_started_spi : IN std_logic ;
274 roi_array : IN roi_array_type ;
275 roi_max : IN roi_max_type ;
276 sensor_array : IN sensor_array_type ;
277 sensor_ready : IN std_logic ;
278 dac_array : IN dac_array_type ;
279 package_length : IN std_logic_vector (15 DOWNTO 0);
280 board_id : IN std_logic_vector (3 DOWNTO 0);
281 crate_id : IN std_logic_vector (1 DOWNTO 0);
282 trigger_id : IN std_logic_vector (47 DOWNTO 0);
283 trigger : IN std_logic ;
284 -- s_trigger : in std_logic;
285 new_config : IN std_logic ;
286 config_started : OUT std_logic := '0';
287 adc_data_array : IN adc_data_array_type ;
288 adc_oeb : OUT std_logic := '1';
289 adc_clk_en : OUT std_logic := '0';
290 adc_otr : IN std_logic_vector (3 DOWNTO 0);
291 drs_channel_id : OUT std_logic_vector (3 DOWNTO 0) := (others => '0');
292 drs_dwrite : OUT std_logic := '1';
293 drs_clk_en : OUT std_logic := '0';
294 drs_read_s_cell : OUT std_logic := '0';
295 drs_srin_write_8b : OUT std_logic := '0';
296 drs_srin_write_ack : IN std_logic ;
297 drs_srin_data : OUT std_logic_vector (7 DOWNTO 0) := (others => '0');
298 drs_srin_write_ready : IN std_logic ;
299 drs_read_s_cell_ready : IN std_logic ;
300 drs_s_cell_array : IN drs_s_cell_array_type
301 );
302 END COMPONENT;
303 COMPONENT drs_pulser
304 PORT (
305 CLK : IN std_logic;
306 SROUT_in_0 : IN std_logic;
307 SROUT_in_1 : IN std_logic;
308 SROUT_in_2 : IN std_logic;
309 SROUT_in_3 : IN std_logic;
310 srin_data : IN std_logic_vector (7 DOWNTO 0);
311 start_endless_mode : IN std_logic;
312 start_read_stop_pos_mode : IN std_logic;
313 start_srin_write_8b : IN std_logic;
314 RSRLOAD : OUT std_logic := '0';
315 SRCLK : OUT std_logic := '0';
316 SRIN_out : OUT std_logic := '0';
317 srin_write_ack : OUT std_logic := '0';
318 srin_write_ready : OUT std_logic := '0';
319 stop_pos : OUT drs_s_cell_array_type;
320 stop_pos_valid : OUT std_logic := '0'
321 );
322 END COMPONENT;
323 COMPONENT led_controller
324 GENERIC (
325 HEARTBEAT_DIVIDER : integer := 5000; -- 100kHz @ 50 MHz
326 WAITING_DIVIDER : integer := 50000000 -- 10Hz @ 50 MHz
327 );
328 PORT (
329 CLK : IN std_logic;
330 socks_connected : IN std_logic;
331 socks_waiting : IN std_logic;
332 trigger : IN std_logic;
333 amber : OUT std_logic;
334 green : OUT std_logic;
335 red : OUT std_logic
336 );
337 END COMPONENT;
338 COMPONENT memory_manager
339 GENERIC (
340 RAM_ADDR_WIDTH_64B : integer := 12;
341 RAM_ADDR_WIDTH_16B : integer := 14
342 );
343 PORT (
344 clk : IN std_logic ;
345 config_start : IN std_logic ;
346 ram_write_ready : IN std_logic ;
347 -- --
348 ram_write_ready_ack : OUT std_logic := '0';
349 -- --
350 roi_array : IN roi_array_type ;
351 ram_write_ea : OUT std_logic := '0';
352 config_ready : OUT std_logic := '0';
353 config_started : OUT std_logic := '0';
354 roi_max : OUT roi_max_type := (others => conv_std_logic_vector (0, 11));
355 package_length : OUT std_logic_vector (15 DOWNTO 0) := (others => '0');
356 wiz_ram_start_addr : OUT std_logic_vector (RAM_ADDR_WIDTH_16B-1 DOWNTO 0) := (others => '0');
357 wiz_write_length : OUT std_logic_vector (16 DOWNTO 0) := (others => '0');
358 wiz_number_of_channels : OUT std_logic_vector (3 DOWNTO 0) := (others => '0');
359 wiz_write_ea : OUT std_logic := '0';
360 wiz_write_header : OUT std_logic := '0';
361 wiz_write_end : OUT std_logic := '0';
362 wiz_busy : IN std_logic ;
363 wiz_ack : IN std_logic ;
364 ram_start_addr : OUT std_logic_vector (RAM_ADDR_WIDTH_64B-1 DOWNTO 0) := (others => '0')
365 );
366 END COMPONENT;
367 COMPONENT spi_interface
368 PORT (
369 clk_50MHz : IN std_logic ;
370 config_start : IN std_logic ;
371 dac_array : IN dac_array_type ;
372 config_ready : OUT std_logic ;
373 config_started : OUT std_logic := '0';
374 dac_cs : OUT std_logic ;
375 mosi : OUT std_logic := '0';
376 sclk : OUT std_logic ;
377 sensor_array : OUT sensor_array_type ;
378 sensor_cs : OUT std_logic_vector (3 DOWNTO 0);
379 sensor_ready : OUT std_logic ;
380 miso : INOUT std_logic
381 );
382 END COMPONENT;
383 COMPONENT trigger_counter
384 PORT (
385 trigger_id : OUT std_logic_vector (47 DOWNTO 0);
386 trigger : IN std_logic ;
387 clk : IN std_logic
388 );
389 END COMPONENT;
390 COMPONENT w5300_modul
391 GENERIC (
392 RAM_ADDR_WIDTH : integer := 14
393 );
394 PORT (
395 clk : IN std_logic ;
396 wiz_reset : OUT std_logic := '1';
397 addr : OUT std_logic_vector (9 DOWNTO 0);
398 data : INOUT std_logic_vector (15 DOWNTO 0);
399 cs : OUT std_logic := '1';
400 wr : OUT std_logic := '1';
401 led : OUT std_logic_vector (7 DOWNTO 0) := (OTHERS => '0');
402 rd : OUT std_logic := '1';
403 int : IN std_logic ;
404 write_length : IN std_logic_vector (16 DOWNTO 0);
405 ram_start_addr : IN std_logic_vector (RAM_ADDR_WIDTH-1 DOWNTO 0);
406 ram_data : IN std_logic_vector (15 DOWNTO 0);
407 ram_addr : OUT std_logic_vector (RAM_ADDR_WIDTH-1 DOWNTO 0);
408 data_valid : IN std_logic ;
409 data_valid_ack : OUT std_logic := '0';
410 busy : OUT std_logic := '1';
411 write_header_flag : IN std_logic ;
412 write_end_flag : IN std_logic ;
413 fifo_channels : IN std_logic_vector (3 DOWNTO 0);
414 s_trigger : OUT std_logic := '0';
415 new_config : OUT std_logic := '0';
416 config_started : IN std_logic ;
417 config_addr : OUT std_logic_vector (7 DOWNTO 0);
418 config_data : INOUT std_logic_vector (15 DOWNTO 0) := (others => 'Z');
419 config_wr_en : OUT std_logic := '0';
420 config_rd_en : OUT std_logic := '0';
421 -- --
422 config_rw_ack : IN std_logic ;
423 -- --
424 config_rw_ready : IN std_logic ;
425 -- --
426 config_busy : IN std_logic ;
427 denable : OUT std_logic := '0'; -- default domino wave off
428 dwrite_enable : OUT std_logic := '0'; -- default DWRITE low.
429 sclk_enable : OUT std_logic := '1'; -- default DWRITE HIGH.
430 ps_direction : OUT std_logic := '1'; -- default phase shift upwards
431 ps_do_phase_shift : OUT std_logic := '0'; --pulse this TO phase shift once
432 ps_reset : OUT std_logic := '0'; -- pulse this TO reset the variable phase shift
433 srclk_enable : OUT std_logic := '1'; -- default SRCLK on.
434 socks_waiting : OUT std_logic ;
435 socks_connected : OUT std_logic
436 );
437 END COMPONENT;
438
439 -- Optional embedded configurations
440 -- pragma synthesis_off
441 FOR ALL : adc_buffer USE ENTITY FACT_FAD_lib.adc_buffer;
442 FOR ALL : clock_generator_var_ps USE ENTITY FACT_FAD_lib.clock_generator_var_ps;
443 FOR ALL : control_unit USE ENTITY FACT_FAD_lib.control_unit;
444 FOR ALL : dataRAM_64b_16b_width14_5 USE ENTITY FACT_FAD_lib.dataRAM_64b_16b_width14_5;
445 FOR ALL : data_generator USE ENTITY FACT_FAD_lib.data_generator;
446 FOR ALL : drs_pulser USE ENTITY FACT_FAD_lib.drs_pulser;
447 FOR ALL : led_controller USE ENTITY FACT_FAD_lib.led_controller;
448 FOR ALL : memory_manager USE ENTITY FACT_FAD_lib.memory_manager;
449 FOR ALL : spi_interface USE ENTITY FACT_FAD_lib.spi_interface;
450 FOR ALL : trigger_counter USE ENTITY FACT_FAD_lib.trigger_counter;
451 FOR ALL : w5300_modul USE ENTITY FACT_FAD_lib.w5300_modul;
452 -- pragma synthesis_on
453
454
455BEGIN
456
457 -- ModuleWare code(v1.9) for instance 'I5' of 'and'
458 drs_dwrite <= dwrite AND dwrite_enable;
459
460 -- ModuleWare code(v1.9) for instance 'I6' of 'and'
461 SRCLK <= SRCLK1 AND srclk_enable;
462
463 -- ModuleWare code(v1.9) for instance 'U_1' of 'and'
464 sclk <= sclk_enable AND sclk1;
465
466 -- ModuleWare code(v1.9) for instance 'U_3' of 'assignment'
467 PS_DO_IN <= ps_do_phase_shift;
468
469 -- ModuleWare code(v1.9) for instance 'U_5' of 'assignment'
470 PS_DIR_IN <= ps_direction;
471
472 -- ModuleWare code(v1.9) for instance 'U_6' of 'assignment'
473 CLK50_OUT <= CLK_50_internal;
474
475 -- ModuleWare code(v1.9) for instance 'U_7' of 'assignment'
476 CLK25_OUT <= CLK_25;
477
478 -- ModuleWare code(v1.9) for instance 'U_8' of 'assignment'
479 CLK25_PSOUT <= CLK_25_PS_internal;
480
481 -- ModuleWare code(v1.9) for instance 'U_0' of 'mux'
482 u_0combo_proc: PROCESS(drs_channel_internal, drs_address,
483 drs_address_mode)
484 BEGIN
485 CASE drs_address_mode IS
486 WHEN '0' => drs_channel_id <= drs_channel_internal;
487 WHEN '1' => drs_channel_id <= drs_address;
488 WHEN OTHERS => drs_channel_id <= (OTHERS => 'X');
489 END CASE;
490 END PROCESS u_0combo_proc;
491
492 -- ModuleWare code(v1.9) for instance 'U_9' of 'or'
493 trigger_out <= s_trigger OR trigger;
494
495 -- Instance port mappings.
496 I_main_adc_buffer : adc_buffer
497 PORT MAP (
498 clk_ps => CLK_25_PS_internal,
499 adc_data_array => adc_data_array,
500 adc_otr_array => adc_otr_array,
501 adc_data_array_int => adc_data_array_int,
502 adc_otr => adc_otr
503 );
504 U_2 : clock_generator_var_ps
505 PORT MAP (
506 CLK => CLK,
507 RST_IN => ps_reset,
508 direction => ps_direction,
509 do_shift => ps_do_phase_shift,
510 CLK_25 => CLK_25,
511 CLK_25_PS => CLK_25_PS_internal,
512 CLK_50 => CLK_50_internal,
513 DCM_locked => DCM_locked,
514 LOCKED_extraOUT => LOCKED_extraOUT,
515 PSCLK_OUT => PSCLK_OUT,
516 PSDONE_extraOUT => PSDONE_extraOUT,
517 PSEN_OUT => PSEN_OUT,
518 PSINCDEC_OUT => PSINCDEC_OUT,
519 offset => offset,
520 ready => ready,
521 shifting => shifting
522 );
523 I_main_control_unit : control_unit
524 PORT MAP (
525 clk => CLK_50_internal,
526 config_addr => config_addr,
527 config_rd_en => config_rd_en,
528 config_start => config_start_cm,
529 config_wr_en => config_wr_en,
530 config_busy => config_busy,
531 config_data_valid => config_data_valid,
532 config_ready => config_ready_cm,
533 config_rw_ack => config_rw_ack,
534 config_rw_ready => config_rw_ready,
535 config_started => config_started_cu,
536 dac_array => dac_array,
537 roi_array => roi_array,
538 config_data => config_data
539 );
540 U_4 : dataRAM_64b_16b_width14_5
541 PORT MAP (
542 clka => CLK_25,
543 dina => data_out,
544 addra => addr_out,
545 wea => write_ea,
546 clkb => CLK_50_internal,
547 addrb => ram_addr,
548 doutb => ram_data
549 );
550 I_main_data_generator : data_generator
551 GENERIC MAP (
552 RAM_ADDR_WIDTH => RAMADDRWIDTH64b
553 )
554 PORT MAP (
555 clk => CLK_25,
556 data_out => data_out,
557 addr_out => addr_out,
558 write_ea => write_ea,
559 ram_start_addr => ram_start_addr,
560 ram_write_ea => ram_write_ea,
561 ram_write_ready => ram_write_ready,
562 ram_write_ready_ack => ram_write_ready_ack,
563 config_start_mm => config_start,
564 config_start_cm => config_start_cm,
565 config_start_spi => config_start_spi,
566 config_ready_mm => config_ready,
567 config_ready_cm => config_ready_cm,
568 config_ready_spi => config_ready_spi,
569 config_started_mm => config_started_mm,
570 config_started_cm => config_started_cu,
571 config_started_spi => config_started_spi,
572 roi_array => roi_array,
573 roi_max => roi_max,
574 sensor_array => sensor_array,
575 sensor_ready => sensor_ready,
576 dac_array => dac_array,
577 package_length => package_length,
578 board_id => board_id,
579 crate_id => crate_id,
580 trigger_id => trigger_id,
581 trigger => trigger_out,
582 new_config => new_config,
583 config_started => config_started,
584 adc_data_array => adc_data_array_int,
585 adc_oeb => adc_oeb,
586 adc_clk_en => adc_clk_en,
587 adc_otr => adc_otr,
588 drs_channel_id => drs_channel_internal,
589 drs_dwrite => dwrite,
590 drs_clk_en => drs_clk_en,
591 drs_read_s_cell => drs_read_s_cell,
592 drs_srin_write_8b => start_srin_write_8b,
593 drs_srin_write_ack => srin_write_ack,
594 drs_srin_data => drs_srin_data,
595 drs_srin_write_ready => srin_write_ready,
596 drs_read_s_cell_ready => drs_read_s_cell_ready,
597 drs_s_cell_array => drs_s_cell_array
598 );
599 I_main_drs_pulser : drs_pulser
600 PORT MAP (
601 CLK => CLK_25,
602 start_endless_mode => drs_clk_en,
603 start_read_stop_pos_mode => drs_read_s_cell,
604 SROUT_in_0 => SROUT_in_0,
605 SROUT_in_1 => SROUT_in_1,
606 SROUT_in_2 => SROUT_in_2,
607 SROUT_in_3 => SROUT_in_3,
608 stop_pos => drs_s_cell_array,
609 stop_pos_valid => drs_read_s_cell_ready,
610 start_srin_write_8b => start_srin_write_8b,
611 srin_write_ready => srin_write_ready,
612 srin_write_ack => srin_write_ack,
613 srin_data => drs_srin_data,
614 SRIN_out => SRIN_out,
615 RSRLOAD => RSRLOAD,
616 SRCLK => SRCLK1
617 );
618 U_10 : led_controller
619 GENERIC MAP (
620 HEARTBEAT_DIVIDER => 25000000, -- 2Hz @ 50 MHz
621 WAITING_DIVIDER => 5000000 -- 10Hz @ 50 MHz
622 )
623 PORT MAP (
624 CLK => CLK_50_internal,
625 green => green,
626 amber => amber,
627 red => red,
628 trigger => trigger_out,
629 socks_waiting => socks_waiting,
630 socks_connected => socks_connected
631 );
632 I_main_memory_manager : memory_manager
633 GENERIC MAP (
634 RAM_ADDR_WIDTH_64B => RAMADDRWIDTH64b,
635 RAM_ADDR_WIDTH_16B => RAMADDRWIDTH64b+2
636 )
637 PORT MAP (
638 clk => CLK_25,
639 config_start => config_start,
640 ram_write_ready => ram_write_ready,
641 ram_write_ready_ack => ram_write_ready_ack,
642 roi_array => roi_array,
643 ram_write_ea => ram_write_ea,
644 config_ready => config_ready,
645 config_started => config_started_mm,
646 roi_max => roi_max,
647 package_length => package_length,
648 wiz_ram_start_addr => wiz_ram_start_addr,
649 wiz_write_length => wiz_write_length,
650 wiz_number_of_channels => wiz_number_of_channels,
651 wiz_write_ea => wiz_write_ea,
652 wiz_write_header => wiz_write_header,
653 wiz_write_end => wiz_write_end,
654 wiz_busy => wiz_busy,
655 wiz_ack => wiz_ack,
656 ram_start_addr => ram_start_addr
657 );
658 I_main_SPI_interface : spi_interface
659 PORT MAP (
660 clk_50MHz => CLK_50_internal,
661 config_start => config_start_spi,
662 dac_array => dac_array,
663 config_ready => config_ready_spi,
664 config_started => config_started_spi,
665 dac_cs => dac_cs,
666 mosi => mosi,
667 sclk => sclk1,
668 sensor_array => sensor_array,
669 sensor_cs => sensor_cs,
670 sensor_ready => sensor_ready,
671 miso => sio
672 );
673 I_main_ext_trigger : trigger_counter
674 PORT MAP (
675 trigger_id => trigger_id,
676 trigger => trigger_out,
677 clk => CLK_25_PS_internal
678 );
679 I_main_ethernet : w5300_modul
680 GENERIC MAP (
681 RAM_ADDR_WIDTH => RAMADDRWIDTH64b+2
682 )
683 PORT MAP (
684 clk => CLK_50_internal,
685 wiz_reset => wiz_reset,
686 addr => wiz_addr,
687 data => wiz_data,
688 cs => wiz_cs,
689 wr => wiz_wr,
690 led => led,
691 rd => wiz_rd,
692 int => wiz_int,
693 write_length => wiz_write_length,
694 ram_start_addr => wiz_ram_start_addr,
695 ram_data => ram_data,
696 ram_addr => ram_addr,
697 data_valid => wiz_write_ea,
698 data_valid_ack => wiz_ack,
699 busy => wiz_busy,
700 write_header_flag => wiz_write_header,
701 write_end_flag => wiz_write_end,
702 fifo_channels => wiz_number_of_channels,
703 s_trigger => s_trigger,
704 new_config => new_config,
705 config_started => config_started,
706 config_addr => config_addr,
707 config_data => config_data,
708 config_wr_en => config_wr_en,
709 config_rd_en => config_rd_en,
710 config_rw_ack => config_rw_ack,
711 config_rw_ready => config_rw_ready,
712 config_busy => config_busy,
713 denable => denable,
714 dwrite_enable => dwrite_enable,
715 sclk_enable => sclk_enable,
716 ps_direction => ps_direction,
717 ps_do_phase_shift => ps_do_phase_shift,
718 ps_reset => ps_reset,
719 srclk_enable => srclk_enable,
720 socks_waiting => socks_waiting,
721 socks_connected => socks_connected
722 );
723
724 -- Implicit buffered output assignments
725 CLK_25_PS <= CLK_25_PS_internal;
726 CLK_50 <= CLK_50_internal;
727
728END struct;
Note: See TracBrowser for help on using the repository browser.