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;
6 use work.lx_rocon_pkg.all;
8 -- Transaction measurement register
10 entity measurement_register is
13 id_g : std_logic_vector(31 downto 0) := (others => '0')
20 reset_i : in std_logic;
24 switch_i : in std_logic;
26 data_i : in std_logic_vector(31 downto 0);
27 data_o : out std_logic_vector(31 downto 0);
29 bls_i : in std_logic_vector(3 downto 0)
31 end measurement_register;
33 architecture Behavioral of measurement_register is
34 signal value_s : std_logic_vector(31 downto 0);
37 data_o <= value_s when switch_i = '1' else id_g;
39 -- Write waits for clock
44 wait until clk_i'event and clk_i = '1';
47 value_s <= (others => '0');
50 if ce_i = '1' and bls_i /= "0000" then
52 if bls_i(0) = '1' then
53 value_s(7 downto 0) <= data_i(7 downto 0);
55 if bls_i(1) = '1' then
56 value_s(15 downto 8) <= data_i(15 downto 8);
58 if bls_i(2) = '1' then
59 value_s(23 downto 16) <= data_i(23 downto 16);
61 if bls_i(3) = '1' then
62 value_s(31 downto 24) <= data_i(31 downto 24);