2 use ieee.std_logic_1164.all;
3 use ieee.numeric_std.all;
4 use work.lx_dad_pkg.all;
6 -- Transaction measurement register
8 entity measurement_register is
11 id_g : std_logic_vector(31 downto 0) := (others => '0')
18 reset_i : in std_logic;
22 switch_i : in std_logic;
24 data_i : in std_logic_vector(31 downto 0);
25 data_o : out std_logic_vector(31 downto 0);
27 bls_i : in std_logic_vector(3 downto 0)
29 end measurement_register;
31 architecture Behavioral of measurement_register is
32 signal value_s : std_logic_vector(31 downto 0);
35 data_o <= value_s when switch_i = '1' else id_g;
37 -- Write waits for clock
42 wait until clk_i'event and clk_i = '1';
45 value_s <= (others => '0');
48 if ce_i = '1' and bls_i /= "0000" then
50 if bls_i(0) = '1' then
51 value_s(7 downto 0) <= data_i(7 downto 0);
53 if bls_i(1) = '1' then
54 value_s(15 downto 8) <= data_i(15 downto 8);
56 if bls_i(2) = '1' then
57 value_s(23 downto 16) <= data_i(23 downto 16);
59 if bls_i(3) = '1' then
60 value_s(31 downto 24) <= data_i(31 downto 24);