]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/lx-rocon.git/blob - hw/irc_reader.vhd
36897875e11a0618e789ac1f5d275b44587f80fb
[fpga/lx-cpu1/lx-rocon.git] / hw / irc_reader.vhd
1 library ieee;
2 use ieee.std_logic_1164.all;
3 use ieee.std_logic_arith.all;
4 use ieee.std_logic_unsigned.all;
5 use ieee.numeric_std.all;
6 use work.lx_rocon_pkg.all;
7
8 -- IRC reader module
9
10 entity irc_reader is
11         port
12         (
13                 -- Inputs
14     clk_i               : in std_logic;
15     reset_i             : in std_logic;
16     irc_i               : in IRC_INPUT_Type;
17                 -- State
18                 reset_index_event_i : in std_logic;
19                 reset_ab_error_i    : in std_logic;
20                 -- Outputs
21     irc_o               : out IRC_OUTPUT_Type
22   );
23 end irc_reader;
24
25 architecture rtl of irc_reader is
26
27         begin
28
29         dff_mark: dff2
30         port map
31         (
32                 clk_i   => clk_i,
33                 reset_i => '0',
34                 d_i     => irc_i.mark,
35                 q_o     => irc_o.mark
36         );
37
38         qctr: qcounter
39         port map
40         (
41                 clk_i               => clk_i,
42                 reset_i             => reset_i,
43                 a0_i                => irc_i.a,
44                 b0_i                => irc_i.b,
45                 index0_i            => irc_i.index,
46                 reset_index_event_i => reset_index_event_i,
47                 reset_ab_error_i    => reset_ab_error_i,
48                 qcount_o            => irc_o.qcount,
49                 qcount_index_o      => irc_o.index,
50                 ab_error_o          => irc_o.ab_error,
51                 ab_event_o          => open,
52                 index_event_o       => irc_o.index_event,
53                 a_rise_o            => open,
54                 a_fall_o            => open,
55                 b_rise_o            => open,
56                 b_fall_o            => open
57         );
58
59 end rtl;