]> rtime.felk.cvut.cz Git - fpga/virtex2/msp_motion.git/blob - mcu_periph/capture_reg16.vhd
Added index capture register hardware
[fpga/virtex2/msp_motion.git] / mcu_periph / capture_reg16.vhd
1 library ieee;
2 use ieee.std_logic_1164.ALL;
3 use ieee.std_logic_arith.ALL;
4
5 --------------------------------------------------------------------------------
6
7 entity capture_reg16 is
8   port (
9     -- Peripheral bus interface
10     ACK_O  : out std_logic;
11     ADR_I  : in  std_logic_vector (0 downto 0);
12     CLK_I  : in  std_logic;
13     DAT_O  : out std_logic_vector (15 downto 0);
14     SEL_I  : in  std_logic;
15     STB_I  : in  std_logic;
16     -- QCounter component interface
17         EVENT_I   : in  std_logic;
18     CAPTURE_I : in  std_logic_vector (31 downto 0));
19 end capture_reg16;
20
21 --------------------------------------------------------------------------------
22
23 architecture behavioral of capture_reg16 is
24   
25   signal CR_DAT_O : std_logic_vector (31 downto 0);
26
27 --------------------------------------------------------------------------------
28
29 begin
30
31   with ADR_I select
32     DAT_O <= 
33     CR_DAT_O (15 downto  0) when "0",
34     CR_DAT_O (31 downto 16) when "1",
35     (others => 'X')         when others;
36
37
38   capture_reg0 : entity work.capture_reg
39     generic map (
40       W => 32)
41     port map (
42           ACK_O  => ACK_O,
43       CLK_I  => CLK_I,
44       DAT_O  => CR_DAT_O,
45       SEL_I  => SEL_I,
46       STB_I  => STB_I,
47       EVENT_I   => EVENT_I,
48       CAPTURE_I => CAPTURE_I);
49
50 end behavioral;
51