[259] | 1 | #include "../include/tsarv4_cluster_xbar.h" |
---|
| 2 | |
---|
| 3 | namespace soclib { |
---|
| 4 | namespace caba { |
---|
| 5 | |
---|
| 6 | ////////////////////////////////////////////////////////////////////////// |
---|
| 7 | // Constructor |
---|
| 8 | ////////////////////////////////////////////////////////////////////////// |
---|
| 9 | template<typename vci_param, typename iss_t, int cmd_width, int rsp_width> |
---|
| 10 | TsarV4ClusterXbar<vci_param, iss_t, cmd_width, rsp_width>::TsarV4ClusterXbar( |
---|
| 11 | sc_module_name insname, |
---|
| 12 | size_t nprocs, |
---|
| 13 | size_t x_id, |
---|
| 14 | size_t y_id, |
---|
| 15 | size_t cluster_id, |
---|
| 16 | const soclib::common::MappingTable &mtd, |
---|
| 17 | const soclib::common::MappingTable &mtc, |
---|
| 18 | const soclib::common::MappingTable &mtx, |
---|
| 19 | size_t x_width, |
---|
| 20 | size_t y_width, |
---|
| 21 | size_t tgtid_memc, |
---|
| 22 | size_t tgtid_xicu, |
---|
| 23 | size_t tgtid_fbuf, |
---|
| 24 | size_t tgtid_mtty, |
---|
| 25 | size_t tgtid_brom, |
---|
| 26 | size_t tgtid_bdev, |
---|
| 27 | size_t tgtid_mdma, |
---|
| 28 | size_t memc_ways, |
---|
| 29 | size_t memc_sets, |
---|
| 30 | size_t l1_i_ways, |
---|
| 31 | size_t l1_i_sets, |
---|
| 32 | size_t l1_d_ways, |
---|
| 33 | size_t l1_d_sets, |
---|
| 34 | size_t xram_latency, |
---|
| 35 | bool io, |
---|
| 36 | size_t xfb, |
---|
| 37 | size_t yfb, |
---|
| 38 | size_t fb_mode, |
---|
| 39 | char* disk_name, |
---|
| 40 | size_t block_size, |
---|
| 41 | const Loader &loader) |
---|
| 42 | : soclib::caba::BaseModule(insname), |
---|
| 43 | p_clk("clk"), |
---|
| 44 | p_resetn("resetn"), |
---|
| 45 | |
---|
| 46 | signal_dspin_cmd_l2g_d("signal_dspin_cmd_l2g_d"), |
---|
| 47 | signal_dspin_cmd_g2l_d("signal_dspin_cmd_g2l_d"), |
---|
| 48 | signal_dspin_cmd_l2g_c("signal_dspin_cmd_l2g_c"), |
---|
| 49 | signal_dspin_cmd_g2l_c("signal_dspin_cmd_g2l_c"), |
---|
| 50 | signal_dspin_rsp_l2g_d("signal_dspin_rsp_l2g_d"), |
---|
| 51 | signal_dspin_rsp_g2l_d("signal_dspin_rsp_g2l_d"), |
---|
| 52 | signal_dspin_rsp_l2g_c("signal_dspin_rsp_l2g_c"), |
---|
| 53 | signal_dspin_rsp_g2l_c("signal_dspin_rsp_g2l_c"), |
---|
| 54 | |
---|
| 55 | signal_vci_ini_d_bdev("signal_vci_ini_d_bdev"), |
---|
| 56 | signal_vci_ini_d_cdma("signal_vci_ini_d_cdma"), |
---|
| 57 | |
---|
| 58 | signal_vci_tgt_d_memc("signal_vci_tgt_d_memc"), |
---|
| 59 | signal_vci_tgt_d_mtty("signal_vci_tgt_d_mtty"), |
---|
| 60 | signal_vci_tgt_d_xicu("signal_vci_tgt_d_xicu"), |
---|
| 61 | signal_vci_tgt_d_bdev("signal_vci_tgt_d_bdev"), |
---|
| 62 | signal_vci_tgt_d_cdma("signal_vci_tgt_d_cdma"), |
---|
| 63 | signal_vci_tgt_d_brom("signal_vci_tgt_d_brom"), |
---|
| 64 | signal_vci_tgt_d_fbuf("signal_vci_tgt_d_fbuf"), |
---|
| 65 | |
---|
| 66 | signal_vci_ini_c_memc("signal_vci_ini_c_memc"), |
---|
| 67 | signal_vci_tgt_c_memc("signal_vci_tgt_c_memc"), |
---|
| 68 | |
---|
| 69 | signal_vci_xram("signal_vci_xram") |
---|
| 70 | |
---|
| 71 | { |
---|
| 72 | // Vectors of ports definition |
---|
| 73 | |
---|
| 74 | p_cmd_in = alloc_elems<DspinInput<cmd_width> >("p_cmd_in", 2, 4); |
---|
| 75 | p_cmd_out = alloc_elems<DspinOutput<cmd_width> >("p_cmd_out", 2, 4); |
---|
| 76 | p_rsp_in = alloc_elems<DspinInput<rsp_width> >("p_rsp_in", 2, 4); |
---|
| 77 | p_rsp_out = alloc_elems<DspinOutput<rsp_width> >("p_rsp_out", 2, 4); |
---|
| 78 | |
---|
| 79 | // Components definition |
---|
| 80 | |
---|
| 81 | // on direct network : local srcid[proc] in [0...nprocs-1] |
---|
| 82 | // on direct network : local srcid[mdma] = nprocs |
---|
| 83 | // on direct network : local srcid[bdev] = nprocs + 1 |
---|
| 84 | |
---|
| 85 | // on coherence network : local srcid[proc] in [0...nprocs-1] |
---|
| 86 | // on coherence network : local srcid[memc] = nprocs |
---|
| 87 | |
---|
| 88 | std::cout << " - building proc_" << x_id << "_" << y_id << "-*" << std::endl; |
---|
| 89 | |
---|
| 90 | for ( size_t p=0 ; p<nprocs ; p++ ) |
---|
| 91 | { |
---|
| 92 | std::ostringstream sproc; |
---|
| 93 | sproc << "proc_" << x_id << "_" << y_id << "_" << p; |
---|
| 94 | |
---|
| 95 | #if USE_MEMCACHE_V4 |
---|
| 96 | proc[p] = new VciCcXCacheWrapperV4<vci_param, iss_t>( |
---|
| 97 | sproc.str().c_str(), |
---|
| 98 | cluster_id*nprocs + p, |
---|
| 99 | mtd, // Mapping Table Direct |
---|
| 100 | mtc, // Mapping Table Coherence |
---|
| 101 | IntTab(cluster_id,p), // SRCID_D |
---|
| 102 | IntTab(cluster_id,p), // SRCID_C |
---|
| 103 | IntTab(cluster_id,p), // TGTID_C |
---|
| 104 | 1, // single core |
---|
| 105 | 1, // single dcache |
---|
| 106 | l1_i_ways,l1_i_sets,16, // ICACHE size |
---|
| 107 | l1_d_ways,l1_d_sets,16, // DCACHE size |
---|
| 108 | 4, // WBUF width |
---|
| 109 | 8 // WBUF depth |
---|
| 110 | ); |
---|
| 111 | #endif // USE_MEMCACHE_V4 |
---|
| 112 | |
---|
| 113 | #if USE_MEMCACHE_V3 |
---|
| 114 | proc[p] = new VciCcVCacheWrapper2V1<vci_param, iss_t>( |
---|
| 115 | sproc.str().c_str(), |
---|
| 116 | cluster_id*nprocs + p, |
---|
| 117 | mtd, mtc, |
---|
| 118 | IntTab(cluster_id,p), // SRCID_D |
---|
| 119 | IntTab(cluster_id,p), // SRCID_C |
---|
| 120 | IntTab(cluster_id,p), // TGTID_C |
---|
| 121 | TLB_IWAYS,TLB_ISETS,TLB_DWAYS,TLB_DSETS, |
---|
| 122 | l1_i_ways,l1_i_sets,16, |
---|
| 123 | l1_d_ways,l1_d_sets,16, |
---|
| 124 | 16); // TLB, Icache and Dcache sizes |
---|
| 125 | #endif // USE_MEMCACHE_V3 |
---|
| 126 | |
---|
| 127 | #if USE_PROFILER_ON_CPUs |
---|
| 128 | std::ostringstream sp; |
---|
| 129 | sp << "profiler_" << x_id << "_" << y_id << "-" << p; |
---|
| 130 | |
---|
| 131 | profiler[p] = new VciProfiler <vci_param, iss_t> (sp.str().c_str(), |
---|
| 132 | cluster_id, |
---|
| 133 | x_id, |
---|
| 134 | y_id, |
---|
| 135 | x_width, |
---|
| 136 | y_width, |
---|
| 137 | CONFIG_ADDRESS_WIDTH); |
---|
| 138 | profiler[p]->p_clk (this->p_clk); |
---|
| 139 | profiler[p]->p_resetn (this->p_resetn); |
---|
| 140 | profiler[p]->p_vci (signal_vci_ini_d_proc[p]); |
---|
| 141 | profiler[p]->set_L1_cache(proc[p]); |
---|
| 142 | #endif // USE_PROFILER_ON_CPUs |
---|
| 143 | |
---|
| 144 | #if USE_LOGGER_ON_CPUs |
---|
| 145 | std::ostringstream sp2; |
---|
| 146 | sp2 << "logger_" << x_id << "_" << y_id << "-" << p; |
---|
| 147 | vci_logger[p] = new VciLogger <vci_param> (sp2.str().c_str(), mtd); |
---|
| 148 | vci_logger[p]->p_clk (this->p_clk); |
---|
| 149 | vci_logger[p]->p_resetn (this->p_resetn); |
---|
| 150 | vci_logger[p]->p_vci (signal_vci_ini_d_proc[p]); |
---|
| 151 | #endif // USE_LOGGER_ON_CPUs |
---|
| 152 | |
---|
| 153 | } // for on CPUs number |
---|
| 154 | |
---|
| 155 | std::cout << " - building memc_" << x_id << "_" << y_id << std::endl; |
---|
| 156 | |
---|
| 157 | std::ostringstream smemc; |
---|
| 158 | smemc << "memc_" << x_id << "_" << y_id; |
---|
| 159 | |
---|
| 160 | #if USE_MEMCACHE_V4 |
---|
| 161 | memc = new VciMemCacheV4<vci_param>( |
---|
| 162 | smemc.str().c_str(), |
---|
| 163 | mtd, mtc, mtx, |
---|
| 164 | IntTab(cluster_id), // SRCID_X |
---|
| 165 | IntTab(cluster_id, nprocs), // SRCID_C |
---|
| 166 | IntTab(cluster_id, tgtid_memc), // TGTID_D |
---|
| 167 | IntTab(cluster_id, nprocs), // TGTID_C |
---|
| 168 | memc_ways, memc_sets, 16, // CACHE SIZE |
---|
| 169 | 4096, // HEAP SIZE |
---|
| 170 | 8, // TRANSACTION TABLE DEPTH |
---|
| 171 | 8); // UPDATE TABLE DEPTH |
---|
| 172 | #endif |
---|
| 173 | |
---|
| 174 | #if USE_MEMCACHE_V3 |
---|
| 175 | memc = new VciMemCacheV3<vci_param>( |
---|
| 176 | smemc.str().c_str(), |
---|
| 177 | mtd, mtc, mtx, |
---|
| 178 | IntTab(cluster_id), // SRCID_X |
---|
| 179 | IntTab(cluster_id, nprocs), // SRCID_C |
---|
| 180 | IntTab(cluster_id, tgtid_memc), // TGTID_D |
---|
| 181 | IntTab(cluster_id, nprocs), // TGTID_C |
---|
| 182 | memc_ways, memc_sets, 16, |
---|
| 183 | 4096); |
---|
| 184 | #endif // USE_MEMCACHE_V3 |
---|
| 185 | |
---|
| 186 | |
---|
| 187 | std::cout << " - building xram_" << x_id << "_" << y_id << std::endl; |
---|
| 188 | |
---|
| 189 | std::ostringstream sxram; |
---|
| 190 | sxram << "xram_" << x_id << "_" << y_id; |
---|
| 191 | xram = new VciSimpleRam<vci_param>( |
---|
| 192 | sxram.str().c_str(), |
---|
| 193 | IntTab(cluster_id), |
---|
| 194 | mtx, |
---|
| 195 | loader, |
---|
| 196 | xram_latency); |
---|
| 197 | |
---|
| 198 | std::cout << " - building xicu_" << x_id << "_" << y_id << std::endl; |
---|
| 199 | |
---|
| 200 | //size_t nhwi = 8; // always 8 (or 9) ports, even if |
---|
| 201 | //if( io == true ) nhwi = 9; // there if less than 4 processors |
---|
| 202 | |
---|
| 203 | |
---|
| 204 | size_t nhwi = 0; |
---|
| 205 | if(io == true) nhwi = 6; |
---|
| 206 | |
---|
| 207 | std::ostringstream sicu; |
---|
| 208 | sicu << "xicu_" << x_id << "_" << y_id; |
---|
| 209 | xicu = new VciXicu<vci_param>( |
---|
| 210 | sicu.str().c_str(), |
---|
| 211 | mtd, // mapping table |
---|
| 212 | IntTab(cluster_id, tgtid_xicu), // TGTID_D |
---|
| 213 | nprocs, // number of timer IRQs |
---|
| 214 | nhwi, // number of hard IRQs |
---|
| 215 | nprocs, // number of soft IRQs |
---|
| 216 | nprocs); // number of output IRQs |
---|
| 217 | |
---|
| 218 | std::cout << " - building xbard_" << x_id << "_" << y_id << std::endl; |
---|
| 219 | |
---|
| 220 | // direct local crossbar |
---|
| 221 | size_t nb_direct_initiators = nprocs; |
---|
| 222 | size_t nb_direct_targets = 2; |
---|
| 223 | |
---|
| 224 | if( io == true ) |
---|
| 225 | { |
---|
| 226 | nb_direct_initiators = nprocs + 2; |
---|
| 227 | nb_direct_targets = 7; |
---|
| 228 | } |
---|
| 229 | |
---|
| 230 | std::ostringstream sd; |
---|
| 231 | sd << "xbard_" << x_id << "_" << y_id; |
---|
| 232 | |
---|
| 233 | #if USE_LOCAL_RING |
---|
| 234 | xbard = new VciLocalRingFast<vci_param,cmd_width,rsp_width>( |
---|
| 235 | sd.str().c_str(), |
---|
| 236 | mtd, |
---|
| 237 | IntTab(cluster_id), // cluster index |
---|
| 238 | 4, // wrapper fifo depth |
---|
| 239 | 18, // gateway fifo depth |
---|
| 240 | nb_direct_initiators , // number of initiators |
---|
| 241 | nb_direct_targets); // number of targets |
---|
| 242 | #else |
---|
| 243 | xbard = new VciLocalCrossbar<vci_param>( |
---|
| 244 | sd.str().c_str(), |
---|
| 245 | mtd, |
---|
| 246 | IntTab(cluster_id), // cluster initiator index |
---|
| 247 | IntTab(cluster_id), // cluster target index |
---|
| 248 | nb_direct_initiators, // number of initiators |
---|
| 249 | nb_direct_targets); // number of targets |
---|
| 250 | #endif // USE_LOCAL_RING |
---|
| 251 | |
---|
| 252 | |
---|
| 253 | std::cout << " - building xbarc_" << x_id << "_" << y_id << std::endl; |
---|
| 254 | |
---|
| 255 | // coherence local crossbar |
---|
| 256 | std::ostringstream sc; |
---|
| 257 | sc << "xbarc_" << x_id << "_" << y_id; |
---|
| 258 | |
---|
| 259 | #if USE_LOCAL_RING |
---|
| 260 | xbarc = new VciLocalRingFast<vci_param,cmd_width,rsp_width>( |
---|
| 261 | sc.str().c_str(), |
---|
| 262 | mtc, |
---|
| 263 | IntTab(cluster_id), // cluster index |
---|
| 264 | 4, // wrapper fifo depth |
---|
| 265 | 18, // gateway fifo depth |
---|
| 266 | nprocs + 1, // number of initiators |
---|
| 267 | nprocs + 1); // number of targets |
---|
| 268 | |
---|
| 269 | #else |
---|
| 270 | xbarc = new VciLocalCrossbar<vci_param>( |
---|
| 271 | sc.str().c_str(), |
---|
| 272 | mtc, |
---|
| 273 | IntTab(cluster_id), // cluster initiator index |
---|
| 274 | IntTab(cluster_id), // cluster target index |
---|
| 275 | nprocs + 1, // number of initiators |
---|
| 276 | nprocs + 1); // number of targets |
---|
| 277 | #endif // USE_LOCAL_RING |
---|
| 278 | |
---|
| 279 | #if !(USE_LOCAL_RING) |
---|
| 280 | std::cout << " - building wrappers in cluster_" << x_id << "_" << y_id << std::endl; |
---|
| 281 | |
---|
| 282 | // direct initiator wrapper |
---|
| 283 | std::ostringstream wid; |
---|
| 284 | wid << "iniwrapperd_" << x_id << "_" << y_id; |
---|
| 285 | iniwrapperd = new VciVdspinInitiatorWrapper<vci_param,cmd_width,rsp_width>( |
---|
| 286 | wid.str().c_str(), |
---|
| 287 | 4, // cmd fifo depth |
---|
| 288 | 4); // rsp fifo depth |
---|
| 289 | |
---|
| 290 | // direct target wrapper |
---|
| 291 | std::ostringstream wtd; |
---|
| 292 | wtd << "tgtwrapperd_" << x_id << "_" << y_id; |
---|
| 293 | tgtwrapperd = new VciVdspinTargetWrapper<vci_param,cmd_width,rsp_width>( |
---|
| 294 | wtd.str().c_str(), |
---|
| 295 | 4, // cmd fifo depth |
---|
| 296 | 4); // rsp fifo depth |
---|
| 297 | |
---|
| 298 | // coherence initiator wrapper |
---|
| 299 | std::ostringstream wic; |
---|
| 300 | wic << "iniwrapperc_" << x_id << "_" << y_id; |
---|
| 301 | iniwrapperc = new VciVdspinInitiatorWrapper<vci_param,cmd_width,rsp_width>( |
---|
| 302 | wic.str().c_str(), |
---|
| 303 | 4, // cmd fifo depth |
---|
| 304 | 4); // rsp fifo depth |
---|
| 305 | |
---|
| 306 | // coherence target wrapper |
---|
| 307 | std::ostringstream wtc; |
---|
| 308 | wtc << "tgtwrapperc_" << x_id << "_" << y_id; |
---|
| 309 | tgtwrapperc = new VciVdspinTargetWrapper<vci_param,cmd_width,rsp_width>( |
---|
| 310 | wtc.str().c_str(), |
---|
| 311 | 4, // cmd fifo depth |
---|
| 312 | 4); // rsp fifo depth |
---|
| 313 | #endif // !(USE_LOCAL_RING) |
---|
| 314 | |
---|
| 315 | std::cout << " - building cmdrouter_" << x_id << "_" << y_id << std::endl; |
---|
| 316 | |
---|
| 317 | // CMD router |
---|
| 318 | std::ostringstream scmd; |
---|
| 319 | scmd << "cmdrouter_" << x_id << "_" << y_id; |
---|
| 320 | cmdrouter = new VirtualDspinRouter<cmd_width>( |
---|
| 321 | scmd.str().c_str(), |
---|
| 322 | x_id,y_id, // coordinate in the mesh |
---|
| 323 | x_width, y_width, // x & y fields width |
---|
| 324 | 4,4); // input & output fifo depths |
---|
| 325 | |
---|
| 326 | std::cout << " - building rsprouter_" << x_id << "_" << y_id << std::endl; |
---|
| 327 | |
---|
| 328 | // RSP router |
---|
| 329 | std::ostringstream srsp; |
---|
| 330 | srsp << "rsprouter_" << x_id << "_" << y_id; |
---|
| 331 | rsprouter = new VirtualDspinRouter<rsp_width>( |
---|
| 332 | srsp.str().c_str(), |
---|
| 333 | x_id,y_id, // coordinates in mesh |
---|
| 334 | x_width, y_width, // x & y fields width |
---|
| 335 | 4,4); // input & output fifo depths |
---|
| 336 | |
---|
| 337 | // IO cluster components |
---|
| 338 | if ( io == true ) |
---|
| 339 | { |
---|
| 340 | brom = new VciSimpleRam<vci_param>( |
---|
| 341 | "brom", |
---|
| 342 | IntTab(cluster_id, tgtid_brom), |
---|
| 343 | mtd, |
---|
| 344 | loader); |
---|
| 345 | |
---|
| 346 | #if USE_FRAME_BUFFER |
---|
| 347 | fbuf = new VciFrameBuffer<vci_param>( |
---|
| 348 | "fbuf", |
---|
| 349 | IntTab(cluster_id, tgtid_fbuf), |
---|
| 350 | mtd, |
---|
| 351 | xfb, |
---|
| 352 | yfb, |
---|
| 353 | fb_mode); |
---|
| 354 | #else |
---|
| 355 | std::ostringstream sf; |
---|
| 356 | sd << "fb_logger__" << x_id << "_" << y_id; |
---|
| 357 | fbuf = new VciLogger <vci_param> (sd.str().c_str(), mtd); |
---|
| 358 | #endif |
---|
| 359 | |
---|
| 360 | cdma = new VciDmaTsarV2<vci_param>( |
---|
| 361 | "cdma", |
---|
| 362 | mtd, |
---|
| 363 | IntTab(cluster_id, nprocs), |
---|
| 364 | IntTab(cluster_id, tgtid_mdma), |
---|
| 365 | 64); |
---|
| 366 | |
---|
| 367 | #if USE_LOGGER_ON_DMA |
---|
| 368 | std::ostringstream sd; |
---|
| 369 | sd << "dma_logger_" << x_id << "_" << y_id; |
---|
| 370 | vci_dma_logger = new VciLogger <vci_param> (sd.str().c_str(), mtd); |
---|
| 371 | vci_dma_logger->p_clk (this->p_clk); |
---|
| 372 | vci_dma_logger->p_resetn (this->p_resetn); |
---|
| 373 | vci_dma_logger->p_vci (signal_vci_ini_d_cdma); |
---|
| 374 | #endif // USE_LOGGER_ON_DMA |
---|
| 375 | |
---|
| 376 | bdev = new VciBlockDeviceTsarV2<vci_param>( |
---|
| 377 | "bdev", |
---|
| 378 | mtd, |
---|
| 379 | IntTab(cluster_id, nprocs+1), |
---|
| 380 | IntTab(cluster_id, tgtid_bdev), |
---|
| 381 | disk_name, |
---|
| 382 | block_size); |
---|
| 383 | |
---|
| 384 | // tty |
---|
| 385 | signal_irq_mtty = alloc_elems<sc_signal<bool> >("signal_irq_mtty", 4); |
---|
| 386 | |
---|
| 387 | std::ostringstream stty; |
---|
| 388 | stty << "tty_" << x_id << "_" << y_id; |
---|
| 389 | mtty = new VciMultiTty<vci_param>( |
---|
| 390 | stty.str().c_str(), |
---|
| 391 | IntTab(cluster_id, tgtid_mtty), |
---|
| 392 | mtd, "tty0", "tty1", "tty2", "tty3", NULL); |
---|
| 393 | } |
---|
| 394 | |
---|
| 395 | std::cout << " - all components constructed" << std::endl; |
---|
| 396 | |
---|
| 397 | //////////////////////////////////// |
---|
| 398 | // Connections are defined here |
---|
| 399 | //////////////////////////////////// |
---|
| 400 | |
---|
| 401 | // CMDROUTER and RSPROUTER |
---|
| 402 | cmdrouter->p_clk (this->p_clk); |
---|
| 403 | cmdrouter->p_resetn (this->p_resetn); |
---|
| 404 | rsprouter->p_clk (this->p_clk); |
---|
| 405 | rsprouter->p_resetn (this->p_resetn); |
---|
| 406 | for(int x = 0; x < 2; x++) |
---|
| 407 | { |
---|
| 408 | for(int y = 0; y < 4; y++) |
---|
| 409 | { |
---|
| 410 | cmdrouter->p_out[x][y] (this->p_cmd_out[x][y]); |
---|
| 411 | cmdrouter->p_in[x][y] (this->p_cmd_in[x][y]); |
---|
| 412 | rsprouter->p_out[x][y] (this->p_rsp_out[x][y]); |
---|
| 413 | rsprouter->p_in[x][y] (this->p_rsp_in[x][y]); |
---|
| 414 | } |
---|
| 415 | } |
---|
| 416 | |
---|
| 417 | cmdrouter->p_out[0][4] (signal_dspin_cmd_g2l_d); |
---|
| 418 | cmdrouter->p_out[1][4] (signal_dspin_cmd_g2l_c); |
---|
| 419 | cmdrouter->p_in[0][4] (signal_dspin_cmd_l2g_d); |
---|
| 420 | cmdrouter->p_in[1][4] (signal_dspin_cmd_l2g_c); |
---|
| 421 | |
---|
| 422 | rsprouter->p_out[0][4] (signal_dspin_rsp_g2l_d); |
---|
| 423 | rsprouter->p_out[1][4] (signal_dspin_rsp_g2l_c); |
---|
| 424 | rsprouter->p_in[0][4] (signal_dspin_rsp_l2g_d); |
---|
| 425 | rsprouter->p_in[1][4] (signal_dspin_rsp_l2g_c); |
---|
| 426 | |
---|
| 427 | #if !(USE_LOCAL_RING) |
---|
| 428 | // VCI/DSPIN WRAPPERS |
---|
| 429 | iniwrapperd->p_clk (this->p_clk); |
---|
| 430 | iniwrapperd->p_resetn (this->p_resetn); |
---|
| 431 | iniwrapperd->p_vci (signal_vci_l2g_d); |
---|
| 432 | iniwrapperd->p_dspin_out (signal_dspin_cmd_l2g_d); |
---|
| 433 | iniwrapperd->p_dspin_in (signal_dspin_rsp_g2l_d); |
---|
| 434 | |
---|
| 435 | tgtwrapperd->p_clk (this->p_clk); |
---|
| 436 | tgtwrapperd->p_resetn (this->p_resetn); |
---|
| 437 | tgtwrapperd->p_vci (signal_vci_g2l_d); |
---|
| 438 | tgtwrapperd->p_dspin_out (signal_dspin_rsp_l2g_d); |
---|
| 439 | tgtwrapperd->p_dspin_in (signal_dspin_cmd_g2l_d); |
---|
| 440 | |
---|
| 441 | iniwrapperc->p_clk (this->p_clk); |
---|
| 442 | iniwrapperc->p_resetn (this->p_resetn); |
---|
| 443 | iniwrapperc->p_vci (signal_vci_l2g_c); |
---|
| 444 | iniwrapperc->p_dspin_out (signal_dspin_cmd_l2g_c); |
---|
| 445 | iniwrapperc->p_dspin_in (signal_dspin_rsp_g2l_c); |
---|
| 446 | |
---|
| 447 | tgtwrapperc->p_clk (this->p_clk); |
---|
| 448 | tgtwrapperc->p_resetn (this->p_resetn); |
---|
| 449 | tgtwrapperc->p_vci (signal_vci_g2l_c); |
---|
| 450 | tgtwrapperc->p_dspin_out (signal_dspin_rsp_l2g_c); |
---|
| 451 | tgtwrapperc->p_dspin_in (signal_dspin_cmd_g2l_c); |
---|
| 452 | #endif |
---|
| 453 | |
---|
| 454 | // CROSSBAR direct |
---|
| 455 | xbard->p_clk (this->p_clk); |
---|
| 456 | xbard->p_resetn (this->p_resetn); |
---|
| 457 | |
---|
| 458 | #if USE_LOCAL_RING |
---|
| 459 | xbard->p_gate_cmd_out (signal_dspin_cmd_l2g_d); |
---|
| 460 | xbard->p_gate_cmd_in (signal_dspin_cmd_g2l_d); |
---|
| 461 | xbard->p_gate_rsp_out (signal_dspin_rsp_l2g_d); |
---|
| 462 | xbard->p_gate_rsp_in (signal_dspin_rsp_g2l_d); |
---|
| 463 | #else |
---|
| 464 | xbard->p_initiator_to_up (signal_vci_l2g_d); |
---|
| 465 | xbard->p_target_to_up (signal_vci_g2l_d); |
---|
| 466 | #endif |
---|
| 467 | xbard->p_to_target[tgtid_memc] (signal_vci_tgt_d_memc); |
---|
| 468 | xbard->p_to_target[tgtid_xicu] (signal_vci_tgt_d_xicu); |
---|
| 469 | |
---|
| 470 | for ( size_t p=0 ; p<nprocs ; p++) |
---|
| 471 | xbard->p_to_initiator[p] (signal_vci_ini_d_proc[p]); |
---|
| 472 | |
---|
| 473 | if ( io == true ) |
---|
| 474 | { |
---|
| 475 | xbard->p_to_target[tgtid_brom] (signal_vci_tgt_d_brom); |
---|
| 476 | xbard->p_to_target[tgtid_bdev] (signal_vci_tgt_d_bdev); |
---|
| 477 | xbard->p_to_target[tgtid_fbuf] (signal_vci_tgt_d_fbuf); |
---|
| 478 | xbard->p_to_target[tgtid_mtty] (signal_vci_tgt_d_mtty); |
---|
| 479 | xbard->p_to_target[tgtid_mdma] (signal_vci_tgt_d_cdma); |
---|
| 480 | |
---|
| 481 | xbard->p_to_initiator[nprocs] (signal_vci_ini_d_cdma); |
---|
| 482 | xbard->p_to_initiator[nprocs+1] (signal_vci_ini_d_bdev); |
---|
| 483 | } |
---|
| 484 | |
---|
| 485 | // CROSSBAR coherence |
---|
| 486 | xbarc->p_clk (this->p_clk); |
---|
| 487 | xbarc->p_resetn (this->p_resetn); |
---|
| 488 | |
---|
| 489 | #if USE_LOCAL_RING |
---|
| 490 | xbarc->p_gate_cmd_out (signal_dspin_cmd_l2g_c); |
---|
| 491 | xbarc->p_gate_cmd_in (signal_dspin_cmd_g2l_c); |
---|
| 492 | xbarc->p_gate_rsp_out (signal_dspin_rsp_l2g_c); |
---|
| 493 | xbarc->p_gate_rsp_in (signal_dspin_rsp_g2l_c); |
---|
| 494 | #else |
---|
| 495 | xbarc->p_initiator_to_up (signal_vci_l2g_c); |
---|
| 496 | xbarc->p_target_to_up (signal_vci_g2l_c); |
---|
| 497 | #endif |
---|
| 498 | xbarc->p_to_initiator[nprocs] (signal_vci_ini_c_memc); |
---|
| 499 | xbarc->p_to_target[nprocs] (signal_vci_tgt_c_memc); |
---|
| 500 | |
---|
| 501 | for ( size_t p=0 ; p<nprocs ; p++) |
---|
| 502 | { |
---|
| 503 | xbarc->p_to_target[p] (signal_vci_tgt_c_proc[p]); |
---|
| 504 | xbarc->p_to_initiator[p] (signal_vci_ini_c_proc[p]); |
---|
| 505 | } |
---|
| 506 | |
---|
| 507 | // Processors |
---|
| 508 | for ( size_t p=0 ; p<nprocs ; p++) |
---|
| 509 | { |
---|
| 510 | proc[p]->p_clk (this->p_clk); |
---|
| 511 | proc[p]->p_resetn (this->p_resetn); |
---|
| 512 | proc[p]->p_vci_ini_rw (signal_vci_ini_d_proc[p]); |
---|
| 513 | proc[p]->p_vci_ini_c (signal_vci_ini_c_proc[p]); |
---|
| 514 | proc[p]->p_vci_tgt (signal_vci_tgt_c_proc[p]); |
---|
| 515 | proc[p]->p_irq[0] (signal_proc_it[p]); |
---|
| 516 | |
---|
| 517 | for ( size_t j = 1 ; j < 6 ; j++ ) |
---|
| 518 | proc[p]->p_irq[j] (signal_false); |
---|
| 519 | } |
---|
| 520 | |
---|
| 521 | // XICU |
---|
| 522 | xicu->p_clk (this->p_clk); |
---|
| 523 | xicu->p_resetn (this->p_resetn); |
---|
| 524 | xicu->p_vci (signal_vci_tgt_d_xicu); |
---|
| 525 | |
---|
| 526 | for ( size_t p=0 ; p<nprocs ; p++) |
---|
| 527 | xicu->p_irq[p] (signal_proc_it[p]); |
---|
| 528 | |
---|
| 529 | // MEMC |
---|
| 530 | memc->p_clk (this->p_clk); |
---|
| 531 | memc->p_resetn (this->p_resetn); |
---|
| 532 | memc->p_vci_ixr (signal_vci_xram); |
---|
| 533 | memc->p_vci_tgt (signal_vci_tgt_d_memc); |
---|
| 534 | memc->p_vci_ini (signal_vci_ini_c_memc); |
---|
| 535 | memc->p_vci_tgt_cleanup (signal_vci_tgt_c_memc); |
---|
| 536 | |
---|
| 537 | // XRAM |
---|
| 538 | xram->p_clk (this->p_clk); |
---|
| 539 | xram->p_resetn (this->p_resetn); |
---|
| 540 | xram->p_vci (signal_vci_xram); |
---|
| 541 | |
---|
| 542 | // Components in IO cluster |
---|
| 543 | if ( io == true ) |
---|
| 544 | { |
---|
| 545 | // BDEV |
---|
| 546 | bdev->p_clk (this->p_clk); |
---|
| 547 | bdev->p_resetn (this->p_resetn); |
---|
| 548 | bdev->p_irq (signal_irq_bdev); |
---|
| 549 | bdev->p_vci_target (signal_vci_tgt_d_bdev); |
---|
| 550 | bdev->p_vci_initiator (signal_vci_ini_d_bdev); |
---|
| 551 | |
---|
| 552 | // FBUF |
---|
| 553 | fbuf->p_clk (this->p_clk); |
---|
| 554 | fbuf->p_resetn (this->p_resetn); |
---|
| 555 | fbuf->p_vci (signal_vci_tgt_d_fbuf); |
---|
| 556 | |
---|
| 557 | // BROM |
---|
| 558 | brom->p_clk (this->p_clk); |
---|
| 559 | brom->p_resetn (this->p_resetn); |
---|
| 560 | brom->p_vci (signal_vci_tgt_d_brom); |
---|
| 561 | |
---|
| 562 | // MTTY |
---|
| 563 | mtty->p_clk (this->p_clk); |
---|
| 564 | mtty->p_resetn (this->p_resetn); |
---|
| 565 | mtty->p_vci (signal_vci_tgt_d_mtty); |
---|
| 566 | for(size_t i=0 ; i<4 ; i++) |
---|
| 567 | mtty->p_irq[i] (signal_irq_mtty[i]); |
---|
| 568 | |
---|
| 569 | // CDMA |
---|
| 570 | cdma->p_clk (this->p_clk); |
---|
| 571 | cdma->p_resetn (this->p_resetn); |
---|
| 572 | cdma->p_irq (signal_irq_cdma); |
---|
| 573 | cdma->p_vci_target (signal_vci_tgt_d_cdma); |
---|
| 574 | cdma->p_vci_initiator (signal_vci_ini_d_cdma); |
---|
| 575 | |
---|
| 576 | xicu->p_hwi[0] (signal_irq_bdev); |
---|
| 577 | xicu->p_hwi[1] (signal_irq_cdma); |
---|
| 578 | |
---|
| 579 | for(size_t i=0 ; i<4 ; i++) |
---|
| 580 | xicu->p_hwi[2+i] (signal_irq_mtty[i]); |
---|
| 581 | } |
---|
| 582 | } // end constructor |
---|
| 583 | |
---|
| 584 | /////////////////////////////////////////////////////////////////////////// |
---|
| 585 | // destructor |
---|
| 586 | /////////////////////////////////////////////////////////////////////////// |
---|
| 587 | template<typename vci_param, typename iss_t, int cmd_width, int rsp_width> |
---|
| 588 | TsarV4ClusterXbar<vci_param, iss_t, cmd_width, rsp_width>::~TsarV4ClusterXbar() {} |
---|
| 589 | |
---|
| 590 | }} |
---|