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

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

Code polishing

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