2 use ieee.std_logic_1164.all;
3 use ieee.numeric_std.all;
6 generic ( TDATA_WIDTH : integer := 8);
9 wr_field_0 : in std_logic_vector(TDATA_WIDTH - 1 downto 0);
10 wr_field_1 : in std_logic;
13 rd_field_0 : out std_logic_vector(TDATA_WIDTH - 1 downto 0);
14 rd_field_1 : out std_logic
18 architecture foo of foo2 is
20 type data_array_t is array (3 downto 0) of std_logic_vector(TDATA_WIDTH downto 0);
21 signal data_buffer : data_array_t;
23 signal addr : unsigned(3 downto 0) := (others => '0');
27 rd_field_0 <= data_buffer(to_integer(addr))(TDATA_WIDTH - 1 downto 0);
28 rd_field_1 <= data_buffer(to_integer(addr))(TDATA_WIDTH);
32 if rising_edge(clk) then
36 data_buffer(to_integer(addr)) <= wr_field_0 & wr_field_1;