source: branches/v5/platforms/tsarv5_generic_mmu/tsarv5_cluster_mmu/caba/source/src/tsarv5_cluster_mmu.cpp @ 345

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

Introducing the cluster component in tsarv5_generic_mmu platform.

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