CMX
CMX firmware code in-line documentation
 All Classes Namespaces Files Functions Variables
vme_inreg_async_rtl.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 
18 entity vme_inreg_async is
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 : inout std_logic_vector (15 downto 0);
31 
32 
33  data_from_vme : out std_logic_vector (width-1 downto 0);
34  data_to_vme :in std_logic_vector (width-1 downto 0)
35 
36  );
37 
38 -- Declarations
39 
40 end vme_inreg_async ;
41 --------------------------------------------------------------------------------
42 ARCHITECTURE rtl OF vme_inreg_async IS
43 --------------------------------------------------------------------------------
44 -- VME register, all bits are inputs to board (q).
45 -- Variable width q, max 16.
46 --
47 
48  signal ren: std_logic; -- vme read enable
49 
50  signal wen: std_logic; -- vme write enable
51 
52 
53 --------------------------------------------------------------------------------
54 BEGIN
55 
56 
57  ren <= vme_ren (ia_vme, addr_vme, ncs, rd_nwr);
58  wen <= vme_wen (ia_vme, addr_vme, ncs, rd_nwr);
59 
60 
61  --async mode to drive the bus/let go of the bus as soon as ren is updated
63  -- read access
64  begin
65  data_vme <= "ZZZZZZZZZZZZZZZZ";
66  if (ren = '1') then
67  data_vme <= (others=>'0');
68  data_vme(width-1 downto 0) <= data_to_vme(width-1 downto 0);
69  end if;
70  end process;
71 
72 
73 
74 
75  vme_w_proc: process (data_vme,wen, ds)
76  -- write access
77  begin
78  if(ds'event and ds = '1') then
79  if (wen = '1') then
80  data_from_vme <= data_vme(width-1 downto 0);
81  end if;
82  end if;
83  end process;
84 
85 
86 
87 END rtl;
88 
89 
90 
out data_from_vmestd_logic_vector (width - 1 downto 0)
in addr_vmestd_logic_vector (15 downto 0)
in data_to_vmestd_logic_vector (width - 1 downto 0)
_library_ ieeeieee
Definition: tx_sync.vhd:66
test registers
inout data_vmestd_logic_vector (15 downto 0)