1 |
145 |
lanttu |
-------------------------------------------------------------------------------
|
2 |
|
|
-- File : hibi_wrapper_r3.vhd
|
3 |
|
|
-- Description : HIBI bus wrapper_r3.
|
4 |
|
|
-- This is interface revision 3
|
5 |
|
|
-- - separate IP interface for regular and hi-prior data
|
6 |
|
|
-- - IP writes/gets addr and data in parallel
|
7 |
|
|
--
|
8 |
|
|
-- r3 uses r1 inside together with multiplexers that
|
9 |
|
|
-- convert addr+ data par->seq and vice versa
|
10 |
|
|
--
|
11 |
|
|
-- NOTE! one_d_out and one_p_out do not work fully as expected,
|
12 |
|
|
-- since they're straight from the FIFO and full and empty are
|
13 |
|
|
-- formed in another blocks (addr_data_mux_write etc).
|
14 |
|
|
-- I suggest that they're removed from the interface.
|
15 |
|
|
-- Author : Erno Salminen
|
16 |
|
|
-- e-mail : erno.salminen@tut.fi
|
17 |
|
|
-- Design :
|
18 |
|
|
-- Date : 28.10.2004
|
19 |
|
|
-- Modified :
|
20 |
|
|
--
|
21 |
|
|
-- 15.12.04 ES names changed
|
22 |
|
|
-- 28.02.2005 ES cfg_rom_en_g removed, cfg_re and cfg_we added
|
23 |
|
|
-------------------------------------------------------------------------------
|
24 |
|
|
-- Funbase IP library Copyright (C) 2011 TUT Department of Computer Systems
|
25 |
|
|
--
|
26 |
|
|
-- This file is part of HIBI
|
27 |
|
|
--
|
28 |
|
|
-- This source file may be used and distributed without
|
29 |
|
|
-- restriction provided that this copyright statement is not
|
30 |
|
|
-- removed from the file and that any derivative work contains
|
31 |
|
|
-- the original copyright notice and the associated disclaimer.
|
32 |
|
|
--
|
33 |
|
|
-- This source file is free software; you can redistribute it
|
34 |
|
|
-- and/or modify it under the terms of the GNU Lesser General
|
35 |
|
|
-- Public License as published by the Free Software Foundation;
|
36 |
|
|
-- either version 2.1 of the License, or (at your option) any
|
37 |
|
|
-- later version.
|
38 |
|
|
--
|
39 |
|
|
-- This source is distributed in the hope that it will be
|
40 |
|
|
-- useful, but WITHOUT ANY WARRANTY; without even the implied
|
41 |
|
|
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
42 |
|
|
-- PURPOSE. See the GNU Lesser General Public License for more
|
43 |
|
|
-- details.
|
44 |
|
|
--
|
45 |
|
|
-- You should have received a copy of the GNU Lesser General
|
46 |
|
|
-- Public License along with this source; if not, download it
|
47 |
|
|
-- from http://www.opencores.org/lgpl.shtml
|
48 |
|
|
-------------------------------------------------------------------------------
|
49 |
|
|
library ieee;
|
50 |
|
|
use ieee.std_logic_1164.all;
|
51 |
|
|
use ieee.std_logic_arith.all;
|
52 |
|
|
use ieee.std_logic_unsigned.all;
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
entity hibi_wrapper_r3 is
|
56 |
|
|
|
57 |
|
|
generic (
|
58 |
|
|
-- Note: n_ = number of,
|
59 |
|
|
-- lte = less than or equal,
|
60 |
|
|
-- gte = greater than or equal
|
61 |
|
|
|
62 |
|
|
-- Structural settings.
|
63 |
|
|
-- All widths are given in bits
|
64 |
|
|
addr_width_g : integer := 32; -- lte data_width
|
65 |
|
|
data_width_g : integer := 32;
|
66 |
|
|
comm_width_g : integer := 3; -- HIBI v.2=3, v.3 = 5 bits
|
67 |
|
|
counter_width_g : integer := 7; -- gte (n_agents, max_send...)
|
68 |
|
|
debug_width_g : integer := 0; -- for special monitors
|
69 |
|
|
|
70 |
|
|
-- All FIFO depths are given in words
|
71 |
|
|
-- Allowed values 0,2,3... words.
|
72 |
|
|
-- Prefix msg refers to hi-prior data
|
73 |
|
|
rx_fifo_depth_g : integer := 5;
|
74 |
|
|
tx_fifo_depth_g : integer := 5;
|
75 |
|
|
rx_msg_fifo_depth_g : integer := 5;
|
76 |
|
|
tx_msg_fifo_depth_g : integer := 5;
|
77 |
|
|
|
78 |
|
|
-- Clocking and synchronization
|
79 |
|
|
-- fifo_sel: 0 synch multiclk, 1 basic GALS,
|
80 |
|
|
-- 2 Gray FIFO (depth=2^n!), 3 mixed clock pausible
|
81 |
|
|
fifo_sel_g : integer := 0; -- use 0 for synchronous systems
|
82 |
|
|
-- E.g. Synch_multiclk FIFOs must know the ratio of frequencies
|
83 |
|
|
rel_agent_freq_g : integer := 1;
|
84 |
|
|
rel_bus_freq_g : integer := 1;
|
85 |
|
|
|
86 |
|
|
|
87 |
|
|
-- Functional: addressing settings
|
88 |
|
|
addr_g : integer := 46; -- unique for each wrapper
|
89 |
|
|
inv_addr_en_g : integer := 0; -- only for bridges
|
90 |
|
|
|
91 |
|
|
-- Functional: arbitration
|
92 |
|
|
-- arb_type 0 round-robin, 1 priority, 2 combined, 3 DAA.
|
93 |
|
|
-- TDMA is enabled by setting n_time_slots > 0
|
94 |
|
|
-- Ensure that all wrappers in a segment agree on arb_type,
|
95 |
|
|
-- n_agents, and n_slots. Max_send can be wrapper-specific.
|
96 |
|
|
arb_type_g : integer := 0;
|
97 |
|
|
n_agents_g : integer := 4; -- within one segment
|
98 |
|
|
prior_g : integer := 2; -- lte n_agents
|
99 |
|
|
max_send_g : integer := 50; -- in words
|
100 |
|
|
n_time_slots_g : integer := 0; -- for TDMA
|
101 |
|
|
keep_slot_g : integer := 0; -- for TDMA
|
102 |
|
|
|
103 |
|
|
-- Func/Stuctural: (Run-time re)configuration memory
|
104 |
|
|
id_g : integer := 5; -- used instead of addr in recfg
|
105 |
|
|
id_width_g : integer := 4; -- gte(log2(id_g))
|
106 |
|
|
cfg_re_g : integer := 0; -- enable reading config
|
107 |
|
|
cfg_we_g : integer := 0; -- enable writing config
|
108 |
|
|
n_extra_params_g : integer := 0; -- app-specific registers
|
109 |
|
|
-- Having multiple pages allows fast reconfig
|
110 |
|
|
n_cfg_pages_g : integer := 1;
|
111 |
|
|
-- Note that cfg memory initialization is done with separate
|
112 |
|
|
-- package if you have many time slots or configuration pages
|
113 |
|
|
|
114 |
|
|
id_min_g : integer := 0; -- Only for bridges+cfg, zero for others!
|
115 |
|
|
id_max_g : integer := 0; -- Only for bridges+cfg, zero for others!
|
116 |
|
|
addr_limit_g : integer := 0; -- Upper address boundary
|
117 |
|
|
separate_addr_g : integer := 0 -- Transmits addr in parallel with data
|
118 |
|
|
|
119 |
|
|
);
|
120 |
|
|
|
121 |
|
|
port (
|
122 |
|
|
bus_clk : in std_logic;
|
123 |
|
|
agent_clk : in std_logic;
|
124 |
|
|
-- pulsed clocks. used in pausible clock scheme
|
125 |
|
|
bus_sync_clk : in std_logic;
|
126 |
|
|
agent_sync_clk : in std_logic;
|
127 |
|
|
|
128 |
|
|
rst_n : in std_logic;
|
129 |
|
|
bus_comm_in : in std_logic_vector (comm_width_g-1 downto 0);
|
130 |
|
|
bus_data_in : in std_logic_vector(
|
131 |
|
|
data_width_g+separate_addr_g*addr_width_g-1 downto 0);
|
132 |
|
|
bus_full_in : in std_logic;
|
133 |
|
|
bus_Lock_in : in std_logic;
|
134 |
|
|
bus_av_in : in std_logic;
|
135 |
|
|
|
136 |
|
|
bus_comm_out : out std_logic_vector (comm_width_g-1 downto 0);
|
137 |
|
|
bus_data_out : out std_logic_vector(
|
138 |
|
|
data_width_g+separate_addr_g*addr_width_g-1 downto 0);
|
139 |
|
|
bus_full_out : out std_logic;
|
140 |
|
|
bus_Lock_out : out std_logic;
|
141 |
|
|
bus_av_out : out std_logic;
|
142 |
|
|
|
143 |
|
|
agent_comm_in : in std_logic_vector (comm_width_g-1 downto 0);
|
144 |
|
|
agent_data_in : in std_logic_vector (data_width_g-1 downto 0);
|
145 |
|
|
agent_addr_in : in std_logic_vector (addr_width_g-1 downto 0);
|
146 |
|
|
agent_we_in : in std_logic;
|
147 |
|
|
agent_re_in : in std_logic;
|
148 |
|
|
|
149 |
|
|
agent_addr_out : out std_logic_vector (addr_width_g-1 downto 0);
|
150 |
|
|
agent_data_out : out std_logic_vector (data_width_g-1 downto 0);
|
151 |
|
|
agent_comm_out : out std_logic_vector (comm_width_g-1 downto 0);
|
152 |
|
|
agent_empty_out : out std_logic;
|
153 |
|
|
agent_full_out : out std_logic;
|
154 |
|
|
agent_one_p_out : out std_logic;
|
155 |
|
|
agent_one_d_out : out std_logic; -- is this used??
|
156 |
|
|
|
157 |
|
|
agent_msg_addr_in : in std_logic_vector (addr_width_g-1 downto 0);
|
158 |
|
|
agent_msg_data_in : in std_logic_vector (data_width_g-1 downto 0);
|
159 |
|
|
agent_msg_comm_in : in std_logic_vector (comm_width_g-1 downto 0);
|
160 |
|
|
agent_msg_we_in : in std_logic;
|
161 |
|
|
agent_msg_re_in : in std_logic;
|
162 |
|
|
|
163 |
|
|
agent_msg_full_out : out std_logic;
|
164 |
|
|
agent_msg_one_p_out : out std_logic;
|
165 |
|
|
agent_msg_addr_out : out std_logic_vector (addr_width_g-1 downto 0);
|
166 |
|
|
agent_msg_data_out : out std_logic_vector (data_width_g-1 downto 0);
|
167 |
|
|
agent_msg_comm_out : out std_logic_vector (comm_width_g-1 downto 0);
|
168 |
|
|
agent_msg_empty_out : out std_logic;
|
169 |
|
|
agent_msg_one_d_out : out std_logic -- is this used??
|
170 |
|
|
-- synthesis translate_off
|
171 |
|
|
;
|
172 |
|
|
|
173 |
|
|
debug_out : out std_logic_vector(debug_width_g-1 downto 0);
|
174 |
|
|
debug_in : in std_logic_vector(debug_width_g-1 downto 0)
|
175 |
|
|
-- synthesis translate_on
|
176 |
|
|
);
|
177 |
|
|
end hibi_wrapper_r3;
|
178 |
|
|
|
179 |
|
|
|
180 |
|
|
|
181 |
|
|
|
182 |
|
|
architecture structural of hibi_wrapper_r3 is
|
183 |
|
|
|
184 |
|
|
-- Two basic structures:
|
185 |
|
|
-- 1. Sequential addr and data (as in HIBI v.2), needs additional muxes
|
186 |
|
|
-- 2. Addr and data in parallel (new for HIBI v.3, separate_addr_g=1)
|
187 |
|
|
|
188 |
|
|
|
189 |
|
|
-- notations:
|
190 |
|
|
-- 'signal_src_dst' = internal signal driven by src, and read by dst
|
191 |
|
|
-- '_h' = hibi wrapper r1
|
192 |
|
|
-- '_mw' = mux_for_writing, '_mmw' = mux_for_writing messages
|
193 |
|
|
-- '_mr' = mux_for_reading, '_mmr' = mux_for_reading messages
|
194 |
|
|
-- 'sad' = simultaneous address and data
|
195 |
|
|
|
196 |
|
|
|
197 |
|
|
-- structure
|
198 |
|
|
--
|
199 |
|
|
-- hibi_wrapper_r3
|
200 |
|
|
-- #################################################
|
201 |
|
|
-- # muxes (when separate_addr=0) # wrapper r1 #
|
202 |
|
|
-- # # #
|
203 |
|
|
-- ip_input # bus_output
|
204 |
|
|
-- # # #
|
205 |
|
|
-- ip => 2x addr_data_mux_write ==> hibiv.2 => bus
|
206 |
|
|
-- => (mw, mmw) ==> #
|
207 |
|
|
-- # # #
|
208 |
|
|
-- # # #
|
209 |
|
|
-- ip_output # bus_input
|
210 |
|
|
-- # # #
|
211 |
|
|
-- ip <= 2x addr_data_demux_read <== hibiv.2 <= bus
|
212 |
|
|
-- <= (dr, mdr) <== #
|
213 |
|
|
-- # # #
|
214 |
|
|
-- #################################################
|
215 |
|
|
--
|
216 |
|
|
--
|
217 |
|
|
-- signal names ==> XXX_mw_h, XXX_mmw_h
|
218 |
|
|
-- <== XXX_h_mr, XXX_h_mmr
|
219 |
|
|
--
|
220 |
|
|
|
221 |
|
|
|
222 |
|
|
-- Signals between addr_data_mux_write and hibi wrapper r1
|
223 |
|
|
-- (IP writes to bus)
|
224 |
|
|
signal av_mw_h : std_logic;
|
225 |
|
|
signal data_mw_h : std_logic_vector (data_width_g-1 downto 0);
|
226 |
|
|
signal comm_mw_h : std_logic_vector (comm_width_g-1 downto 0);
|
227 |
|
|
signal we_mw_h : std_logic;
|
228 |
|
|
signal full_h_mw : std_logic;
|
229 |
|
|
signal one_p_h_mw : std_logic;
|
230 |
|
|
|
231 |
|
|
signal av_mmw_h : std_logic;
|
232 |
|
|
signal data_mmw_h : std_logic_vector (data_width_g-1 downto 0);
|
233 |
|
|
signal comm_mmw_h : std_logic_vector (comm_width_g-1 downto 0);
|
234 |
|
|
signal we_mmw_h : std_logic;
|
235 |
|
|
signal full_h_mmw : std_logic;
|
236 |
|
|
signal one_p_h_mmw : std_logic;
|
237 |
|
|
|
238 |
|
|
|
239 |
|
|
-- Signals between fifo_mux_read and addr_data_demux_read
|
240 |
|
|
-- (data arrives from bus to IP)
|
241 |
|
|
signal av_h_dr : std_logic;
|
242 |
|
|
signal data_h_dr : std_logic_vector (data_width_g-1 downto 0);
|
243 |
|
|
signal comm_h_dr : std_logic_vector (comm_width_g-1 downto 0);
|
244 |
|
|
signal re_dr_h : std_logic;
|
245 |
|
|
signal empty_h_dr : std_logic;
|
246 |
|
|
signal one_d_h_dr : std_logic;
|
247 |
|
|
|
248 |
|
|
signal av_h_mdr : std_logic;
|
249 |
|
|
signal data_h_mdr : std_logic_vector (data_width_g-1 downto 0);
|
250 |
|
|
signal comm_h_mdr : std_logic_vector (comm_width_g-1 downto 0);
|
251 |
|
|
signal re_mdr_h : std_logic;
|
252 |
|
|
signal empty_h_mdr : std_logic;
|
253 |
|
|
signal one_d_h_mdr : std_logic;
|
254 |
|
|
|
255 |
|
|
|
256 |
|
|
-- Takes addr and data in parallel and muxes them into one signal
|
257 |
|
|
-- This way the IP's designed for Hibi v1 can used with Hibi v2
|
258 |
|
|
component addr_data_mux_write
|
259 |
|
|
generic (
|
260 |
|
|
data_width_g : integer := 0;
|
261 |
|
|
addr_width_g : integer := 0;
|
262 |
|
|
comm_width_g : integer := 0
|
263 |
|
|
);
|
264 |
|
|
port (
|
265 |
|
|
clk : in std_logic;
|
266 |
|
|
rst_n : in std_logic;
|
267 |
|
|
|
268 |
|
|
data_in : in std_logic_vector (data_width_g-1 downto 0);
|
269 |
|
|
addr_in : in std_logic_vector (addr_width_g-1 downto 0);
|
270 |
|
|
comm_in : in std_logic_vector (comm_width_g-1 downto 0);
|
271 |
|
|
we_in : in std_logic;
|
272 |
|
|
full_out : out std_logic;
|
273 |
|
|
one_p_out : out std_logic;
|
274 |
|
|
|
275 |
|
|
av_out : out std_logic;
|
276 |
|
|
data_out : out std_logic_vector (data_width_g-1 downto 0);
|
277 |
|
|
comm_out : out std_logic_vector (comm_width_g-1 downto 0);
|
278 |
|
|
we_out : out std_logic;
|
279 |
|
|
full_in : in std_logic;
|
280 |
|
|
one_p_in : in std_logic
|
281 |
|
|
);
|
282 |
|
|
end component; --addr_data_mux_write;
|
283 |
|
|
|
284 |
|
|
-- Takes addr and data separately and puts them into separate signals
|
285 |
|
|
-- This way the IP's designed for Hibi v1 can used with Hibi v2
|
286 |
|
|
component addr_data_demux_read
|
287 |
|
|
generic (
|
288 |
|
|
data_width_g : integer := 0;
|
289 |
|
|
addr_width_g : integer := 0;
|
290 |
|
|
comm_width_g : integer := 0
|
291 |
|
|
);
|
292 |
|
|
port (
|
293 |
|
|
clk : in std_logic;
|
294 |
|
|
rst_n : in std_logic;
|
295 |
|
|
|
296 |
|
|
re_out : out std_logic;
|
297 |
|
|
av_in : in std_logic;
|
298 |
|
|
data_in : in std_logic_vector (data_width_g-1 downto 0);
|
299 |
|
|
comm_in : in std_logic_vector (comm_width_g-1 downto 0);
|
300 |
|
|
empty_in : in std_logic;
|
301 |
|
|
--one_d_in : in std_logic;
|
302 |
|
|
|
303 |
|
|
re_in : in std_logic;
|
304 |
|
|
addr_out : out std_logic_vector (addr_width_g-1 downto 0);
|
305 |
|
|
data_out : out std_logic_vector (data_width_g-1 downto 0);
|
306 |
|
|
comm_out : out std_logic_vector (comm_width_g-1 downto 0);
|
307 |
|
|
empty_out : out std_logic
|
308 |
|
|
--one_d_out : out std_logic
|
309 |
|
|
);
|
310 |
|
|
end component; --addr_data_demux_read;
|
311 |
|
|
|
312 |
|
|
-- Transmitting addr in parallel with data is done
|
313 |
|
|
-- by concatenating, and hence wide data signal is needed.
|
314 |
|
|
-- 4 signals needed: (tx + rx)* (regular + hi-prior)
|
315 |
|
|
signal sad_data_to_r1 : std_logic_vector
|
316 |
|
|
(addr_width_g+data_width_g-1 downto 0);
|
317 |
|
|
signal sad_msg_to_r1 : std_logic_vector
|
318 |
|
|
(addr_width_g+data_width_g-1 downto 0);
|
319 |
|
|
signal sad_data_from_r1 : std_logic_vector
|
320 |
|
|
(addr_width_g+data_width_g-1 downto 0);
|
321 |
|
|
signal sad_msg_from_r1 : std_logic_vector
|
322 |
|
|
(addr_width_g+data_width_g-1 downto 0);
|
323 |
|
|
|
324 |
|
|
begin
|
325 |
|
|
|
326 |
|
|
-----------------------------------------------------------------------------
|
327 |
|
|
-- NORMAL MULTIPLEXED ADDRESS AND DATA LINES
|
328 |
|
|
-----------------------------------------------------------------------------
|
329 |
|
|
normal_mode : if separate_addr_g = 0 generate
|
330 |
|
|
|
331 |
|
|
hibi_wra : entity work.hibi_wrapper_r1
|
332 |
|
|
generic map(
|
333 |
|
|
id_g => id_g,
|
334 |
|
|
|
335 |
|
|
id_width_g => id_width_g,
|
336 |
|
|
addr_width_g => addr_width_g, -- in bits!
|
337 |
|
|
data_width_g => data_width_g,
|
338 |
|
|
comm_width_g => comm_width_g,
|
339 |
|
|
counter_width_g => counter_width_g,
|
340 |
|
|
|
341 |
|
|
rel_agent_freq_g => rel_agent_freq_g,
|
342 |
|
|
rel_bus_freq_g => rel_bus_freq_g,
|
343 |
|
|
|
344 |
|
|
rx_fifo_depth_g => rx_fifo_depth_g,
|
345 |
|
|
rx_msg_fifo_depth_g => rx_msg_fifo_depth_g,
|
346 |
|
|
tx_fifo_depth_g => tx_fifo_depth_g,
|
347 |
|
|
tx_msg_fifo_depth_g => tx_msg_fifo_depth_g,
|
348 |
|
|
|
349 |
|
|
arb_type_g => arb_type_g,
|
350 |
|
|
fifo_sel_g => fifo_sel_g,
|
351 |
|
|
|
352 |
|
|
addr_g => addr_g,
|
353 |
|
|
prior_g => prior_g,
|
354 |
|
|
inv_addr_en_g => inv_addr_en_g,
|
355 |
|
|
|
356 |
|
|
max_send_g => max_send_g,
|
357 |
|
|
n_agents_g => n_agents_g,
|
358 |
|
|
n_cfg_pages_g => n_cfg_pages_g,
|
359 |
|
|
n_time_slots_g => n_time_slots_g,
|
360 |
|
|
n_extra_params_g => n_extra_params_g,
|
361 |
|
|
|
362 |
|
|
cfg_re_g => cfg_re_g,
|
363 |
|
|
cfg_we_g => cfg_we_g,
|
364 |
|
|
debug_width_g => debug_width_g,
|
365 |
|
|
|
366 |
|
|
id_min_g => id_min_g,
|
367 |
|
|
id_max_g => id_max_g,
|
368 |
|
|
addr_limit_g => addr_limit_g,
|
369 |
|
|
separate_addr_g => separate_addr_g
|
370 |
|
|
|
371 |
|
|
)
|
372 |
|
|
port map(
|
373 |
|
|
bus_clk => bus_clk,
|
374 |
|
|
agent_clk => agent_clk,
|
375 |
|
|
bus_sync_clk => bus_sync_clk,
|
376 |
|
|
agent_sync_clk => agent_sync_clk,
|
377 |
|
|
rst_n => rst_n,
|
378 |
|
|
|
379 |
|
|
bus_av_in => bus_av_in,
|
380 |
|
|
bus_data_in => bus_data_in,
|
381 |
|
|
bus_comm_in => bus_comm_in,
|
382 |
|
|
bus_full_in => bus_full_in,
|
383 |
|
|
bus_Lock_in => bus_Lock_in,
|
384 |
|
|
|
385 |
|
|
agent_av_in => av_mw_h,
|
386 |
|
|
agent_comm_in => comm_mw_h,
|
387 |
|
|
agent_data_in => data_mw_h,
|
388 |
|
|
agent_we_in => we_mw_h,
|
389 |
|
|
agent_full_out => full_h_mw,
|
390 |
|
|
agent_one_p_out => one_p_h_mw,
|
391 |
|
|
|
392 |
|
|
|
393 |
|
|
agent_msg_av_in => av_mmw_h,
|
394 |
|
|
agent_msg_data_in => data_mmw_h,
|
395 |
|
|
agent_msg_comm_in => comm_mmw_h,
|
396 |
|
|
agent_msg_we_in => we_mmw_h,
|
397 |
|
|
agent_msg_full_out => full_h_mmw,
|
398 |
|
|
agent_msg_one_p_out => one_p_h_mmw,
|
399 |
|
|
|
400 |
|
|
bus_av_out => bus_av_out,
|
401 |
|
|
bus_comm_out => bus_comm_out,
|
402 |
|
|
bus_data_out => bus_data_out,
|
403 |
|
|
bus_full_out => bus_full_out,
|
404 |
|
|
bus_Lock_out => bus_Lock_out,
|
405 |
|
|
|
406 |
|
|
agent_re_in => re_dr_h,
|
407 |
|
|
agent_av_out => av_h_dr,
|
408 |
|
|
agent_data_out => data_h_dr,
|
409 |
|
|
agent_comm_out => comm_h_dr,
|
410 |
|
|
agent_empty_out => empty_h_dr,
|
411 |
|
|
agent_one_d_out => one_d_h_dr,
|
412 |
|
|
|
413 |
|
|
agent_msg_av_out => av_h_mdr,
|
414 |
|
|
agent_msg_re_in => re_mdr_h,
|
415 |
|
|
agent_msg_data_out => data_h_mdr,
|
416 |
|
|
agent_msg_comm_out => comm_h_mdr,
|
417 |
|
|
agent_msg_empty_out => empty_h_mdr,
|
418 |
|
|
agent_msg_one_d_out => one_d_h_mdr
|
419 |
|
|
--synthesis translate_off
|
420 |
|
|
,
|
421 |
|
|
debug_in => debug_in,
|
422 |
|
|
debug_out => debug_out
|
423 |
|
|
--synthesis translate_on
|
424 |
|
|
);
|
425 |
|
|
|
426 |
|
|
agent_one_d_out <= one_d_h_dr; -- danger
|
427 |
|
|
agent_msg_one_d_out <= one_d_h_mdr; -- danger
|
428 |
|
|
|
429 |
|
|
-- Takes addr and data in parallel and muxes them into one signal
|
430 |
|
|
-- This way the IP's designed for Hibi v1 can used with Hibi v2
|
431 |
|
|
-- IP writes data to this block
|
432 |
|
|
mw : addr_data_mux_write
|
433 |
|
|
generic map(
|
434 |
|
|
data_width_g => data_width_g,
|
435 |
|
|
addr_width_g => addr_width_g,
|
436 |
|
|
comm_width_g => comm_width_g
|
437 |
|
|
)
|
438 |
|
|
port map(
|
439 |
|
|
clk => agent_clk,
|
440 |
|
|
rst_n => rst_n,
|
441 |
|
|
|
442 |
|
|
addr_in => agent_addr_in,
|
443 |
|
|
data_in => agent_data_in,
|
444 |
|
|
comm_in => agent_comm_in,
|
445 |
|
|
we_in => agent_we_in,
|
446 |
|
|
full_out => agent_full_out,
|
447 |
|
|
one_p_out => agent_one_p_out,
|
448 |
|
|
|
449 |
|
|
av_out => av_mw_h,
|
450 |
|
|
data_out => data_mw_h,
|
451 |
|
|
comm_out => comm_mw_h,
|
452 |
|
|
we_out => we_mw_h,
|
453 |
|
|
full_in => full_h_mw,
|
454 |
|
|
one_p_in => one_p_h_mw
|
455 |
|
|
);
|
456 |
|
|
|
457 |
|
|
|
458 |
|
|
mmw : addr_data_mux_write
|
459 |
|
|
generic map(
|
460 |
|
|
data_width_g => data_width_g,
|
461 |
|
|
addr_width_g => addr_width_g,
|
462 |
|
|
comm_width_g => comm_width_g
|
463 |
|
|
)
|
464 |
|
|
port map(
|
465 |
|
|
clk => agent_clk,
|
466 |
|
|
rst_n => rst_n,
|
467 |
|
|
|
468 |
|
|
addr_in => agent_msg_addr_in,
|
469 |
|
|
data_in => agent_msg_data_in,
|
470 |
|
|
comm_in => agent_msg_comm_in,
|
471 |
|
|
we_in => agent_msg_we_in,
|
472 |
|
|
full_out => agent_msg_full_out,
|
473 |
|
|
one_p_out => agent_msg_one_p_out,
|
474 |
|
|
|
475 |
|
|
av_out => av_mmw_h,
|
476 |
|
|
data_out => data_mmw_h,
|
477 |
|
|
comm_out => comm_mmw_h,
|
478 |
|
|
we_out => we_mmw_h,
|
479 |
|
|
full_in => full_h_mmw,
|
480 |
|
|
one_p_in => one_p_h_mmw
|
481 |
|
|
);
|
482 |
|
|
|
483 |
|
|
-- Takes addr and data separately and puts them into separate signals
|
484 |
|
|
-- This way the IP's designed for Hibi v1 can used with Hibi v2
|
485 |
|
|
-- IP reads data from this block
|
486 |
|
|
dr : addr_data_demux_read
|
487 |
|
|
generic map(
|
488 |
|
|
data_width_g => data_width_g,
|
489 |
|
|
addr_width_g => addr_width_g,
|
490 |
|
|
comm_width_g => comm_width_g
|
491 |
|
|
)
|
492 |
|
|
port map(
|
493 |
|
|
clk => agent_clk,
|
494 |
|
|
rst_n => rst_n,
|
495 |
|
|
|
496 |
|
|
re_out => re_dr_h,
|
497 |
|
|
av_in => av_h_dr,
|
498 |
|
|
data_in => data_h_dr,
|
499 |
|
|
comm_in => comm_h_dr,
|
500 |
|
|
empty_in => empty_h_dr,
|
501 |
|
|
-- one_d_in => one_d_h_dr,
|
502 |
|
|
|
503 |
|
|
re_in => agent_re_in,
|
504 |
|
|
addr_out => agent_addr_out,
|
505 |
|
|
data_out => agent_data_out,
|
506 |
|
|
comm_out => agent_comm_out,
|
507 |
|
|
empty_out => agent_empty_out
|
508 |
|
|
-- one_d_out => agent_one_p_out,
|
509 |
|
|
);
|
510 |
|
|
|
511 |
|
|
|
512 |
|
|
mdr : addr_data_demux_read
|
513 |
|
|
generic map(
|
514 |
|
|
data_width_g => data_width_g,
|
515 |
|
|
addr_width_g => addr_width_g,
|
516 |
|
|
comm_width_g => comm_width_g
|
517 |
|
|
)
|
518 |
|
|
port map(
|
519 |
|
|
clk => agent_clk,
|
520 |
|
|
rst_n => rst_n,
|
521 |
|
|
|
522 |
|
|
re_out => re_mdr_h,
|
523 |
|
|
av_in => av_h_mdr,
|
524 |
|
|
data_in => data_h_mdr,
|
525 |
|
|
comm_in => comm_h_mdr,
|
526 |
|
|
empty_in => empty_h_mdr,
|
527 |
|
|
-- one_d_in => one_d_h_mdr,
|
528 |
|
|
|
529 |
|
|
re_in => agent_msg_re_in,
|
530 |
|
|
addr_out => agent_msg_addr_out,
|
531 |
|
|
data_out => agent_msg_data_out,
|
532 |
|
|
comm_out => agent_msg_comm_out,
|
533 |
|
|
empty_out => agent_msg_empty_out
|
534 |
|
|
-- one_d_out => agent_msg_one_p_out,
|
535 |
|
|
);
|
536 |
|
|
|
537 |
|
|
|
538 |
|
|
end generate normal_mode;
|
539 |
|
|
|
540 |
|
|
|
541 |
|
|
-----------------------------------------------------------------------------
|
542 |
|
|
-- SEPARATE ADDRESS AND DATA LINES
|
543 |
|
|
-----------------------------------------------------------------------------
|
544 |
|
|
sad_mode : if separate_addr_g = 1 generate
|
545 |
|
|
|
546 |
|
|
|
547 |
|
|
-- Concatenate the sent addr and data together
|
548 |
|
|
sad_data_to_r1 <= agent_addr_in & agent_data_in;
|
549 |
|
|
sad_msg_to_r1 <= agent_msg_addr_in & agent_msg_data_in;
|
550 |
|
|
|
551 |
|
|
-- Split the received addr and data apart
|
552 |
|
|
agent_addr_out <=
|
553 |
|
|
sad_data_from_r1(addr_width_g+data_width_g-1 downto data_width_g);
|
554 |
|
|
|
555 |
|
|
agent_data_out <= sad_data_from_r1(data_width_g-1 downto 0);
|
556 |
|
|
|
557 |
|
|
agent_msg_addr_out <=
|
558 |
|
|
sad_msg_from_r1(addr_width_g+data_width_g-1 downto data_width_g);
|
559 |
|
|
|
560 |
|
|
agent_msg_data_out <= sad_msg_from_r1(data_width_g-1 downto 0);
|
561 |
|
|
|
562 |
|
|
|
563 |
|
|
-- Now we can use r1 wrapper without muxes since wrapper's
|
564 |
|
|
-- 'data width' is actually data_width+addr_width and
|
565 |
|
|
-- addr_valid from IP is 1 constantly
|
566 |
|
|
hibi_wrapper_r1_1 : entity work.hibi_wrapper_r1
|
567 |
|
|
generic map (
|
568 |
|
|
addr_width_g => addr_width_g,
|
569 |
|
|
data_width_g => data_width_g+(separate_addr_g*addr_width_g),
|
570 |
|
|
comm_width_g => comm_width_g,
|
571 |
|
|
counter_width_g => counter_width_g,
|
572 |
|
|
debug_width_g => debug_width_g,
|
573 |
|
|
rx_fifo_depth_g => rx_fifo_depth_g,
|
574 |
|
|
tx_fifo_depth_g => tx_fifo_depth_g,
|
575 |
|
|
rx_msg_fifo_depth_g => rx_msg_fifo_depth_g,
|
576 |
|
|
tx_msg_fifo_depth_g => tx_msg_fifo_depth_g,
|
577 |
|
|
fifo_sel_g => fifo_sel_g,
|
578 |
|
|
rel_agent_freq_g => rel_agent_freq_g,
|
579 |
|
|
rel_bus_freq_g => rel_bus_freq_g,
|
580 |
|
|
addr_g => addr_g,
|
581 |
|
|
inv_addr_en_g => inv_addr_en_g,
|
582 |
|
|
|
583 |
|
|
n_agents_g => n_agents_g,
|
584 |
|
|
prior_g => prior_g,
|
585 |
|
|
max_send_g => max_send_g,
|
586 |
|
|
n_time_slots_g => n_time_slots_g,
|
587 |
|
|
arb_type_g => arb_type_g,
|
588 |
|
|
keep_slot_g => keep_slot_g,
|
589 |
|
|
id_g => id_g,
|
590 |
|
|
id_width_g => id_width_g,
|
591 |
|
|
cfg_re_g => cfg_re_g,
|
592 |
|
|
cfg_we_g => cfg_we_g,
|
593 |
|
|
n_extra_params_g => n_extra_params_g,
|
594 |
|
|
n_cfg_pages_g => n_cfg_pages_g,
|
595 |
|
|
id_min_g => id_min_g,
|
596 |
|
|
id_max_g => id_max_g,
|
597 |
|
|
addr_limit_g => addr_limit_g,
|
598 |
|
|
separate_addr_g => separate_addr_g)
|
599 |
|
|
port map (
|
600 |
|
|
bus_clk => bus_clk,
|
601 |
|
|
agent_clk => agent_clk,
|
602 |
|
|
bus_sync_clk => bus_sync_clk,
|
603 |
|
|
agent_sync_clk => agent_sync_clk,
|
604 |
|
|
rst_n => rst_n,
|
605 |
|
|
|
606 |
|
|
bus_av_in => bus_av_in,
|
607 |
|
|
bus_data_in => bus_data_in,
|
608 |
|
|
bus_comm_in => bus_comm_in,
|
609 |
|
|
bus_full_in => bus_full_in,
|
610 |
|
|
bus_lock_in => bus_lock_in,
|
611 |
|
|
|
612 |
|
|
agent_av_in => '1',
|
613 |
|
|
agent_data_in => sad_data_to_r1,
|
614 |
|
|
agent_comm_in => agent_comm_in,
|
615 |
|
|
agent_we_in => agent_we_in,
|
616 |
|
|
agent_re_in => agent_re_in,
|
617 |
|
|
agent_msg_av_in => '1',
|
618 |
|
|
agent_msg_data_in => sad_msg_to_r1,
|
619 |
|
|
agent_msg_comm_in => agent_msg_comm_in,
|
620 |
|
|
agent_msg_we_in => agent_msg_we_in,
|
621 |
|
|
agent_msg_re_in => agent_msg_re_in,
|
622 |
|
|
|
623 |
|
|
bus_av_out => bus_av_out,
|
624 |
|
|
bus_data_out => bus_data_out,
|
625 |
|
|
bus_comm_out => bus_comm_out,
|
626 |
|
|
bus_lock_out => bus_lock_out,
|
627 |
|
|
bus_full_out => bus_full_out,
|
628 |
|
|
|
629 |
|
|
agent_av_out => open,
|
630 |
|
|
agent_data_out => sad_data_from_r1,
|
631 |
|
|
agent_comm_out => agent_comm_out,
|
632 |
|
|
agent_empty_out => agent_empty_out,
|
633 |
|
|
agent_one_d_out => agent_one_d_out,
|
634 |
|
|
agent_full_out => agent_full_out,
|
635 |
|
|
agent_one_p_out => agent_one_p_out,
|
636 |
|
|
agent_msg_av_out => open,
|
637 |
|
|
agent_msg_data_out => sad_msg_from_r1,
|
638 |
|
|
agent_msg_comm_out => agent_msg_comm_out,
|
639 |
|
|
agent_msg_empty_out => agent_msg_empty_out,
|
640 |
|
|
agent_msg_one_d_out => agent_msg_one_d_out,
|
641 |
|
|
agent_msg_full_out => agent_msg_full_out,
|
642 |
|
|
agent_msg_one_p_out => agent_msg_one_p_out
|
643 |
|
|
--synthesis translate_off
|
644 |
|
|
,
|
645 |
|
|
debug_in => debug_in,
|
646 |
|
|
debug_out => debug_out
|
647 |
|
|
--synthesis translate_on
|
648 |
|
|
);
|
649 |
|
|
|
650 |
|
|
|
651 |
|
|
end generate sad_mode;
|
652 |
|
|
|
653 |
|
|
|
654 |
|
|
end structural;
|