source: firmware/FTM/ethernet/header_modul_beha.vhd@ 10360

Last change on this file since 10360 was 10256, checked in by weitzel, 14 years ago
new version of FTM ethernet module; first version of clock conditioner
  • Property svn:executable set to *
File size: 2.3 KB
Line 
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
11LIBRARY ieee;
12USE ieee.std_logic_1164.all;
13USE ieee.std_logic_arith.all;
14USE 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;
18library ftm_definitions;
19USE ftm_definitions.ftm_array_types.all;
20USE ftm_definitions.ftm_constants.all;
21
22ENTITY header_modul IS
23PORT(
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 );
33END ENTITY header_modul;
34
35--
36ARCHITECTURE 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
42BEGIN
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
79END ARCHITECTURE beha;
Note: See TracBrowser for help on using the repository browser.