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