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