10 use IEEE.STD_LOGIC_1164.
ALL;
11 use ieee.numeric_std.
all;
13 use ipbus_lib.ipbus.
all;
32 we: in std_logic := '0';
34 d: in std_logic_vector(31 downto 0) := (others => '0');
36 q: out std_logic_vector(31 downto 0);
38 addr: in std_logic_vector(ADDR_WIDTH - 1 downto 0)
46 type ram_array is array(0 to 2 ** ADDR_WIDTH - 1 ) of std_logic_vector(31 downto 0);
48 shared variable ram: ram_array :=(
50 X"03000000", others => X"00000000" );
52 signal sel, rsel: integer range 0 to 2 ** ADDR_WIDTH - 1 := 0;
53 signal ack: std_logic;
57 sel <= to_integer(unsigned(ipb_in.ipb_addr(ADDR_WIDTH - 1 downto 0)));
61 if rising_edge(clk) then
64 ram(sel) := ipb_in.ipb_wdata;
66 ack <= ipb_in.ipb_strobe and not ack;
73 rsel <= to_integer(unsigned(addr));
77 if rising_edge(rclk) then
in clk std_logic
write clock
in addr std_logic_vector( ADDR_WIDTH- 1 downto 0)
address
out ipb_out ipb_rbus
IPBus output bus going from slaves to master.
in rclk std_logic
read clock
in we std_logic := '0'
write enable
in ipb_in ipb_wbus
IPBus input bus going from master to slaves.
in d std_logic_vector( 31 downto 0) :=( others => '0')
data in
out q std_logic_vector( 31 downto 0)
data out