source: trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/src/tsar_xbar_cluster.cpp @ 396

Last change on this file since 396 was 396, checked in by alain, 11 years ago

Major evolution of platform "tsar_generic_xbar"
to support 40 bits physical addresse, and 64 bits data
between mem_cache and external RAM.

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