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

Last change on this file since 389 was 389, checked in by cfuguet, 11 years ago

Modifying the tsar_generic_xbar:

  • Modifying the metadata and the sources of the tsar_xbar_cluster to support two differents VCI parameters (one for the DIRECT network and another for the EXTERNAL network).

The DIRECT network use 32 bits for VCI_DATA and the EXTERNAL network use
64 bits.

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