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

Last change on this file since 597 was 597, checked in by cfuguet, 10 years ago

Modifications in vci_mem_cache:

  • Bugfix in req_distance function used to compute manhattan distance between requests coordinates and self global coordinates.
  • New constructor parameters for vci_mem_cache:
    1. x_self : X self coordinate
    2. y_self : Y self coordinate


This parameter are used for instrumentation

  • Remove cc_global_id constructor parameter:

This parameter was the mem_cache coherence srcid. This srcid is not
used by the L1 caches because they take the mem cache global id from
the msb of nline to invalidate (CLEANUP) or to update (MULTIACK)

As the constructor parameters has been changed, the platform using the
mem cache must be changed accordingly. Therefore, the tsar_generic_xbar and
the tsar_generic_iob platforms were updated.

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                     x_id,                               // X self coordinate
174                     y_id,                               // Y self coordinate
175                     x_width,                            // number of bits for x coordinate
176                     y_width,                            // number of bits for y coordinate
177                     memc_ways, memc_sets, 16,           // CACHE SIZE
178                     3,                                  // MAX NUMBER OF COPIES
179                     4096,                               // HEAP SIZE
180                     8,                                  // TRANSACTION TABLE DEPTH
181                     8,                                  // UPDATE TABLE DEPTH
182                     8,                                  // INVALIDATE TABLE DEPTH
183                     debug_start_cycle,
184                     memc_debug_ok );
185
186    std::ostringstream s_wt_memc;
187    s_wt_memc << "memc_wt_" << x_id << "_" << y_id;
188    memc_int_wt = new VciDspinTargetWrapper<vci_param_int,
189                                            dspin_int_cmd_width,
190                                            dspin_int_rsp_width>(
191                     s_wt_memc.str().c_str(),
192                     x_width + y_width + l_width);
193
194    std::ostringstream s_wi_memc;
195    s_wi_memc << "memc_wi_" << x_id << "_" << y_id;
196    memc_ram_wi = new VciDspinInitiatorWrapper<vci_param_ext,
197                                               dspin_ram_cmd_width,
198                                               dspin_ram_rsp_width>(
199                     s_wi_memc.str().c_str(),
200                     x_width + y_width + l_width);
201
202    ///////////   XICU
203    std::ostringstream s_xicu;
204    s_xicu << "xicu_" << x_id << "_" << y_id;
205    xicu = new VciXicu<vci_param_int>(
206                     s_xicu.str().c_str(),
207                     mt_int,                            // mapping table INT network
208                     IntTab(cluster_id,xicu_int_tgtid), // TGTID direct space
209                     32,                                // number of timer IRQs
210                     32,                                // number of hard IRQs
211                     32,                                // number of soft IRQs
212                     nb_procs);                         // number of output IRQs
213
214    std::ostringstream s_wt_xicu;
215    s_wt_xicu << "xicu_wt_" << x_id << "_" << y_id;
216    xicu_int_wt = new VciDspinTargetWrapper<vci_param_int,
217                                        dspin_int_cmd_width,
218                                        dspin_int_rsp_width>(
219                     s_wt_xicu.str().c_str(),
220                     x_width + y_width + l_width);
221
222    ////////////  MDMA
223    std::ostringstream s_mdma;
224    s_mdma << "mdma_" << x_id << "_" << y_id;
225    mdma = new VciMultiDma<vci_param_int>(
226                     s_mdma.str().c_str(),
227                     mt_int,
228                     IntTab(cluster_id, nb_procs),        // SRCID
229                     IntTab(cluster_id, mdma_int_tgtid),  // TGTID
230                     64,                                  // burst size
231                     nb_dmas);                            // number of IRQs
232
233    std::ostringstream s_wt_mdma;
234    s_wt_mdma << "mdma_wt_" << x_id << "_" << y_id;
235    mdma_int_wt = new VciDspinTargetWrapper<vci_param_int,
236                                            dspin_int_cmd_width,
237                                            dspin_int_rsp_width>(
238                     s_wt_mdma.str().c_str(),
239                     x_width + y_width + l_width);
240
241    std::ostringstream s_wi_mdma;
242    s_wi_mdma << "mdma_wi_" << x_id << "_" << y_id;
243    mdma_int_wi = new VciDspinInitiatorWrapper<vci_param_int,
244                                               dspin_int_cmd_width,
245                                               dspin_int_rsp_width>(
246                     s_wi_mdma.str().c_str(),
247                     x_width + y_width + l_width);
248
249    ///////////  Direct LOCAL_XBAR(S)
250    size_t nb_direct_initiators      = nb_procs + 1;
251    size_t nb_direct_targets         = 3;
252    if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) )
253    {
254        nb_direct_initiators         = nb_procs + 2;
255        nb_direct_targets            = 4;
256    }
257
258    std::ostringstream s_int_xbar_cmd_d;
259    s_int_xbar_cmd_d << "int_xbar_cmd_d_" << x_id << "_" << y_id;
260    int_xbar_cmd_d = new DspinLocalCrossbar<dspin_int_cmd_width>(
261                     s_int_xbar_cmd_d.str().c_str(),
262                     mt_int,                       // mapping table
263                     x_id, y_id,                   // cluster coordinates
264                     x_width, y_width, l_width,
265                     nb_direct_initiators,         // number of local of sources
266                     nb_direct_targets,            // number of local dests
267                     2, 2,                         // fifo depths 
268                     true,                         // CMD crossbar
269                     true,                         // use routing table
270                     false );                      // no broacast
271
272    std::ostringstream s_int_xbar_rsp_d;
273    s_int_xbar_rsp_d << "int_xbar_rsp_d_" << x_id << "_" << y_id;
274    int_xbar_rsp_d = new DspinLocalCrossbar<dspin_int_rsp_width>(
275                     s_int_xbar_rsp_d.str().c_str(),
276                     mt_int,                       // mapping table
277                     x_id, y_id,                   // cluster coordinates
278                     x_width, y_width, l_width,
279                     nb_direct_targets,            // number of local sources     
280                     nb_direct_initiators,         // number of local dests
281                     2, 2,                         // fifo depths
282                     false,                        // RSP crossbar 
283                     false,                        // don't use routing table
284                     false );                      // no broacast
285
286    ////////////  Coherence LOCAL_XBAR(S)
287    std::ostringstream s_int_xbar_m2p_c;
288    s_int_xbar_m2p_c << "int_xbar_m2p_c_" << x_id << "_" << y_id;
289    int_xbar_m2p_c = new DspinLocalCrossbar<dspin_int_cmd_width>(
290                     s_int_xbar_m2p_c.str().c_str(),
291                     mt_int,                       // mapping table
292                     x_id, y_id,                   // cluster coordinates
293                     x_width, y_width, l_width,    // several dests
294                     1,                            // number of local sources
295                     nb_procs,                     // number of local dests
296                     2, 2,                         // fifo depths 
297                     true,                         // pseudo CMD
298                     false,                        // no routing table
299                     true );                       // broacast
300
301    std::ostringstream s_int_xbar_p2m_c;
302    s_int_xbar_p2m_c << "int_xbar_p2m_c_" << x_id << "_" << y_id;
303    int_xbar_p2m_c = new DspinLocalCrossbar<dspin_int_rsp_width>(
304                     s_int_xbar_p2m_c.str().c_str(),
305                     mt_int,                       // mapping table
306                     x_id, y_id,                   // cluster coordinates
307                     x_width, y_width, 0,          // only one dest
308                     nb_procs,                     // number of local sources
309                     1,                            // number of local dests
310                     2, 2,                         // fifo depths 
311                     false,                        // pseudo RSP
312                     false,                        // no routing table
313                     false );                      // no broacast
314
315    std::ostringstream s_int_xbar_clack_c;
316    s_int_xbar_clack_c << "int_xbar_clack_c_" << x_id << "_" << y_id;
317    int_xbar_clack_c = new DspinLocalCrossbar<dspin_int_cmd_width>(
318                     s_int_xbar_clack_c.str().c_str(),
319                     mt_int,                       // mapping table
320                     x_id, y_id,                   // cluster coordinates
321                     x_width, y_width, l_width,
322                     1,                            // number of local sources
323                     nb_procs,                     // number of local targets
324                     1, 1,                         // fifo depths
325                     true,                         // CMD
326                     false,                        // don't use local routing table
327                     false);                       // broadcast
328
329    //////////////  INT ROUTER(S)
330    std::ostringstream s_int_router_cmd;
331    s_int_router_cmd << "router_cmd_" << x_id << "_" << y_id;
332    int_router_cmd = new VirtualDspinRouter<dspin_int_cmd_width>(
333                     s_int_router_cmd.str().c_str(),
334                     x_id,y_id,                    // coordinate in the mesh
335                     x_width, y_width,             // x & y fields width
336                     3,                            // nb virtual channels
337                     4,4);                         // input & output fifo depths
338
339    std::ostringstream s_int_router_rsp;
340    s_int_router_rsp << "router_rsp_" << x_id << "_" << y_id;
341    int_router_rsp = new VirtualDspinRouter<dspin_int_rsp_width>(
342                     s_int_router_rsp.str().c_str(),
343                     x_id,y_id,                    // router coordinates in mesh
344                     x_width, y_width,             // x & y fields width
345                     2,                            // nb virtual channels
346                     4,4);                         // input & output fifo depths
347
348    //////////////  XRAM
349    std::ostringstream s_xram;
350    s_xram << "xram_" << x_id << "_" << y_id;
351    xram = new VciSimpleRam<vci_param_ext>(
352                     s_xram.str().c_str(),
353                     IntTab(cluster_id, xram_ram_tgtid ),
354                     mt_ram,
355                     loader,
356                     xram_latency);
357
358    std::ostringstream s_wt_xram;
359    s_wt_xram << "xram_wt_" << x_id << "_" << y_id;
360    xram_ram_wt = new VciDspinTargetWrapper<vci_param_ext,
361                                            dspin_ram_cmd_width,
362                                            dspin_ram_rsp_width>(
363                     s_wt_xram.str().c_str(),
364                     x_width + y_width + l_width);
365
366    /////////////  RAM ROUTER(S)
367    std::ostringstream s_ram_router_cmd;
368    s_ram_router_cmd << "ram_router_cmd_" << x_id << "_" << y_id;
369    size_t is_iob0 = (x_id == 0) and (y_id == 0);
370    size_t is_iob1 = (x_id == (xmax-1)) and (y_id == (ymax-1));
371    ram_router_cmd = new DspinRouterTsar<dspin_ram_cmd_width>(
372                     s_ram_router_cmd.str().c_str(),
373                     x_id, y_id,                     // router coordinates in mesh
374                     x_width,                        // x field width in first flit
375                     y_width,                        // y field width in first flit
376                     4, 4,                           // input & output fifo depths
377                     is_iob0,                        // cluster contains IOB0
378                     is_iob1,                        // cluster contains IOB1
379                     false,                          // not a response router
380                     l_width);                       // local field width in first flit
381
382    std::ostringstream s_ram_router_rsp;
383    s_ram_router_rsp << "ram_router_rsp_" << x_id << "_" << y_id;
384    ram_router_rsp = new DspinRouterTsar<dspin_ram_rsp_width>(
385                     s_ram_router_rsp.str().c_str(),
386                     x_id, y_id,                     // coordinates in mesh
387                     x_width,                        // x field width in first flit
388                     y_width,                        // y field width in first flit
389                     4, 4,                           // input & output fifo depths
390                     is_iob0,                        // cluster contains IOB0
391                     is_iob1,                        // cluster contains IOB1
392                     true,                           // response router
393                     l_width);                       // local field width in first flit
394
395
396    ////////////////////// I/O  CLUSTER ONLY    ///////////////////////
397    if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) )
398    {
399        ///////////  IO_BRIDGE
400        size_t iox_local_id;
401        size_t global_id;
402        bool   has_irqs;
403        if ( cluster_id == cluster_iob0 ) 
404        {
405            iox_local_id = 0;
406            global_id    = cluster_iob0;
407            has_irqs     = true;
408        }
409        else
410        {
411            iox_local_id = 1;
412            global_id    = cluster_iob1;
413            has_irqs     = false;
414        }
415
416        std::ostringstream s_iob;
417        s_iob << "iob_" << x_id << "_" << y_id;   
418        iob = new VciIoBridge<vci_param_int,
419                              vci_param_ext>( 
420                     s_iob.str().c_str(),
421                     mt_ram,                               // EXT network maptab
422                     mt_int,                               // INT network maptab
423                     mt_iox,                               // IOX network maptab
424                     IntTab( global_id, iobx_int_tgtid ),  // INT TGTID
425                     IntTab( global_id, iobx_int_srcid ),  // INT SRCID
426                     IntTab( global_id, iox_local_id   ),  // IOX TGTID
427                     has_irqs, 
428                     16,                                   // cache line words
429                     8,                                    // IOTLB ways
430                     8,                                    // IOTLB sets
431                     debug_start_cycle,
432                     iob_debug_ok );
433       
434        std::ostringstream s_iob_int_wi;
435        s_iob_int_wi << "iob_int_wi_" << x_id << "_" << y_id;   
436        iob_int_wi = new VciDspinInitiatorWrapper<vci_param_int,
437                                                  dspin_int_cmd_width,
438                                                  dspin_int_rsp_width>(
439                     s_iob_int_wi.str().c_str(),
440                     x_width + y_width + l_width);
441
442        std::ostringstream s_iob_int_wt;
443        s_iob_int_wt << "iob_int_wt_" << x_id << "_" << y_id;   
444        iob_int_wt = new VciDspinTargetWrapper<vci_param_int,
445                                               dspin_int_cmd_width,
446                                               dspin_int_rsp_width>(
447                     s_iob_int_wt.str().c_str(),
448                     x_width + y_width + l_width);
449
450        std::ostringstream s_iob_ram_wi;
451        s_iob_ram_wi << "iob_ram_wi_" << x_id << "_" << y_id;   
452        iob_ram_wi = new VciDspinInitiatorWrapper<vci_param_ext,
453                                                  dspin_ram_cmd_width,
454                                                  dspin_ram_rsp_width>(
455                     s_iob_ram_wi.str().c_str(),
456                     x_width + y_width + l_width);
457    } // end if IO
458
459    ////////////////////////////////////
460    // Connections are defined here
461    ////////////////////////////////////
462
463    // on coherence network : local srcid[proc] in [0...nb_procs-1]
464    //                      : local srcid[memc] = nb_procs
465    // In cluster_iob0, 32 HWI interrupts from external peripherals
466    // are connected to the XICU ports p_hwi[0:31]
467    // In other clusters, no HWI interrupts are connected to XICU
468 
469    //////////////////////// internal CMD & RSP routers
470    int_router_cmd->p_clk                        (this->p_clk);
471    int_router_cmd->p_resetn                     (this->p_resetn);
472    int_router_rsp->p_clk                        (this->p_clk);
473    int_router_rsp->p_resetn                     (this->p_resetn);
474
475    for (int i = 0; i < 4; i++)
476    {
477        for(int k = 0; k < 3; k++)
478        {
479            int_router_cmd->p_out[i][k]          (this->p_dspin_int_cmd_out[i][k]);
480            int_router_cmd->p_in[i][k]           (this->p_dspin_int_cmd_in[i][k]);
481        }
482
483        for(int k = 0; k < 2; k++)
484        {
485            int_router_rsp->p_out[i][k]          (this->p_dspin_int_rsp_out[i][k]);
486            int_router_rsp->p_in[i][k]           (this->p_dspin_int_rsp_in[i][k]);
487        }
488    }
489
490    // local ports
491    int_router_cmd->p_out[4][0]                  (signal_int_dspin_cmd_g2l_d);
492    int_router_cmd->p_out[4][1]                  (signal_int_dspin_m2p_g2l_c);
493    int_router_cmd->p_out[4][2]                  (signal_int_dspin_clack_g2l_c);
494    int_router_cmd->p_in[4][0]                   (signal_int_dspin_cmd_l2g_d);
495    int_router_cmd->p_in[4][1]                   (signal_int_dspin_m2p_l2g_c);
496    int_router_cmd->p_in[4][2]                   (signal_int_dspin_clack_l2g_c);
497   
498    int_router_rsp->p_out[4][0]                  (signal_int_dspin_rsp_g2l_d);
499    int_router_rsp->p_out[4][1]                  (signal_int_dspin_p2m_g2l_c);
500    int_router_rsp->p_in[4][0]                   (signal_int_dspin_rsp_l2g_d);
501    int_router_rsp->p_in[4][1]                   (signal_int_dspin_p2m_l2g_c);
502
503    ///////////////////// CMD DSPIN  local crossbar direct
504    int_xbar_cmd_d->p_clk                        (this->p_clk);
505    int_xbar_cmd_d->p_resetn                     (this->p_resetn);
506    int_xbar_cmd_d->p_global_out                 (signal_int_dspin_cmd_l2g_d);
507    int_xbar_cmd_d->p_global_in                  (signal_int_dspin_cmd_g2l_d);
508
509    int_xbar_cmd_d->p_local_out[memc_int_tgtid]  (signal_int_dspin_cmd_memc_t);
510    int_xbar_cmd_d->p_local_out[xicu_int_tgtid]  (signal_int_dspin_cmd_xicu_t);
511    int_xbar_cmd_d->p_local_out[mdma_int_tgtid]  (signal_int_dspin_cmd_mdma_t);
512
513    int_xbar_cmd_d->p_local_in[mdma_int_srcid]   (signal_int_dspin_cmd_mdma_i);
514
515    for (size_t p = 0; p < nb_procs; p++)
516    int_xbar_cmd_d->p_local_in[proc_int_srcid+p] (signal_int_dspin_cmd_proc_i[p]);
517
518    if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) )
519    {
520    int_xbar_cmd_d->p_local_out[iobx_int_tgtid]  (signal_int_dspin_cmd_iobx_t);
521    int_xbar_cmd_d->p_local_in[iobx_int_srcid]   (signal_int_dspin_cmd_iobx_i);
522    }
523
524    //////////////////////// RSP DSPIN  local crossbar direct
525    int_xbar_rsp_d->p_clk                        (this->p_clk);
526    int_xbar_rsp_d->p_resetn                     (this->p_resetn);
527    int_xbar_rsp_d->p_global_out                 (signal_int_dspin_rsp_l2g_d);
528    int_xbar_rsp_d->p_global_in                  (signal_int_dspin_rsp_g2l_d);
529
530    int_xbar_rsp_d->p_local_in[memc_int_tgtid]   (signal_int_dspin_rsp_memc_t);
531    int_xbar_rsp_d->p_local_in[xicu_int_tgtid]   (signal_int_dspin_rsp_xicu_t);
532    int_xbar_rsp_d->p_local_in[mdma_int_tgtid]   (signal_int_dspin_rsp_mdma_t);
533
534    int_xbar_rsp_d->p_local_out[mdma_int_srcid]  (signal_int_dspin_rsp_mdma_i);
535
536    for (size_t p = 0; p < nb_procs; p++)
537    int_xbar_rsp_d->p_local_out[proc_int_srcid+p] (signal_int_dspin_rsp_proc_i[p]);
538
539    if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) )
540    {
541    int_xbar_rsp_d->p_local_in[iobx_int_tgtid]   (signal_int_dspin_rsp_iobx_t);
542    int_xbar_rsp_d->p_local_out[iobx_int_srcid]  (signal_int_dspin_rsp_iobx_i);
543    }
544
545    ////////////////////// M2P DSPIN local crossbar coherence
546    int_xbar_m2p_c->p_clk                        (this->p_clk);
547    int_xbar_m2p_c->p_resetn                     (this->p_resetn);
548    int_xbar_m2p_c->p_global_out                 (signal_int_dspin_m2p_l2g_c);
549    int_xbar_m2p_c->p_global_in                  (signal_int_dspin_m2p_g2l_c);
550    int_xbar_m2p_c->p_local_in[0]                (signal_int_dspin_m2p_memc);
551    for (size_t p = 0; p < nb_procs; p++) 
552        int_xbar_m2p_c->p_local_out[p]           (signal_int_dspin_m2p_proc[p]);
553
554    ////////////////////////// P2M DSPIN local crossbar coherence
555    int_xbar_p2m_c->p_clk                        (this->p_clk);
556    int_xbar_p2m_c->p_resetn                     (this->p_resetn);
557    int_xbar_p2m_c->p_global_out                 (signal_int_dspin_p2m_l2g_c);
558    int_xbar_p2m_c->p_global_in                  (signal_int_dspin_p2m_g2l_c);
559    int_xbar_p2m_c->p_local_out[0]               (signal_int_dspin_p2m_memc);
560    for (size_t p = 0; p < nb_procs; p++) 
561        int_xbar_p2m_c->p_local_in[p]            (signal_int_dspin_p2m_proc[p]);
562
563    ////////////////////// CLACK DSPIN local crossbar coherence
564    int_xbar_clack_c->p_clk                      (this->p_clk);
565    int_xbar_clack_c->p_resetn                   (this->p_resetn);
566    int_xbar_clack_c->p_global_out               (signal_int_dspin_clack_l2g_c);
567    int_xbar_clack_c->p_global_in                (signal_int_dspin_clack_g2l_c);
568    int_xbar_clack_c->p_local_in[0]              (signal_int_dspin_clack_memc);
569    for (size_t p = 0; p < nb_procs; p++)
570        int_xbar_clack_c->p_local_out[p]         (signal_int_dspin_clack_proc[p]);
571
572    //////////////////////////////////// Processors
573    for (size_t p = 0; p < nb_procs; p++)
574    {
575        proc[p]->p_clk                           (this->p_clk);
576        proc[p]->p_resetn                        (this->p_resetn);
577        proc[p]->p_vci                           (signal_int_vci_ini_proc[p]);
578        proc[p]->p_dspin_m2p                     (signal_int_dspin_m2p_proc[p]);
579        proc[p]->p_dspin_p2m                     (signal_int_dspin_p2m_proc[p]);
580        proc[p]->p_dspin_clack                   (signal_int_dspin_clack_proc[p]);
581        proc[p]->p_irq[0]                        (signal_proc_it[p]);
582        for ( size_t j = 1 ; j < 6 ; j++)
583        {
584            proc[p]->p_irq[j]                    (signal_false);
585        }
586
587        proc_wi[p]->p_clk                        (this->p_clk);
588        proc_wi[p]->p_resetn                     (this->p_resetn);
589        proc_wi[p]->p_dspin_cmd                  (signal_int_dspin_cmd_proc_i[p]);
590        proc_wi[p]->p_dspin_rsp                  (signal_int_dspin_rsp_proc_i[p]);
591        proc_wi[p]->p_vci                        (signal_int_vci_ini_proc[p]);
592    }
593
594    ///////////////////////////////////// XICU
595    xicu->p_clk                                  (this->p_clk);
596    xicu->p_resetn                               (this->p_resetn);
597    xicu->p_vci                                  (signal_int_vci_tgt_xicu);
598    for ( size_t p=0 ; p<nb_procs ; p++)
599    {
600        xicu->p_irq[p]                           (signal_proc_it[p]);
601    }
602    for ( size_t i=0 ; i<32 ; i++)
603    {
604        if (cluster_id == cluster_iob0) 
605            xicu->p_hwi[i]                       (*(this->p_irq[i]));
606        else 
607            xicu->p_hwi[i]                       (signal_false);
608    }                     
609
610    // wrapper XICU
611    xicu_int_wt->p_clk                           (this->p_clk);
612    xicu_int_wt->p_resetn                        (this->p_resetn);
613    xicu_int_wt->p_dspin_cmd                     (signal_int_dspin_cmd_xicu_t);
614    xicu_int_wt->p_dspin_rsp                     (signal_int_dspin_rsp_xicu_t);
615    xicu_int_wt->p_vci                           (signal_int_vci_tgt_xicu);
616
617    ///////////////////////////////////// MEMC
618    memc->p_clk                                  (this->p_clk);
619    memc->p_resetn                               (this->p_resetn);
620    memc->p_vci_ixr                              (signal_ram_vci_ini_memc);
621    memc->p_vci_tgt                              (signal_int_vci_tgt_memc);
622    memc->p_dspin_p2m                            (signal_int_dspin_p2m_memc);
623    memc->p_dspin_m2p                            (signal_int_dspin_m2p_memc);
624    memc->p_dspin_clack                          (signal_int_dspin_clack_memc);
625
626    // wrapper to INT network
627    memc_int_wt->p_clk                           (this->p_clk);
628    memc_int_wt->p_resetn                        (this->p_resetn);
629    memc_int_wt->p_dspin_cmd                     (signal_int_dspin_cmd_memc_t);
630    memc_int_wt->p_dspin_rsp                     (signal_int_dspin_rsp_memc_t);
631    memc_int_wt->p_vci                           (signal_int_vci_tgt_memc);
632
633    // wrapper to RAM network
634    memc_ram_wi->p_clk                           (this->p_clk);
635    memc_ram_wi->p_resetn                        (this->p_resetn);
636    memc_ram_wi->p_dspin_cmd                     (signal_ram_dspin_cmd_memc_i);
637    memc_ram_wi->p_dspin_rsp                     (signal_ram_dspin_rsp_memc_i);
638    memc_ram_wi->p_vci                           (signal_ram_vci_ini_memc);
639
640    //////////////////////////////////// XRAM
641    xram->p_clk                                  (this->p_clk);
642    xram->p_resetn                               (this->p_resetn);
643    xram->p_vci                                  (signal_ram_vci_tgt_xram);
644
645    // wrapper to RAM network
646    xram_ram_wt->p_clk                           (this->p_clk);
647    xram_ram_wt->p_resetn                        (this->p_resetn);
648    xram_ram_wt->p_dspin_cmd                     (signal_ram_dspin_cmd_xram_t);
649    xram_ram_wt->p_dspin_rsp                     (signal_ram_dspin_rsp_xram_t);
650    xram_ram_wt->p_vci                           (signal_ram_vci_tgt_xram);
651
652    /////////////////////////////////// MDMA
653    mdma->p_clk                                  (this->p_clk);
654    mdma->p_resetn                               (this->p_resetn);
655    mdma->p_vci_target                           (signal_int_vci_tgt_mdma);
656    mdma->p_vci_initiator                        (signal_int_vci_ini_mdma);
657    for (size_t i=0 ; i<nb_dmas ; i++)
658        mdma->p_irq[i]                           (signal_irq_mdma[i]);
659
660    // target wrapper
661    mdma_int_wt->p_clk                           (this->p_clk);
662    mdma_int_wt->p_resetn                        (this->p_resetn);
663    mdma_int_wt->p_dspin_cmd                     (signal_int_dspin_cmd_mdma_t);
664    mdma_int_wt->p_dspin_rsp                     (signal_int_dspin_rsp_mdma_t);
665    mdma_int_wt->p_vci                           (signal_int_vci_tgt_mdma);
666
667    // initiator wrapper
668    mdma_int_wi->p_clk                           (this->p_clk);
669    mdma_int_wi->p_resetn                        (this->p_resetn);
670    mdma_int_wi->p_dspin_cmd                     (signal_int_dspin_cmd_mdma_i);
671    mdma_int_wi->p_dspin_rsp                     (signal_int_dspin_rsp_mdma_i);
672    mdma_int_wi->p_vci                           (signal_int_vci_ini_mdma);
673
674    //////////////////////////// RAM network CMD & RSP routers
675    ram_router_cmd->p_clk                    (this->p_clk);
676    ram_router_cmd->p_resetn                 (this->p_resetn);
677    ram_router_rsp->p_clk                    (this->p_clk);
678    ram_router_rsp->p_resetn                 (this->p_resetn);
679    for( size_t n=0 ; n<4 ; n++)
680    {
681        ram_router_cmd->p_out[n]             (this->p_dspin_ram_cmd_out[n]);
682        ram_router_cmd->p_in[n]              (this->p_dspin_ram_cmd_in[n]);
683        ram_router_rsp->p_out[n]             (this->p_dspin_ram_rsp_out[n]);
684        ram_router_rsp->p_in[n]              (this->p_dspin_ram_rsp_in[n]);
685    }
686    ram_router_cmd->p_out[4]                 (signal_ram_dspin_cmd_xram_t);
687    ram_router_cmd->p_in[4]                  (signal_ram_dspin_cmd_memc_i);
688    ram_router_rsp->p_out[4]                 (signal_ram_dspin_rsp_memc_i);
689    ram_router_rsp->p_in[4]                  (signal_ram_dspin_rsp_xram_t);
690   
691    ///////////////////////// IOB exists only in cluster_iob0 & cluster_iob1.
692    if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) )
693    {
694        // IO bridge
695        iob->p_clk                               (this->p_clk);
696        iob->p_resetn                            (this->p_resetn);
697        iob->p_vci_ini_iox                       (*(this->p_vci_iob_iox_ini));
698        iob->p_vci_tgt_iox                       (*(this->p_vci_iob_iox_tgt));
699        iob->p_vci_tgt_int                       (signal_int_vci_tgt_iobx);
700        iob->p_vci_ini_int                       (signal_int_vci_ini_iobx);
701        iob->p_vci_ini_ram                       (signal_ram_vci_ini_iobx);
702
703        if ( cluster_id == cluster_iob0 )
704               for ( size_t n=0 ; n<32 ; n++ )
705                   (*iob->p_irq[n])                 (*(this->p_irq[n]));
706
707        // initiator wrapper to RAM network
708        iob_ram_wi->p_clk                        (this->p_clk);
709        iob_ram_wi->p_resetn                     (this->p_resetn);
710        iob_ram_wi->p_dspin_cmd                  (*(this->p_dspin_iob_cmd_out));
711        iob_ram_wi->p_dspin_rsp                  (*(this->p_dspin_iob_rsp_in));
712        iob_ram_wi->p_vci                        (signal_ram_vci_ini_iobx);
713
714        // initiator wrapper to INT network
715        iob_int_wi->p_clk                        (this->p_clk);
716        iob_int_wi->p_resetn                     (this->p_resetn);
717        iob_int_wi->p_dspin_cmd                  (signal_int_dspin_cmd_iobx_i);
718        iob_int_wi->p_dspin_rsp                  (signal_int_dspin_rsp_iobx_i);
719        iob_int_wi->p_vci                        (signal_int_vci_ini_iobx);
720
721        // target wrapper to INT network
722        iob_int_wt->p_clk                        (this->p_clk);
723        iob_int_wt->p_resetn                     (this->p_resetn);
724        iob_int_wt->p_dspin_cmd                  (signal_int_dspin_cmd_iobx_t);
725        iob_int_wt->p_dspin_rsp                  (signal_int_dspin_rsp_iobx_t);
726        iob_int_wt->p_vci                        (signal_int_vci_tgt_iobx);
727    }
728
729} // end constructor
730
731}}
732
733
734// Local Variables:
735// tab-width: 3
736// c-basic-offset: 3
737// c-file-offsets:((innamespace . 0)(inline-open . 0))
738// indent-tabs-mode: nil
739// End:
740
741// vim: filetype=cpp:expandtab:shiftwidth=3:tabstop=3:softtabstop=3
742
743
744
Note: See TracBrowser for help on using the repository browser.