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;
8 -- Entities within lx_dad
12 -- D sampler (filtered, 2 cycles)
22 -- D sampler (filtered, 3 cycles)
35 cnt_width_g : natural := 8
41 reset_i : in std_logic;
42 ratio_i : in std_logic_vector(cnt_width_g-1 downto 0);
43 q_out_o : out std_logic
47 -- Clock Cross Domain Synchronization Elastic Buffer/FIFO
48 component lx_crosdom_ser_fifo
51 fifo_len_g : positive := 8;
52 sync_adj_g : integer := 0
56 -- Asynchronous clock domain interface
57 acd_clock_i : in std_logic;
58 acd_miso_i : in std_logic;
59 acd_sync_i : in std_logic;
62 reset_i : in std_logic;
63 -- Output synchronous with clk_i
64 miso_o : out std_logic;
65 sync_o : out std_logic;
66 data_ready_o : out std_logic
70 --------------------------------------------------------------------------------
72 --------------------------------------------------------------------------------
74 -- Measurement register
75 component measurement_register
78 id_g : std_logic_vector(31 downto 0) := (others => '0')
85 reset_i : in std_logic;
89 switch_i : in std_logic;
91 data_i : in std_logic_vector(31 downto 0);
92 data_o : out std_logic_vector(31 downto 0);
94 bls_i : in std_logic_vector(3 downto 0)
98 -- Example component interconnect
102 clk_i : in std_logic;
103 reset_i : in std_logic;
104 -- Master CPU peripheral bus
105 address_i : in std_logic_vector(11 downto 0);
107 data_i : in std_logic_vector(31 downto 0);
108 data_o : out std_logic_vector(31 downto 0);
110 bls_i : in std_logic_vector(3 downto 0)
114 -- Add there externaly visible signals
118 -- Measurement interconnect
119 component bus_measurement
123 clk_i : in std_logic;
125 reset_i : in std_logic;
129 address_i : in std_logic_vector(1 downto 0);
131 data_i : in std_logic_vector(31 downto 0);
132 data_o : out std_logic_vector(31 downto 0);
134 bls_i : in std_logic_vector(3 downto 0)
138 -- Register on the bus
139 component bus_register is
143 reset_value_g : std_logic_vector(31 downto 0) := (others => '0');
153 clk_i : in std_logic;
155 reset_i : in std_logic;
159 data_i : in std_logic_vector((b0_g+b1_g+b2_g+b3_g-1) downto 0);
160 data_o : out std_logic_vector((b0_g+b1_g+b2_g+b3_g-1) downto 0);
162 bls_i : in std_logic_vector(3 downto 0)
167 --------------------------------------------------------------------------------
169 --------------------------------------------------------------------------------
170 type BRAM_type is (READ_FIRST, WRITE_FIRST, NO_CHANGE);
172 component xilinx_dualport_bram
175 byte_width : positive := 8;
176 address_width : positive := 8;
177 we_width : positive := 4;
178 port_a_type : BRAM_type := READ_FIRST;
179 port_b_type : BRAM_type := READ_FIRST
186 wea : in std_logic_vector((we_width-1) downto 0);
187 addra : in std_logic_vector((address_width-1) downto 0);
188 dina : in std_logic_vector(((byte_width*we_width)-1) downto 0);
189 douta : out std_logic_vector(((byte_width*we_width)-1) downto 0);
193 web : in std_logic_vector((we_width-1) downto 0);
194 addrb : in std_logic_vector((address_width-1) downto 0);
195 dinb : in std_logic_vector(((byte_width*we_width)-1) downto 0);
196 doutb : out std_logic_vector(((byte_width*we_width)-1) downto 0)
202 package body lx_dad_pkg is