1 |
145 |
lanttu |
-------------------------------------------------------------------------------
|
2 |
|
|
-- Funbase IP library Copyright (C) 2011 TUT Department of Computer Systems
|
3 |
|
|
--
|
4 |
|
|
-- This source file may be used and distributed without
|
5 |
|
|
-- restriction provided that this copyright statement is not
|
6 |
|
|
-- removed from the file and that any derivative work contains
|
7 |
|
|
-- the original copyright notice and the associated disclaimer.
|
8 |
|
|
--
|
9 |
|
|
-- This source file is free software; you can redistribute it
|
10 |
|
|
-- and/or modify it under the terms of the GNU Lesser General
|
11 |
|
|
-- Public License as published by the Free Software Foundation;
|
12 |
|
|
-- either version 2.1 of the License, or (at your option) any
|
13 |
|
|
-- later version.
|
14 |
|
|
--
|
15 |
|
|
-- This source is distributed in the hope that it will be
|
16 |
|
|
-- useful, but WITHOUT ANY WARRANTY; without even the impliedlk
|
17 |
|
|
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
18 |
|
|
-- PURPOSE. See the GNU Lesser General Public License for more
|
19 |
|
|
-- details.
|
20 |
|
|
--
|
21 |
|
|
-- You should have received a copy of the GNU Lesser General
|
22 |
|
|
-- Public License along with this source; if not, download it
|
23 |
|
|
-- from http://www.opencores.org/lgpl.shtml
|
24 |
|
|
-------------------------------------------------------------------------------
|
25 |
|
|
-------------------------------------------------------------------------------
|
26 |
|
|
-- file : hibi_segment_small.vhd
|
27 |
|
|
-- description : hibi bus for connecting eight nioses, this time
|
28 |
|
|
-- using hibi_wrapper_r4 (only one fifo interface)
|
29 |
|
|
-- author : Tapio Koskinen
|
30 |
|
|
-- date : 29.9.2008
|
31 |
|
|
-- modified :
|
32 |
|
|
-- 29.09.2008 tko modified from Ari Kulmala's eight_hibi_r4_and_radio.vhdl
|
33 |
|
|
-- 2012-03-16 ES Beautified lots of things, e.g. indexing starts now from 0
|
34 |
|
|
-------------------------------------------------------------------------------
|
35 |
|
|
library ieee;
|
36 |
|
|
use ieee.std_logic_1164.all;
|
37 |
|
|
use ieee.std_logic_arith.all;
|
38 |
|
|
use ieee.std_logic_unsigned.all;
|
39 |
|
|
|
40 |
|
|
|
41 |
|
|
entity hibi_segment_small is
|
42 |
|
|
generic (
|
43 |
|
|
data_width_g : integer := 32;
|
44 |
|
|
counter_width_g : integer := 16;
|
45 |
|
|
addr_width_g : integer := 32;
|
46 |
|
|
comm_width_g : integer := 5;
|
47 |
|
|
|
48 |
|
|
number_of_r4_agents_g : integer := 3; -- 1-3
|
49 |
|
|
number_of_r3_agents_g : integer := 0; -- 0-1
|
50 |
|
|
|
51 |
|
|
-- max sends
|
52 |
|
|
agent_max_send_0_g : integer := 200;
|
53 |
|
|
agent_max_send_1_g : integer := 200;
|
54 |
|
|
agent_max_send_2_g : integer := 200;
|
55 |
|
|
agent_max_send_16_g : integer := 200
|
56 |
|
|
);
|
57 |
|
|
|
58 |
|
|
port (
|
59 |
|
|
clk_in : in std_logic;
|
60 |
|
|
rst_n_in : in std_logic;
|
61 |
|
|
|
62 |
|
|
-- Debug signals for bus monitoring purposes
|
63 |
|
|
debug_bus_full_out : out std_logic;
|
64 |
|
|
debug_bus_comm_out : out std_logic_vector (comm_width_g-1 downto 0);
|
65 |
|
|
debug_bus_av_out : out std_logic;
|
66 |
|
|
|
67 |
|
|
-- terminal 0 (type r4)
|
68 |
|
|
agent_av_in_0 : in std_logic;
|
69 |
|
|
agent_data_in_0 : in std_logic_vector (data_width_g-1 downto 0);
|
70 |
|
|
agent_comm_in_0 : in std_logic_vector (comm_width_g-1 downto 0);
|
71 |
|
|
agent_we_in_0 : in std_logic;
|
72 |
|
|
agent_full_out_0 : out std_logic;
|
73 |
|
|
agent_one_p_out_0 : out std_logic;
|
74 |
|
|
|
75 |
|
|
agent_av_out_0 : out std_logic;
|
76 |
|
|
agent_data_out_0 : out std_logic_vector (data_width_g-1 downto 0);
|
77 |
|
|
agent_comm_out_0 : out std_logic_vector (comm_width_g-1 downto 0);
|
78 |
|
|
agent_re_in_0 : in std_logic;
|
79 |
|
|
agent_empty_out_0 : out std_logic;
|
80 |
|
|
agent_one_d_out_0 : out std_logic;
|
81 |
|
|
|
82 |
|
|
-- terminal 1 (type r4)
|
83 |
|
|
agent_av_in_1 : in std_logic;
|
84 |
|
|
agent_data_in_1 : in std_logic_vector (data_width_g-1 downto 0);
|
85 |
|
|
agent_comm_in_1 : in std_logic_vector (comm_width_g-1 downto 0);
|
86 |
|
|
agent_we_in_1 : in std_logic;
|
87 |
|
|
agent_full_out_1 : out std_logic;
|
88 |
|
|
agent_one_p_out_1 : out std_logic;
|
89 |
|
|
|
90 |
|
|
agent_av_out_1 : out std_logic;
|
91 |
|
|
agent_data_out_1 : out std_logic_vector (data_width_g-1 downto 0);
|
92 |
|
|
agent_comm_out_1 : out std_logic_vector (comm_width_g-1 downto 0);
|
93 |
|
|
agent_re_in_1 : in std_logic;
|
94 |
|
|
agent_empty_out_1 : out std_logic;
|
95 |
|
|
agent_one_d_out_1 : out std_logic;
|
96 |
|
|
|
97 |
|
|
-- terminal 2 (type r4)
|
98 |
|
|
agent_av_in_2 : in std_logic;
|
99 |
|
|
agent_data_in_2 : in std_logic_vector (data_width_g-1 downto 0);
|
100 |
|
|
agent_comm_in_2 : in std_logic_vector (comm_width_g-1 downto 0);
|
101 |
|
|
agent_we_in_2 : in std_logic;
|
102 |
|
|
agent_full_out_2 : out std_logic;
|
103 |
|
|
agent_one_p_out_2 : out std_logic;
|
104 |
|
|
|
105 |
|
|
agent_av_out_2 : out std_logic;
|
106 |
|
|
agent_data_out_2 : out std_logic_vector (data_width_g-1 downto 0);
|
107 |
|
|
agent_comm_out_2 : out std_logic_vector (comm_width_g-1 downto 0);
|
108 |
|
|
agent_re_in_2 : in std_logic;
|
109 |
|
|
agent_empty_out_2 : out std_logic;
|
110 |
|
|
agent_one_d_out_2 : out std_logic;
|
111 |
|
|
|
112 |
|
|
|
113 |
|
|
-- terminal 17 (type r3)
|
114 |
|
|
agent_addr_in_16 : in std_logic_vector (data_width_g-1 downto 0);
|
115 |
|
|
agent_data_in_16 : in std_logic_vector (data_width_g-1 downto 0);
|
116 |
|
|
agent_comm_in_16 : in std_logic_vector (comm_width_g-1 downto 0);
|
117 |
|
|
agent_we_in_16 : in std_logic;
|
118 |
|
|
agent_full_out_16 : out std_logic;
|
119 |
|
|
agent_one_p_out_16 : out std_logic;
|
120 |
|
|
|
121 |
|
|
agent_addr_out_16 : out std_logic_vector (data_width_g-1 downto 0);
|
122 |
|
|
agent_data_out_16 : out std_logic_vector (data_width_g-1 downto 0);
|
123 |
|
|
agent_comm_out_16 : out std_logic_vector (comm_width_g-1 downto 0);
|
124 |
|
|
agent_re_in_16 : in std_logic;
|
125 |
|
|
agent_empty_out_16 : out std_logic;
|
126 |
|
|
agent_one_d_out_16 : out std_logic;
|
127 |
|
|
|
128 |
|
|
agent_msg_addr_in_16 : in std_logic_vector (data_width_g-1 downto 0);
|
129 |
|
|
agent_msg_data_in_16 : in std_logic_vector (data_width_g-1 downto 0);
|
130 |
|
|
agent_msg_comm_in_16 : in std_logic_vector (comm_width_g-1 downto 0);
|
131 |
|
|
agent_msg_we_in_16 : in std_logic;
|
132 |
|
|
agent_msg_full_out_16 : out std_logic;
|
133 |
|
|
agent_msg_one_p_out_16 : out std_logic;
|
134 |
|
|
|
135 |
|
|
agent_msg_addr_out_16 : out std_logic_vector (data_width_g-1 downto 0);
|
136 |
|
|
agent_msg_data_out_16 : out std_logic_vector (data_width_g-1 downto 0);
|
137 |
|
|
agent_msg_comm_out_16 : out std_logic_vector (comm_width_g-1 downto 0);
|
138 |
|
|
agent_msg_re_in_16 : in std_logic;
|
139 |
|
|
agent_msg_empty_out_16 : out std_logic;
|
140 |
|
|
agent_msg_one_d_out_16 : out std_logic
|
141 |
|
|
);
|
142 |
|
|
end hibi_segment_small;
|
143 |
|
|
|
144 |
|
|
architecture structural of hibi_segment_small is
|
145 |
|
|
|
146 |
|
|
|
147 |
|
|
type data_vec_array is array (0 to 8) of std_logic_vector (data_width_g-1 downto 0);
|
148 |
|
|
type addr_array is array (0 to 16) of integer;
|
149 |
|
|
constant addr_c : addr_array := (16#01000000#, 16#03000000#, 16#05000000#, 16#07000000#,
|
150 |
|
|
16#09000000#, 16#0b000000#, 16#0d000000#, 16#0f000000#,
|
151 |
|
|
16#11000000#, 16#13000000#, 16#15000000#, 16#17000000#,
|
152 |
|
|
16#19000000#, 16#1b000000#, 16#1d000000#, 16#1f000000#,
|
153 |
|
|
16#29000000#);
|
154 |
|
|
constant fifo_depths_c : addr_array := (8, 8, 8, 8,
|
155 |
|
|
8, 8, 8, 8,
|
156 |
|
|
8, 8, 8, 8,
|
157 |
|
|
8, 8, 8, 8, 8);
|
158 |
|
|
|
159 |
|
|
constant msg_fifo_depths_c : addr_array := (8, 8, 8, 8,
|
160 |
|
|
8, 8, 8, 8,
|
161 |
|
|
8, 8, 8, 8,
|
162 |
|
|
8, 8, 8, 8, 8);
|
163 |
|
|
|
164 |
|
|
constant id_width_c : integer := 5;
|
165 |
|
|
|
166 |
|
|
|
167 |
|
|
component hibi_wrapper_r4
|
168 |
|
|
generic (
|
169 |
|
|
id_g : integer := 5;
|
170 |
|
|
--base_id_g : integer := 5;
|
171 |
|
|
|
172 |
|
|
id_width_g : integer := 4;
|
173 |
|
|
addr_width_g : integer := 32; -- in bits!
|
174 |
|
|
data_width_g : integer := 32;
|
175 |
|
|
comm_width_g : integer := 5;
|
176 |
|
|
counter_width_g : integer := 8;
|
177 |
|
|
|
178 |
|
|
rel_agent_freq_g : integer := 1;
|
179 |
|
|
rel_bus_freq_g : integer := 1;
|
180 |
|
|
|
181 |
|
|
-- 0 synch multiclk, 1 basic GALS,
|
182 |
|
|
-- 2 Gray FIFO (depth=2^n!), 3 mixed clock pausible
|
183 |
|
|
fifo_sel_g : integer := 0;
|
184 |
|
|
|
185 |
|
|
|
186 |
|
|
rx_fifo_depth_g : integer := 5;
|
187 |
|
|
rx_msg_fifo_depth_g : integer := 5;
|
188 |
|
|
tx_fifo_depth_g : integer := 5;
|
189 |
|
|
tx_msg_fifo_depth_g : integer := 5;
|
190 |
|
|
|
191 |
|
|
arb_type_g : integer := 0;
|
192 |
|
|
|
193 |
|
|
addr_g : integer := 46;
|
194 |
|
|
addr_limit_g : integer;
|
195 |
|
|
prior_g : integer := 2;
|
196 |
|
|
inv_addr_en_g : integer := 0;
|
197 |
|
|
max_send_g : integer := 50;
|
198 |
|
|
|
199 |
|
|
n_agents_g : integer := 4;
|
200 |
|
|
n_cfg_pages_g : integer := 1;
|
201 |
|
|
n_time_slots_g : integer := 0;
|
202 |
|
|
n_extra_params_g : integer := 0;
|
203 |
|
|
|
204 |
|
|
cfg_re_g : integer := 0;
|
205 |
|
|
cfg_we_g : integer := 0;
|
206 |
|
|
debug_width_g : integer := 0
|
207 |
|
|
);
|
208 |
|
|
port (
|
209 |
|
|
bus_clk : in std_logic;
|
210 |
|
|
agent_clk : in std_logic;
|
211 |
|
|
bus_sync_clk : in std_logic;
|
212 |
|
|
agent_sync_clk : in std_logic;
|
213 |
|
|
rst_n : in std_logic;
|
214 |
|
|
|
215 |
|
|
bus_av_in : in std_logic;
|
216 |
|
|
bus_data_in : in std_logic_vector (data_width_g-1 downto 0);
|
217 |
|
|
bus_comm_in : in std_logic_vector (comm_width_g-1 downto 0);
|
218 |
|
|
bus_lock_in : in std_logic;
|
219 |
|
|
bus_full_in : in std_logic;
|
220 |
|
|
|
221 |
|
|
agent_av_in : in std_logic;
|
222 |
|
|
agent_data_in : in std_logic_vector (data_width_g-1 downto 0);
|
223 |
|
|
agent_comm_in : in std_logic_vector (comm_width_g-1 downto 0);
|
224 |
|
|
agent_we_in : in std_logic;
|
225 |
|
|
agent_full_out : out std_logic;
|
226 |
|
|
agent_one_p_out : out std_logic;
|
227 |
|
|
|
228 |
|
|
bus_av_out : out std_logic;
|
229 |
|
|
bus_data_out : out std_logic_vector (data_width_g-1 downto 0);
|
230 |
|
|
bus_comm_out : out std_logic_vector (comm_width_g-1 downto 0);
|
231 |
|
|
bus_lock_out : out std_logic;
|
232 |
|
|
bus_full_out : out std_logic;
|
233 |
|
|
|
234 |
|
|
agent_av_out : out std_logic;
|
235 |
|
|
agent_data_out : out std_logic_vector (data_width_g-1 downto 0);
|
236 |
|
|
agent_comm_out : out std_logic_vector (comm_width_g-1 downto 0);
|
237 |
|
|
agent_re_in : in std_logic;
|
238 |
|
|
agent_empty_out : out std_logic;
|
239 |
|
|
agent_one_d_out : out std_logic
|
240 |
|
|
-- synthesis translate_off
|
241 |
|
|
-- pragma translate_off
|
242 |
|
|
;
|
243 |
|
|
debug_out : out std_logic_vector (debug_width_g-1 downto 0);
|
244 |
|
|
debug_in : in std_logic_vector (debug_width_g-1 downto 0)
|
245 |
|
|
-- pragma translate_on
|
246 |
|
|
-- synthesis translate_on
|
247 |
|
|
);
|
248 |
|
|
end component; -- hibi_wrapper_r4;
|
249 |
|
|
|
250 |
|
|
component hibi_wrapper_r3 is
|
251 |
|
|
generic (
|
252 |
|
|
id_g : integer := 5;
|
253 |
|
|
|
254 |
|
|
id_width_g : integer := 4;
|
255 |
|
|
addr_width_g : integer := 32; -- in bits!
|
256 |
|
|
data_width_g : integer := 32;
|
257 |
|
|
comm_width_g : integer := 5;
|
258 |
|
|
counter_width_g : integer := 8;
|
259 |
|
|
|
260 |
|
|
rx_fifo_depth_g : integer := 5;
|
261 |
|
|
rx_msg_fifo_depth_g : integer := 5;
|
262 |
|
|
tx_fifo_depth_g : integer := 5;
|
263 |
|
|
tx_msg_fifo_depth_g : integer := 5;
|
264 |
|
|
rel_agent_freq_g : integer := 1;
|
265 |
|
|
rel_bus_freq_g : integer := 1;
|
266 |
|
|
-- 0 synch multiclk, 1 basic GALS,
|
267 |
|
|
-- 2 Gray FIFO (depth=2^n!), 3 mixed clock pausible
|
268 |
|
|
fifo_sel_g : integer := 0;
|
269 |
|
|
|
270 |
|
|
addr_g : integer := 46;
|
271 |
|
|
addr_limit_g : integer;
|
272 |
|
|
prior_g : integer := 2;
|
273 |
|
|
inv_addr_en_g : integer := 0;
|
274 |
|
|
max_send_g : integer := 50;
|
275 |
|
|
|
276 |
|
|
arb_type_g : integer := 0;
|
277 |
|
|
|
278 |
|
|
n_agents_g : integer := 4;
|
279 |
|
|
n_cfg_pages_g : integer := 1;
|
280 |
|
|
n_time_slots_g : integer := 0;
|
281 |
|
|
n_extra_params_g : integer := 0;
|
282 |
|
|
|
283 |
|
|
cfg_re_g : integer := 0;
|
284 |
|
|
cfg_we_g : integer := 0;
|
285 |
|
|
debug_width_g : integer := 0
|
286 |
|
|
|
287 |
|
|
);
|
288 |
|
|
|
289 |
|
|
port (
|
290 |
|
|
bus_clk : in std_logic;
|
291 |
|
|
agent_clk : in std_logic;
|
292 |
|
|
bus_sync_clk : in std_logic;
|
293 |
|
|
agent_sync_clk : in std_logic;
|
294 |
|
|
rst_n : in std_logic;
|
295 |
|
|
|
296 |
|
|
bus_av_in : in std_logic;
|
297 |
|
|
bus_data_in : in std_logic_vector (data_width_g-1 downto 0);
|
298 |
|
|
bus_comm_in : in std_logic_vector (comm_width_g-1 downto 0);
|
299 |
|
|
bus_lock_in : in std_logic;
|
300 |
|
|
bus_full_in : in std_logic;
|
301 |
|
|
|
302 |
|
|
agent_comm_in : in std_logic_vector (comm_width_g-1 downto 0);
|
303 |
|
|
agent_data_in : in std_logic_vector (data_width_g-1 downto 0);
|
304 |
|
|
agent_addr_in : in std_logic_vector (data_width_g-1 downto 0);
|
305 |
|
|
agent_we_in : in std_logic;
|
306 |
|
|
agent_full_out : out std_logic;
|
307 |
|
|
agent_one_p_out : out std_logic;
|
308 |
|
|
|
309 |
|
|
agent_msg_addr_in : in std_logic_vector (data_width_g-1 downto 0);
|
310 |
|
|
agent_msg_data_in : in std_logic_vector (data_width_g-1 downto 0);
|
311 |
|
|
agent_msg_comm_in : in std_logic_vector (comm_width_g-1 downto 0);
|
312 |
|
|
agent_msg_we_in : in std_logic;
|
313 |
|
|
agent_msg_full_out : out std_logic;
|
314 |
|
|
agent_msg_one_p_out : out std_logic;
|
315 |
|
|
|
316 |
|
|
bus_av_out : out std_logic;
|
317 |
|
|
bus_data_out : out std_logic_vector (data_width_g-1 downto 0);
|
318 |
|
|
bus_comm_out : out std_logic_vector (comm_width_g-1 downto 0);
|
319 |
|
|
bus_lock_out : out std_logic;
|
320 |
|
|
bus_full_out : out std_logic;
|
321 |
|
|
|
322 |
|
|
agent_addr_out : out std_logic_vector (data_width_g-1 downto 0);
|
323 |
|
|
agent_data_out : out std_logic_vector (data_width_g-1 downto 0);
|
324 |
|
|
agent_comm_out : out std_logic_vector (comm_width_g-1 downto 0);
|
325 |
|
|
agent_empty_out : out std_logic;
|
326 |
|
|
agent_re_in : in std_logic;
|
327 |
|
|
agent_one_d_out : out std_logic;
|
328 |
|
|
|
329 |
|
|
agent_msg_addr_out : out std_logic_vector (data_width_g-1 downto 0);
|
330 |
|
|
agent_msg_data_out : out std_logic_vector (data_width_g-1 downto 0);
|
331 |
|
|
agent_msg_comm_out : out std_logic_vector (comm_width_g-1 downto 0);
|
332 |
|
|
agent_msg_re_in : in std_logic;
|
333 |
|
|
agent_msg_empty_out : out std_logic;
|
334 |
|
|
agent_msg_one_d_out : out std_logic
|
335 |
|
|
);
|
336 |
|
|
end component;
|
337 |
|
|
|
338 |
|
|
-- From wrappers to OR
|
339 |
|
|
signal bus_av_out_0 : std_logic;
|
340 |
|
|
signal bus_data_out_0 : std_logic_vector (data_width_g-1 downto 0);
|
341 |
|
|
signal bus_comm_out_0 : std_logic_vector (comm_width_g-1 downto 0);
|
342 |
|
|
signal bus_lock_out_0 : std_logic;
|
343 |
|
|
signal bus_full_out_0 : std_logic;
|
344 |
|
|
|
345 |
|
|
signal bus_av_out_1 : std_logic;
|
346 |
|
|
signal bus_data_out_1 : std_logic_vector (data_width_g-1 downto 0);
|
347 |
|
|
signal bus_comm_out_1 : std_logic_vector (comm_width_g-1 downto 0);
|
348 |
|
|
signal bus_lock_out_1 : std_logic;
|
349 |
|
|
signal bus_full_out_1 : std_logic;
|
350 |
|
|
|
351 |
|
|
signal bus_av_out_2 : std_logic;
|
352 |
|
|
signal bus_data_out_2 : std_logic_vector (data_width_g-1 downto 0);
|
353 |
|
|
signal bus_comm_out_2 : std_logic_vector (comm_width_g-1 downto 0);
|
354 |
|
|
signal bus_lock_out_2 : std_logic;
|
355 |
|
|
signal bus_full_out_2 : std_logic;
|
356 |
|
|
|
357 |
|
|
signal bus_av_out_16 : std_logic;
|
358 |
|
|
signal bus_data_out_16 : std_logic_vector (data_width_g-1 downto 0);
|
359 |
|
|
signal bus_comm_out_16 : std_logic_vector (comm_width_g-1 downto 0);
|
360 |
|
|
signal bus_lock_out_16 : std_logic;
|
361 |
|
|
signal bus_full_out_16 : std_logic;
|
362 |
|
|
|
363 |
|
|
-- From OR to wrappers
|
364 |
|
|
signal bus_data_in : std_logic_vector (data_width_g-1 downto 0);
|
365 |
|
|
signal bus_comm_in : std_logic_vector (comm_width_g-1 downto 0);
|
366 |
|
|
signal bus_av_in : std_logic;
|
367 |
|
|
signal bus_lock_in : std_logic;
|
368 |
|
|
signal bus_full_in : std_logic;
|
369 |
|
|
|
370 |
|
|
begin -- structural
|
371 |
|
|
|
372 |
|
|
|
373 |
|
|
a0 : if number_of_r4_agents_g > 0 generate
|
374 |
|
|
|
375 |
|
|
agent_0 : hibi_wrapper_r4
|
376 |
|
|
generic map (
|
377 |
|
|
id_g => 4,
|
378 |
|
|
|
379 |
|
|
id_width_g => id_width_c,
|
380 |
|
|
addr_width_g => addr_width_g,
|
381 |
|
|
data_width_g => data_width_g,
|
382 |
|
|
comm_width_g => comm_width_g,
|
383 |
|
|
counter_width_g => counter_width_g,
|
384 |
|
|
|
385 |
|
|
rx_fifo_depth_g => fifo_depths_c(3),
|
386 |
|
|
rx_msg_fifo_depth_g => msg_fifo_depths_c(3),
|
387 |
|
|
tx_fifo_depth_g => fifo_depths_c(3),
|
388 |
|
|
tx_msg_fifo_depth_g => msg_fifo_depths_c(3),
|
389 |
|
|
addr_g => addr_c(0),
|
390 |
|
|
addr_limit_g => addr_c(1)-1,
|
391 |
|
|
|
392 |
|
|
prior_g => 1,
|
393 |
|
|
inv_addr_en_g => 0,
|
394 |
|
|
max_send_g => agent_max_send_0_g,
|
395 |
|
|
n_agents_g => number_of_r4_agents_g + number_of_r3_agents_g,
|
396 |
|
|
n_cfg_pages_g => 1,
|
397 |
|
|
n_time_slots_g => 0,
|
398 |
|
|
n_extra_params_g => 0
|
399 |
|
|
|
400 |
|
|
)
|
401 |
|
|
port map (
|
402 |
|
|
bus_clk => clk_in,
|
403 |
|
|
agent_clk => clk_in,
|
404 |
|
|
bus_sync_clk => clk_in,
|
405 |
|
|
agent_sync_clk => clk_in,
|
406 |
|
|
rst_n => rst_n_in,
|
407 |
|
|
|
408 |
|
|
bus_av_in => bus_av_in,
|
409 |
|
|
bus_data_in => bus_data_in,
|
410 |
|
|
bus_comm_in => bus_comm_in,
|
411 |
|
|
bus_lock_in => bus_lock_in,
|
412 |
|
|
bus_full_in => bus_full_in,
|
413 |
|
|
|
414 |
|
|
bus_av_out => bus_av_out_0,
|
415 |
|
|
bus_comm_out => bus_comm_out_0,
|
416 |
|
|
bus_data_out => bus_data_out_0,
|
417 |
|
|
bus_lock_out => bus_lock_out_0,
|
418 |
|
|
bus_full_out => bus_full_out_0,
|
419 |
|
|
|
420 |
|
|
agent_av_in => agent_av_in_0,
|
421 |
|
|
agent_comm_in => agent_comm_in_0,
|
422 |
|
|
agent_data_in => agent_data_in_0,
|
423 |
|
|
agent_we_in => agent_we_in_0,
|
424 |
|
|
agent_full_out => agent_full_out_0,
|
425 |
|
|
agent_one_p_out => agent_one_p_out_0,
|
426 |
|
|
|
427 |
|
|
agent_av_out => agent_av_out_0,
|
428 |
|
|
agent_comm_out => agent_comm_out_0,
|
429 |
|
|
agent_data_out => agent_data_out_0,
|
430 |
|
|
agent_re_in => agent_re_in_0,
|
431 |
|
|
agent_empty_out => agent_empty_out_0,
|
432 |
|
|
agent_one_d_out => agent_one_d_out_0
|
433 |
|
|
|
434 |
|
|
-- synthesis translate_off
|
435 |
|
|
-- pragma translate_off
|
436 |
|
|
,
|
437 |
|
|
debug_out => open,
|
438 |
|
|
debug_in => (others => '0')
|
439 |
|
|
-- pragma translate_on
|
440 |
|
|
-- synthesis translate_on
|
441 |
|
|
);
|
442 |
|
|
end generate a0;
|
443 |
|
|
|
444 |
|
|
|
445 |
|
|
a1 : if number_of_r4_agents_g > 1 generate
|
446 |
|
|
|
447 |
|
|
agent_1 : hibi_wrapper_r4
|
448 |
|
|
generic map (
|
449 |
|
|
id_g => 1,
|
450 |
|
|
|
451 |
|
|
id_width_g => id_width_c,
|
452 |
|
|
addr_width_g => addr_width_g,
|
453 |
|
|
data_width_g => data_width_g,
|
454 |
|
|
comm_width_g => comm_width_g,
|
455 |
|
|
counter_width_g => counter_width_g,
|
456 |
|
|
|
457 |
|
|
rx_fifo_depth_g => fifo_depths_c(1),
|
458 |
|
|
rx_msg_fifo_depth_g => msg_fifo_depths_c(1),
|
459 |
|
|
tx_fifo_depth_g => fifo_depths_c(1),
|
460 |
|
|
tx_msg_fifo_depth_g => msg_fifo_depths_c(1),
|
461 |
|
|
addr_g => addr_c(1),
|
462 |
|
|
addr_limit_g => addr_c(2)-1,
|
463 |
|
|
prior_g => 1,
|
464 |
|
|
|
465 |
|
|
inv_addr_en_g => 0,
|
466 |
|
|
max_send_g => agent_max_send_1_g,
|
467 |
|
|
n_agents_g => number_of_r4_agents_g + number_of_r3_agents_g,
|
468 |
|
|
n_cfg_pages_g => 1,
|
469 |
|
|
n_time_slots_g => 0,
|
470 |
|
|
n_extra_params_g => 0,
|
471 |
|
|
|
472 |
|
|
debug_width_g => 0
|
473 |
|
|
)
|
474 |
|
|
port map (
|
475 |
|
|
bus_clk => clk_in,
|
476 |
|
|
agent_clk => clk_in,
|
477 |
|
|
bus_sync_clk => clk_in,
|
478 |
|
|
agent_sync_clk => clk_in,
|
479 |
|
|
rst_n => rst_n_in,
|
480 |
|
|
|
481 |
|
|
bus_av_in => bus_av_in,
|
482 |
|
|
bus_comm_in => bus_comm_in,
|
483 |
|
|
bus_data_in => bus_data_in,
|
484 |
|
|
bus_full_in => bus_full_in,
|
485 |
|
|
bus_lock_in => bus_lock_in,
|
486 |
|
|
|
487 |
|
|
bus_av_out => bus_av_out_1,
|
488 |
|
|
bus_data_out => bus_data_out_1,
|
489 |
|
|
bus_comm_out => bus_comm_out_1,
|
490 |
|
|
bus_full_out => bus_full_out_1,
|
491 |
|
|
bus_lock_out => bus_lock_out_1,
|
492 |
|
|
|
493 |
|
|
agent_av_in => agent_av_in_1,
|
494 |
|
|
agent_comm_in => agent_comm_in_1,
|
495 |
|
|
agent_data_in => agent_data_in_1,
|
496 |
|
|
agent_we_in => agent_we_in_1,
|
497 |
|
|
agent_full_out => agent_full_out_1,
|
498 |
|
|
agent_one_p_out => agent_one_p_out_1,
|
499 |
|
|
|
500 |
|
|
agent_av_out => agent_av_out_1,
|
501 |
|
|
agent_data_out => agent_data_out_1,
|
502 |
|
|
agent_comm_out => agent_comm_out_1,
|
503 |
|
|
agent_re_in => agent_re_in_1,
|
504 |
|
|
agent_empty_out => agent_empty_out_1,
|
505 |
|
|
agent_one_d_out => agent_one_d_out_1
|
506 |
|
|
|
507 |
|
|
-- synthesis translate_off
|
508 |
|
|
-- pragma translate_off
|
509 |
|
|
,
|
510 |
|
|
debug_out => open,
|
511 |
|
|
debug_in => (others => '0')
|
512 |
|
|
-- pragma translate_on
|
513 |
|
|
-- synthesis translate_on
|
514 |
|
|
);
|
515 |
|
|
end generate a1;
|
516 |
|
|
|
517 |
|
|
a2 : if number_of_r4_agents_g > 2 generate
|
518 |
|
|
|
519 |
|
|
agent_2 : hibi_wrapper_r4
|
520 |
|
|
generic map (
|
521 |
|
|
id_g => 2,
|
522 |
|
|
|
523 |
|
|
id_width_g => id_width_c,
|
524 |
|
|
addr_width_g => addr_width_g,
|
525 |
|
|
data_width_g => data_width_g,
|
526 |
|
|
comm_width_g => comm_width_g,
|
527 |
|
|
counter_width_g => counter_width_g,
|
528 |
|
|
|
529 |
|
|
rx_fifo_depth_g => fifo_depths_c(2),
|
530 |
|
|
rx_msg_fifo_depth_g => msg_fifo_depths_c(2),
|
531 |
|
|
tx_fifo_depth_g => fifo_depths_c(2),
|
532 |
|
|
tx_msg_fifo_depth_g => msg_fifo_depths_c(2),
|
533 |
|
|
addr_g => addr_c(2),
|
534 |
|
|
addr_limit_g => addr_c(3)-1,
|
535 |
|
|
prior_g => 2,
|
536 |
|
|
|
537 |
|
|
inv_addr_en_g => 0,
|
538 |
|
|
max_send_g => agent_max_send_2_g,
|
539 |
|
|
n_agents_g => number_of_r4_agents_g + number_of_r3_agents_g,
|
540 |
|
|
n_cfg_pages_g => 1,
|
541 |
|
|
n_time_slots_g => 0,
|
542 |
|
|
n_extra_params_g => 0
|
543 |
|
|
|
544 |
|
|
)
|
545 |
|
|
port map (
|
546 |
|
|
bus_clk => clk_in,
|
547 |
|
|
agent_clk => clk_in,
|
548 |
|
|
bus_sync_clk => clk_in,
|
549 |
|
|
agent_sync_clk => clk_in,
|
550 |
|
|
rst_n => rst_n_in,
|
551 |
|
|
|
552 |
|
|
|
553 |
|
|
bus_av_in => bus_av_in,
|
554 |
|
|
bus_comm_in => bus_comm_in,
|
555 |
|
|
bus_data_in => bus_data_in,
|
556 |
|
|
bus_full_in => bus_full_in,
|
557 |
|
|
bus_lock_in => bus_lock_in,
|
558 |
|
|
|
559 |
|
|
bus_av_out => bus_av_out_2,
|
560 |
|
|
bus_data_out => bus_data_out_2,
|
561 |
|
|
bus_comm_out => bus_comm_out_2,
|
562 |
|
|
bus_full_out => bus_full_out_2,
|
563 |
|
|
bus_lock_out => bus_lock_out_2,
|
564 |
|
|
|
565 |
|
|
agent_av_in => agent_av_in_2,
|
566 |
|
|
agent_data_in => agent_data_in_2,
|
567 |
|
|
agent_comm_in => agent_comm_in_2,
|
568 |
|
|
agent_we_in => agent_we_in_2,
|
569 |
|
|
agent_full_out => agent_full_out_2,
|
570 |
|
|
agent_one_p_out => agent_one_p_out_2,
|
571 |
|
|
|
572 |
|
|
agent_av_out => agent_av_out_2,
|
573 |
|
|
agent_comm_out => agent_comm_out_2,
|
574 |
|
|
agent_data_out => agent_data_out_2,
|
575 |
|
|
agent_re_in => agent_re_in_2,
|
576 |
|
|
agent_empty_out => agent_empty_out_2,
|
577 |
|
|
agent_one_d_out => agent_one_d_out_2
|
578 |
|
|
-- synthesis translate_off
|
579 |
|
|
-- pragma translate_off
|
580 |
|
|
,
|
581 |
|
|
debug_out => open,
|
582 |
|
|
debug_in => (others => '0')
|
583 |
|
|
-- pragma translate_on
|
584 |
|
|
-- synthesis translate_on
|
585 |
|
|
);
|
586 |
|
|
end generate a2;
|
587 |
|
|
|
588 |
|
|
a17 : if number_of_r3_agents_g > 0 generate
|
589 |
|
|
|
590 |
|
|
agent_16 : hibi_wrapper_r3
|
591 |
|
|
generic map (
|
592 |
|
|
id_g => 3,
|
593 |
|
|
|
594 |
|
|
id_width_g => id_width_c,
|
595 |
|
|
addr_width_g => addr_width_g,
|
596 |
|
|
data_width_g => data_width_g,
|
597 |
|
|
comm_width_g => comm_width_g,
|
598 |
|
|
counter_width_g => counter_width_g,
|
599 |
|
|
|
600 |
|
|
rx_fifo_depth_g => fifo_depths_c(16),
|
601 |
|
|
rx_msg_fifo_depth_g => msg_fifo_depths_c(16),
|
602 |
|
|
tx_fifo_depth_g => fifo_depths_c(16),
|
603 |
|
|
tx_msg_fifo_depth_g => msg_fifo_depths_c(16),
|
604 |
|
|
addr_g => addr_c (15),
|
605 |
|
|
addr_limit_g => addr_c (16) -1,
|
606 |
|
|
prior_g => number_of_r4_agents_g + 1, -- to prevent empty priority numbers.
|
607 |
|
|
|
608 |
|
|
inv_addr_en_g => 0,
|
609 |
|
|
max_send_g => agent_max_send_16_g,
|
610 |
|
|
n_agents_g => number_of_r4_agents_g + number_of_r3_agents_g,
|
611 |
|
|
n_cfg_pages_g => 1,
|
612 |
|
|
n_time_slots_g => 0,
|
613 |
|
|
n_extra_params_g => 0
|
614 |
|
|
|
615 |
|
|
)
|
616 |
|
|
port map (
|
617 |
|
|
bus_clk => clk_in,
|
618 |
|
|
agent_clk => clk_in,
|
619 |
|
|
bus_sync_clk => clk_in,
|
620 |
|
|
agent_sync_clk => clk_in,
|
621 |
|
|
rst_n => rst_n_in,
|
622 |
|
|
|
623 |
|
|
bus_av_in => bus_av_in,
|
624 |
|
|
bus_data_in => bus_data_in,
|
625 |
|
|
bus_comm_in => bus_comm_in,
|
626 |
|
|
bus_lock_in => bus_lock_in,
|
627 |
|
|
bus_full_in => bus_full_in,
|
628 |
|
|
|
629 |
|
|
bus_av_out => bus_av_out_16,
|
630 |
|
|
bus_comm_out => bus_comm_out_16,
|
631 |
|
|
bus_data_out => bus_data_out_16,
|
632 |
|
|
bus_lock_out => bus_lock_out_16,
|
633 |
|
|
bus_full_out => bus_full_out_16,
|
634 |
|
|
|
635 |
|
|
agent_addr_in => agent_addr_in_16,
|
636 |
|
|
agent_data_in => agent_data_in_16,
|
637 |
|
|
agent_comm_in => agent_comm_in_16,
|
638 |
|
|
agent_we_in => agent_we_in_16,
|
639 |
|
|
agent_full_out => agent_full_out_16,
|
640 |
|
|
agent_one_p_out => agent_one_p_out_16,
|
641 |
|
|
|
642 |
|
|
agent_addr_out => agent_addr_out_16,
|
643 |
|
|
agent_data_out => agent_data_out_16,
|
644 |
|
|
agent_comm_out => agent_comm_out_16,
|
645 |
|
|
agent_re_in => agent_re_in_16,
|
646 |
|
|
agent_empty_out => agent_empty_out_16,
|
647 |
|
|
agent_one_d_out => agent_one_d_out_16,
|
648 |
|
|
|
649 |
|
|
agent_msg_addr_in => agent_msg_addr_in_16,
|
650 |
|
|
agent_msg_data_in => agent_msg_data_in_16,
|
651 |
|
|
agent_msg_comm_in => agent_msg_comm_in_16,
|
652 |
|
|
agent_msg_we_in => agent_msg_we_in_16,
|
653 |
|
|
agent_msg_full_out => agent_msg_full_out_16,
|
654 |
|
|
agent_msg_one_p_out => agent_msg_one_p_out_16,
|
655 |
|
|
|
656 |
|
|
agent_msg_addr_out => agent_msg_addr_out_16,
|
657 |
|
|
agent_msg_data_out => agent_msg_data_out_16,
|
658 |
|
|
agent_msg_comm_out => agent_msg_comm_out_16,
|
659 |
|
|
agent_msg_re_in => agent_msg_re_in_16,
|
660 |
|
|
agent_msg_empty_out => agent_msg_empty_out_16,
|
661 |
|
|
agent_msg_one_d_out => agent_msg_one_d_out_16
|
662 |
|
|
);
|
663 |
|
|
end generate a17;
|
664 |
|
|
|
665 |
|
|
-- no wrappers
|
666 |
|
|
s0 : if number_of_r4_agents_g < 1 generate
|
667 |
|
|
bus_av_out_0 <= '0';
|
668 |
|
|
bus_data_out_0 <= (others => '0');
|
669 |
|
|
bus_comm_out_0 <= (others => '0');
|
670 |
|
|
bus_lock_out_0 <= '0';
|
671 |
|
|
bus_full_out_0 <= '0';
|
672 |
|
|
|
673 |
|
|
agent_data_out_0 <= (others => '0');
|
674 |
|
|
end generate s0;
|
675 |
|
|
|
676 |
|
|
-- only one wrapper
|
677 |
|
|
s1 : if number_of_r4_agents_g < 2 generate
|
678 |
|
|
bus_av_out_1 <= '0';
|
679 |
|
|
bus_data_out_1 <= (others => '0');
|
680 |
|
|
bus_comm_out_1 <= (others => '0');
|
681 |
|
|
bus_lock_out_1 <= '0';
|
682 |
|
|
bus_full_out_1 <= '0';
|
683 |
|
|
|
684 |
|
|
agent_data_out_1 <= (others => '0');
|
685 |
|
|
end generate s1;
|
686 |
|
|
|
687 |
|
|
s2 : if number_of_r4_agents_g < 3 generate
|
688 |
|
|
bus_av_out_2 <= '0';
|
689 |
|
|
bus_data_out_2 <= (others => '0');
|
690 |
|
|
bus_comm_out_2 <= (others => '0');
|
691 |
|
|
bus_lock_out_2 <= '0';
|
692 |
|
|
bus_full_out_2 <= '0';
|
693 |
|
|
|
694 |
|
|
agent_data_out_2 <= (others => '0');
|
695 |
|
|
end generate s2;
|
696 |
|
|
|
697 |
|
|
s17 : if number_of_r3_agents_g < 1 generate
|
698 |
|
|
bus_av_out_16 <= '0';
|
699 |
|
|
bus_data_out_16 <= (others => '0');
|
700 |
|
|
bus_comm_out_16 <= (others => '0');
|
701 |
|
|
bus_lock_out_16 <= '0';
|
702 |
|
|
bus_full_out_16 <= '0';
|
703 |
|
|
|
704 |
|
|
agent_msg_data_out_16 <= (others => '0');
|
705 |
|
|
end generate s17;
|
706 |
|
|
|
707 |
|
|
-- continuous assignments
|
708 |
|
|
bus_av_in <= bus_av_out_0 or bus_av_out_1 or bus_av_out_2 or bus_av_out_16;
|
709 |
|
|
bus_data_in <= bus_data_out_0 or bus_data_out_1 or bus_data_out_2 or bus_data_out_16;
|
710 |
|
|
bus_comm_in <= bus_comm_out_0 or bus_comm_out_1 or bus_comm_out_2 or bus_comm_out_16;
|
711 |
|
|
bus_lock_in <= bus_lock_out_0 or bus_lock_out_1 or bus_lock_out_2 or bus_lock_out_16;
|
712 |
|
|
bus_full_in <= bus_full_out_0 or bus_full_out_1 or bus_full_out_2 or bus_full_out_16;
|
713 |
|
|
|
714 |
|
|
-- Debug signals OUT
|
715 |
|
|
debug_bus_av_out <= bus_av_in;
|
716 |
|
|
debug_bus_comm_out <= bus_comm_in;
|
717 |
|
|
debug_bus_full_out <= bus_full_in;
|
718 |
|
|
|
719 |
|
|
|
720 |
|
|
end structural;
|
721 |
|
|
|