1 | ////////////////////////////////////////////////////////////////////////////// |
---|
2 | // File: tsar_xbar_cluster.cpp |
---|
3 | // Author: Alain Greiner |
---|
4 | // Copyright: UPMC/LIP6 |
---|
5 | // Date : march 2011 |
---|
6 | // This program is released under the GNU public license |
---|
7 | ////////////////////////////////////////////////////////////////////////////// |
---|
8 | // This file define a TSAR cluster architecture with virtual memory: |
---|
9 | // - It uses two virtual_dspin_router as distributed global interconnect |
---|
10 | // - It uses four dspin_local_crossbar as local interconnect |
---|
11 | // - It uses the vci_cc_vcache_wrapper |
---|
12 | // - It uses the vci_mem_cache |
---|
13 | // - It contains a private RAM with a variable latency to emulate the L3 cache |
---|
14 | // - It can contains 1, 2 or 4 processors |
---|
15 | // - Each processor has a private dma channel (vci_multi_dma) |
---|
16 | // - It uses the vci_xicu interrupt controller |
---|
17 | // - The peripherals MTTY, BDEV, FBUF, MNIC and BROM are in cluster (0,0) |
---|
18 | // - The Multi-TTY component controls up to 15 terminals. |
---|
19 | // - Each Multi-DMA component controls up to 8 DMA channels. |
---|
20 | // - The DMA IRQs are connected to IRQ_IN[8]...IRQ_IN[15] |
---|
21 | // - The TTY IRQs are connected to IRQ_IN[16]...IRQ_IN[30] |
---|
22 | // - The BDEV IRQ is connected to IRQ_IN[31] |
---|
23 | ////////////////////////////////////////////////////////////////////////////////// |
---|
24 | |
---|
25 | #include "../include/tsar_xbar_cluster.h" |
---|
26 | |
---|
27 | |
---|
28 | namespace soclib { |
---|
29 | namespace caba { |
---|
30 | |
---|
31 | //////////////////////////////////////////////////////////////////////////////////// |
---|
32 | template<size_t dspin_cmd_width, |
---|
33 | size_t dspin_rsp_width, |
---|
34 | typename vci_param_int, |
---|
35 | typename vci_param_ext> TsarXbarCluster<dspin_cmd_width, |
---|
36 | dspin_rsp_width, |
---|
37 | vci_param_int, |
---|
38 | vci_param_ext>::TsarXbarCluster( |
---|
39 | //////////////////////////////////////////////////////////////////////////////////// |
---|
40 | sc_module_name insname, |
---|
41 | size_t nb_procs, |
---|
42 | size_t nb_ttys, |
---|
43 | size_t nb_dmas, |
---|
44 | size_t x_id, |
---|
45 | size_t y_id, |
---|
46 | size_t cluster_id, |
---|
47 | const soclib::common::MappingTable &mtd, |
---|
48 | const soclib::common::MappingTable &mtx, |
---|
49 | size_t x_width, |
---|
50 | size_t y_width, |
---|
51 | size_t l_width, |
---|
52 | size_t tgtid_memc, |
---|
53 | size_t tgtid_xicu, |
---|
54 | size_t tgtid_mdma, |
---|
55 | size_t tgtid_fbuf, |
---|
56 | size_t tgtid_mtty, |
---|
57 | size_t tgtid_brom, |
---|
58 | size_t tgtid_mnic, |
---|
59 | size_t tgtid_bdev, |
---|
60 | size_t memc_ways, |
---|
61 | size_t memc_sets, |
---|
62 | size_t l1_i_ways, |
---|
63 | size_t l1_i_sets, |
---|
64 | size_t l1_d_ways, |
---|
65 | size_t l1_d_sets, |
---|
66 | size_t xram_latency, |
---|
67 | bool io, |
---|
68 | size_t xfb, |
---|
69 | size_t yfb, |
---|
70 | char* disk_name, |
---|
71 | size_t block_size, |
---|
72 | size_t nic_channels, |
---|
73 | char* nic_rx_name, |
---|
74 | char* nic_tx_name, |
---|
75 | uint32_t nic_timeout, |
---|
76 | const Loader &loader, |
---|
77 | uint32_t frozen_cycles, |
---|
78 | uint32_t debug_start_cycle, |
---|
79 | bool memc_debug_ok, |
---|
80 | bool proc_debug_ok) |
---|
81 | : soclib::caba::BaseModule(insname), |
---|
82 | p_clk("clk"), |
---|
83 | p_resetn("resetn") |
---|
84 | |
---|
85 | { |
---|
86 | // Vectors of ports definition |
---|
87 | p_cmd_in = alloc_elems<DspinInput<dspin_cmd_width> >("p_cmd_in", 4, 2); |
---|
88 | p_cmd_out = alloc_elems<DspinOutput<dspin_cmd_width> >("p_cmd_out", 4, 2); |
---|
89 | p_rsp_in = alloc_elems<DspinInput<dspin_rsp_width> >("p_rsp_in", 4, 2); |
---|
90 | p_rsp_out = alloc_elems<DspinOutput<dspin_rsp_width> >("p_rsp_out", 4, 2); |
---|
91 | |
---|
92 | ///////////////////////////////////////////////////////////////////////////// |
---|
93 | // Components definition |
---|
94 | ///////////////////////////////////////////////////////////////////////////// |
---|
95 | |
---|
96 | for (size_t p = 0; p < nb_procs; p++) |
---|
97 | { |
---|
98 | std::ostringstream sproc; |
---|
99 | sproc << "proc_" << x_id << "_" << y_id << "_" << p; |
---|
100 | proc[p] = new VciCcVCacheWrapper<vci_param_int, |
---|
101 | dspin_cmd_width, |
---|
102 | dspin_rsp_width, |
---|
103 | GdbServer<Mips32ElIss> >( |
---|
104 | sproc.str().c_str(), |
---|
105 | cluster_id*nb_procs + p, // GLOBAL PROC_ID |
---|
106 | mtd, // Mapping Table |
---|
107 | IntTab(cluster_id,p), // SRCID |
---|
108 | (cluster_id << l_width) + p, // CC_GLOBAL_ID |
---|
109 | 8, // ITLB ways |
---|
110 | 8, // ITLB sets |
---|
111 | 8, // DTLB ways |
---|
112 | 8, // DTLB sets |
---|
113 | l1_i_ways,l1_i_sets,16, // ICACHE size |
---|
114 | l1_d_ways,l1_d_sets,16, // DCACHE size |
---|
115 | 4, // WBUF nlines |
---|
116 | 4, // WBUF nwords |
---|
117 | x_width, |
---|
118 | y_width, |
---|
119 | frozen_cycles, // max frozen cycles |
---|
120 | debug_start_cycle, |
---|
121 | proc_debug_ok); |
---|
122 | |
---|
123 | std::ostringstream swip; |
---|
124 | swip << "wi_proc_" << x_id << "_" << y_id << "_" << p; |
---|
125 | wi_proc[p] = new VciDspinInitiatorWrapper<vci_param_int, |
---|
126 | dspin_cmd_width, |
---|
127 | dspin_rsp_width>( |
---|
128 | swip.str().c_str(), |
---|
129 | x_width + y_width + l_width); |
---|
130 | } |
---|
131 | |
---|
132 | ///////////////////////////////////////////////////////////////////////////// |
---|
133 | std::ostringstream smemc; |
---|
134 | smemc << "memc_" << x_id << "_" << y_id; |
---|
135 | memc = new VciMemCache<vci_param_int, |
---|
136 | vci_param_ext, |
---|
137 | dspin_rsp_width, |
---|
138 | dspin_cmd_width>( |
---|
139 | smemc.str().c_str(), |
---|
140 | mtd, // Mapping Table direct space |
---|
141 | mtx, // Mapping Table external space |
---|
142 | IntTab(cluster_id), // SRCID external space |
---|
143 | IntTab(cluster_id, tgtid_memc), // TGTID direct space |
---|
144 | (cluster_id << l_width) + nb_procs, // CC_GLOBAL_ID |
---|
145 | memc_ways, memc_sets, 16, // CACHE SIZE |
---|
146 | 3, // MAX NUMBER OF COPIES |
---|
147 | 4096, // HEAP SIZE |
---|
148 | 8, // TRANSACTION TABLE DEPTH |
---|
149 | 8, // UPDATE TABLE DEPTH |
---|
150 | debug_start_cycle, |
---|
151 | memc_debug_ok ); |
---|
152 | |
---|
153 | wt_memc = new VciDspinTargetWrapper<vci_param_int, |
---|
154 | dspin_cmd_width, |
---|
155 | dspin_rsp_width>( |
---|
156 | "wt_memc", |
---|
157 | x_width + y_width + l_width); |
---|
158 | |
---|
159 | ///////////////////////////////////////////////////////////////////////////// |
---|
160 | std::ostringstream sxram; |
---|
161 | sxram << "xram_" << x_id << "_" << y_id; |
---|
162 | xram = new VciSimpleRam<vci_param_ext>( |
---|
163 | sxram.str().c_str(), |
---|
164 | IntTab(cluster_id), |
---|
165 | mtx, |
---|
166 | loader, |
---|
167 | xram_latency); |
---|
168 | |
---|
169 | ///////////////////////////////////////////////////////////////////////////// |
---|
170 | std::ostringstream sxicu; |
---|
171 | sxicu << "xicu_" << x_id << "_" << y_id; |
---|
172 | xicu = new VciXicu<vci_param_int>( |
---|
173 | sxicu.str().c_str(), |
---|
174 | mtd, // mapping table |
---|
175 | IntTab(cluster_id, tgtid_xicu), // TGTID_D |
---|
176 | nb_procs, // number of timer IRQs |
---|
177 | 32, // number of hard IRQs |
---|
178 | 32, // number of soft IRQs |
---|
179 | nb_procs); // number of output IRQs |
---|
180 | |
---|
181 | wt_xicu = new VciDspinTargetWrapper<vci_param_int, |
---|
182 | dspin_cmd_width, |
---|
183 | dspin_rsp_width>( |
---|
184 | "wt_xicu", |
---|
185 | x_width + y_width + l_width); |
---|
186 | |
---|
187 | ///////////////////////////////////////////////////////////////////////////// |
---|
188 | std::ostringstream smdma; |
---|
189 | smdma << "mdma_" << x_id << "_" << y_id; |
---|
190 | mdma = new VciMultiDma<vci_param_int>( |
---|
191 | smdma.str().c_str(), |
---|
192 | mtd, |
---|
193 | IntTab(cluster_id, nb_procs), // SRCID |
---|
194 | IntTab(cluster_id, tgtid_mdma), // TGTID |
---|
195 | 64, // burst size |
---|
196 | nb_dmas); // number of IRQs |
---|
197 | |
---|
198 | wt_mdma = new VciDspinTargetWrapper<vci_param_int, |
---|
199 | dspin_cmd_width, |
---|
200 | dspin_rsp_width>( |
---|
201 | "wt_mdma", |
---|
202 | x_width + y_width + l_width); |
---|
203 | |
---|
204 | wi_mdma = new VciDspinInitiatorWrapper<vci_param_int, |
---|
205 | dspin_cmd_width, |
---|
206 | dspin_rsp_width>( |
---|
207 | "wi_mdma", |
---|
208 | x_width + y_width + l_width); |
---|
209 | |
---|
210 | ///////////////////////////////////////////////////////////////////////////// |
---|
211 | size_t nb_direct_initiators = nb_procs + 1; |
---|
212 | size_t nb_direct_targets = 3; |
---|
213 | if ( io ) |
---|
214 | { |
---|
215 | nb_direct_initiators = nb_procs + 2; |
---|
216 | nb_direct_targets = 8; |
---|
217 | } |
---|
218 | |
---|
219 | xbar_cmd_d = new DspinLocalCrossbar<dspin_cmd_width>( |
---|
220 | "xbar_cmd_d", |
---|
221 | mtd, // mapping table |
---|
222 | x_id, y_id, // cluster coordinates |
---|
223 | x_width, y_width, l_width, |
---|
224 | nb_direct_initiators, // number of local of sources |
---|
225 | nb_direct_targets, // number of local dests |
---|
226 | 2, 2, // fifo depths |
---|
227 | true, // CMD |
---|
228 | true, // use local routing table |
---|
229 | false ); // no broadcast |
---|
230 | |
---|
231 | ///////////////////////////////////////////////////////////////////////////// |
---|
232 | xbar_rsp_d = new DspinLocalCrossbar<dspin_rsp_width>( |
---|
233 | "xbar_rsp_d", |
---|
234 | mtd, // mapping table |
---|
235 | x_id, y_id, // cluster coordinates |
---|
236 | x_width, y_width, l_width, |
---|
237 | nb_direct_targets, // number of local sources |
---|
238 | nb_direct_initiators, // number of local dests |
---|
239 | 2, 2, // fifo depths |
---|
240 | false, // RSP |
---|
241 | false, // don't use local routing table |
---|
242 | false ); // no broadcast |
---|
243 | |
---|
244 | ///////////////////////////////////////////////////////////////////////////// |
---|
245 | xbar_m2p_c = new DspinLocalCrossbar<dspin_cmd_width>( |
---|
246 | "xbar_m2p_c", |
---|
247 | mtd, // mapping table |
---|
248 | x_id, y_id, // cluster coordinates |
---|
249 | x_width, y_width, l_width, |
---|
250 | 1, // number of local sources |
---|
251 | nb_procs, // number of local targets |
---|
252 | 2, 2, // fifo depths |
---|
253 | true, // CMD |
---|
254 | false, // don't use local routing table |
---|
255 | true ); // broadcast |
---|
256 | |
---|
257 | ///////////////////////////////////////////////////////////////////////////// |
---|
258 | xbar_p2m_c = new DspinLocalCrossbar<dspin_rsp_width>( |
---|
259 | "xbar_p2m_c", |
---|
260 | mtd, // mapping table |
---|
261 | x_id, y_id, // cluster coordinates |
---|
262 | x_width, y_width, 0, // l_width unused on p2m network |
---|
263 | nb_procs, // number of local sources |
---|
264 | 1, // number of local dests |
---|
265 | 2, 2, // fifo depths |
---|
266 | false, // RSP |
---|
267 | false, // don't use local routing table |
---|
268 | false ); // no broadcast |
---|
269 | |
---|
270 | ///////////////////////////////////////////////////////////////////////////// |
---|
271 | router_cmd = new VirtualDspinRouter<dspin_cmd_width>( |
---|
272 | "router_cmd", |
---|
273 | x_id,y_id, // coordinate in the mesh |
---|
274 | x_width, y_width, // x & y fields width |
---|
275 | 2, // nb virtual channels |
---|
276 | 4,4); // input & output fifo depths |
---|
277 | |
---|
278 | ///////////////////////////////////////////////////////////////////////////// |
---|
279 | router_rsp = new VirtualDspinRouter<dspin_rsp_width>( |
---|
280 | "router_rsp", |
---|
281 | x_id,y_id, // coordinates in mesh |
---|
282 | x_width, y_width, // x & y fields width |
---|
283 | 2, // nb virtual channels |
---|
284 | 4,4); // input & output fifo depths |
---|
285 | |
---|
286 | // IO cluster components |
---|
287 | if ( io ) |
---|
288 | { |
---|
289 | ///////////////////////////////////////////// |
---|
290 | brom = new VciSimpleRom<vci_param_int>( |
---|
291 | "brom", |
---|
292 | IntTab(cluster_id, tgtid_brom), |
---|
293 | mtd, |
---|
294 | loader); |
---|
295 | |
---|
296 | wt_brom = new VciDspinTargetWrapper<vci_param_int, |
---|
297 | dspin_cmd_width, |
---|
298 | dspin_rsp_width>( |
---|
299 | "wt_brom", |
---|
300 | x_width + y_width + l_width); |
---|
301 | |
---|
302 | ///////////////////////////////////////////// |
---|
303 | fbuf = new VciFrameBuffer<vci_param_int>( |
---|
304 | "fbuf", |
---|
305 | IntTab(cluster_id, tgtid_fbuf), |
---|
306 | mtd, |
---|
307 | xfb, yfb); |
---|
308 | |
---|
309 | wt_fbuf = new VciDspinTargetWrapper<vci_param_int, |
---|
310 | dspin_cmd_width, |
---|
311 | dspin_rsp_width>( |
---|
312 | "wt_fbuf", |
---|
313 | x_width + y_width + l_width); |
---|
314 | |
---|
315 | ///////////////////////////////////////////// |
---|
316 | bdev = new VciBlockDeviceTsar<vci_param_int>( |
---|
317 | "bdev", |
---|
318 | mtd, |
---|
319 | IntTab(cluster_id, nb_procs+1), |
---|
320 | IntTab(cluster_id, tgtid_bdev), |
---|
321 | disk_name, |
---|
322 | block_size, |
---|
323 | 64); // burst size |
---|
324 | |
---|
325 | wt_bdev = new VciDspinTargetWrapper<vci_param_int, |
---|
326 | dspin_cmd_width, |
---|
327 | dspin_rsp_width>( |
---|
328 | "wt_bdev", |
---|
329 | x_width + y_width + l_width); |
---|
330 | |
---|
331 | wi_bdev = new VciDspinInitiatorWrapper<vci_param_int, |
---|
332 | dspin_cmd_width, |
---|
333 | dspin_rsp_width>( |
---|
334 | "wi_bdev", |
---|
335 | x_width + y_width + l_width); |
---|
336 | |
---|
337 | ///////////////////////////////////////////// |
---|
338 | mnic = new VciMultiNic<vci_param_int>( |
---|
339 | "mnic", |
---|
340 | IntTab(cluster_id, tgtid_mnic), |
---|
341 | mtd, |
---|
342 | nic_channels, |
---|
343 | nic_rx_name, |
---|
344 | nic_tx_name, |
---|
345 | 0, // mac_4 address |
---|
346 | 0 ); // mac_2 address |
---|
347 | |
---|
348 | wt_mnic = new VciDspinTargetWrapper<vci_param_int, |
---|
349 | dspin_cmd_width, |
---|
350 | dspin_rsp_width>( |
---|
351 | "wt_mnic", |
---|
352 | x_width + y_width + l_width); |
---|
353 | |
---|
354 | ///////////////////////////////////////////// |
---|
355 | std::vector<std::string> vect_names; |
---|
356 | for( size_t tid = 0 ; tid < (nb_ttys) ; tid++ ) |
---|
357 | { |
---|
358 | std::ostringstream term_name; |
---|
359 | term_name << "term" << tid; |
---|
360 | vect_names.push_back(term_name.str().c_str()); |
---|
361 | } |
---|
362 | mtty = new VciMultiTty<vci_param_int>( |
---|
363 | "mtty", |
---|
364 | IntTab(cluster_id, tgtid_mtty), |
---|
365 | mtd, |
---|
366 | vect_names); |
---|
367 | |
---|
368 | wt_mtty = new VciDspinTargetWrapper<vci_param_int, |
---|
369 | dspin_cmd_width, |
---|
370 | dspin_rsp_width>( |
---|
371 | "wt_mtty", |
---|
372 | x_width + y_width + l_width); |
---|
373 | } |
---|
374 | |
---|
375 | //////////////////////////////////// |
---|
376 | // Connections are defined here |
---|
377 | //////////////////////////////////// |
---|
378 | |
---|
379 | //////////////////////// CMD ROUTER and RSP ROUTER |
---|
380 | router_cmd->p_clk (this->p_clk); |
---|
381 | router_cmd->p_resetn (this->p_resetn); |
---|
382 | router_rsp->p_clk (this->p_clk); |
---|
383 | router_rsp->p_resetn (this->p_resetn); |
---|
384 | |
---|
385 | for(int i = 0; i < 4; i++) |
---|
386 | { |
---|
387 | for (int k = 0; k < 2; k++) |
---|
388 | { |
---|
389 | router_cmd->p_out[i][k] (this->p_cmd_out[i][k]); |
---|
390 | router_cmd->p_in[i][k] (this->p_cmd_in[i][k]); |
---|
391 | router_rsp->p_out[i][k] (this->p_rsp_out[i][k]); |
---|
392 | router_rsp->p_in[i][k] (this->p_rsp_in[i][k]); |
---|
393 | } |
---|
394 | } |
---|
395 | |
---|
396 | router_cmd->p_out[4][0] (signal_dspin_cmd_g2l_d); |
---|
397 | router_cmd->p_out[4][1] (signal_dspin_m2p_g2l_c); |
---|
398 | router_cmd->p_in[4][0] (signal_dspin_cmd_l2g_d); |
---|
399 | router_cmd->p_in[4][1] (signal_dspin_m2p_l2g_c); |
---|
400 | |
---|
401 | router_rsp->p_out[4][0] (signal_dspin_rsp_g2l_d); |
---|
402 | router_rsp->p_out[4][1] (signal_dspin_p2m_g2l_c); |
---|
403 | router_rsp->p_in[4][0] (signal_dspin_rsp_l2g_d); |
---|
404 | router_rsp->p_in[4][1] (signal_dspin_p2m_l2g_c); |
---|
405 | |
---|
406 | std::cout << " - CMD & RSP routers connected" << std::endl; |
---|
407 | |
---|
408 | ///////////////////// CMD DSPIN local crossbar direct |
---|
409 | xbar_cmd_d->p_clk (this->p_clk); |
---|
410 | xbar_cmd_d->p_resetn (this->p_resetn); |
---|
411 | xbar_cmd_d->p_global_out (signal_dspin_cmd_l2g_d); |
---|
412 | xbar_cmd_d->p_global_in (signal_dspin_cmd_g2l_d); |
---|
413 | |
---|
414 | xbar_cmd_d->p_local_out[tgtid_memc] (signal_dspin_cmd_memc_t); |
---|
415 | xbar_cmd_d->p_local_out[tgtid_xicu] (signal_dspin_cmd_xicu_t); |
---|
416 | xbar_cmd_d->p_local_out[tgtid_mdma] (signal_dspin_cmd_mdma_t); |
---|
417 | |
---|
418 | xbar_cmd_d->p_local_in[nb_procs] (signal_dspin_cmd_mdma_i); |
---|
419 | |
---|
420 | for (size_t p = 0; p < nb_procs; p++) |
---|
421 | xbar_cmd_d->p_local_in[p] (signal_dspin_cmd_proc_i[p]); |
---|
422 | |
---|
423 | if ( io ) |
---|
424 | { |
---|
425 | xbar_cmd_d->p_local_out[tgtid_mtty] (signal_dspin_cmd_mtty_t); |
---|
426 | xbar_cmd_d->p_local_out[tgtid_brom] (signal_dspin_cmd_brom_t); |
---|
427 | xbar_cmd_d->p_local_out[tgtid_bdev] (signal_dspin_cmd_bdev_t); |
---|
428 | xbar_cmd_d->p_local_out[tgtid_fbuf] (signal_dspin_cmd_fbuf_t); |
---|
429 | xbar_cmd_d->p_local_out[tgtid_mnic] (signal_dspin_cmd_mnic_t); |
---|
430 | |
---|
431 | xbar_cmd_d->p_local_in[nb_procs+1] (signal_dspin_cmd_bdev_i); |
---|
432 | } |
---|
433 | |
---|
434 | std::cout << " - Command Direct crossbar connected" << std::endl; |
---|
435 | |
---|
436 | //////////////////////// RSP DSPIN local crossbar direct |
---|
437 | xbar_rsp_d->p_clk (this->p_clk); |
---|
438 | xbar_rsp_d->p_resetn (this->p_resetn); |
---|
439 | xbar_rsp_d->p_global_out (signal_dspin_rsp_l2g_d); |
---|
440 | xbar_rsp_d->p_global_in (signal_dspin_rsp_g2l_d); |
---|
441 | |
---|
442 | xbar_rsp_d->p_local_in[tgtid_memc] (signal_dspin_rsp_memc_t); |
---|
443 | xbar_rsp_d->p_local_in[tgtid_xicu] (signal_dspin_rsp_xicu_t); |
---|
444 | xbar_rsp_d->p_local_in[tgtid_mdma] (signal_dspin_rsp_mdma_t); |
---|
445 | |
---|
446 | xbar_rsp_d->p_local_out[nb_procs] (signal_dspin_rsp_mdma_i); |
---|
447 | |
---|
448 | for (size_t p = 0; p < nb_procs; p++) |
---|
449 | xbar_rsp_d->p_local_out[p] (signal_dspin_rsp_proc_i[p]); |
---|
450 | |
---|
451 | if ( io ) |
---|
452 | { |
---|
453 | xbar_rsp_d->p_local_in[tgtid_mtty] (signal_dspin_rsp_mtty_t); |
---|
454 | xbar_rsp_d->p_local_in[tgtid_brom] (signal_dspin_rsp_brom_t); |
---|
455 | xbar_rsp_d->p_local_in[tgtid_bdev] (signal_dspin_rsp_bdev_t); |
---|
456 | xbar_rsp_d->p_local_in[tgtid_fbuf] (signal_dspin_rsp_fbuf_t); |
---|
457 | xbar_rsp_d->p_local_in[tgtid_mnic] (signal_dspin_rsp_mnic_t); |
---|
458 | |
---|
459 | xbar_rsp_d->p_local_out[nb_procs+1] (signal_dspin_rsp_bdev_i); |
---|
460 | } |
---|
461 | |
---|
462 | std::cout << " - Response Direct crossbar connected" << std::endl; |
---|
463 | |
---|
464 | ////////////////////// M2P DSPIN local crossbar coherence |
---|
465 | xbar_m2p_c->p_clk (this->p_clk); |
---|
466 | xbar_m2p_c->p_resetn (this->p_resetn); |
---|
467 | xbar_m2p_c->p_global_out (signal_dspin_m2p_l2g_c); |
---|
468 | xbar_m2p_c->p_global_in (signal_dspin_m2p_g2l_c); |
---|
469 | xbar_m2p_c->p_local_in[0] (signal_dspin_m2p_memc); |
---|
470 | for (size_t p = 0; p < nb_procs; p++) |
---|
471 | xbar_m2p_c->p_local_out[p] (signal_dspin_m2p_proc[p]); |
---|
472 | |
---|
473 | std::cout << " - M2P Coherence crossbar connected" << std::endl; |
---|
474 | |
---|
475 | ////////////////////////// P2M DSPIN local crossbar coherence |
---|
476 | xbar_p2m_c->p_clk (this->p_clk); |
---|
477 | xbar_p2m_c->p_resetn (this->p_resetn); |
---|
478 | xbar_p2m_c->p_global_out (signal_dspin_p2m_l2g_c); |
---|
479 | xbar_p2m_c->p_global_in (signal_dspin_p2m_g2l_c); |
---|
480 | xbar_p2m_c->p_local_out[0] (signal_dspin_p2m_memc); |
---|
481 | for (size_t p = 0; p < nb_procs; p++) |
---|
482 | xbar_p2m_c->p_local_in[p] (signal_dspin_p2m_proc[p]); |
---|
483 | |
---|
484 | std::cout << " - P2M Coherence crossbar connected" << std::endl; |
---|
485 | |
---|
486 | |
---|
487 | //////////////////////////////////// Processors |
---|
488 | for (size_t p = 0; p < nb_procs; p++) |
---|
489 | { |
---|
490 | proc[p]->p_clk (this->p_clk); |
---|
491 | proc[p]->p_resetn (this->p_resetn); |
---|
492 | proc[p]->p_vci (signal_vci_ini_proc[p]); |
---|
493 | proc[p]->p_dspin_in (signal_dspin_m2p_proc[p]); |
---|
494 | proc[p]->p_dspin_out (signal_dspin_p2m_proc[p]); |
---|
495 | proc[p]->p_irq[0] (signal_proc_it[p]); |
---|
496 | for ( size_t j = 1 ; j < 6 ; j++) |
---|
497 | { |
---|
498 | proc[p]->p_irq[j] (signal_false); |
---|
499 | } |
---|
500 | |
---|
501 | wi_proc[p]->p_clk (this->p_clk); |
---|
502 | wi_proc[p]->p_resetn (this->p_resetn); |
---|
503 | wi_proc[p]->p_dspin_cmd (signal_dspin_cmd_proc_i[p]); |
---|
504 | wi_proc[p]->p_dspin_rsp (signal_dspin_rsp_proc_i[p]); |
---|
505 | wi_proc[p]->p_vci (signal_vci_ini_proc[p]); |
---|
506 | } |
---|
507 | |
---|
508 | std::cout << " - Processors connected" << std::endl; |
---|
509 | |
---|
510 | ///////////////////////////////////// XICU |
---|
511 | xicu->p_clk (this->p_clk); |
---|
512 | xicu->p_resetn (this->p_resetn); |
---|
513 | xicu->p_vci (signal_vci_tgt_xicu); |
---|
514 | for ( size_t p=0 ; p<nb_procs ; p++) |
---|
515 | { |
---|
516 | xicu->p_irq[p] (signal_proc_it[p]); |
---|
517 | } |
---|
518 | for ( size_t i=0 ; i<32 ; i++) |
---|
519 | { |
---|
520 | if ( io ) // I/O cluster |
---|
521 | { |
---|
522 | if (i < 8) xicu->p_hwi[i] (signal_false); |
---|
523 | else if (i < (8 + nb_dmas)) xicu->p_hwi[i] (signal_irq_mdma[i-8]); |
---|
524 | else if (i < 16) xicu->p_hwi[i] (signal_false); |
---|
525 | else if (i < (16 + nb_ttys)) xicu->p_hwi[i] (signal_irq_mtty[i-16]); |
---|
526 | else if (i < 31) xicu->p_hwi[i] (signal_false); |
---|
527 | else xicu->p_hwi[i] (signal_irq_bdev); |
---|
528 | } |
---|
529 | else // other clusters |
---|
530 | { |
---|
531 | if (i < 8) xicu->p_hwi[i] (signal_false); |
---|
532 | else if (i < (8 + nb_dmas)) xicu->p_hwi[i] (signal_irq_mdma[i-8]); |
---|
533 | else xicu->p_hwi[i] (signal_false); |
---|
534 | } |
---|
535 | } |
---|
536 | |
---|
537 | // wrapper XICU |
---|
538 | wt_xicu->p_clk (this->p_clk); |
---|
539 | wt_xicu->p_resetn (this->p_resetn); |
---|
540 | wt_xicu->p_dspin_cmd (signal_dspin_cmd_xicu_t); |
---|
541 | wt_xicu->p_dspin_rsp (signal_dspin_rsp_xicu_t); |
---|
542 | wt_xicu->p_vci (signal_vci_tgt_xicu); |
---|
543 | |
---|
544 | std::cout << " - XICU connected" << std::endl; |
---|
545 | |
---|
546 | //////////////////////////////////////////////// MEMC |
---|
547 | memc->p_clk (this->p_clk); |
---|
548 | memc->p_resetn (this->p_resetn); |
---|
549 | memc->p_vci_ixr (signal_vci_xram); |
---|
550 | memc->p_vci_tgt (signal_vci_tgt_memc); |
---|
551 | memc->p_dspin_in (signal_dspin_p2m_memc); |
---|
552 | memc->p_dspin_out (signal_dspin_m2p_memc); |
---|
553 | |
---|
554 | // wrapper MEMC |
---|
555 | wt_memc->p_clk (this->p_clk); |
---|
556 | wt_memc->p_resetn (this->p_resetn); |
---|
557 | wt_memc->p_dspin_cmd (signal_dspin_cmd_memc_t); |
---|
558 | wt_memc->p_dspin_rsp (signal_dspin_rsp_memc_t); |
---|
559 | wt_memc->p_vci (signal_vci_tgt_memc); |
---|
560 | |
---|
561 | std::cout << " - MEMC connected" << std::endl; |
---|
562 | |
---|
563 | /////////////////////////////////////////////// XRAM |
---|
564 | xram->p_clk (this->p_clk); |
---|
565 | xram->p_resetn (this->p_resetn); |
---|
566 | xram->p_vci (signal_vci_xram); |
---|
567 | |
---|
568 | std::cout << " - XRAM connected" << std::endl; |
---|
569 | |
---|
570 | ////////////////////////////////////////////// MDMA |
---|
571 | mdma->p_clk (this->p_clk); |
---|
572 | mdma->p_resetn (this->p_resetn); |
---|
573 | mdma->p_vci_target (signal_vci_tgt_mdma); |
---|
574 | mdma->p_vci_initiator (signal_vci_ini_mdma); |
---|
575 | for (size_t i=0 ; i<nb_dmas ; i++) |
---|
576 | mdma->p_irq[i] (signal_irq_mdma[i]); |
---|
577 | |
---|
578 | // wrapper tgt MDMA |
---|
579 | wt_mdma->p_clk (this->p_clk); |
---|
580 | wt_mdma->p_resetn (this->p_resetn); |
---|
581 | wt_mdma->p_dspin_cmd (signal_dspin_cmd_mdma_t); |
---|
582 | wt_mdma->p_dspin_rsp (signal_dspin_rsp_mdma_t); |
---|
583 | wt_mdma->p_vci (signal_vci_tgt_mdma); |
---|
584 | |
---|
585 | // wrapper ini MDMA |
---|
586 | wi_mdma->p_clk (this->p_clk); |
---|
587 | wi_mdma->p_resetn (this->p_resetn); |
---|
588 | wi_mdma->p_dspin_cmd (signal_dspin_cmd_mdma_i); |
---|
589 | wi_mdma->p_dspin_rsp (signal_dspin_rsp_mdma_i); |
---|
590 | wi_mdma->p_vci (signal_vci_ini_mdma); |
---|
591 | |
---|
592 | std::cout << " - MDMA connected" << std::endl; |
---|
593 | |
---|
594 | /////////////////////////////// Components in I/O cluster |
---|
595 | |
---|
596 | if ( io ) |
---|
597 | { |
---|
598 | // BDEV |
---|
599 | bdev->p_clk (this->p_clk); |
---|
600 | bdev->p_resetn (this->p_resetn); |
---|
601 | bdev->p_irq (signal_irq_bdev); |
---|
602 | bdev->p_vci_target (signal_vci_tgt_bdev); |
---|
603 | bdev->p_vci_initiator (signal_vci_ini_bdev); |
---|
604 | |
---|
605 | // wrapper tgt BDEV |
---|
606 | wt_bdev->p_clk (this->p_clk); |
---|
607 | wt_bdev->p_resetn (this->p_resetn); |
---|
608 | wt_bdev->p_dspin_cmd (signal_dspin_cmd_bdev_t); |
---|
609 | wt_bdev->p_dspin_rsp (signal_dspin_rsp_bdev_t); |
---|
610 | wt_bdev->p_vci (signal_vci_tgt_bdev); |
---|
611 | |
---|
612 | // wrapper ini BDEV |
---|
613 | wi_bdev->p_clk (this->p_clk); |
---|
614 | wi_bdev->p_resetn (this->p_resetn); |
---|
615 | wi_bdev->p_dspin_cmd (signal_dspin_cmd_bdev_i); |
---|
616 | wi_bdev->p_dspin_rsp (signal_dspin_rsp_bdev_i); |
---|
617 | wi_bdev->p_vci (signal_vci_ini_bdev); |
---|
618 | |
---|
619 | std::cout << " - BDEV connected" << std::endl; |
---|
620 | |
---|
621 | // FBUF |
---|
622 | fbuf->p_clk (this->p_clk); |
---|
623 | fbuf->p_resetn (this->p_resetn); |
---|
624 | fbuf->p_vci (signal_vci_tgt_fbuf); |
---|
625 | |
---|
626 | // wrapper tgt FBUF |
---|
627 | wt_fbuf->p_clk (this->p_clk); |
---|
628 | wt_fbuf->p_resetn (this->p_resetn); |
---|
629 | wt_fbuf->p_dspin_cmd (signal_dspin_cmd_fbuf_t); |
---|
630 | wt_fbuf->p_dspin_rsp (signal_dspin_rsp_fbuf_t); |
---|
631 | wt_fbuf->p_vci (signal_vci_tgt_fbuf); |
---|
632 | |
---|
633 | std::cout << " - FBUF connected" << std::endl; |
---|
634 | |
---|
635 | // MNIC |
---|
636 | mnic->p_clk (this->p_clk); |
---|
637 | mnic->p_resetn (this->p_resetn); |
---|
638 | mnic->p_vci (signal_vci_tgt_mnic); |
---|
639 | for ( size_t i=0 ; i<nic_channels ; i++ ) |
---|
640 | { |
---|
641 | mnic->p_rx_irq[i] (signal_irq_mnic_rx[i]); |
---|
642 | mnic->p_tx_irq[i] (signal_irq_mnic_tx[i]); |
---|
643 | } |
---|
644 | |
---|
645 | // wrapper tgt MNIC |
---|
646 | wt_mnic->p_clk (this->p_clk); |
---|
647 | wt_mnic->p_resetn (this->p_resetn); |
---|
648 | wt_mnic->p_dspin_cmd (signal_dspin_cmd_mnic_t); |
---|
649 | wt_mnic->p_dspin_rsp (signal_dspin_rsp_mnic_t); |
---|
650 | wt_mnic->p_vci (signal_vci_tgt_mnic); |
---|
651 | |
---|
652 | std::cout << " - MNIC connected" << std::endl; |
---|
653 | |
---|
654 | // BROM |
---|
655 | brom->p_clk (this->p_clk); |
---|
656 | brom->p_resetn (this->p_resetn); |
---|
657 | brom->p_vci (signal_vci_tgt_brom); |
---|
658 | |
---|
659 | // wrapper tgt BROM |
---|
660 | wt_brom->p_clk (this->p_clk); |
---|
661 | wt_brom->p_resetn (this->p_resetn); |
---|
662 | wt_brom->p_dspin_cmd (signal_dspin_cmd_brom_t); |
---|
663 | wt_brom->p_dspin_rsp (signal_dspin_rsp_brom_t); |
---|
664 | wt_brom->p_vci (signal_vci_tgt_brom); |
---|
665 | |
---|
666 | std::cout << " - BROM connected" << std::endl; |
---|
667 | |
---|
668 | // MTTY |
---|
669 | mtty->p_clk (this->p_clk); |
---|
670 | mtty->p_resetn (this->p_resetn); |
---|
671 | mtty->p_vci (signal_vci_tgt_mtty); |
---|
672 | for ( size_t i=0 ; i<nb_ttys ; i++ ) |
---|
673 | { |
---|
674 | mtty->p_irq[i] (signal_irq_mtty[i]); |
---|
675 | } |
---|
676 | |
---|
677 | // wrapper tgt MTTY |
---|
678 | wt_mtty->p_clk (this->p_clk); |
---|
679 | wt_mtty->p_resetn (this->p_resetn); |
---|
680 | wt_mtty->p_dspin_cmd (signal_dspin_cmd_mtty_t); |
---|
681 | wt_mtty->p_dspin_rsp (signal_dspin_rsp_mtty_t); |
---|
682 | wt_mtty->p_vci (signal_vci_tgt_mtty); |
---|
683 | |
---|
684 | std::cout << " - MTTY connected" << std::endl; |
---|
685 | } |
---|
686 | } // end constructor |
---|
687 | |
---|
688 | }} |
---|
689 | |
---|
690 | // Local Variables: |
---|
691 | // tab-width: 3 |
---|
692 | // c-basic-offset: 3 |
---|
693 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
---|
694 | // indent-tabs-mode: nil |
---|
695 | // End: |
---|
696 | |
---|
697 | // vim: filetype=cpp:expandtab:shiftwidth=3:tabstop=3:softtabstop=3 |
---|
698 | |
---|
699 | |
---|
700 | |
---|