CMX
CMX firmware code in-line documentation
 All Classes Namespaces Files Functions Variables
CMX_pipeline_module.vhd
Go to the documentation of this file.
1 
12 
13 
14 
15 LIBRARY ieee ;
16 USE ieee.std_logic_1164.all;
17 USE ieee.numeric_std.all;
18 LIBRARY unisim ;
19 USE unisim.VCOMPONENTS.all;
20 
21 
22 
24  GENERIC(
26  );
27  PORT(
28  clk : IN std_logic ;
29  din : IN std_logic_vector ;
30  dout : OUT std_logic_vector ;
31  --VME control:
32  ncs : in std_logic;
33  rd_nwr : in std_logic;
34  ds : in std_logic;
35  addr_vme : in std_logic_vector (15 downto 0);
36  data_vme_in : in std_logic_vector (15 downto 0);
37  data_vme_out : out std_logic_vector (15 downto 0);
38  bus_drive : out std_logic
39  );
40 
41 -- Declarations
42 
43 END CMX_pipeline_module ;
44 
45 -- renoir interface_end
46 --------------------------------------------------------------------------------
47 ARCHITECTURE xlx OF CMX_pipeline_module IS
48 --------------------------------------------------------------------------------
49 -- variable pipeline, 'width' bits wide of dynamically variable length 0-16,
50 -- steering address bit 0 selects direct data or through srl if set
51 -- bits 4-7 control the length of the srl
52 
53 --------------------------------------------------------------------------------
54 
55  constant data_width : integer := din'length; --how big is the data port
56  constant data_width_out : integer := dout'length; --how big is the data port
57 
58 
59  signal data_from_vme_REG_RW_PIPELINE_DELAY_LENGTH : std_logic_vector(15 downto 0);
60  signal data_to_vme_REG_RW_PIPELINE_DELAY_LENGTH : std_logic_vector(15 downto 0);
61 
62  signal delay : std_logic_vector (3 downto 0) ;
63 
64  signal enable_srl : std_logic;
65 
66  signal dout_srl : std_logic_vector(data_width-1 downto 0);
67 
68 BEGIN
69 
70  assert (data_width = data_width_out ) report "input and output port of the pipeline lengths not equal" severity failure;
71 
72 
73  vme_inreg_notri_async_REG_RW_PIPELINE_DELAY_LENGTH : entity work.vme_inreg_notri_async
74  generic map (
76  width => 16)
77  port map (
78  ncs => ncs,
79  rd_nwr => rd_nwr,
80  ds => ds,
81  addr_vme => addr_vme,
87 
89 
90  enable_srl<=data_from_vme_REG_RW_PIPELINE_DELAY_LENGTH(0);
91  delay(3 downto 0)<= data_from_vme_REG_RW_PIPELINE_DELAY_LENGTH(7 downto 4);
92 
93  gensrl: for i in 0 to (data_width-1) generate
94  bit: srl16 port map (
95  d =>din(i), clk =>clk, a0 =>delay(0), a1 =>delay(1),
96  a2 =>delay(2), a3 =>delay(3),
97  q =>dout_srl (i)
98  );
99  end generate gensrl;
100 
101 
102  dout<=dout_srl when enable_srl='1' else din;
103 
104 
105 END xlx;
std_logic_vector (data_width - 1 downto 0) dout_srl
in addr_vmestd_logic_vector (15 downto 0)
in addr_vmestd_logic_vector (15 downto 0)
in dinstd_logic_vector
out data_from_vmestd_logic_vector (width - 1 downto 0)
out doutstd_logic_vector
std_logic_vector (15 downto 0) data_to_vme_REG_RW_PIPELINE_DELAY_LENGTH
in data_vme_instd_logic_vector (15 downto 0)
out data_vme_outstd_logic_vector (15 downto 0)
ADDR_REG_RW_PIPELINE_DELAY_LENGTHinteger :=0
std_logic_vector (3 downto 0) delay
srl16 bitbit
in data_to_vmestd_logic_vector (width - 1 downto 0)
std_logic_vector (15 downto 0) data_from_vme_REG_RW_PIPELINE_DELAY_LENGTH
integer :=din' length data_width
out data_vme_outstd_logic_vector (15 downto 0)
integer :=dout' length data_width_out
in data_vme_instd_logic_vector (15 downto 0)