13 USE ieee.std_logic_1164.
all;
14 use ieee.numeric_std.
all;
18 USE ipbus_lib.ipbus.
all;
23 IPBUS_ADDR_WIDTH : positive := 10
27 clk_320 : in std_logic;
28 rst_320 : in std_logic;
29 fifo_data : in std_logic_vector (63 DOWNTO 0);
30 fifo_valid : in std_logic;
31 fifo_last : in std_logic;
32 fifo_tready : in std_logic;
34 clk_ipb : in std_logic;
35 rst_ipb : in std_logic;
36 rst_ipbus_addr : in std_logic;
37 ipbus_wraparound : in std_logic;
39 ipb_out : out ipb_rbus
46 Component ipbus_dpram64
is
54 ipb_out:
out ipb_rbus;
56 we:
in std_logic := '
0';
57 d:
in std_logic_vector(
63 downto 0) := (
others => '
0');
58 q:
out std_logic_vector(
63 downto 0);
59 addr:
in std_logic_vector(ADDR_WIDTH
- 1 downto 0)
61 End Component ipbus_dpram64;
63 SIGNAL IPBus_RAM_addr, IPBus_RAM_addr_i : std_logic_vector(IPBUS_ADDR_WIDTH-1 downto 0);
64 SIGNAL IPBus_RAM_din, IPBus_RAM_din_i, fifo_data_i : std_logic_vector(63 DOWNTO 0);
65 SIGNAL IPBus_RAM_we, IPBus_RAM_we_i, fifo_valid_i, fifo_last_i, fifo_tready_i : std_logic;
69 IPbus_RAM : ipbus_dpram64
71 ADDR_WIDTH => IPBUS_ADDR_WIDTH
82 addr => IPBus_RAM_addr
85 ipbus_ram_block:
process(clk_320)
86 variable ram_addr, next_addr: unsigned(IPBUS_ADDR_WIDTH-1 downto 0) := (Others => '0');
87 constant max_addr
: unsigned(IPBUS_ADDR_WIDTH-1 downto 0) := (Others => '1');
88 constant min_addr
: unsigned(IPBUS_ADDR_WIDTH-1 downto 0) := to_unsigned(1, IPBUS_ADDR_WIDTH);
89 variable ram_we, endaddr_pending, we_active: std_logic;
90 variable ram_data: std_logic_vector(63 downto 0);
92 if rising_edge(clk_320) then
94 ram_addr := next_addr;
95 ram_data := (Others => '0');
96 if (rst_320 = '1') or (rst_ipbus_addr = '1') then
97 next_addr := min_addr;
98 endaddr_pending := '0';
100 elsif (fifo_valid_i = '1') and (fifo_tready_i = '1') then
102 ram_data := fifo_data_i;
103 endaddr_pending := fifo_last_i;
104 if (next_addr = max_addr) then
105 next_addr := min_addr;
107 we_active := ipbus_wraparound;
109 next_addr := next_addr + 1;
111 elsif (endaddr_pending = '1') then
113 ram_addr := (Others => '0');
114 ram_data(63 downto IPBUS_ADDR_WIDTH+1) := (Others => '0');
115 ram_data(IPBUS_ADDR_WIDTH downto 1) := std_logic_vector(next_addr);
117 endaddr_pending := '0';
119 IPBus_RAM_we_i <= ram_we
124 IPBus_RAM_din_i <= ram_data
129 IPBus_RAM_addr_i <= std_logic_vector(ram_addr)
135 end process ipbus_ram_block;
137 fifo_reg_block:
process(clk_320)
139 if rising_edge(clk_320) then
140 fifo_data_i <= fifo_data
145 fifo_valid_i <= fifo_valid
150 fifo_last_i <= fifo_last
155 fifo_tready_i <= fifo_tready
161 end process fifo_reg_block;
163 ipbus_ram_reg_block:
process(clk_320)
165 if rising_edge(clk_320) then
166 IPBus_RAM_din <= IPBus_RAM_din_i
171 IPBus_RAM_addr <= IPBus_RAM_addr_i
176 IPBus_RAM_we <= IPBus_RAM_we_i
182 end process ipbus_ram_reg_block;
184 END Architecture rtl;
Capture FIFO traffic into IPBus DPRAM64...
Capture FIFO traffic into IPBus DPRAM64...