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