1 | --
|
---|
2 | -- VHDL Architecture FACT_FTM_lib.header_modul.beha
|
---|
3 | --
|
---|
4 | -- Created:
|
---|
5 | -- by - kai.UNKNOWN (E5PCXX)
|
---|
6 | -- at - 10:30:24 03.03.2011
|
---|
7 | --
|
---|
8 | -- using Mentor Graphics HDL Designer(TM) 2009.1 (Build 12)
|
---|
9 | --
|
---|
10 |
|
---|
11 | LIBRARY ieee;
|
---|
12 | USE ieee.std_logic_1164.all;
|
---|
13 | USE ieee.std_logic_arith.all;
|
---|
14 | USE IEEE.STD_LOGIC_UNSIGNED.all;
|
---|
15 | -- LIBRARY FACT_FTM_lib;
|
---|
16 | -- USE FACT_FTM_lib.ftm_array_types.all;
|
---|
17 | -- USE FACT_FTM_lib.ftm_constants.all;
|
---|
18 | library ftm_definitions;
|
---|
19 | USE ftm_definitions.ftm_array_types.all;
|
---|
20 | USE ftm_definitions.ftm_constants.all;
|
---|
21 |
|
---|
22 | ENTITY header_modul IS
|
---|
23 | PORT(
|
---|
24 | clk : IN std_logic;
|
---|
25 | get_header : IN std_logic;
|
---|
26 | get_header_started : OUT std_logic := '0';
|
---|
27 | get_header_ready : OUT std_logic := '0';
|
---|
28 | header_board_id : OUT std_logic_vector (63 DOWNTO 0) := (others => '0');
|
---|
29 | header_firmware_id : OUT std_logic_vector (15 DOWNTO 0) := (others => '0');
|
---|
30 | header_trigger_counter : OUT std_logic_vector (31 DOWNTO 0) := (others => '0');
|
---|
31 | header_timestamp_counter : OUT std_logic_vector (47 DOWNTO 0) := (others => '0')
|
---|
32 | );
|
---|
33 | END ENTITY header_modul;
|
---|
34 |
|
---|
35 | --
|
---|
36 | ARCHITECTURE beha OF header_modul IS
|
---|
37 |
|
---|
38 | type state_header_proc_type is (HP_INIT, HP_CONFIG, HP_IDLE, HP_START, HP_END);
|
---|
39 |
|
---|
40 | signal state_header_proc : state_header_proc_type := HP_INIT;
|
---|
41 |
|
---|
42 | BEGIN
|
---|
43 | header_proc : process (clk)
|
---|
44 | begin
|
---|
45 | if rising_edge (clk) then
|
---|
46 | case state_header_proc is
|
---|
47 |
|
---|
48 | when HP_INIT =>
|
---|
49 | state_header_proc <= HP_CONFIG;
|
---|
50 |
|
---|
51 | when HP_CONFIG =>
|
---|
52 | state_header_proc <= HP_IDLE;
|
---|
53 |
|
---|
54 | when HP_IDLE =>
|
---|
55 | if (get_header = '1') then
|
---|
56 | get_header_started <= '1';
|
---|
57 | get_header_ready <= '0';
|
---|
58 | state_header_proc <= HP_START;
|
---|
59 | end if;
|
---|
60 |
|
---|
61 | when HP_START =>
|
---|
62 | header_board_id <= to_stdlogicvector (DNA_FOR_SIM);
|
---|
63 | header_firmware_id <= X"00" & FIRMWARE_ID;
|
---|
64 | header_trigger_counter <= X"22221111";
|
---|
65 | header_timestamp_counter <= X"333322221111";
|
---|
66 | state_header_proc <= HP_END;
|
---|
67 |
|
---|
68 | when HP_END =>
|
---|
69 | if (get_header <= '0') then
|
---|
70 | get_header_started <= '0';
|
---|
71 | get_header_ready <= '1';
|
---|
72 | state_header_proc <= HP_IDLE;
|
---|
73 | end if;
|
---|
74 |
|
---|
75 | end case;
|
---|
76 | end if;
|
---|
77 | end process header_proc;
|
---|
78 |
|
---|
79 | END ARCHITECTURE beha;
|
---|