2 use ieee.std_logic_1164.all;
3 use ieee.numeric_std.all;
6 -- Entities within lx_dad
10 -- D sampler (filtered, 2 cycles)
20 -- D sampler (filtered, 3 cycles)
33 cnt_width_g : natural := 8
39 reset_i : in std_logic;
40 ratio_i : in std_logic_vector(cnt_width_g-1 downto 0);
41 q_out_o : out std_logic
45 -- Clock Cross Domain Synchronization Elastic Buffer/FIFO
46 component lx_crosdom_ser_fifo
49 fifo_len_g : positive := 8;
50 sync_adj_g : integer := 0
54 -- Asynchronous clock domain interface
55 acd_clock_i : in std_logic;
56 acd_miso_i : in std_logic;
57 acd_sync_i : in std_logic;
60 reset_i : in std_logic;
61 -- Output synchronous with clk_i
62 miso_o : out std_logic;
63 sync_o : out std_logic;
64 data_ready_o : out std_logic
68 --------------------------------------------------------------------------------
70 --------------------------------------------------------------------------------
72 -- Measurement register
73 component measurement_register
76 id_g : std_logic_vector(31 downto 0) := (others => '0')
83 reset_i : in std_logic;
87 switch_i : in std_logic;
89 data_i : in std_logic_vector(31 downto 0);
90 data_o : out std_logic_vector(31 downto 0);
92 bls_i : in std_logic_vector(3 downto 0)
96 -- Example component interconnect
100 clk_i : in std_logic;
101 reset_i : in std_logic;
102 -- Master CPU peripheral bus
103 address_i : in std_logic_vector(11 downto 0);
105 data_i : in std_logic_vector(31 downto 0);
106 data_o : out std_logic_vector(31 downto 0);
108 bls_i : in std_logic_vector(3 downto 0)
112 -- Add there externaly visible signals
116 -- Dualported memory for example componenet
117 component lx_example_mem
120 -- Memory wiring for internal state automata use
121 clk_i : in std_logic;
123 adr_i : in std_logic_vector(9 downto 0);
124 bls_i : in std_logic_vector(3 downto 0);
125 dat_i : in std_logic_vector(31 downto 0);
126 dat_o : out std_logic_vector(31 downto 0);
127 -- Memory wiring for Master CPU
128 clk_m : in std_logic;
130 we_m : in std_logic_vector(3 downto 0);
131 addr_m : in std_logic_vector(9 downto 0);
132 din_m : in std_logic_vector(31 downto 0);
133 dout_m : out std_logic_vector(31 downto 0)
137 -- Measurement interconnect
138 component bus_measurement
142 clk_i : in std_logic;
144 reset_i : in std_logic;
148 address_i : in std_logic_vector(1 downto 0);
150 data_i : in std_logic_vector(31 downto 0);
151 data_o : out std_logic_vector(31 downto 0);
153 bls_i : in std_logic_vector(3 downto 0)
157 -- Register on the bus
158 component bus_register is
162 reset_value_g : std_logic_vector(31 downto 0) := (others => '0');
172 clk_i : in std_logic;
174 reset_i : in std_logic;
178 data_i : in std_logic_vector((b0_g+b1_g+b2_g+b3_g-1) downto 0);
179 data_o : out std_logic_vector((b0_g+b1_g+b2_g+b3_g-1) downto 0);
181 bls_i : in std_logic_vector(3 downto 0)
186 --------------------------------------------------------------------------------
188 --------------------------------------------------------------------------------
189 type BRAM_type is (READ_FIRST, WRITE_FIRST, NO_CHANGE);
191 component xilinx_dualport_bram
194 byte_width : positive := 8;
195 address_width : positive := 8;
196 we_width : positive := 4;
197 port_a_type : BRAM_type := READ_FIRST;
198 port_b_type : BRAM_type := READ_FIRST
205 wea : in std_logic_vector((we_width-1) downto 0);
206 addra : in std_logic_vector((address_width-1) downto 0);
207 dina : in std_logic_vector(((byte_width*we_width)-1) downto 0);
208 douta : out std_logic_vector(((byte_width*we_width)-1) downto 0);
212 web : in std_logic_vector((we_width-1) downto 0);
213 addrb : in std_logic_vector((address_width-1) downto 0);
214 dinb : in std_logic_vector(((byte_width*we_width)-1) downto 0);
215 doutb : out std_logic_vector(((byte_width*we_width)-1) downto 0)
221 package body lx_dad_pkg is