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 -- Dualported memory for example componenet
119 component lx_example_mem
122 -- Memory wiring for internal state automata use
123 clk_i : in std_logic;
125 adr_i : in std_logic_vector(9 downto 0);
126 bls_i : in std_logic_vector(3 downto 0);
127 dat_i : in std_logic_vector(31 downto 0);
128 dat_o : out std_logic_vector(31 downto 0);
129 -- Memory wiring for Master CPU
130 clk_m : in std_logic;
132 we_m : in std_logic_vector(3 downto 0);
133 addr_m : in std_logic_vector(9 downto 0);
134 din_m : in std_logic_vector(31 downto 0);
135 dout_m : out std_logic_vector(31 downto 0)
139 -- Measurement interconnect
140 component bus_measurement
144 clk_i : in std_logic;
146 reset_i : in std_logic;
150 address_i : in std_logic_vector(1 downto 0);
152 data_i : in std_logic_vector(31 downto 0);
153 data_o : out std_logic_vector(31 downto 0);
155 bls_i : in std_logic_vector(3 downto 0)
159 -- Register on the bus
160 component bus_register is
164 reset_value_g : std_logic_vector(31 downto 0) := (others => '0');
174 clk_i : in std_logic;
176 reset_i : in std_logic;
180 data_i : in std_logic_vector((b0_g+b1_g+b2_g+b3_g-1) downto 0);
181 data_o : out std_logic_vector((b0_g+b1_g+b2_g+b3_g-1) downto 0);
183 bls_i : in std_logic_vector(3 downto 0)
188 --------------------------------------------------------------------------------
190 --------------------------------------------------------------------------------
191 type BRAM_type is (READ_FIRST, WRITE_FIRST, NO_CHANGE);
193 component xilinx_dualport_bram
196 byte_width : positive := 8;
197 address_width : positive := 8;
198 we_width : positive := 4;
199 port_a_type : BRAM_type := READ_FIRST;
200 port_b_type : BRAM_type := READ_FIRST
207 wea : in std_logic_vector((we_width-1) downto 0);
208 addra : in std_logic_vector((address_width-1) downto 0);
209 dina : in std_logic_vector(((byte_width*we_width)-1) downto 0);
210 douta : out std_logic_vector(((byte_width*we_width)-1) downto 0);
214 web : in std_logic_vector((we_width-1) downto 0);
215 addrb : in std_logic_vector((address_width-1) downto 0);
216 dinb : in std_logic_vector(((byte_width*we_width)-1) downto 0);
217 doutb : out std_logic_vector(((byte_width*we_width)-1) downto 0)
223 package body lx_dad_pkg is