source: trunk/platforms/tsar_generic_iob/tsar_iob_cluster/caba/source/src/tsar_iob_cluster.cpp @ 584

Last change on this file since 584 was 584, checked in by alain, 10 years ago

cosmetic.

File size: 37.4 KB
Line 
1//////////////////////////////////////////////////////////////////////////////
2// File: tsar_iob_cluster.cpp
3// Author: Alain Greiner
4// Copyright: UPMC/LIP6
5// Date : april 2013
6// This program is released under the GNU public license
7//////////////////////////////////////////////////////////////////////////////
8// Cluster(0,0) & Cluster(xmax-1,ymax-1) contains the IOB0 & IOB1 components.
9// These two clusters contain 6 extra components:
10// - 1 vci_io_bridge (connected to the 3 networks.
11// - 3 vci_dspin_wrapper for the IOB.
12// - 2 dspin_local_crossbar for commands and responses.
13//////////////////////////////////////////////////////////////////////////////
14
15#include "../include/tsar_iob_cluster.h"
16
17namespace soclib { namespace caba  {
18
19//////////////////////////////////////////////////////////////////////////
20//                 Constructor
21//////////////////////////////////////////////////////////////////////////
22template<typename vci_param_int, 
23         typename vci_param_ext,
24         size_t   dspin_int_cmd_width, 
25         size_t   dspin_int_rsp_width,
26         size_t   dspin_ram_cmd_width, 
27         size_t   dspin_ram_rsp_width>
28TsarIobCluster<vci_param_int, 
29               vci_param_ext,
30               dspin_int_cmd_width, 
31               dspin_int_rsp_width,
32               dspin_ram_cmd_width, 
33               dspin_ram_rsp_width>::TsarIobCluster(
34//////////////////////////////////////////////////////////////////////////
35                    sc_module_name                     insname,
36                    size_t                             nb_procs,
37                    size_t                             nb_dmas,
38                    size_t                             x_id,
39                    size_t                             y_id,
40                    size_t                             xmax,
41                    size_t                             ymax,
42
43                    const soclib::common::MappingTable &mt_int,
44                    const soclib::common::MappingTable &mt_ram, 
45                    const soclib::common::MappingTable &mt_iox, 
46
47                    size_t                             x_width,
48                    size_t                             y_width,
49                    size_t                             l_width,
50
51                    size_t                             memc_int_tgtid,  // local index
52                    size_t                             xicu_int_tgtid,  // local index
53                    size_t                             mdma_int_tgtid,  // local index
54                    size_t                             iobx_int_tgtid,  // local index
55
56                    size_t                             proc_int_srcid,  // local index
57                    size_t                             mdma_int_srcid,  // local index
58                    size_t                             iobx_int_srcid,  // local index
59
60                    size_t                             xram_ram_tgtid,  // local index
61
62                    size_t                             memc_ram_srcid,  // local index
63                    size_t                             iobx_ram_srcid,  // local index
64
65                    size_t                             memc_ways,
66                    size_t                             memc_sets,
67                    size_t                             l1_i_ways,
68                    size_t                             l1_i_sets,
69                    size_t                             l1_d_ways,
70                    size_t                             l1_d_sets,
71                    size_t                             xram_latency,
72
73                    const Loader                      &loader,
74
75                    uint32_t                           frozen_cycles,
76                    uint32_t                           debug_start_cycle,
77                    bool                               memc_debug_ok,
78                    bool                               proc_debug_ok,
79                    bool                               iob_debug_ok )
80    : soclib::caba::BaseModule(insname),
81      p_clk("clk"),
82      p_resetn("resetn")
83{
84    assert( (x_id < xmax) and (y_id < ymax) and "Illegal cluster coordinates");
85
86    size_t cluster_id = x_id * ymax + y_id;
87
88    size_t cluster_iob0 = 0;                 // South-West cluster
89    size_t cluster_iob1 = xmax*ymax-1;       // North-East cluster
90
91    // Vectors of DSPIN ports for inter-cluster communications
92    p_dspin_int_cmd_in  = alloc_elems<DspinInput<dspin_int_cmd_width> >("p_int_cmd_in", 4, 3);
93    p_dspin_int_cmd_out = alloc_elems<DspinOutput<dspin_int_cmd_width> >("p_int_cmd_out", 4, 3);
94    p_dspin_int_rsp_in  = alloc_elems<DspinInput<dspin_int_rsp_width> >("p_int_rsp_in", 4, 2);
95    p_dspin_int_rsp_out = alloc_elems<DspinOutput<dspin_int_rsp_width> >("p_int_rsp_out", 4, 2);
96
97    p_dspin_ram_cmd_in  = alloc_elems<DspinInput<dspin_ram_cmd_width> >("p_ext_cmd_in", 4);
98    p_dspin_ram_cmd_out = alloc_elems<DspinOutput<dspin_ram_cmd_width> >("p_ext_cmd_out", 4);
99    p_dspin_ram_rsp_in  = alloc_elems<DspinInput<dspin_ram_rsp_width> >("p_ext_rsp_in", 4);
100    p_dspin_ram_rsp_out = alloc_elems<DspinOutput<dspin_ram_rsp_width> >("p_ext_rsp_out", 4);
101
102    // ports in cluster_iob0 and cluster_iob1 only
103    if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) )
104    {
105        // VCI ports from IOB to IOX network
106        p_vci_iob_iox_ini = new soclib::caba::VciInitiator<vci_param_ext>;
107        p_vci_iob_iox_tgt = new soclib::caba::VciTarget<vci_param_ext>; 
108
109        // DSPIN ports from IOB to RAM network
110        p_dspin_iob_cmd_out = new soclib::caba::DspinOutput<dspin_ram_cmd_width>;
111        p_dspin_iob_rsp_in  = new soclib::caba::DspinInput<dspin_ram_rsp_width>;
112    }
113
114    // IRQ ports in cluster_iob0 only
115    if ( cluster_id == cluster_iob0 )
116    {
117        for ( size_t n=0 ; n<32 ; n++ ) p_irq[n] = new sc_in<bool>;
118    }
119
120    /////////////////////////////////////////////////////////////////////////////
121    //    Hardware components
122    /////////////////////////////////////////////////////////////////////////////
123
124    ////////////  PROCS
125    for (size_t p = 0; p < nb_procs; p++)
126    { 
127        std::ostringstream s_proc;
128        s_proc << "proc_" << x_id << "_" << y_id << "_" << p;
129        proc[p] = new VciCcVCacheWrapper<vci_param_int,
130                                         dspin_int_cmd_width,
131                                         dspin_int_rsp_width,
132                                         GdbServer<Mips32ElIss> >(
133                      s_proc.str().c_str(),
134                      cluster_id*nb_procs + p,        // GLOBAL PROC_ID
135                      mt_int,                         // Mapping Table INT network
136                      IntTab(cluster_id,p),           // SRCID
137                      (cluster_id << l_width) + p,    // CC_GLOBAL_ID
138                      8,                              // ITLB ways
139                      8,                              // ITLB sets
140                      8,                              // DTLB ways
141                      8,                              // DTLB sets
142                      l1_i_ways,l1_i_sets,16,         // ICACHE size
143                      l1_d_ways,l1_d_sets,16,         // DCACHE size
144                      4,                              // WBUF nlines
145                      4,                              // WBUF nwords
146                      x_width,
147                      y_width,
148                      frozen_cycles,                  // max frozen cycles
149                      debug_start_cycle,
150                      proc_debug_ok);
151
152        std::ostringstream s_wi_proc;
153        s_wi_proc << "proc_wi_" << x_id << "_" << y_id << "_" << p;
154        proc_wi[p] = new VciDspinInitiatorWrapper<vci_param_int,
155                                                      dspin_int_cmd_width,
156                                                      dspin_int_rsp_width>(
157                     s_wi_proc.str().c_str(),
158                     x_width + y_width + l_width);
159    }
160
161    ///////////  MEMC   
162    std::ostringstream s_memc;
163    s_memc << "memc_" << x_id << "_" << y_id;
164    memc = new VciMemCache<vci_param_int,
165                           vci_param_ext,
166                           dspin_int_rsp_width,
167                           dspin_int_cmd_width>(
168                     s_memc.str().c_str(),
169                     mt_int,                             // Mapping Table INT network
170                     mt_ram,                             // Mapping Table RAM network
171                     IntTab(cluster_id, memc_ram_srcid), // SRCID RAM network
172                     IntTab(cluster_id, memc_int_tgtid), // TGTID INT network
173                     (cluster_id << l_width) + nb_procs, // CC_GLOBAL_ID
174                     x_width,                            // number of bits for x coordinate
175                     y_width,                            // number of bits for y coordinate
176                     memc_ways, memc_sets, 16,           // CACHE SIZE
177                     3,                                  // MAX NUMBER OF COPIES
178                     4096,                               // HEAP SIZE
179                     8,                                  // TRANSACTION TABLE DEPTH
180                     8,                                  // UPDATE TABLE DEPTH
181                     8,                                  // INVALIDATE TABLE DEPTH
182                     debug_start_cycle,
183                     memc_debug_ok );
184
185    std::ostringstream s_wt_memc;
186    s_wt_memc << "memc_wt_" << x_id << "_" << y_id;
187    memc_int_wt = new VciDspinTargetWrapper<vci_param_int,
188                                            dspin_int_cmd_width,
189                                            dspin_int_rsp_width>(
190                     s_wt_memc.str().c_str(),
191                     x_width + y_width + l_width);
192
193    std::ostringstream s_wi_memc;
194    s_wi_memc << "memc_wi_" << x_id << "_" << y_id;
195    memc_ram_wi = new VciDspinInitiatorWrapper<vci_param_ext,
196                                               dspin_ram_cmd_width,
197                                               dspin_ram_rsp_width>(
198                     s_wi_memc.str().c_str(),
199                     x_width + y_width + l_width);
200
201    ///////////   XICU
202    std::ostringstream s_xicu;
203    s_xicu << "xicu_" << x_id << "_" << y_id;
204    xicu = new VciXicu<vci_param_int>(
205                     s_xicu.str().c_str(),
206                     mt_int,                            // mapping table INT network
207                     IntTab(cluster_id,xicu_int_tgtid), // TGTID direct space
208                     32,                                // number of timer IRQs
209                     32,                                // number of hard IRQs
210                     32,                                // number of soft IRQs
211                     nb_procs);                         // number of output IRQs
212
213    std::ostringstream s_wt_xicu;
214    s_wt_xicu << "xicu_wt_" << x_id << "_" << y_id;
215    xicu_int_wt = new VciDspinTargetWrapper<vci_param_int,
216                                        dspin_int_cmd_width,
217                                        dspin_int_rsp_width>(
218                     s_wt_xicu.str().c_str(),
219                     x_width + y_width + l_width);
220
221    ////////////  MDMA
222    std::ostringstream s_mdma;
223    s_mdma << "mdma_" << x_id << "_" << y_id;
224    mdma = new VciMultiDma<vci_param_int>(
225                     s_mdma.str().c_str(),
226                     mt_int,
227                     IntTab(cluster_id, nb_procs),        // SRCID
228                     IntTab(cluster_id, mdma_int_tgtid),  // TGTID
229                     64,                                  // burst size
230                     nb_dmas);                            // number of IRQs
231
232    std::ostringstream s_wt_mdma;
233    s_wt_mdma << "mdma_wt_" << x_id << "_" << y_id;
234    mdma_int_wt = new VciDspinTargetWrapper<vci_param_int,
235                                            dspin_int_cmd_width,
236                                            dspin_int_rsp_width>(
237                     s_wt_mdma.str().c_str(),
238                     x_width + y_width + l_width);
239
240    std::ostringstream s_wi_mdma;
241    s_wi_mdma << "mdma_wi_" << x_id << "_" << y_id;
242    mdma_int_wi = new VciDspinInitiatorWrapper<vci_param_int,
243                                               dspin_int_cmd_width,
244                                               dspin_int_rsp_width>(
245                     s_wi_mdma.str().c_str(),
246                     x_width + y_width + l_width);
247
248    ///////////  Direct LOCAL_XBAR(S)
249    size_t nb_direct_initiators      = nb_procs + 1;
250    size_t nb_direct_targets         = 3;
251    if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) )
252    {
253        nb_direct_initiators         = nb_procs + 2;
254        nb_direct_targets            = 4;
255    }
256
257    std::ostringstream s_int_xbar_cmd_d;
258    s_int_xbar_cmd_d << "int_xbar_cmd_d_" << x_id << "_" << y_id;
259    int_xbar_cmd_d = new DspinLocalCrossbar<dspin_int_cmd_width>(
260                     s_int_xbar_cmd_d.str().c_str(),
261                     mt_int,                       // mapping table
262                     x_id, y_id,                   // cluster coordinates
263                     x_width, y_width, l_width,
264                     nb_direct_initiators,         // number of local of sources
265                     nb_direct_targets,            // number of local dests
266                     2, 2,                         // fifo depths 
267                     true,                         // CMD crossbar
268                     true,                         // use routing table
269                     false );                      // no broacast
270
271    std::ostringstream s_int_xbar_rsp_d;
272    s_int_xbar_rsp_d << "int_xbar_rsp_d_" << x_id << "_" << y_id;
273    int_xbar_rsp_d = new DspinLocalCrossbar<dspin_int_rsp_width>(
274                     s_int_xbar_rsp_d.str().c_str(),
275                     mt_int,                       // mapping table
276                     x_id, y_id,                   // cluster coordinates
277                     x_width, y_width, l_width,
278                     nb_direct_targets,            // number of local sources     
279                     nb_direct_initiators,         // number of local dests
280                     2, 2,                         // fifo depths
281                     false,                        // RSP crossbar 
282                     false,                        // don't use routing table
283                     false );                      // no broacast
284
285    ////////////  Coherence LOCAL_XBAR(S)
286    std::ostringstream s_int_xbar_m2p_c;
287    s_int_xbar_m2p_c << "int_xbar_m2p_c_" << x_id << "_" << y_id;
288    int_xbar_m2p_c = new DspinLocalCrossbar<dspin_int_cmd_width>(
289                     s_int_xbar_m2p_c.str().c_str(),
290                     mt_int,                       // mapping table
291                     x_id, y_id,                   // cluster coordinates
292                     x_width, y_width, l_width,    // several dests
293                     1,                            // number of local sources
294                     nb_procs,                     // number of local dests
295                     2, 2,                         // fifo depths 
296                     true,                         // pseudo CMD
297                     false,                        // no routing table
298                     true );                       // broacast
299
300    std::ostringstream s_int_xbar_p2m_c;
301    s_int_xbar_p2m_c << "int_xbar_p2m_c_" << x_id << "_" << y_id;
302    int_xbar_p2m_c = new DspinLocalCrossbar<dspin_int_rsp_width>(
303                     s_int_xbar_p2m_c.str().c_str(),
304                     mt_int,                       // mapping table
305                     x_id, y_id,                   // cluster coordinates
306                     x_width, y_width, 0,          // only one dest
307                     nb_procs,                     // number of local sources
308                     1,                            // number of local dests
309                     2, 2,                         // fifo depths 
310                     false,                        // pseudo RSP
311                     false,                        // no routing table
312                     false );                      // no broacast
313
314    std::ostringstream s_int_xbar_clack_c;
315    s_int_xbar_clack_c << "int_xbar_clack_c_" << x_id << "_" << y_id;
316    int_xbar_clack_c = new DspinLocalCrossbar<dspin_int_cmd_width>(
317                     s_int_xbar_clack_c.str().c_str(),
318                     mt_int,                       // mapping table
319                     x_id, y_id,                   // cluster coordinates
320                     x_width, y_width, l_width,
321                     1,                            // number of local sources
322                     nb_procs,                     // number of local targets
323                     1, 1,                         // fifo depths
324                     true,                         // CMD
325                     false,                        // don't use local routing table
326                     false);                       // broadcast
327
328    //////////////  INT ROUTER(S)
329    std::ostringstream s_int_router_cmd;
330    s_int_router_cmd << "router_cmd_" << x_id << "_" << y_id;
331    int_router_cmd = new VirtualDspinRouter<dspin_int_cmd_width>(
332                     s_int_router_cmd.str().c_str(),
333                     x_id,y_id,                    // coordinate in the mesh
334                     x_width, y_width,             // x & y fields width
335                     3,                            // nb virtual channels
336                     4,4);                         // input & output fifo depths
337
338    std::ostringstream s_int_router_rsp;
339    s_int_router_rsp << "router_rsp_" << x_id << "_" << y_id;
340    int_router_rsp = new VirtualDspinRouter<dspin_int_rsp_width>(
341                     s_int_router_rsp.str().c_str(),
342                     x_id,y_id,                    // router coordinates in mesh
343                     x_width, y_width,             // x & y fields width
344                     2,                            // nb virtual channels
345                     4,4);                         // input & output fifo depths
346
347    //////////////  XRAM
348    std::ostringstream s_xram;
349    s_xram << "xram_" << x_id << "_" << y_id;
350    xram = new VciSimpleRam<vci_param_ext>(
351                     s_xram.str().c_str(),
352                     IntTab(cluster_id, xram_ram_tgtid ),
353                     mt_ram,
354                     loader,
355                     xram_latency);
356
357    std::ostringstream s_wt_xram;
358    s_wt_xram << "xram_wt_" << x_id << "_" << y_id;
359    xram_ram_wt = new VciDspinTargetWrapper<vci_param_ext,
360                                            dspin_ram_cmd_width,
361                                            dspin_ram_rsp_width>(
362                     s_wt_xram.str().c_str(),
363                     x_width + y_width + l_width);
364
365    /////////////  RAM ROUTER(S)
366    std::ostringstream s_ram_router_cmd;
367    s_ram_router_cmd << "ram_router_cmd_" << x_id << "_" << y_id;
368    size_t is_iob0 = (x_id == 0) and (y_id == 0);
369    size_t is_iob1 = (x_id == (xmax-1)) and (y_id == (ymax-1));
370    ram_router_cmd = new DspinRouterTsar<dspin_ram_cmd_width>(
371                     s_ram_router_cmd.str().c_str(),
372                     x_id, y_id,                     // router coordinates in mesh
373                     x_width,                        // x field width in first flit
374                     y_width,                        // y field width in first flit
375                     4, 4,                           // input & output fifo depths
376                     is_iob0,                        // cluster contains IOB0
377                     is_iob1,                        // cluster contains IOB1
378                     false,                          // not a response router
379                     l_width);                       // local field width in first flit
380
381    std::ostringstream s_ram_router_rsp;
382    s_ram_router_rsp << "ram_router_rsp_" << x_id << "_" << y_id;
383    ram_router_rsp = new DspinRouterTsar<dspin_ram_rsp_width>(
384                     s_ram_router_rsp.str().c_str(),
385                     x_id, y_id,                     // coordinates in mesh
386                     x_width,                        // x field width in first flit
387                     y_width,                        // y field width in first flit
388                     4, 4,                           // input & output fifo depths
389                     is_iob0,                        // cluster contains IOB0
390                     is_iob1,                        // cluster contains IOB1
391                     true,                           // response router
392                     l_width);                       // local field width in first flit
393
394
395    ////////////////////// I/O  CLUSTER ONLY    ///////////////////////
396    if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) )
397    {
398        ///////////  IO_BRIDGE
399        size_t iox_local_id;
400        size_t global_id;
401        bool   has_irqs;
402        if ( cluster_id == cluster_iob0 ) 
403        {
404            iox_local_id = 0;
405            global_id    = cluster_iob0;
406            has_irqs     = true;
407        }
408        else
409        {
410            iox_local_id = 1;
411            global_id    = cluster_iob1;
412            has_irqs     = false;
413        }
414
415        std::ostringstream s_iob;
416        s_iob << "iob_" << x_id << "_" << y_id;   
417        iob = new VciIoBridge<vci_param_int,
418                              vci_param_ext>( 
419                     s_iob.str().c_str(),
420                     mt_ram,                               // EXT network maptab
421                     mt_int,                               // INT network maptab
422                     mt_iox,                               // IOX network maptab
423                     IntTab( global_id, iobx_int_tgtid ),  // INT TGTID
424                     IntTab( global_id, iobx_int_srcid ),  // INT SRCID
425                     IntTab( global_id, iox_local_id   ),  // IOX TGTID
426                     has_irqs, 
427                     16,                                   // cache line words
428                     8,                                    // IOTLB ways
429                     8,                                    // IOTLB sets
430                     debug_start_cycle,
431                     iob_debug_ok );
432       
433        std::ostringstream s_iob_int_wi;
434        s_iob_int_wi << "iob_int_wi_" << x_id << "_" << y_id;   
435        iob_int_wi = new VciDspinInitiatorWrapper<vci_param_int,
436                                                  dspin_int_cmd_width,
437                                                  dspin_int_rsp_width>(
438                     s_iob_int_wi.str().c_str(),
439                     x_width + y_width + l_width);
440
441        std::ostringstream s_iob_int_wt;
442        s_iob_int_wt << "iob_int_wt_" << x_id << "_" << y_id;   
443        iob_int_wt = new VciDspinTargetWrapper<vci_param_int,
444                                               dspin_int_cmd_width,
445                                               dspin_int_rsp_width>(
446                     s_iob_int_wt.str().c_str(),
447                     x_width + y_width + l_width);
448
449        std::ostringstream s_iob_ram_wi;
450        s_iob_ram_wi << "iob_ram_wi_" << x_id << "_" << y_id;   
451        iob_ram_wi = new VciDspinInitiatorWrapper<vci_param_ext,
452                                                  dspin_ram_cmd_width,
453                                                  dspin_ram_rsp_width>(
454                     s_iob_ram_wi.str().c_str(),
455                     x_width + y_width + l_width);
456    } // end if IO
457
458    ////////////////////////////////////
459    // Connections are defined here
460    ////////////////////////////////////
461
462    // on coherence network : local srcid[proc] in [0...nb_procs-1]
463    //                      : local srcid[memc] = nb_procs
464    // In cluster_iob0, 32 HWI interrupts from external peripherals
465    // are connected to the XICU ports p_hwi[0:31]
466    // In other clusters, no HWI interrupts are connected to XICU
467 
468    //////////////////////// internal CMD & RSP routers
469    int_router_cmd->p_clk                        (this->p_clk);
470    int_router_cmd->p_resetn                     (this->p_resetn);
471    int_router_rsp->p_clk                        (this->p_clk);
472    int_router_rsp->p_resetn                     (this->p_resetn);
473
474    for (int i = 0; i < 4; i++)
475    {
476        for(int k = 0; k < 3; k++)
477        {
478            int_router_cmd->p_out[i][k]          (this->p_dspin_int_cmd_out[i][k]);
479            int_router_cmd->p_in[i][k]           (this->p_dspin_int_cmd_in[i][k]);
480        }
481
482        for(int k = 0; k < 2; k++)
483        {
484            int_router_rsp->p_out[i][k]          (this->p_dspin_int_rsp_out[i][k]);
485            int_router_rsp->p_in[i][k]           (this->p_dspin_int_rsp_in[i][k]);
486        }
487    }
488
489    // local ports
490    int_router_cmd->p_out[4][0]                  (signal_int_dspin_cmd_g2l_d);
491    int_router_cmd->p_out[4][1]                  (signal_int_dspin_m2p_g2l_c);
492    int_router_cmd->p_out[4][2]                  (signal_int_dspin_clack_g2l_c);
493    int_router_cmd->p_in[4][0]                   (signal_int_dspin_cmd_l2g_d);
494    int_router_cmd->p_in[4][1]                   (signal_int_dspin_m2p_l2g_c);
495    int_router_cmd->p_in[4][2]                   (signal_int_dspin_clack_l2g_c);
496   
497    int_router_rsp->p_out[4][0]                  (signal_int_dspin_rsp_g2l_d);
498    int_router_rsp->p_out[4][1]                  (signal_int_dspin_p2m_g2l_c);
499    int_router_rsp->p_in[4][0]                   (signal_int_dspin_rsp_l2g_d);
500    int_router_rsp->p_in[4][1]                   (signal_int_dspin_p2m_l2g_c);
501
502    ///////////////////// CMD DSPIN  local crossbar direct
503    int_xbar_cmd_d->p_clk                        (this->p_clk);
504    int_xbar_cmd_d->p_resetn                     (this->p_resetn);
505    int_xbar_cmd_d->p_global_out                 (signal_int_dspin_cmd_l2g_d);
506    int_xbar_cmd_d->p_global_in                  (signal_int_dspin_cmd_g2l_d);
507
508    int_xbar_cmd_d->p_local_out[memc_int_tgtid]  (signal_int_dspin_cmd_memc_t);
509    int_xbar_cmd_d->p_local_out[xicu_int_tgtid]  (signal_int_dspin_cmd_xicu_t);
510    int_xbar_cmd_d->p_local_out[mdma_int_tgtid]  (signal_int_dspin_cmd_mdma_t);
511
512    int_xbar_cmd_d->p_local_in[mdma_int_srcid]   (signal_int_dspin_cmd_mdma_i);
513
514    for (size_t p = 0; p < nb_procs; p++)
515    int_xbar_cmd_d->p_local_in[proc_int_srcid+p] (signal_int_dspin_cmd_proc_i[p]);
516
517    if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) )
518    {
519    int_xbar_cmd_d->p_local_out[iobx_int_tgtid]  (signal_int_dspin_cmd_iobx_t);
520    int_xbar_cmd_d->p_local_in[iobx_int_srcid]   (signal_int_dspin_cmd_iobx_i);
521    }
522
523    //////////////////////// RSP DSPIN  local crossbar direct
524    int_xbar_rsp_d->p_clk                        (this->p_clk);
525    int_xbar_rsp_d->p_resetn                     (this->p_resetn);
526    int_xbar_rsp_d->p_global_out                 (signal_int_dspin_rsp_l2g_d);
527    int_xbar_rsp_d->p_global_in                  (signal_int_dspin_rsp_g2l_d);
528
529    int_xbar_rsp_d->p_local_in[memc_int_tgtid]   (signal_int_dspin_rsp_memc_t);
530    int_xbar_rsp_d->p_local_in[xicu_int_tgtid]   (signal_int_dspin_rsp_xicu_t);
531    int_xbar_rsp_d->p_local_in[mdma_int_tgtid]   (signal_int_dspin_rsp_mdma_t);
532
533    int_xbar_rsp_d->p_local_out[mdma_int_srcid]  (signal_int_dspin_rsp_mdma_i);
534
535    for (size_t p = 0; p < nb_procs; p++)
536    int_xbar_rsp_d->p_local_out[proc_int_srcid+p] (signal_int_dspin_rsp_proc_i[p]);
537
538    if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) )
539    {
540    int_xbar_rsp_d->p_local_in[iobx_int_tgtid]   (signal_int_dspin_rsp_iobx_t);
541    int_xbar_rsp_d->p_local_out[iobx_int_srcid]  (signal_int_dspin_rsp_iobx_i);
542    }
543
544    ////////////////////// M2P DSPIN local crossbar coherence
545    int_xbar_m2p_c->p_clk                        (this->p_clk);
546    int_xbar_m2p_c->p_resetn                     (this->p_resetn);
547    int_xbar_m2p_c->p_global_out                 (signal_int_dspin_m2p_l2g_c);
548    int_xbar_m2p_c->p_global_in                  (signal_int_dspin_m2p_g2l_c);
549    int_xbar_m2p_c->p_local_in[0]                (signal_int_dspin_m2p_memc);
550    for (size_t p = 0; p < nb_procs; p++) 
551        int_xbar_m2p_c->p_local_out[p]           (signal_int_dspin_m2p_proc[p]);
552
553    ////////////////////////// P2M DSPIN local crossbar coherence
554    int_xbar_p2m_c->p_clk                        (this->p_clk);
555    int_xbar_p2m_c->p_resetn                     (this->p_resetn);
556    int_xbar_p2m_c->p_global_out                 (signal_int_dspin_p2m_l2g_c);
557    int_xbar_p2m_c->p_global_in                  (signal_int_dspin_p2m_g2l_c);
558    int_xbar_p2m_c->p_local_out[0]               (signal_int_dspin_p2m_memc);
559    for (size_t p = 0; p < nb_procs; p++) 
560        int_xbar_p2m_c->p_local_in[p]            (signal_int_dspin_p2m_proc[p]);
561
562    ////////////////////// CLACK DSPIN local crossbar coherence
563    int_xbar_clack_c->p_clk                      (this->p_clk);
564    int_xbar_clack_c->p_resetn                   (this->p_resetn);
565    int_xbar_clack_c->p_global_out               (signal_int_dspin_clack_l2g_c);
566    int_xbar_clack_c->p_global_in                (signal_int_dspin_clack_g2l_c);
567    int_xbar_clack_c->p_local_in[0]              (signal_int_dspin_clack_memc);
568    for (size_t p = 0; p < nb_procs; p++)
569        int_xbar_clack_c->p_local_out[p]         (signal_int_dspin_clack_proc[p]);
570
571    //////////////////////////////////// Processors
572    for (size_t p = 0; p < nb_procs; p++)
573    {
574        proc[p]->p_clk                           (this->p_clk);
575        proc[p]->p_resetn                        (this->p_resetn);
576        proc[p]->p_vci                           (signal_int_vci_ini_proc[p]);
577        proc[p]->p_dspin_m2p                     (signal_int_dspin_m2p_proc[p]);
578        proc[p]->p_dspin_p2m                     (signal_int_dspin_p2m_proc[p]);
579        proc[p]->p_dspin_clack                   (signal_int_dspin_clack_proc[p]);
580        proc[p]->p_irq[0]                        (signal_proc_it[p]);
581        for ( size_t j = 1 ; j < 6 ; j++)
582        {
583            proc[p]->p_irq[j]                    (signal_false);
584        }
585
586        proc_wi[p]->p_clk                        (this->p_clk);
587        proc_wi[p]->p_resetn                     (this->p_resetn);
588        proc_wi[p]->p_dspin_cmd                  (signal_int_dspin_cmd_proc_i[p]);
589        proc_wi[p]->p_dspin_rsp                  (signal_int_dspin_rsp_proc_i[p]);
590        proc_wi[p]->p_vci                        (signal_int_vci_ini_proc[p]);
591    }
592
593    ///////////////////////////////////// XICU
594    xicu->p_clk                                  (this->p_clk);
595    xicu->p_resetn                               (this->p_resetn);
596    xicu->p_vci                                  (signal_int_vci_tgt_xicu);
597    for ( size_t p=0 ; p<nb_procs ; p++)
598    {
599        xicu->p_irq[p]                           (signal_proc_it[p]);
600    }
601    for ( size_t i=0 ; i<32 ; i++)
602    {
603        if (cluster_id == cluster_iob0) 
604            xicu->p_hwi[i]                       (*(this->p_irq[i]));
605        else 
606            xicu->p_hwi[i]                       (signal_false);
607    }                     
608
609    // wrapper XICU
610    xicu_int_wt->p_clk                           (this->p_clk);
611    xicu_int_wt->p_resetn                        (this->p_resetn);
612    xicu_int_wt->p_dspin_cmd                     (signal_int_dspin_cmd_xicu_t);
613    xicu_int_wt->p_dspin_rsp                     (signal_int_dspin_rsp_xicu_t);
614    xicu_int_wt->p_vci                           (signal_int_vci_tgt_xicu);
615
616    ///////////////////////////////////// MEMC
617    memc->p_clk                                  (this->p_clk);
618    memc->p_resetn                               (this->p_resetn);
619    memc->p_vci_ixr                              (signal_ram_vci_ini_memc);
620    memc->p_vci_tgt                              (signal_int_vci_tgt_memc);
621    memc->p_dspin_p2m                            (signal_int_dspin_p2m_memc);
622    memc->p_dspin_m2p                            (signal_int_dspin_m2p_memc);
623    memc->p_dspin_clack                          (signal_int_dspin_clack_memc);
624
625    // wrapper to INT network
626    memc_int_wt->p_clk                           (this->p_clk);
627    memc_int_wt->p_resetn                        (this->p_resetn);
628    memc_int_wt->p_dspin_cmd                     (signal_int_dspin_cmd_memc_t);
629    memc_int_wt->p_dspin_rsp                     (signal_int_dspin_rsp_memc_t);
630    memc_int_wt->p_vci                           (signal_int_vci_tgt_memc);
631
632    // wrapper to RAM network
633    memc_ram_wi->p_clk                           (this->p_clk);
634    memc_ram_wi->p_resetn                        (this->p_resetn);
635    memc_ram_wi->p_dspin_cmd                     (signal_ram_dspin_cmd_memc_i);
636    memc_ram_wi->p_dspin_rsp                     (signal_ram_dspin_rsp_memc_i);
637    memc_ram_wi->p_vci                           (signal_ram_vci_ini_memc);
638
639    //////////////////////////////////// XRAM
640    xram->p_clk                                  (this->p_clk);
641    xram->p_resetn                               (this->p_resetn);
642    xram->p_vci                                  (signal_ram_vci_tgt_xram);
643
644    // wrapper to RAM network
645    xram_ram_wt->p_clk                           (this->p_clk);
646    xram_ram_wt->p_resetn                        (this->p_resetn);
647    xram_ram_wt->p_dspin_cmd                     (signal_ram_dspin_cmd_xram_t);
648    xram_ram_wt->p_dspin_rsp                     (signal_ram_dspin_rsp_xram_t);
649    xram_ram_wt->p_vci                           (signal_ram_vci_tgt_xram);
650
651    /////////////////////////////////// MDMA
652    mdma->p_clk                                  (this->p_clk);
653    mdma->p_resetn                               (this->p_resetn);
654    mdma->p_vci_target                           (signal_int_vci_tgt_mdma);
655    mdma->p_vci_initiator                        (signal_int_vci_ini_mdma);
656    for (size_t i=0 ; i<nb_dmas ; i++)
657        mdma->p_irq[i]                           (signal_irq_mdma[i]);
658
659    // target wrapper
660    mdma_int_wt->p_clk                           (this->p_clk);
661    mdma_int_wt->p_resetn                        (this->p_resetn);
662    mdma_int_wt->p_dspin_cmd                     (signal_int_dspin_cmd_mdma_t);
663    mdma_int_wt->p_dspin_rsp                     (signal_int_dspin_rsp_mdma_t);
664    mdma_int_wt->p_vci                           (signal_int_vci_tgt_mdma);
665
666    // initiator wrapper
667    mdma_int_wi->p_clk                           (this->p_clk);
668    mdma_int_wi->p_resetn                        (this->p_resetn);
669    mdma_int_wi->p_dspin_cmd                     (signal_int_dspin_cmd_mdma_i);
670    mdma_int_wi->p_dspin_rsp                     (signal_int_dspin_rsp_mdma_i);
671    mdma_int_wi->p_vci                           (signal_int_vci_ini_mdma);
672
673    //////////////////////////// RAM network CMD & RSP routers
674    ram_router_cmd->p_clk                    (this->p_clk);
675    ram_router_cmd->p_resetn                 (this->p_resetn);
676    ram_router_rsp->p_clk                    (this->p_clk);
677    ram_router_rsp->p_resetn                 (this->p_resetn);
678    for( size_t n=0 ; n<4 ; n++)
679    {
680        ram_router_cmd->p_out[n]             (this->p_dspin_ram_cmd_out[n]);
681        ram_router_cmd->p_in[n]              (this->p_dspin_ram_cmd_in[n]);
682        ram_router_rsp->p_out[n]             (this->p_dspin_ram_rsp_out[n]);
683        ram_router_rsp->p_in[n]              (this->p_dspin_ram_rsp_in[n]);
684    }
685    ram_router_cmd->p_out[4]                 (signal_ram_dspin_cmd_xram_t);
686    ram_router_cmd->p_in[4]                  (signal_ram_dspin_cmd_memc_i);
687    ram_router_rsp->p_out[4]                 (signal_ram_dspin_rsp_memc_i);
688    ram_router_rsp->p_in[4]                  (signal_ram_dspin_rsp_xram_t);
689   
690    ///////////////////////// IOB exists only in cluster_iob0 & cluster_iob1.
691    if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) )
692    {
693        // IO bridge
694        iob->p_clk                               (this->p_clk);
695        iob->p_resetn                            (this->p_resetn);
696        iob->p_vci_ini_iox                       (*(this->p_vci_iob_iox_ini));
697        iob->p_vci_tgt_iox                       (*(this->p_vci_iob_iox_tgt));
698        iob->p_vci_tgt_int                       (signal_int_vci_tgt_iobx);
699        iob->p_vci_ini_int                       (signal_int_vci_ini_iobx);
700        iob->p_vci_ini_ram                       (signal_ram_vci_ini_iobx);
701
702        if ( cluster_id == cluster_iob0 )
703               for ( size_t n=0 ; n<32 ; n++ )
704                   (*iob->p_irq[n])                 (*(this->p_irq[n]));
705
706        // initiator wrapper to RAM network
707        iob_ram_wi->p_clk                        (this->p_clk);
708        iob_ram_wi->p_resetn                     (this->p_resetn);
709        iob_ram_wi->p_dspin_cmd                  (*(this->p_dspin_iob_cmd_out));
710        iob_ram_wi->p_dspin_rsp                  (*(this->p_dspin_iob_rsp_in));
711        iob_ram_wi->p_vci                        (signal_ram_vci_ini_iobx);
712
713        // initiator wrapper to INT network
714        iob_int_wi->p_clk                        (this->p_clk);
715        iob_int_wi->p_resetn                     (this->p_resetn);
716        iob_int_wi->p_dspin_cmd                  (signal_int_dspin_cmd_iobx_i);
717        iob_int_wi->p_dspin_rsp                  (signal_int_dspin_rsp_iobx_i);
718        iob_int_wi->p_vci                        (signal_int_vci_ini_iobx);
719
720        // target wrapper to INT network
721        iob_int_wt->p_clk                        (this->p_clk);
722        iob_int_wt->p_resetn                     (this->p_resetn);
723        iob_int_wt->p_dspin_cmd                  (signal_int_dspin_cmd_iobx_t);
724        iob_int_wt->p_dspin_rsp                  (signal_int_dspin_rsp_iobx_t);
725        iob_int_wt->p_vci                        (signal_int_vci_tgt_iobx);
726    }
727
728} // end constructor
729
730}}
731
732
733// Local Variables:
734// tab-width: 3
735// c-basic-offset: 3
736// c-file-offsets:((innamespace . 0)(inline-open . 0))
737// indent-tabs-mode: nil
738// End:
739
740// vim: filetype=cpp:expandtab:shiftwidth=3:tabstop=3:softtabstop=3
741
742
743
Note: See TracBrowser for help on using the repository browser.