CMX
CMX firmware code in-line documentation
 All Classes Namespaces Files Functions Variables
vme_inreg_rtl_notri_async.vhd
Go to the documentation of this file.
1 
5 
6 
7 
8 LIBRARY ieee ;
9 USE ieee.std_logic_1164.all;
10 USE ieee.numeric_std.all;
11 
12 -- YE: All files are loaded in the library "work"
13 -- LIBRARY cmm_main; -- YE: this is a library, where package "vme_cmm" located
14 -- USE cmm_main.vme_cmm.all; -- YE: package "vme_cmm" moved to the library "work"
15 use work.CMXpackage.all; -- YE: so use package "vme_cmm" from library "work" (cmx_vat.vhd)
16 use work.CMX_VME_defs.all;
17 
19  generic(
20  ia_vme : integer := 0;
21  width : integer := 16
22  );
23  port(
24 
25  ncs : in std_logic;
26  rd_nwr : in std_logic;
27  ds : in std_logic;
28 
29  addr_vme : in std_logic_vector (15 downto 0);
30  data_vme_in : in std_logic_vector (15 downto 0);
31  data_vme_out : out std_logic_vector (15 downto 0);
32  bus_drive : out std_logic;
33 
34  data_from_vme : out std_logic_vector (width-1 downto 0);
35  data_to_vme :in std_logic_vector (width-1 downto 0)
36 
37  );
38 
39 -- Declarations
40 
41 end vme_inreg_notri_async ;
42 --------------------------------------------------------------------------------
43 ARCHITECTURE rtl OF vme_inreg_notri_async IS
44 --------------------------------------------------------------------------------
45 -- VME register, all bits are inputs to board (q).
46 -- Variable width q, max 16.
47 --
48 
49  signal ren: std_logic; -- vme read enable
50 
51  signal wen: std_logic; -- vme write enable
52 
53 
54 --------------------------------------------------------------------------------
55 BEGIN
56 
57 
58  ren <= vme_ren (ia_vme, addr_vme, ncs, rd_nwr);
59  wen <= vme_wen (ia_vme, addr_vme, ncs, rd_nwr);
60 
61  data_vme_out(width-1 downto 0)<=data_to_vme when ren='1' else (others=>'0');
62  gz: if width<16 generate
63  data_vme_out(15 downto width)<=(others=>'0');
64  end generate gz;
65  bus_drive<=ren;
66 
67 
68 
69 
70 
71  vme_w_proc: process (wen, ds)
72  -- write access
73  begin
74  if(ds'event and ds = '1') then
75  if (wen = '1') then
76  data_from_vme <= data_vme_in(width-1 downto 0);
77  end if;
78  end if;
79  end process;
80 
81 
82 
83 END rtl;
84 
85 
86 
in addr_vmestd_logic_vector (15 downto 0)
_library_ ieeeieee
out data_from_vmestd_logic_vector (width - 1 downto 0)
in data_vme_instd_logic_vector (15 downto 0)
in data_to_vmestd_logic_vector (width - 1 downto 0)
out data_vme_outstd_logic_vector (15 downto 0)
test registers