1 | ////////////////////////////////////////////////////////////////////////////// |
---|
2 | // File: tsar_iob_cluster.cpp |
---|
3 | // Author: Alain Greiner |
---|
4 | // Copyright: UPMC/LIP6 |
---|
5 | // Date : april 2013 |
---|
6 | // This program is released under the GNU public license |
---|
7 | ////////////////////////////////////////////////////////////////////////////// |
---|
8 | // Cluster(0,0) & Cluster(xmax-1,ymax-1) contains the IOB0 & IOB1 components. |
---|
9 | // These two clusters contain 6 extra components: |
---|
10 | // - 1 vci_io_bridge (connected to the 3 networks. |
---|
11 | // - 3 vci_dspin_wrapper for the IOB. |
---|
12 | // - 2 dspin_local_crossbar for commands and responses. |
---|
13 | ////////////////////////////////////////////////////////////////////////////// |
---|
14 | |
---|
15 | #include "../include/tsar_iob_cluster.h" |
---|
16 | |
---|
17 | namespace soclib { namespace caba { |
---|
18 | |
---|
19 | ////////////////////////////////////////////////////////////////////////// |
---|
20 | // Constructor |
---|
21 | ////////////////////////////////////////////////////////////////////////// |
---|
22 | template<typename vci_param_int, |
---|
23 | typename vci_param_ext, |
---|
24 | size_t dspin_int_cmd_width, |
---|
25 | size_t dspin_int_rsp_width, |
---|
26 | size_t dspin_ram_cmd_width, |
---|
27 | size_t dspin_ram_rsp_width> |
---|
28 | TsarIobCluster<vci_param_int, |
---|
29 | vci_param_ext, |
---|
30 | dspin_int_cmd_width, |
---|
31 | dspin_int_rsp_width, |
---|
32 | dspin_ram_cmd_width, |
---|
33 | dspin_ram_rsp_width>::TsarIobCluster( |
---|
34 | ////////////////////////////////////////////////////////////////////////// |
---|
35 | sc_module_name insname, |
---|
36 | size_t nb_procs, |
---|
37 | size_t nb_dmas, |
---|
38 | size_t x_id, |
---|
39 | size_t y_id, |
---|
40 | size_t xmax, |
---|
41 | size_t ymax, |
---|
42 | |
---|
43 | const soclib::common::MappingTable &mt_int, |
---|
44 | const soclib::common::MappingTable &mt_ram, |
---|
45 | const soclib::common::MappingTable &mt_iox, |
---|
46 | |
---|
47 | size_t x_width, |
---|
48 | size_t y_width, |
---|
49 | size_t l_width, |
---|
50 | |
---|
51 | size_t memc_int_tgtid, |
---|
52 | size_t xicu_int_tgtid, |
---|
53 | size_t mdma_int_tgtid, |
---|
54 | size_t iobx_int_tgtid, |
---|
55 | |
---|
56 | size_t proc_int_srcid, |
---|
57 | size_t mdma_int_srcid, |
---|
58 | size_t iobx_int_srcid, |
---|
59 | |
---|
60 | size_t xram_ram_tgtid, |
---|
61 | |
---|
62 | size_t memc_ram_srcid, |
---|
63 | size_t iobx_ram_srcid, |
---|
64 | |
---|
65 | size_t memc_ways, |
---|
66 | size_t memc_sets, |
---|
67 | size_t l1_i_ways, |
---|
68 | size_t l1_i_sets, |
---|
69 | size_t l1_d_ways, |
---|
70 | size_t l1_d_sets, |
---|
71 | size_t xram_latency, |
---|
72 | |
---|
73 | const Loader &loader, |
---|
74 | |
---|
75 | uint32_t frozen_cycles, |
---|
76 | uint32_t debug_start_cycle, |
---|
77 | bool memc_debug_ok, |
---|
78 | bool proc_debug_ok, |
---|
79 | bool iob_debug_ok ) |
---|
80 | : soclib::caba::BaseModule(insname), |
---|
81 | p_clk("clk"), |
---|
82 | p_resetn("resetn") |
---|
83 | { |
---|
84 | assert( (x_id < xmax) and (y_id < ymax) and "Illegal cluster coordinates"); |
---|
85 | |
---|
86 | size_t cluster_id = x_id * ymax + y_id; |
---|
87 | size_t cluster_iob0 = 0; |
---|
88 | size_t cluster_iob1 = xmax*ymax-1; |
---|
89 | |
---|
90 | // Vectors of DSPIN ports for inter-cluster communications |
---|
91 | p_dspin_int_cmd_in = alloc_elems<DspinInput<dspin_int_cmd_width> >("p_int_cmd_in", 2, 4); |
---|
92 | p_dspin_int_cmd_out = alloc_elems<DspinOutput<dspin_int_cmd_width> >("p_int_cmd_out", 2, 4); |
---|
93 | p_dspin_int_rsp_in = alloc_elems<DspinInput<dspin_int_rsp_width> >("p_int_rsp_in", 2, 4); |
---|
94 | p_dspin_int_rsp_out = alloc_elems<DspinOutput<dspin_int_rsp_width> >("p_int_rsp_out", 2, 4); |
---|
95 | |
---|
96 | p_dspin_ram_cmd_in = alloc_elems<DspinInput<dspin_ram_cmd_width> >("p_ext_cmd_in", 4); |
---|
97 | p_dspin_ram_cmd_out = alloc_elems<DspinOutput<dspin_ram_cmd_width> >("p_ext_cmd_out", 4); |
---|
98 | p_dspin_ram_rsp_in = alloc_elems<DspinInput<dspin_ram_rsp_width> >("p_ext_rsp_in", 4); |
---|
99 | p_dspin_ram_rsp_out = alloc_elems<DspinOutput<dspin_ram_rsp_width> >("p_ext_rsp_out", 4); |
---|
100 | |
---|
101 | // VCI ports to IOB0 and IOB1 in cluster_iob0 and cluster_iob1 |
---|
102 | if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) ) |
---|
103 | { |
---|
104 | p_vci_iox_ini = new soclib::caba::VciInitiator<vci_param_ext>; |
---|
105 | p_vci_iox_tgt = new soclib::caba::VciTarget<vci_param_ext>; |
---|
106 | } |
---|
107 | |
---|
108 | // IRQ ports in cluster_iob0 only |
---|
109 | if ( cluster_id == cluster_iob0 ) |
---|
110 | { |
---|
111 | for ( size_t n=0 ; n<32 ; n++ ) p_irq[n] = new sc_in<bool>; |
---|
112 | } |
---|
113 | |
---|
114 | ///////////////////////////////////////////////////////////////////////////// |
---|
115 | // Hardware components |
---|
116 | ///////////////////////////////////////////////////////////////////////////// |
---|
117 | |
---|
118 | //////////// PROCS |
---|
119 | for (size_t p = 0; p < nb_procs; p++) |
---|
120 | { |
---|
121 | std::ostringstream s_proc; |
---|
122 | s_proc << "proc_" << x_id << "_" << y_id << "_" << p; |
---|
123 | proc[p] = new VciCcVCacheWrapper<vci_param_int, |
---|
124 | dspin_int_cmd_width, |
---|
125 | dspin_int_rsp_width, |
---|
126 | GdbServer<Mips32ElIss> >( |
---|
127 | s_proc.str().c_str(), |
---|
128 | cluster_id*nb_procs + p, // GLOBAL PROC_ID |
---|
129 | mt_int, // Mapping Table INT network |
---|
130 | IntTab(cluster_id,p), // SRCID |
---|
131 | (cluster_id << l_width) + p, // CC_GLOBAL_ID |
---|
132 | 8, // ITLB ways |
---|
133 | 8, // ITLB sets |
---|
134 | 8, // DTLB ways |
---|
135 | 8, // DTLB sets |
---|
136 | l1_i_ways,l1_i_sets,16, // ICACHE size |
---|
137 | l1_d_ways,l1_d_sets,16, // DCACHE size |
---|
138 | 4, // WBUF nlines |
---|
139 | 4, // WBUF nwords |
---|
140 | x_width, |
---|
141 | y_width, |
---|
142 | frozen_cycles, // max frozen cycles |
---|
143 | debug_start_cycle, |
---|
144 | proc_debug_ok); |
---|
145 | |
---|
146 | std::ostringstream s_wi_proc; |
---|
147 | s_wi_proc << "proc_wi_" << x_id << "_" << y_id << "_" << p; |
---|
148 | proc_wi[p] = new VciDspinInitiatorWrapper<vci_param_int, |
---|
149 | dspin_int_cmd_width, |
---|
150 | dspin_int_rsp_width>( |
---|
151 | s_wi_proc.str().c_str(), |
---|
152 | x_width + y_width + l_width); |
---|
153 | } |
---|
154 | |
---|
155 | /////////// MEMC |
---|
156 | std::ostringstream s_memc; |
---|
157 | s_memc << "memc_" << x_id << "_" << y_id; |
---|
158 | memc = new VciMemCache<vci_param_int, |
---|
159 | vci_param_ext, |
---|
160 | dspin_int_rsp_width, |
---|
161 | dspin_int_cmd_width>( |
---|
162 | s_memc.str().c_str(), |
---|
163 | mt_int, // Mapping Table INT network |
---|
164 | mt_ram, // Mapping Table RAM network |
---|
165 | IntTab(cluster_id, memc_ram_srcid), // SRCID RAM network |
---|
166 | IntTab(cluster_id, memc_int_tgtid), // TGTID INT network |
---|
167 | (cluster_id << l_width) + nb_procs, // CC_GLOBAL_ID |
---|
168 | memc_ways, memc_sets, 16, // CACHE SIZE |
---|
169 | 3, // MAX NUMBER OF COPIES |
---|
170 | 4096, // HEAP SIZE |
---|
171 | 8, // TRANSACTION TABLE DEPTH |
---|
172 | 8, // UPDATE TABLE DEPTH |
---|
173 | debug_start_cycle, |
---|
174 | memc_debug_ok ); |
---|
175 | |
---|
176 | std::ostringstream s_wt_memc; |
---|
177 | s_wt_memc << "memc_wt_" << x_id << "_" << y_id; |
---|
178 | memc_int_wt = new VciDspinTargetWrapper<vci_param_int, |
---|
179 | dspin_int_cmd_width, |
---|
180 | dspin_int_rsp_width>( |
---|
181 | s_wt_memc.str().c_str(), |
---|
182 | x_width + y_width + l_width); |
---|
183 | |
---|
184 | std::ostringstream s_wi_memc; |
---|
185 | s_wi_memc << "memc_wi_" << x_id << "_" << y_id; |
---|
186 | memc_ram_wi = new VciDspinInitiatorWrapper<vci_param_ext, |
---|
187 | dspin_ram_cmd_width, |
---|
188 | dspin_ram_rsp_width>( |
---|
189 | s_wi_memc.str().c_str(), |
---|
190 | x_width + y_width + l_width); |
---|
191 | |
---|
192 | /////////// XICU |
---|
193 | std::ostringstream s_xicu; |
---|
194 | s_xicu << "xicu_" << x_id << "_" << y_id; |
---|
195 | xicu = new VciXicu<vci_param_int>( |
---|
196 | s_xicu.str().c_str(), |
---|
197 | mt_int, // mapping table INT network |
---|
198 | IntTab(cluster_id,xicu_int_tgtid), // TGTID direct space |
---|
199 | nb_procs, // number of timer IRQs |
---|
200 | 32, // number of hard IRQs |
---|
201 | 32, // number of soft IRQs |
---|
202 | nb_procs); // number of output IRQs |
---|
203 | |
---|
204 | std::ostringstream s_wt_xicu; |
---|
205 | s_wt_xicu << "xicu_wt_" << x_id << "_" << y_id; |
---|
206 | xicu_int_wt = new VciDspinTargetWrapper<vci_param_int, |
---|
207 | dspin_int_cmd_width, |
---|
208 | dspin_int_rsp_width>( |
---|
209 | s_wt_xicu.str().c_str(), |
---|
210 | x_width + y_width + l_width); |
---|
211 | |
---|
212 | //////////// MDMA |
---|
213 | std::ostringstream s_mdma; |
---|
214 | s_mdma << "mdma_" << x_id << "_" << y_id; |
---|
215 | mdma = new VciMultiDma<vci_param_int>( |
---|
216 | s_mdma.str().c_str(), |
---|
217 | mt_int, |
---|
218 | IntTab(cluster_id, nb_procs), // SRCID |
---|
219 | IntTab(cluster_id, mdma_int_tgtid), // TGTID |
---|
220 | 64, // burst size |
---|
221 | nb_dmas); // number of IRQs |
---|
222 | |
---|
223 | std::ostringstream s_wt_mdma; |
---|
224 | s_wt_mdma << "mdma_wt_" << x_id << "_" << y_id; |
---|
225 | mdma_int_wt = new VciDspinTargetWrapper<vci_param_int, |
---|
226 | dspin_int_cmd_width, |
---|
227 | dspin_int_rsp_width>( |
---|
228 | s_wt_mdma.str().c_str(), |
---|
229 | x_width + y_width + l_width); |
---|
230 | |
---|
231 | std::ostringstream s_wi_mdma; |
---|
232 | s_wi_mdma << "mdma_wi_" << x_id << "_" << y_id; |
---|
233 | mdma_int_wi = new VciDspinInitiatorWrapper<vci_param_int, |
---|
234 | dspin_int_cmd_width, |
---|
235 | dspin_int_rsp_width>( |
---|
236 | s_wi_mdma.str().c_str(), |
---|
237 | x_width + y_width + l_width); |
---|
238 | |
---|
239 | /////////// Direct LOCAL_XBAR(S) |
---|
240 | size_t nb_direct_initiators = nb_procs + 1; |
---|
241 | size_t nb_direct_targets = 3; |
---|
242 | if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) ) |
---|
243 | { |
---|
244 | nb_direct_initiators = nb_procs + 2; |
---|
245 | nb_direct_targets = 4; |
---|
246 | } |
---|
247 | |
---|
248 | std::ostringstream s_int_xbar_cmd_d; |
---|
249 | s_int_xbar_cmd_d << "int_xbar_cmd_d_" << x_id << "_" << y_id; |
---|
250 | int_xbar_cmd_d = new DspinLocalCrossbar<dspin_int_cmd_width>( |
---|
251 | s_int_xbar_cmd_d.str().c_str(), |
---|
252 | mt_int, // mapping table |
---|
253 | x_id, y_id, // cluster coordinates |
---|
254 | x_width, y_width, l_width, |
---|
255 | nb_direct_initiators, // number of local of sources |
---|
256 | nb_direct_targets, // number of local dests |
---|
257 | 2, 2, // fifo depths |
---|
258 | true, // CMD crossbar |
---|
259 | true, // use routing table |
---|
260 | false ); // no broacast |
---|
261 | |
---|
262 | std::ostringstream s_int_xbar_rsp_d; |
---|
263 | s_int_xbar_rsp_d << "int_xbar_rsp_d_" << x_id << "_" << y_id; |
---|
264 | int_xbar_rsp_d = new DspinLocalCrossbar<dspin_int_rsp_width>( |
---|
265 | s_int_xbar_rsp_d.str().c_str(), |
---|
266 | mt_int, // mapping table |
---|
267 | x_id, y_id, // cluster coordinates |
---|
268 | x_width, y_width, l_width, |
---|
269 | nb_direct_targets, // number of local sources |
---|
270 | nb_direct_initiators, // number of local dests |
---|
271 | 2, 2, // fifo depths |
---|
272 | false, // RSP crossbar |
---|
273 | false, // don't use routing table |
---|
274 | false ); // no broacast |
---|
275 | |
---|
276 | //////////// Coherence LOCAL_XBAR(S) |
---|
277 | std::ostringstream s_int_xbar_m2p_c; |
---|
278 | s_int_xbar_m2p_c << "int_xbar_m2p_c_" << x_id << "_" << y_id; |
---|
279 | int_xbar_m2p_c = new DspinLocalCrossbar<dspin_int_cmd_width>( |
---|
280 | s_int_xbar_m2p_c.str().c_str(), |
---|
281 | mt_int, // mapping table |
---|
282 | x_id, y_id, // cluster coordinates |
---|
283 | x_width, y_width, l_width, // several dests |
---|
284 | 1, // number of local sources |
---|
285 | nb_procs, // number of local dests |
---|
286 | 2, 2, // fifo depths |
---|
287 | true, // pseudo CMD |
---|
288 | false, // no routing table |
---|
289 | true ); // broacast |
---|
290 | |
---|
291 | std::ostringstream s_int_xbar_p2m_c; |
---|
292 | s_int_xbar_p2m_c << "int_xbar_p2m_c_" << x_id << "_" << y_id; |
---|
293 | int_xbar_p2m_c = new DspinLocalCrossbar<dspin_int_rsp_width>( |
---|
294 | s_int_xbar_p2m_c.str().c_str(), |
---|
295 | mt_int, // mapping table |
---|
296 | x_id, y_id, // cluster coordinates |
---|
297 | x_width, y_width, 0, // only one dest |
---|
298 | nb_procs, // number of local sources |
---|
299 | 1, // number of local dests |
---|
300 | 2, 2, // fifo depths |
---|
301 | false, // pseudo RSP |
---|
302 | false, // no routing table |
---|
303 | false ); // no broacast |
---|
304 | |
---|
305 | ////////////// INT ROUTER(S) |
---|
306 | std::ostringstream s_int_router_cmd; |
---|
307 | s_int_router_cmd << "router_cmd_" << x_id << "_" << y_id; |
---|
308 | int_router_cmd = new VirtualDspinRouter<dspin_int_cmd_width>( |
---|
309 | s_int_router_cmd.str().c_str(), |
---|
310 | x_id,y_id, // coordinate in the mesh |
---|
311 | x_width, y_width, // x & y fields width |
---|
312 | 4,4); // input & output fifo depths |
---|
313 | |
---|
314 | std::ostringstream s_int_router_rsp; |
---|
315 | s_int_router_rsp << "router_rsp_" << x_id << "_" << y_id; |
---|
316 | int_router_rsp = new VirtualDspinRouter<dspin_int_rsp_width>( |
---|
317 | s_int_router_rsp.str().c_str(), |
---|
318 | x_id,y_id, // coordinates in mesh |
---|
319 | x_width, y_width, // x & y fields width |
---|
320 | 4,4); // input & output fifo depths |
---|
321 | |
---|
322 | ////////////// XRAM |
---|
323 | std::ostringstream s_xram; |
---|
324 | s_xram << "xram_" << x_id << "_" << y_id; |
---|
325 | xram = new VciSimpleRam<vci_param_ext>( |
---|
326 | s_xram.str().c_str(), |
---|
327 | IntTab(cluster_id, xram_ram_tgtid ), |
---|
328 | mt_ram, |
---|
329 | loader, |
---|
330 | xram_latency); |
---|
331 | |
---|
332 | std::ostringstream s_wt_xram; |
---|
333 | s_wt_xram << "xram_wt_" << x_id << "_" << y_id; |
---|
334 | xram_ram_wt = new VciDspinTargetWrapper<vci_param_ext, |
---|
335 | dspin_ram_cmd_width, |
---|
336 | dspin_ram_rsp_width>( |
---|
337 | s_wt_xram.str().c_str(), |
---|
338 | x_width + y_width + l_width); |
---|
339 | |
---|
340 | ///////////// RAM ROUTER(S) |
---|
341 | std::ostringstream s_ram_router_cmd; |
---|
342 | s_ram_router_cmd << "ram_router_cmd_" << x_id << "_" << y_id; |
---|
343 | ram_router_cmd = new DspinRouter<dspin_ram_cmd_width>( |
---|
344 | s_ram_router_cmd.str().c_str(), |
---|
345 | x_id,y_id, // coordinate in the mesh |
---|
346 | x_width, y_width, // x & y fields width |
---|
347 | 4,4); // input & output fifo depths |
---|
348 | |
---|
349 | std::ostringstream s_ram_router_rsp; |
---|
350 | s_ram_router_rsp << "ram_router_rsp_" << x_id << "_" << y_id; |
---|
351 | ram_router_rsp = new DspinRouter<dspin_ram_rsp_width>( |
---|
352 | s_ram_router_rsp.str().c_str(), |
---|
353 | x_id,y_id, // coordinates in mesh |
---|
354 | x_width, y_width, // x & y fields width |
---|
355 | 4,4); // input & output fifo depths |
---|
356 | |
---|
357 | ////////////////////// I/O CLUSTER ONLY /////////////////////// |
---|
358 | if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) ) |
---|
359 | { |
---|
360 | /////////// IO_BRIDGE |
---|
361 | size_t iox_local_id; |
---|
362 | size_t global_id; |
---|
363 | bool has_irqs; |
---|
364 | if ( cluster_id == cluster_iob0 ) |
---|
365 | { |
---|
366 | iox_local_id = 0; |
---|
367 | global_id = cluster_iob0; |
---|
368 | has_irqs = true; |
---|
369 | } |
---|
370 | else |
---|
371 | { |
---|
372 | iox_local_id = 1; |
---|
373 | global_id = cluster_iob1; |
---|
374 | has_irqs = false; |
---|
375 | } |
---|
376 | |
---|
377 | std::ostringstream s_iob; |
---|
378 | s_iob << "iob_" << x_id << "_" << y_id; |
---|
379 | iob = new VciIoBridge<vci_param_int, |
---|
380 | vci_param_ext>( |
---|
381 | s_iob.str().c_str(), |
---|
382 | mt_ram, // EXT network maptab |
---|
383 | mt_int, // INT network maptab |
---|
384 | mt_iox, // IOX network maptab |
---|
385 | IntTab( global_id, iobx_int_tgtid ), // INT TGTID |
---|
386 | IntTab( global_id, iobx_int_srcid ), // INT SRCID |
---|
387 | IntTab( global_id, iox_local_id ), // IOX TGTID |
---|
388 | has_irqs, |
---|
389 | 16, // cache line words |
---|
390 | 8, // IOTLB ways |
---|
391 | 8, // IOTLB sets |
---|
392 | debug_start_cycle, |
---|
393 | iob_debug_ok ); |
---|
394 | |
---|
395 | std::ostringstream s_iob_int_wi; |
---|
396 | s_iob_int_wi << "iob_int_wi_" << x_id << "_" << y_id; |
---|
397 | iob_int_wi = new VciDspinInitiatorWrapper<vci_param_int, |
---|
398 | dspin_int_cmd_width, |
---|
399 | dspin_int_rsp_width>( |
---|
400 | s_iob_int_wi.str().c_str(), |
---|
401 | x_width + y_width + l_width); |
---|
402 | |
---|
403 | std::ostringstream s_iob_int_wt; |
---|
404 | s_iob_int_wt << "iob_int_wt_" << x_id << "_" << y_id; |
---|
405 | iob_int_wt = new VciDspinTargetWrapper<vci_param_int, |
---|
406 | dspin_int_cmd_width, |
---|
407 | dspin_int_rsp_width>( |
---|
408 | s_iob_int_wt.str().c_str(), |
---|
409 | x_width + y_width + l_width); |
---|
410 | |
---|
411 | std::ostringstream s_iob_ram_wi; |
---|
412 | s_iob_ram_wi << "iob_ram_wi_" << x_id << "_" << y_id; |
---|
413 | iob_ram_wi = new VciDspinInitiatorWrapper<vci_param_ext, |
---|
414 | dspin_ram_cmd_width, |
---|
415 | dspin_ram_rsp_width>( |
---|
416 | s_iob_ram_wi.str().c_str(), |
---|
417 | x_width + y_width + l_width); |
---|
418 | |
---|
419 | ///////////// RAM LOCAL_XBAR(S) |
---|
420 | std::ostringstream s_ram_xbar_cmd; |
---|
421 | s_ram_xbar_cmd << "ram_xbar_cmd_" << x_id << "_" << y_id; |
---|
422 | ram_xbar_cmd = new DspinLocalCrossbar<dspin_ram_cmd_width>( |
---|
423 | s_ram_xbar_cmd.str().c_str(), |
---|
424 | mt_ram, // mapping table |
---|
425 | x_id, y_id, // cluster coordinates |
---|
426 | x_width, y_width, 0, // one dest on ram_cmd network |
---|
427 | 2, // number of local sources |
---|
428 | 1, // number of local dests |
---|
429 | 2, 2, // fifo depths |
---|
430 | true, // CMD crossbar |
---|
431 | false, // no routing table (one dest) |
---|
432 | false ); // no broadcast |
---|
433 | |
---|
434 | std::ostringstream s_ram_xbar_rsp; |
---|
435 | s_ram_xbar_rsp << "ram_xbar_rsp_" << x_id << "_" << y_id; |
---|
436 | ram_xbar_rsp = new DspinLocalCrossbar<dspin_ram_rsp_width>( |
---|
437 | s_ram_xbar_rsp.str().c_str(), |
---|
438 | mt_ram, // mapping table |
---|
439 | x_id, y_id, // cluster coordinates |
---|
440 | x_width, y_width, l_width, // two sources on ram_rsp network |
---|
441 | 1, // number of local sources |
---|
442 | 2, // number of local dests |
---|
443 | 2, 2, // fifo depths |
---|
444 | false, // RSP crossbar |
---|
445 | true, // use routing table |
---|
446 | false ); // no broadcast |
---|
447 | } |
---|
448 | |
---|
449 | //////////////////////////////////// |
---|
450 | // Connections are defined here |
---|
451 | //////////////////////////////////// |
---|
452 | |
---|
453 | // on coherence network : local srcid[proc] in [0...nb_procs-1] |
---|
454 | // : local srcid[memc] = nb_procs |
---|
455 | |
---|
456 | //////////////////////// internal CMD & RSP routers |
---|
457 | int_router_cmd->p_clk (this->p_clk); |
---|
458 | int_router_cmd->p_resetn (this->p_resetn); |
---|
459 | int_router_rsp->p_clk (this->p_clk); |
---|
460 | int_router_rsp->p_resetn (this->p_resetn); |
---|
461 | for (int x = 0; x < 2; x++) |
---|
462 | { |
---|
463 | for(int y = 0; y < 4; y++) |
---|
464 | { |
---|
465 | int_router_cmd->p_out[x][y] (this->p_dspin_int_cmd_out[x][y]); |
---|
466 | int_router_cmd->p_in[x][y] (this->p_dspin_int_cmd_in[x][y]); |
---|
467 | int_router_rsp->p_out[x][y] (this->p_dspin_int_rsp_out[x][y]); |
---|
468 | int_router_rsp->p_in[x][y] (this->p_dspin_int_rsp_in[x][y]); |
---|
469 | } |
---|
470 | } |
---|
471 | |
---|
472 | // local ports |
---|
473 | int_router_cmd->p_out[0][4] (signal_int_dspin_cmd_g2l_d); |
---|
474 | int_router_cmd->p_out[1][4] (signal_int_dspin_m2p_g2l_c); |
---|
475 | int_router_cmd->p_in[0][4] (signal_int_dspin_cmd_l2g_d); |
---|
476 | int_router_cmd->p_in[1][4] (signal_int_dspin_m2p_l2g_c); |
---|
477 | |
---|
478 | int_router_rsp->p_out[0][4] (signal_int_dspin_rsp_g2l_d); |
---|
479 | int_router_rsp->p_out[1][4] (signal_int_dspin_p2m_g2l_c); |
---|
480 | int_router_rsp->p_in[0][4] (signal_int_dspin_rsp_l2g_d); |
---|
481 | int_router_rsp->p_in[1][4] (signal_int_dspin_p2m_l2g_c); |
---|
482 | |
---|
483 | ///////////////////// CMD DSPIN local crossbar direct |
---|
484 | int_xbar_cmd_d->p_clk (this->p_clk); |
---|
485 | int_xbar_cmd_d->p_resetn (this->p_resetn); |
---|
486 | int_xbar_cmd_d->p_global_out (signal_int_dspin_cmd_l2g_d); |
---|
487 | int_xbar_cmd_d->p_global_in (signal_int_dspin_cmd_g2l_d); |
---|
488 | |
---|
489 | int_xbar_cmd_d->p_local_out[memc_int_tgtid] (signal_int_dspin_cmd_memc_t); |
---|
490 | int_xbar_cmd_d->p_local_out[xicu_int_tgtid] (signal_int_dspin_cmd_xicu_t); |
---|
491 | int_xbar_cmd_d->p_local_out[mdma_int_tgtid] (signal_int_dspin_cmd_mdma_t); |
---|
492 | |
---|
493 | int_xbar_cmd_d->p_local_in[mdma_int_srcid] (signal_int_dspin_cmd_mdma_i); |
---|
494 | |
---|
495 | for (size_t p = 0; p < nb_procs; p++) |
---|
496 | int_xbar_cmd_d->p_local_in[proc_int_srcid+p] (signal_int_dspin_cmd_proc_i[p]); |
---|
497 | |
---|
498 | if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) ) |
---|
499 | { |
---|
500 | int_xbar_cmd_d->p_local_out[iobx_int_tgtid] (signal_int_dspin_cmd_iobx_t); |
---|
501 | int_xbar_cmd_d->p_local_in[iobx_int_srcid] (signal_int_dspin_cmd_iobx_i); |
---|
502 | } |
---|
503 | |
---|
504 | //////////////////////// RSP DSPIN local crossbar direct |
---|
505 | int_xbar_rsp_d->p_clk (this->p_clk); |
---|
506 | int_xbar_rsp_d->p_resetn (this->p_resetn); |
---|
507 | int_xbar_rsp_d->p_global_out (signal_int_dspin_rsp_l2g_d); |
---|
508 | int_xbar_rsp_d->p_global_in (signal_int_dspin_rsp_g2l_d); |
---|
509 | |
---|
510 | int_xbar_rsp_d->p_local_in[memc_int_tgtid] (signal_int_dspin_rsp_memc_t); |
---|
511 | int_xbar_rsp_d->p_local_in[xicu_int_tgtid] (signal_int_dspin_rsp_xicu_t); |
---|
512 | int_xbar_rsp_d->p_local_in[mdma_int_tgtid] (signal_int_dspin_rsp_mdma_t); |
---|
513 | |
---|
514 | int_xbar_rsp_d->p_local_out[mdma_int_srcid] (signal_int_dspin_rsp_mdma_i); |
---|
515 | |
---|
516 | for (size_t p = 0; p < nb_procs; p++) |
---|
517 | int_xbar_rsp_d->p_local_out[proc_int_srcid+p] (signal_int_dspin_rsp_proc_i[p]); |
---|
518 | |
---|
519 | if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) ) |
---|
520 | { |
---|
521 | int_xbar_rsp_d->p_local_in[iobx_int_tgtid] (signal_int_dspin_rsp_iobx_t); |
---|
522 | int_xbar_rsp_d->p_local_out[iobx_int_srcid] (signal_int_dspin_rsp_iobx_i); |
---|
523 | } |
---|
524 | |
---|
525 | ////////////////////// M2P DSPIN local crossbar coherence |
---|
526 | int_xbar_m2p_c->p_clk (this->p_clk); |
---|
527 | int_xbar_m2p_c->p_resetn (this->p_resetn); |
---|
528 | int_xbar_m2p_c->p_global_out (signal_int_dspin_m2p_l2g_c); |
---|
529 | int_xbar_m2p_c->p_global_in (signal_int_dspin_m2p_g2l_c); |
---|
530 | int_xbar_m2p_c->p_local_in[0] (signal_int_dspin_m2p_memc); |
---|
531 | for (size_t p = 0; p < nb_procs; p++) |
---|
532 | int_xbar_m2p_c->p_local_out[p] (signal_int_dspin_m2p_proc[p]); |
---|
533 | |
---|
534 | ////////////////////////// P2M DSPIN local crossbar coherence |
---|
535 | int_xbar_p2m_c->p_clk (this->p_clk); |
---|
536 | int_xbar_p2m_c->p_resetn (this->p_resetn); |
---|
537 | int_xbar_p2m_c->p_global_out (signal_int_dspin_p2m_l2g_c); |
---|
538 | int_xbar_p2m_c->p_global_in (signal_int_dspin_p2m_g2l_c); |
---|
539 | int_xbar_p2m_c->p_local_out[0] (signal_int_dspin_p2m_memc); |
---|
540 | for (size_t p = 0; p < nb_procs; p++) |
---|
541 | int_xbar_p2m_c->p_local_in[p] (signal_int_dspin_p2m_proc[p]); |
---|
542 | |
---|
543 | //////////////////////////////////// Processors |
---|
544 | for (size_t p = 0; p < nb_procs; p++) |
---|
545 | { |
---|
546 | proc[p]->p_clk (this->p_clk); |
---|
547 | proc[p]->p_resetn (this->p_resetn); |
---|
548 | proc[p]->p_vci (signal_int_vci_ini_proc[p]); |
---|
549 | proc[p]->p_dspin_in (signal_int_dspin_m2p_proc[p]); |
---|
550 | proc[p]->p_dspin_out (signal_int_dspin_p2m_proc[p]); |
---|
551 | proc[p]->p_irq[0] (signal_proc_it[p]); |
---|
552 | for ( size_t j = 1 ; j < 6 ; j++) |
---|
553 | { |
---|
554 | proc[p]->p_irq[j] (signal_false); |
---|
555 | } |
---|
556 | |
---|
557 | proc_wi[p]->p_clk (this->p_clk); |
---|
558 | proc_wi[p]->p_resetn (this->p_resetn); |
---|
559 | proc_wi[p]->p_dspin_cmd (signal_int_dspin_cmd_proc_i[p]); |
---|
560 | proc_wi[p]->p_dspin_rsp (signal_int_dspin_rsp_proc_i[p]); |
---|
561 | proc_wi[p]->p_vci (signal_int_vci_ini_proc[p]); |
---|
562 | } |
---|
563 | |
---|
564 | ///////////////////////////////////// XICU |
---|
565 | xicu->p_clk (this->p_clk); |
---|
566 | xicu->p_resetn (this->p_resetn); |
---|
567 | xicu->p_vci (signal_int_vci_tgt_xicu); |
---|
568 | for ( size_t p=0 ; p<nb_procs ; p++) |
---|
569 | { |
---|
570 | xicu->p_irq[p] (signal_proc_it[p]); |
---|
571 | } |
---|
572 | for ( size_t i=0 ; i<4 ; i++) |
---|
573 | { |
---|
574 | xicu->p_hwi[i] (signal_irq_mdma[i]); |
---|
575 | } |
---|
576 | for ( size_t i=4 ; i<32 ; i++) |
---|
577 | { |
---|
578 | if (cluster_id == cluster_iob0) |
---|
579 | xicu->p_hwi[i] (*(this->p_irq[i])); |
---|
580 | else |
---|
581 | xicu->p_hwi[i] (signal_false); |
---|
582 | } |
---|
583 | |
---|
584 | // wrapper XICU |
---|
585 | xicu_int_wt->p_clk (this->p_clk); |
---|
586 | xicu_int_wt->p_resetn (this->p_resetn); |
---|
587 | xicu_int_wt->p_dspin_cmd (signal_int_dspin_cmd_xicu_t); |
---|
588 | xicu_int_wt->p_dspin_rsp (signal_int_dspin_rsp_xicu_t); |
---|
589 | xicu_int_wt->p_vci (signal_int_vci_tgt_xicu); |
---|
590 | |
---|
591 | ///////////////////////////////////// MEMC |
---|
592 | memc->p_clk (this->p_clk); |
---|
593 | memc->p_resetn (this->p_resetn); |
---|
594 | memc->p_vci_ixr (signal_ram_vci_ini_memc); |
---|
595 | memc->p_vci_tgt (signal_int_vci_tgt_memc); |
---|
596 | memc->p_dspin_in (signal_int_dspin_p2m_memc); |
---|
597 | memc->p_dspin_out (signal_int_dspin_m2p_memc); |
---|
598 | |
---|
599 | // wrapper to INT network |
---|
600 | memc_int_wt->p_clk (this->p_clk); |
---|
601 | memc_int_wt->p_resetn (this->p_resetn); |
---|
602 | memc_int_wt->p_dspin_cmd (signal_int_dspin_cmd_memc_t); |
---|
603 | memc_int_wt->p_dspin_rsp (signal_int_dspin_rsp_memc_t); |
---|
604 | memc_int_wt->p_vci (signal_int_vci_tgt_memc); |
---|
605 | |
---|
606 | // wrapper to RAM network |
---|
607 | memc_ram_wi->p_clk (this->p_clk); |
---|
608 | memc_ram_wi->p_resetn (this->p_resetn); |
---|
609 | memc_ram_wi->p_dspin_cmd (signal_ram_dspin_cmd_memc_i); |
---|
610 | memc_ram_wi->p_dspin_rsp (signal_ram_dspin_rsp_memc_i); |
---|
611 | memc_ram_wi->p_vci (signal_ram_vci_ini_memc); |
---|
612 | |
---|
613 | //////////////////////////////////// XRAM |
---|
614 | xram->p_clk (this->p_clk); |
---|
615 | xram->p_resetn (this->p_resetn); |
---|
616 | xram->p_vci (signal_ram_vci_tgt_xram); |
---|
617 | |
---|
618 | // wrapper to RAM network |
---|
619 | xram_ram_wt->p_clk (this->p_clk); |
---|
620 | xram_ram_wt->p_resetn (this->p_resetn); |
---|
621 | xram_ram_wt->p_dspin_cmd (signal_ram_dspin_cmd_xram_t); |
---|
622 | xram_ram_wt->p_dspin_rsp (signal_ram_dspin_rsp_xram_t); |
---|
623 | xram_ram_wt->p_vci (signal_ram_vci_tgt_xram); |
---|
624 | |
---|
625 | /////////////////////////////////// MDMA |
---|
626 | mdma->p_clk (this->p_clk); |
---|
627 | mdma->p_resetn (this->p_resetn); |
---|
628 | mdma->p_vci_target (signal_int_vci_tgt_mdma); |
---|
629 | mdma->p_vci_initiator (signal_int_vci_ini_mdma); |
---|
630 | for (size_t i=0 ; i<nb_dmas ; i++) |
---|
631 | mdma->p_irq[i] (signal_irq_mdma[i]); |
---|
632 | |
---|
633 | // target wrapper |
---|
634 | mdma_int_wt->p_clk (this->p_clk); |
---|
635 | mdma_int_wt->p_resetn (this->p_resetn); |
---|
636 | mdma_int_wt->p_dspin_cmd (signal_int_dspin_cmd_mdma_t); |
---|
637 | mdma_int_wt->p_dspin_rsp (signal_int_dspin_rsp_mdma_t); |
---|
638 | mdma_int_wt->p_vci (signal_int_vci_tgt_mdma); |
---|
639 | |
---|
640 | // initiator wrapper |
---|
641 | mdma_int_wi->p_clk (this->p_clk); |
---|
642 | mdma_int_wi->p_resetn (this->p_resetn); |
---|
643 | mdma_int_wi->p_dspin_cmd (signal_int_dspin_cmd_mdma_i); |
---|
644 | mdma_int_wi->p_dspin_rsp (signal_int_dspin_rsp_mdma_i); |
---|
645 | mdma_int_wi->p_vci (signal_int_vci_ini_mdma); |
---|
646 | |
---|
647 | // For the IO bridge and the RAM network components, the connexions |
---|
648 | // depend on cluster type: The vci_io_bridge and dspin_local_crossbar |
---|
649 | // components are only in cluster_iob0 & cluster_iob1 |
---|
650 | |
---|
651 | if ( (cluster_id != cluster_iob0) and (cluster_id != cluster_iob1) ) |
---|
652 | { |
---|
653 | // RAM network CMD & RSP routers |
---|
654 | ram_router_cmd->p_clk (this->p_clk); |
---|
655 | ram_router_cmd->p_resetn (this->p_resetn); |
---|
656 | ram_router_rsp->p_clk (this->p_clk); |
---|
657 | ram_router_rsp->p_resetn (this->p_resetn); |
---|
658 | for( size_t n=0 ; n<4 ; n++) |
---|
659 | { |
---|
660 | ram_router_cmd->p_out[n] (this->p_dspin_ram_cmd_out[n]); |
---|
661 | ram_router_cmd->p_in[n] (this->p_dspin_ram_cmd_in[n]); |
---|
662 | ram_router_rsp->p_out[n] (this->p_dspin_ram_rsp_out[n]); |
---|
663 | ram_router_rsp->p_in[n] (this->p_dspin_ram_rsp_in[n]); |
---|
664 | } |
---|
665 | ram_router_cmd->p_out[4] (signal_ram_dspin_cmd_xram_t); |
---|
666 | ram_router_cmd->p_in[4] (signal_ram_dspin_cmd_memc_i); |
---|
667 | ram_router_rsp->p_out[4] (signal_ram_dspin_rsp_memc_i); |
---|
668 | ram_router_rsp->p_in[4] (signal_ram_dspin_rsp_xram_t); |
---|
669 | } |
---|
670 | else // IO cluster |
---|
671 | { |
---|
672 | // IO bridge |
---|
673 | iob->p_clk (this->p_clk); |
---|
674 | iob->p_resetn (this->p_resetn); |
---|
675 | iob->p_vci_ini_iox (*(this->p_vci_iox_ini)); |
---|
676 | iob->p_vci_tgt_iox (*(this->p_vci_iox_tgt)); |
---|
677 | iob->p_vci_tgt_int (signal_int_vci_tgt_iobx); |
---|
678 | iob->p_vci_ini_int (signal_int_vci_ini_iobx); |
---|
679 | iob->p_vci_ini_ram (signal_ram_vci_ini_iobx); |
---|
680 | if ( cluster_id == cluster_iob0 ) |
---|
681 | for ( size_t n=0 ; n<32 ; n++ ) |
---|
682 | iob->p_irq[n]->bind (*(this->p_irq[n])); |
---|
683 | |
---|
684 | // initiator wrapper to RAM network |
---|
685 | iob_ram_wi->p_clk (this->p_clk); |
---|
686 | iob_ram_wi->p_resetn (this->p_resetn); |
---|
687 | iob_ram_wi->p_dspin_cmd (signal_ram_dspin_cmd_iobx_i); |
---|
688 | iob_ram_wi->p_dspin_rsp (signal_ram_dspin_rsp_iobx_i); |
---|
689 | iob_ram_wi->p_vci (signal_ram_vci_ini_iobx); |
---|
690 | |
---|
691 | // initiator wrapper to INT network |
---|
692 | iob_int_wi->p_clk (this->p_clk); |
---|
693 | iob_int_wi->p_resetn (this->p_resetn); |
---|
694 | iob_int_wi->p_dspin_cmd (signal_int_dspin_cmd_iobx_i); |
---|
695 | iob_int_wi->p_dspin_rsp (signal_int_dspin_rsp_iobx_i); |
---|
696 | iob_int_wi->p_vci (signal_int_vci_ini_iobx); |
---|
697 | |
---|
698 | // target wrapper to INT network |
---|
699 | iob_int_wt->p_clk (this->p_clk); |
---|
700 | iob_int_wt->p_resetn (this->p_resetn); |
---|
701 | iob_int_wt->p_dspin_cmd (signal_int_dspin_cmd_iobx_t); |
---|
702 | iob_int_wt->p_dspin_rsp (signal_int_dspin_rsp_iobx_t); |
---|
703 | iob_int_wt->p_vci (signal_int_vci_tgt_iobx); |
---|
704 | |
---|
705 | // RAM network CMD local crossbar |
---|
706 | ram_xbar_cmd->p_clk (this->p_clk); |
---|
707 | ram_xbar_cmd->p_resetn (this->p_resetn); |
---|
708 | ram_xbar_cmd->p_global_out (signal_ram_dspin_cmd_l2g); |
---|
709 | ram_xbar_cmd->p_global_in (signal_ram_dspin_cmd_g2l); |
---|
710 | ram_xbar_cmd->p_local_in[0] (signal_ram_dspin_cmd_memc_i); |
---|
711 | ram_xbar_cmd->p_local_in[1] (signal_ram_dspin_cmd_iobx_i); |
---|
712 | ram_xbar_cmd->p_local_out[0] (signal_ram_dspin_cmd_xram_t); |
---|
713 | |
---|
714 | // RAM network RSP local crossbar |
---|
715 | ram_xbar_rsp->p_clk (this->p_clk); |
---|
716 | ram_xbar_rsp->p_resetn (this->p_resetn); |
---|
717 | ram_xbar_rsp->p_global_out (signal_ram_dspin_rsp_l2g); |
---|
718 | ram_xbar_rsp->p_global_in (signal_ram_dspin_rsp_g2l); |
---|
719 | ram_xbar_rsp->p_local_in[0] (signal_ram_dspin_rsp_xram_t); |
---|
720 | ram_xbar_rsp->p_local_out[0] (signal_ram_dspin_rsp_memc_i); |
---|
721 | ram_xbar_rsp->p_local_out[1] (signal_ram_dspin_rsp_iobx_i); |
---|
722 | |
---|
723 | // RAM network CMD & RSP routers |
---|
724 | ram_router_cmd->p_clk (this->p_clk); |
---|
725 | ram_router_cmd->p_resetn (this->p_resetn); |
---|
726 | ram_router_rsp->p_clk (this->p_clk); |
---|
727 | ram_router_rsp->p_resetn (this->p_resetn); |
---|
728 | for( size_t n=0 ; n<4 ; n++) |
---|
729 | { |
---|
730 | ram_router_cmd->p_out[n] (this->p_dspin_ram_cmd_out[n]); |
---|
731 | ram_router_cmd->p_in[n] (this->p_dspin_ram_cmd_in[n]); |
---|
732 | ram_router_rsp->p_out[n] (this->p_dspin_ram_rsp_out[n]); |
---|
733 | ram_router_rsp->p_in[n] (this->p_dspin_ram_rsp_in[n]); |
---|
734 | } |
---|
735 | ram_router_cmd->p_out[4] (signal_ram_dspin_cmd_g2l); |
---|
736 | ram_router_cmd->p_in[4] (signal_ram_dspin_cmd_l2g); |
---|
737 | ram_router_rsp->p_out[4] (signal_ram_dspin_rsp_g2l); |
---|
738 | ram_router_rsp->p_in[4] (signal_ram_dspin_rsp_l2g); |
---|
739 | } |
---|
740 | |
---|
741 | } // end constructor |
---|
742 | |
---|
743 | }} |
---|
744 | |
---|
745 | |
---|
746 | // Local Variables: |
---|
747 | // tab-width: 3 |
---|
748 | // c-basic-offset: 3 |
---|
749 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
---|
750 | // indent-tabs-mode: nil |
---|
751 | // End: |
---|
752 | |
---|
753 | // vim: filetype=cpp:expandtab:shiftwidth=3:tabstop=3:softtabstop=3 |
---|
754 | |
---|
755 | |
---|
756 | |
---|