[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, |
---|
[475] | 59 | size_t tgtid_chbuf, |
---|
[345] | 60 | size_t tgtid_bdev, |
---|
[547] | 61 | size_t tgtid_simh, |
---|
[345] | 62 | size_t memc_ways, |
---|
| 63 | size_t memc_sets, |
---|
| 64 | size_t l1_i_ways, |
---|
| 65 | size_t l1_i_sets, |
---|
| 66 | size_t l1_d_ways, |
---|
| 67 | size_t l1_d_sets, |
---|
| 68 | size_t xram_latency, |
---|
| 69 | bool io, |
---|
| 70 | size_t xfb, |
---|
| 71 | size_t yfb, |
---|
| 72 | char* disk_name, |
---|
| 73 | size_t block_size, |
---|
| 74 | size_t nic_channels, |
---|
| 75 | char* nic_rx_name, |
---|
| 76 | char* nic_tx_name, |
---|
| 77 | uint32_t nic_timeout, |
---|
[485] | 78 | size_t chbufdma_channels, |
---|
[345] | 79 | const Loader &loader, |
---|
| 80 | uint32_t frozen_cycles, |
---|
| 81 | uint32_t debug_start_cycle, |
---|
| 82 | bool memc_debug_ok, |
---|
| 83 | bool proc_debug_ok) |
---|
| 84 | : soclib::caba::BaseModule(insname), |
---|
| 85 | p_clk("clk"), |
---|
| 86 | p_resetn("resetn") |
---|
| 87 | |
---|
| 88 | { |
---|
[508] | 89 | |
---|
| 90 | n_procs = nb_procs; |
---|
| 91 | |
---|
[345] | 92 | // Vectors of ports definition |
---|
[508] | 93 | p_cmd_in = alloc_elems<DspinInput<dspin_cmd_width> > ("p_cmd_in", 4, 3); |
---|
| 94 | p_cmd_out = alloc_elems<DspinOutput<dspin_cmd_width> > ("p_cmd_out", 4, 3); |
---|
| 95 | p_rsp_in = alloc_elems<DspinInput<dspin_rsp_width> > ("p_rsp_in", 4, 2); |
---|
| 96 | p_rsp_out = alloc_elems<DspinOutput<dspin_rsp_width> > ("p_rsp_out", 4, 2); |
---|
[345] | 97 | |
---|
[396] | 98 | ///////////////////////////////////////////////////////////////////////////// |
---|
[428] | 99 | // Components definition |
---|
[345] | 100 | ///////////////////////////////////////////////////////////////////////////// |
---|
| 101 | |
---|
| 102 | for (size_t p = 0; p < nb_procs; p++) |
---|
[428] | 103 | { |
---|
[345] | 104 | std::ostringstream sproc; |
---|
[396] | 105 | sproc << "proc_" << x_id << "_" << y_id << "_" << p; |
---|
| 106 | proc[p] = new VciCcVCacheWrapper<vci_param_int, |
---|
| 107 | dspin_cmd_width, |
---|
[428] | 108 | dspin_rsp_width, |
---|
[396] | 109 | GdbServer<Mips32ElIss> >( |
---|
[345] | 110 | sproc.str().c_str(), |
---|
[508] | 111 | cluster_id * nb_procs + p, // GLOBAL PROC_ID |
---|
[428] | 112 | mtd, // Mapping Table |
---|
[345] | 113 | IntTab(cluster_id,p), // SRCID |
---|
| 114 | (cluster_id << l_width) + p, // CC_GLOBAL_ID |
---|
| 115 | 8, // ITLB ways |
---|
| 116 | 8, // ITLB sets |
---|
| 117 | 8, // DTLB ways |
---|
| 118 | 8, // DTLB sets |
---|
[508] | 119 | l1_i_ways,l1_i_sets, 16, // ICACHE size |
---|
| 120 | l1_d_ways,l1_d_sets, 16, // DCACHE size |
---|
[345] | 121 | 4, // WBUF nlines |
---|
| 122 | 4, // WBUF nwords |
---|
| 123 | x_width, |
---|
| 124 | y_width, |
---|
| 125 | frozen_cycles, // max frozen cycles |
---|
| 126 | debug_start_cycle, |
---|
| 127 | proc_debug_ok); |
---|
| 128 | |
---|
| 129 | std::ostringstream swip; |
---|
[435] | 130 | swip << "wi_proc_" << x_id << "_" << y_id << "_" << p; |
---|
[396] | 131 | wi_proc[p] = new VciDspinInitiatorWrapper<vci_param_int, |
---|
| 132 | dspin_cmd_width, |
---|
| 133 | dspin_rsp_width>( |
---|
[351] | 134 | swip.str().c_str(), |
---|
[363] | 135 | x_width + y_width + l_width); |
---|
[345] | 136 | } |
---|
| 137 | |
---|
| 138 | ///////////////////////////////////////////////////////////////////////////// |
---|
[396] | 139 | std::ostringstream smemc; |
---|
| 140 | smemc << "memc_" << x_id << "_" << y_id; |
---|
| 141 | memc = new VciMemCache<vci_param_int, |
---|
| 142 | vci_param_ext, |
---|
| 143 | dspin_rsp_width, |
---|
| 144 | dspin_cmd_width>( |
---|
| 145 | smemc.str().c_str(), |
---|
[345] | 146 | mtd, // Mapping Table direct space |
---|
| 147 | mtx, // Mapping Table external space |
---|
| 148 | IntTab(cluster_id), // SRCID external space |
---|
| 149 | IntTab(cluster_id, tgtid_memc), // TGTID direct space |
---|
[597] | 150 | x_id, // X self coordinate |
---|
| 151 | y_id, // Y self coordinate |
---|
[504] | 152 | x_width, // Number of x bits in platform |
---|
| 153 | y_width, // Number of y bits in platform |
---|
[345] | 154 | memc_ways, memc_sets, 16, // CACHE SIZE |
---|
| 155 | 3, // MAX NUMBER OF COPIES |
---|
| 156 | 4096, // HEAP SIZE |
---|
| 157 | 8, // TRANSACTION TABLE DEPTH |
---|
| 158 | 8, // UPDATE TABLE DEPTH |
---|
[468] | 159 | 8, // INVALIDATE TABLE DEPTH |
---|
[345] | 160 | debug_start_cycle, |
---|
[508] | 161 | memc_debug_ok); |
---|
[345] | 162 | |
---|
[396] | 163 | wt_memc = new VciDspinTargetWrapper<vci_param_int, |
---|
| 164 | dspin_cmd_width, |
---|
| 165 | dspin_rsp_width>( |
---|
[379] | 166 | "wt_memc", |
---|
[363] | 167 | x_width + y_width + l_width); |
---|
[345] | 168 | |
---|
| 169 | ///////////////////////////////////////////////////////////////////////////// |
---|
[396] | 170 | std::ostringstream sxram; |
---|
| 171 | sxram << "xram_" << x_id << "_" << y_id; |
---|
| 172 | xram = new VciSimpleRam<vci_param_ext>( |
---|
| 173 | sxram.str().c_str(), |
---|
[345] | 174 | IntTab(cluster_id), |
---|
| 175 | mtx, |
---|
| 176 | loader, |
---|
| 177 | xram_latency); |
---|
[379] | 178 | |
---|
[345] | 179 | ///////////////////////////////////////////////////////////////////////////// |
---|
[396] | 180 | std::ostringstream sxicu; |
---|
| 181 | sxicu << "xicu_" << x_id << "_" << y_id; |
---|
| 182 | xicu = new VciXicu<vci_param_int>( |
---|
| 183 | sxicu.str().c_str(), |
---|
[345] | 184 | mtd, // mapping table |
---|
| 185 | IntTab(cluster_id, tgtid_xicu), // TGTID_D |
---|
| 186 | nb_procs, // number of timer IRQs |
---|
| 187 | 32, // number of hard IRQs |
---|
[389] | 188 | 32, // number of soft IRQs |
---|
[345] | 189 | nb_procs); // number of output IRQs |
---|
| 190 | |
---|
[396] | 191 | wt_xicu = new VciDspinTargetWrapper<vci_param_int, |
---|
| 192 | dspin_cmd_width, |
---|
| 193 | dspin_rsp_width>( |
---|
[379] | 194 | "wt_xicu", |
---|
[363] | 195 | x_width + y_width + l_width); |
---|
[345] | 196 | |
---|
| 197 | ///////////////////////////////////////////////////////////////////////////// |
---|
[396] | 198 | std::ostringstream smdma; |
---|
| 199 | smdma << "mdma_" << x_id << "_" << y_id; |
---|
| 200 | mdma = new VciMultiDma<vci_param_int>( |
---|
| 201 | smdma.str().c_str(), |
---|
[345] | 202 | mtd, |
---|
| 203 | IntTab(cluster_id, nb_procs), // SRCID |
---|
| 204 | IntTab(cluster_id, tgtid_mdma), // TGTID |
---|
| 205 | 64, // burst size |
---|
[379] | 206 | nb_dmas); // number of IRQs |
---|
[345] | 207 | |
---|
[396] | 208 | wt_mdma = new VciDspinTargetWrapper<vci_param_int, |
---|
| 209 | dspin_cmd_width, |
---|
| 210 | dspin_rsp_width>( |
---|
[379] | 211 | "wt_mdma", |
---|
[363] | 212 | x_width + y_width + l_width); |
---|
[345] | 213 | |
---|
[396] | 214 | wi_mdma = new VciDspinInitiatorWrapper<vci_param_int, |
---|
| 215 | dspin_cmd_width, |
---|
| 216 | dspin_rsp_width>( |
---|
[379] | 217 | "wi_mdma", |
---|
[363] | 218 | x_width + y_width + l_width); |
---|
[345] | 219 | |
---|
| 220 | ///////////////////////////////////////////////////////////////////////////// |
---|
| 221 | size_t nb_direct_initiators = nb_procs + 1; |
---|
| 222 | size_t nb_direct_targets = 3; |
---|
[508] | 223 | if (io) |
---|
[345] | 224 | { |
---|
[475] | 225 | nb_direct_initiators = nb_procs + 3; |
---|
[547] | 226 | nb_direct_targets = 10; |
---|
[345] | 227 | } |
---|
| 228 | |
---|
[396] | 229 | xbar_cmd_d = new DspinLocalCrossbar<dspin_cmd_width>( |
---|
[379] | 230 | "xbar_cmd_d", |
---|
[345] | 231 | mtd, // mapping table |
---|
| 232 | x_id, y_id, // cluster coordinates |
---|
| 233 | x_width, y_width, l_width, |
---|
| 234 | nb_direct_initiators, // number of local of sources |
---|
[435] | 235 | nb_direct_targets, // number of local dests |
---|
| 236 | 2, 2, // fifo depths |
---|
| 237 | true, // CMD |
---|
| 238 | true, // use local routing table |
---|
| 239 | false ); // no broadcast |
---|
[345] | 240 | |
---|
| 241 | ///////////////////////////////////////////////////////////////////////////// |
---|
[396] | 242 | xbar_rsp_d = new DspinLocalCrossbar<dspin_rsp_width>( |
---|
[379] | 243 | "xbar_rsp_d", |
---|
[345] | 244 | mtd, // mapping table |
---|
| 245 | x_id, y_id, // cluster coordinates |
---|
| 246 | x_width, y_width, l_width, |
---|
[428] | 247 | nb_direct_targets, // number of local sources |
---|
[345] | 248 | nb_direct_initiators, // number of local dests |
---|
[435] | 249 | 2, 2, // fifo depths |
---|
| 250 | false, // RSP |
---|
| 251 | false, // don't use local routing table |
---|
| 252 | false ); // no broadcast |
---|
[345] | 253 | |
---|
| 254 | ///////////////////////////////////////////////////////////////////////////// |
---|
[396] | 255 | xbar_m2p_c = new DspinLocalCrossbar<dspin_cmd_width>( |
---|
[379] | 256 | "xbar_m2p_c", |
---|
[345] | 257 | mtd, // mapping table |
---|
| 258 | x_id, y_id, // cluster coordinates |
---|
| 259 | x_width, y_width, l_width, |
---|
| 260 | 1, // number of local sources |
---|
[435] | 261 | nb_procs, // number of local targets |
---|
[428] | 262 | 2, 2, // fifo depths |
---|
[435] | 263 | true, // CMD |
---|
[345] | 264 | false, // don't use local routing table |
---|
[435] | 265 | true ); // broadcast |
---|
[345] | 266 | |
---|
| 267 | ///////////////////////////////////////////////////////////////////////////// |
---|
[396] | 268 | xbar_p2m_c = new DspinLocalCrossbar<dspin_rsp_width>( |
---|
[379] | 269 | "xbar_p2m_c", |
---|
[345] | 270 | mtd, // mapping table |
---|
| 271 | x_id, y_id, // cluster coordinates |
---|
[379] | 272 | x_width, y_width, 0, // l_width unused on p2m network |
---|
[345] | 273 | nb_procs, // number of local sources |
---|
| 274 | 1, // number of local dests |
---|
[428] | 275 | 2, 2, // fifo depths |
---|
[435] | 276 | false, // RSP |
---|
[345] | 277 | false, // don't use local routing table |
---|
[435] | 278 | false ); // no broadcast |
---|
[345] | 279 | |
---|
| 280 | ///////////////////////////////////////////////////////////////////////////// |
---|
[468] | 281 | xbar_clack_c = new DspinLocalCrossbar<dspin_cmd_width>( |
---|
| 282 | "xbar_clack_c", |
---|
| 283 | mtd, // mapping table |
---|
| 284 | x_id, y_id, // cluster coordinates |
---|
| 285 | x_width, y_width, l_width, |
---|
| 286 | 1, // number of local sources |
---|
| 287 | nb_procs, // number of local targets |
---|
| 288 | 1, 1, // fifo depths |
---|
| 289 | true, // CMD |
---|
| 290 | false, // don't use local routing table |
---|
| 291 | false); // broadcast |
---|
| 292 | |
---|
| 293 | ///////////////////////////////////////////////////////////////////////////// |
---|
[396] | 294 | router_cmd = new VirtualDspinRouter<dspin_cmd_width>( |
---|
[379] | 295 | "router_cmd", |
---|
[345] | 296 | x_id,y_id, // coordinate in the mesh |
---|
| 297 | x_width, y_width, // x & y fields width |
---|
[468] | 298 | 3, // nb virtual channels |
---|
[345] | 299 | 4,4); // input & output fifo depths |
---|
| 300 | |
---|
| 301 | ///////////////////////////////////////////////////////////////////////////// |
---|
[396] | 302 | router_rsp = new VirtualDspinRouter<dspin_rsp_width>( |
---|
[379] | 303 | "router_rsp", |
---|
[345] | 304 | x_id,y_id, // coordinates in mesh |
---|
| 305 | x_width, y_width, // x & y fields width |
---|
[465] | 306 | 2, // nb virtual channels |
---|
[345] | 307 | 4,4); // input & output fifo depths |
---|
| 308 | |
---|
| 309 | // IO cluster components |
---|
[508] | 310 | if (io) |
---|
[345] | 311 | { |
---|
| 312 | ///////////////////////////////////////////// |
---|
[435] | 313 | brom = new VciSimpleRom<vci_param_int>( |
---|
[396] | 314 | "brom", |
---|
| 315 | IntTab(cluster_id, tgtid_brom), |
---|
| 316 | mtd, |
---|
| 317 | loader); |
---|
[345] | 318 | |
---|
[396] | 319 | wt_brom = new VciDspinTargetWrapper<vci_param_int, |
---|
| 320 | dspin_cmd_width, |
---|
| 321 | dspin_rsp_width>( |
---|
| 322 | "wt_brom", |
---|
[363] | 323 | x_width + y_width + l_width); |
---|
[345] | 324 | |
---|
| 325 | ///////////////////////////////////////////// |
---|
[396] | 326 | fbuf = new VciFrameBuffer<vci_param_int>( |
---|
| 327 | "fbuf", |
---|
| 328 | IntTab(cluster_id, tgtid_fbuf), |
---|
| 329 | mtd, |
---|
[428] | 330 | xfb, yfb); |
---|
[345] | 331 | |
---|
[396] | 332 | wt_fbuf = new VciDspinTargetWrapper<vci_param_int, |
---|
| 333 | dspin_cmd_width, |
---|
| 334 | dspin_rsp_width>( |
---|
| 335 | "wt_fbuf", |
---|
[363] | 336 | x_width + y_width + l_width); |
---|
[345] | 337 | |
---|
| 338 | ///////////////////////////////////////////// |
---|
[396] | 339 | bdev = new VciBlockDeviceTsar<vci_param_int>( |
---|
| 340 | "bdev", |
---|
| 341 | mtd, |
---|
[508] | 342 | IntTab(cluster_id, nb_procs + 1), |
---|
[396] | 343 | IntTab(cluster_id, tgtid_bdev), |
---|
| 344 | disk_name, |
---|
| 345 | block_size, |
---|
| 346 | 64); // burst size |
---|
[345] | 347 | |
---|
[396] | 348 | wt_bdev = new VciDspinTargetWrapper<vci_param_int, |
---|
| 349 | dspin_cmd_width, |
---|
| 350 | dspin_rsp_width>( |
---|
| 351 | "wt_bdev", |
---|
[363] | 352 | x_width + y_width + l_width); |
---|
[396] | 353 | |
---|
| 354 | wi_bdev = new VciDspinInitiatorWrapper<vci_param_int, |
---|
| 355 | dspin_cmd_width, |
---|
| 356 | dspin_rsp_width>( |
---|
| 357 | "wi_bdev", |
---|
[363] | 358 | x_width + y_width + l_width); |
---|
[345] | 359 | |
---|
[548] | 360 | int mac = 0xBEEF0000; |
---|
| 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 | mac, // mac_4 address |
---|
| 369 | 0xBABE ); // mac_2 address |
---|
[345] | 370 | |
---|
[396] | 371 | wt_mnic = new VciDspinTargetWrapper<vci_param_int, |
---|
[597] | 372 | dspin_cmd_width, |
---|
| 373 | dspin_rsp_width>( |
---|
| 374 | "wt_mnic", |
---|
| 375 | x_width + y_width + l_width); |
---|
[345] | 376 | |
---|
| 377 | ///////////////////////////////////////////// |
---|
[475] | 378 | chbuf = new VciChbufDma<vci_param_int>( |
---|
| 379 | "chbuf_dma", |
---|
| 380 | mtd, |
---|
| 381 | IntTab(cluster_id, nb_procs + 2), |
---|
| 382 | IntTab(cluster_id, tgtid_chbuf), |
---|
| 383 | 64, |
---|
[485] | 384 | chbufdma_channels); |
---|
[475] | 385 | |
---|
| 386 | wt_chbuf = new VciDspinTargetWrapper<vci_param_int, |
---|
| 387 | dspin_cmd_width, |
---|
| 388 | dspin_rsp_width>( |
---|
| 389 | "wt_chbuf", |
---|
| 390 | x_width + y_width + l_width); |
---|
| 391 | |
---|
| 392 | wi_chbuf = new VciDspinInitiatorWrapper<vci_param_int, |
---|
| 393 | dspin_cmd_width, |
---|
| 394 | dspin_rsp_width>( |
---|
| 395 | "wi_chbuf", |
---|
| 396 | x_width + y_width + l_width); |
---|
| 397 | |
---|
| 398 | ///////////////////////////////////////////// |
---|
[345] | 399 | std::vector<std::string> vect_names; |
---|
[508] | 400 | for (size_t tid = 0; tid < nb_ttys; tid++) |
---|
[345] | 401 | { |
---|
| 402 | std::ostringstream term_name; |
---|
| 403 | term_name << "term" << tid; |
---|
| 404 | vect_names.push_back(term_name.str().c_str()); |
---|
| 405 | } |
---|
[396] | 406 | mtty = new VciMultiTty<vci_param_int>( |
---|
| 407 | "mtty", |
---|
| 408 | IntTab(cluster_id, tgtid_mtty), |
---|
[428] | 409 | mtd, |
---|
[396] | 410 | vect_names); |
---|
[345] | 411 | |
---|
[396] | 412 | wt_mtty = new VciDspinTargetWrapper<vci_param_int, |
---|
| 413 | dspin_cmd_width, |
---|
| 414 | dspin_rsp_width>( |
---|
| 415 | "wt_mtty", |
---|
[363] | 416 | x_width + y_width + l_width); |
---|
[547] | 417 | |
---|
| 418 | simhelper = new VciSimhelper<vci_param_int>( |
---|
| 419 | "sim_helper", |
---|
| 420 | IntTab(cluster_id, tgtid_simh), |
---|
| 421 | mtd); |
---|
| 422 | |
---|
| 423 | wt_simhelper = new VciDspinTargetWrapper<vci_param_int, |
---|
| 424 | dspin_cmd_width, |
---|
| 425 | dspin_rsp_width>( |
---|
| 426 | "wt_simhelper", |
---|
| 427 | x_width + y_width + l_width); |
---|
[345] | 428 | } |
---|
| 429 | |
---|
| 430 | //////////////////////////////////// |
---|
| 431 | // Connections are defined here |
---|
| 432 | //////////////////////////////////// |
---|
| 433 | |
---|
| 434 | //////////////////////// CMD ROUTER and RSP ROUTER |
---|
| 435 | router_cmd->p_clk (this->p_clk); |
---|
| 436 | router_cmd->p_resetn (this->p_resetn); |
---|
| 437 | router_rsp->p_clk (this->p_clk); |
---|
| 438 | router_rsp->p_resetn (this->p_resetn); |
---|
[465] | 439 | |
---|
[508] | 440 | for (int i = 0; i < 4; i++) |
---|
[345] | 441 | { |
---|
[468] | 442 | for (int k = 0; k < 3; k++) |
---|
[345] | 443 | { |
---|
[465] | 444 | router_cmd->p_out[i][k] (this->p_cmd_out[i][k]); |
---|
| 445 | router_cmd->p_in[i][k] (this->p_cmd_in[i][k]); |
---|
[468] | 446 | } |
---|
| 447 | |
---|
| 448 | for (int k = 0; k < 2; k++) |
---|
| 449 | { |
---|
[465] | 450 | router_rsp->p_out[i][k] (this->p_rsp_out[i][k]); |
---|
| 451 | router_rsp->p_in[i][k] (this->p_rsp_in[i][k]); |
---|
[345] | 452 | } |
---|
| 453 | } |
---|
| 454 | |
---|
[465] | 455 | router_cmd->p_out[4][0] (signal_dspin_cmd_g2l_d); |
---|
| 456 | router_cmd->p_out[4][1] (signal_dspin_m2p_g2l_c); |
---|
[468] | 457 | router_cmd->p_out[4][2] (signal_dspin_clack_g2l_c); |
---|
[465] | 458 | router_cmd->p_in[4][0] (signal_dspin_cmd_l2g_d); |
---|
| 459 | router_cmd->p_in[4][1] (signal_dspin_m2p_l2g_c); |
---|
[468] | 460 | router_cmd->p_in[4][2] (signal_dspin_clack_l2g_c); |
---|
[345] | 461 | |
---|
[465] | 462 | router_rsp->p_out[4][0] (signal_dspin_rsp_g2l_d); |
---|
| 463 | router_rsp->p_out[4][1] (signal_dspin_p2m_g2l_c); |
---|
| 464 | router_rsp->p_in[4][0] (signal_dspin_rsp_l2g_d); |
---|
| 465 | router_rsp->p_in[4][1] (signal_dspin_p2m_l2g_c); |
---|
[345] | 466 | |
---|
[468] | 467 | |
---|
[345] | 468 | std::cout << " - CMD & RSP routers connected" << std::endl; |
---|
| 469 | |
---|
| 470 | ///////////////////// CMD DSPIN local crossbar direct |
---|
| 471 | xbar_cmd_d->p_clk (this->p_clk); |
---|
| 472 | xbar_cmd_d->p_resetn (this->p_resetn); |
---|
| 473 | xbar_cmd_d->p_global_out (signal_dspin_cmd_l2g_d); |
---|
| 474 | xbar_cmd_d->p_global_in (signal_dspin_cmd_g2l_d); |
---|
| 475 | |
---|
| 476 | xbar_cmd_d->p_local_out[tgtid_memc] (signal_dspin_cmd_memc_t); |
---|
| 477 | xbar_cmd_d->p_local_out[tgtid_xicu] (signal_dspin_cmd_xicu_t); |
---|
| 478 | xbar_cmd_d->p_local_out[tgtid_mdma] (signal_dspin_cmd_mdma_t); |
---|
| 479 | |
---|
| 480 | xbar_cmd_d->p_local_in[nb_procs] (signal_dspin_cmd_mdma_i); |
---|
| 481 | |
---|
| 482 | for (size_t p = 0; p < nb_procs; p++) |
---|
| 483 | xbar_cmd_d->p_local_in[p] (signal_dspin_cmd_proc_i[p]); |
---|
| 484 | |
---|
[508] | 485 | if (io) |
---|
[345] | 486 | { |
---|
| 487 | xbar_cmd_d->p_local_out[tgtid_mtty] (signal_dspin_cmd_mtty_t); |
---|
| 488 | xbar_cmd_d->p_local_out[tgtid_brom] (signal_dspin_cmd_brom_t); |
---|
| 489 | xbar_cmd_d->p_local_out[tgtid_bdev] (signal_dspin_cmd_bdev_t); |
---|
| 490 | xbar_cmd_d->p_local_out[tgtid_fbuf] (signal_dspin_cmd_fbuf_t); |
---|
| 491 | xbar_cmd_d->p_local_out[tgtid_mnic] (signal_dspin_cmd_mnic_t); |
---|
[508] | 492 | xbar_cmd_d->p_local_out[tgtid_chbuf] (signal_dspin_cmd_chbuf_t); |
---|
[547] | 493 | xbar_cmd_d->p_local_out[tgtid_simh] (signal_dspin_cmd_simh_t); |
---|
[345] | 494 | |
---|
[508] | 495 | xbar_cmd_d->p_local_in[nb_procs + 1] (signal_dspin_cmd_bdev_i); |
---|
| 496 | xbar_cmd_d->p_local_in[nb_procs + 2] (signal_dspin_cmd_chbuf_i); |
---|
[345] | 497 | } |
---|
| 498 | |
---|
| 499 | std::cout << " - Command Direct crossbar connected" << std::endl; |
---|
| 500 | |
---|
| 501 | //////////////////////// RSP DSPIN local crossbar direct |
---|
| 502 | xbar_rsp_d->p_clk (this->p_clk); |
---|
| 503 | xbar_rsp_d->p_resetn (this->p_resetn); |
---|
| 504 | xbar_rsp_d->p_global_out (signal_dspin_rsp_l2g_d); |
---|
| 505 | xbar_rsp_d->p_global_in (signal_dspin_rsp_g2l_d); |
---|
| 506 | |
---|
| 507 | xbar_rsp_d->p_local_in[tgtid_memc] (signal_dspin_rsp_memc_t); |
---|
| 508 | xbar_rsp_d->p_local_in[tgtid_xicu] (signal_dspin_rsp_xicu_t); |
---|
| 509 | xbar_rsp_d->p_local_in[tgtid_mdma] (signal_dspin_rsp_mdma_t); |
---|
| 510 | |
---|
| 511 | xbar_rsp_d->p_local_out[nb_procs] (signal_dspin_rsp_mdma_i); |
---|
| 512 | |
---|
| 513 | for (size_t p = 0; p < nb_procs; p++) |
---|
| 514 | xbar_rsp_d->p_local_out[p] (signal_dspin_rsp_proc_i[p]); |
---|
| 515 | |
---|
[508] | 516 | if (io) |
---|
[345] | 517 | { |
---|
| 518 | xbar_rsp_d->p_local_in[tgtid_mtty] (signal_dspin_rsp_mtty_t); |
---|
| 519 | xbar_rsp_d->p_local_in[tgtid_brom] (signal_dspin_rsp_brom_t); |
---|
| 520 | xbar_rsp_d->p_local_in[tgtid_bdev] (signal_dspin_rsp_bdev_t); |
---|
| 521 | xbar_rsp_d->p_local_in[tgtid_fbuf] (signal_dspin_rsp_fbuf_t); |
---|
| 522 | xbar_rsp_d->p_local_in[tgtid_mnic] (signal_dspin_rsp_mnic_t); |
---|
[508] | 523 | xbar_rsp_d->p_local_in[tgtid_chbuf] (signal_dspin_rsp_chbuf_t); |
---|
[547] | 524 | xbar_rsp_d->p_local_in[tgtid_simh] (signal_dspin_rsp_simh_t); |
---|
[345] | 525 | |
---|
[508] | 526 | xbar_rsp_d->p_local_out[nb_procs + 1] (signal_dspin_rsp_bdev_i); |
---|
| 527 | xbar_rsp_d->p_local_out[nb_procs + 2] (signal_dspin_rsp_chbuf_i); |
---|
[345] | 528 | } |
---|
| 529 | |
---|
| 530 | std::cout << " - Response Direct crossbar connected" << std::endl; |
---|
| 531 | |
---|
| 532 | ////////////////////// M2P DSPIN local crossbar coherence |
---|
| 533 | xbar_m2p_c->p_clk (this->p_clk); |
---|
| 534 | xbar_m2p_c->p_resetn (this->p_resetn); |
---|
| 535 | xbar_m2p_c->p_global_out (signal_dspin_m2p_l2g_c); |
---|
| 536 | xbar_m2p_c->p_global_in (signal_dspin_m2p_g2l_c); |
---|
[360] | 537 | xbar_m2p_c->p_local_in[0] (signal_dspin_m2p_memc); |
---|
[428] | 538 | for (size_t p = 0; p < nb_procs; p++) |
---|
[345] | 539 | xbar_m2p_c->p_local_out[p] (signal_dspin_m2p_proc[p]); |
---|
| 540 | |
---|
| 541 | std::cout << " - M2P Coherence crossbar connected" << std::endl; |
---|
| 542 | |
---|
[468] | 543 | ////////////////////// CLACK DSPIN local crossbar coherence |
---|
| 544 | xbar_clack_c->p_clk (this->p_clk); |
---|
| 545 | xbar_clack_c->p_resetn (this->p_resetn); |
---|
| 546 | xbar_clack_c->p_global_out (signal_dspin_clack_l2g_c); |
---|
| 547 | xbar_clack_c->p_global_in (signal_dspin_clack_g2l_c); |
---|
| 548 | xbar_clack_c->p_local_in[0] (signal_dspin_clack_memc); |
---|
| 549 | for (size_t p = 0; p < nb_procs; p++) |
---|
[508] | 550 | xbar_clack_c->p_local_out[p] (signal_dspin_clack_proc[p]); |
---|
[468] | 551 | |
---|
| 552 | std::cout << " - Clack Coherence crossbar connected" << std::endl; |
---|
| 553 | |
---|
[345] | 554 | ////////////////////////// P2M DSPIN local crossbar coherence |
---|
| 555 | xbar_p2m_c->p_clk (this->p_clk); |
---|
| 556 | xbar_p2m_c->p_resetn (this->p_resetn); |
---|
| 557 | xbar_p2m_c->p_global_out (signal_dspin_p2m_l2g_c); |
---|
| 558 | xbar_p2m_c->p_global_in (signal_dspin_p2m_g2l_c); |
---|
[360] | 559 | xbar_p2m_c->p_local_out[0] (signal_dspin_p2m_memc); |
---|
[428] | 560 | for (size_t p = 0; p < nb_procs; p++) |
---|
[345] | 561 | xbar_p2m_c->p_local_in[p] (signal_dspin_p2m_proc[p]); |
---|
| 562 | |
---|
| 563 | std::cout << " - P2M Coherence crossbar connected" << std::endl; |
---|
| 564 | |
---|
| 565 | |
---|
| 566 | //////////////////////////////////// Processors |
---|
| 567 | for (size_t p = 0; p < nb_procs; p++) |
---|
| 568 | { |
---|
| 569 | proc[p]->p_clk (this->p_clk); |
---|
| 570 | proc[p]->p_resetn (this->p_resetn); |
---|
| 571 | proc[p]->p_vci (signal_vci_ini_proc[p]); |
---|
[468] | 572 | proc[p]->p_dspin_m2p (signal_dspin_m2p_proc[p]); |
---|
| 573 | proc[p]->p_dspin_p2m (signal_dspin_p2m_proc[p]); |
---|
| 574 | proc[p]->p_dspin_clack (signal_dspin_clack_proc[p]); |
---|
[345] | 575 | proc[p]->p_irq[0] (signal_proc_it[p]); |
---|
| 576 | for ( size_t j = 1 ; j < 6 ; j++) |
---|
| 577 | { |
---|
| 578 | proc[p]->p_irq[j] (signal_false); |
---|
| 579 | } |
---|
| 580 | |
---|
| 581 | wi_proc[p]->p_clk (this->p_clk); |
---|
| 582 | wi_proc[p]->p_resetn (this->p_resetn); |
---|
| 583 | wi_proc[p]->p_dspin_cmd (signal_dspin_cmd_proc_i[p]); |
---|
| 584 | wi_proc[p]->p_dspin_rsp (signal_dspin_rsp_proc_i[p]); |
---|
| 585 | wi_proc[p]->p_vci (signal_vci_ini_proc[p]); |
---|
| 586 | } |
---|
| 587 | |
---|
| 588 | std::cout << " - Processors connected" << std::endl; |
---|
| 589 | |
---|
| 590 | ///////////////////////////////////// XICU |
---|
[428] | 591 | xicu->p_clk (this->p_clk); |
---|
| 592 | xicu->p_resetn (this->p_resetn); |
---|
| 593 | xicu->p_vci (signal_vci_tgt_xicu); |
---|
[508] | 594 | for (size_t p = 0; p < nb_procs; p++) |
---|
[345] | 595 | { |
---|
[428] | 596 | xicu->p_irq[p] (signal_proc_it[p]); |
---|
[345] | 597 | } |
---|
[508] | 598 | for (size_t i = 0; i < 32; i++) |
---|
[345] | 599 | { |
---|
[508] | 600 | if (io) // I/O cluster |
---|
[345] | 601 | { |
---|
| 602 | if (i < 8) xicu->p_hwi[i] (signal_false); |
---|
[508] | 603 | else if (i < (8 + nb_dmas)) xicu->p_hwi[i] (signal_irq_mdma[i - 8]); |
---|
[345] | 604 | else if (i < 16) xicu->p_hwi[i] (signal_false); |
---|
[508] | 605 | else if (i < (16 + nb_ttys)) xicu->p_hwi[i] (signal_irq_mtty[i - 16]); |
---|
[428] | 606 | else if (i < 31) xicu->p_hwi[i] (signal_false); |
---|
[345] | 607 | else xicu->p_hwi[i] (signal_irq_bdev); |
---|
| 608 | } |
---|
| 609 | else // other clusters |
---|
| 610 | { |
---|
| 611 | if (i < 8) xicu->p_hwi[i] (signal_false); |
---|
[508] | 612 | else if (i < (8 + nb_dmas)) xicu->p_hwi[i] (signal_irq_mdma[i - 8]); |
---|
[428] | 613 | else xicu->p_hwi[i] (signal_false); |
---|
[345] | 614 | } |
---|
| 615 | } |
---|
| 616 | |
---|
| 617 | // wrapper XICU |
---|
[360] | 618 | wt_xicu->p_clk (this->p_clk); |
---|
| 619 | wt_xicu->p_resetn (this->p_resetn); |
---|
| 620 | wt_xicu->p_dspin_cmd (signal_dspin_cmd_xicu_t); |
---|
| 621 | wt_xicu->p_dspin_rsp (signal_dspin_rsp_xicu_t); |
---|
| 622 | wt_xicu->p_vci (signal_vci_tgt_xicu); |
---|
[345] | 623 | |
---|
| 624 | std::cout << " - XICU connected" << std::endl; |
---|
| 625 | |
---|
| 626 | //////////////////////////////////////////////// MEMC |
---|
[428] | 627 | memc->p_clk (this->p_clk); |
---|
| 628 | memc->p_resetn (this->p_resetn); |
---|
| 629 | memc->p_vci_ixr (signal_vci_xram); |
---|
| 630 | memc->p_vci_tgt (signal_vci_tgt_memc); |
---|
[468] | 631 | memc->p_dspin_p2m (signal_dspin_p2m_memc); |
---|
| 632 | memc->p_dspin_m2p (signal_dspin_m2p_memc); |
---|
| 633 | memc->p_dspin_clack (signal_dspin_clack_memc); |
---|
[345] | 634 | |
---|
| 635 | // wrapper MEMC |
---|
[360] | 636 | wt_memc->p_clk (this->p_clk); |
---|
| 637 | wt_memc->p_resetn (this->p_resetn); |
---|
| 638 | wt_memc->p_dspin_cmd (signal_dspin_cmd_memc_t); |
---|
| 639 | wt_memc->p_dspin_rsp (signal_dspin_rsp_memc_t); |
---|
| 640 | wt_memc->p_vci (signal_vci_tgt_memc); |
---|
[345] | 641 | |
---|
| 642 | std::cout << " - MEMC connected" << std::endl; |
---|
| 643 | |
---|
| 644 | /////////////////////////////////////////////// XRAM |
---|
[428] | 645 | xram->p_clk (this->p_clk); |
---|
| 646 | xram->p_resetn (this->p_resetn); |
---|
| 647 | xram->p_vci (signal_vci_xram); |
---|
[345] | 648 | |
---|
| 649 | std::cout << " - XRAM connected" << std::endl; |
---|
| 650 | |
---|
[360] | 651 | ////////////////////////////////////////////// MDMA |
---|
[428] | 652 | mdma->p_clk (this->p_clk); |
---|
| 653 | mdma->p_resetn (this->p_resetn); |
---|
| 654 | mdma->p_vci_target (signal_vci_tgt_mdma); |
---|
| 655 | mdma->p_vci_initiator (signal_vci_ini_mdma); |
---|
[508] | 656 | for (size_t i = 0; i < nb_dmas; i++) |
---|
[345] | 657 | mdma->p_irq[i] (signal_irq_mdma[i]); |
---|
| 658 | |
---|
[360] | 659 | // wrapper tgt MDMA |
---|
| 660 | wt_mdma->p_clk (this->p_clk); |
---|
| 661 | wt_mdma->p_resetn (this->p_resetn); |
---|
| 662 | wt_mdma->p_dspin_cmd (signal_dspin_cmd_mdma_t); |
---|
| 663 | wt_mdma->p_dspin_rsp (signal_dspin_rsp_mdma_t); |
---|
| 664 | wt_mdma->p_vci (signal_vci_tgt_mdma); |
---|
| 665 | |
---|
| 666 | // wrapper ini MDMA |
---|
| 667 | wi_mdma->p_clk (this->p_clk); |
---|
| 668 | wi_mdma->p_resetn (this->p_resetn); |
---|
| 669 | wi_mdma->p_dspin_cmd (signal_dspin_cmd_mdma_i); |
---|
| 670 | wi_mdma->p_dspin_rsp (signal_dspin_rsp_mdma_i); |
---|
| 671 | wi_mdma->p_vci (signal_vci_ini_mdma); |
---|
| 672 | |
---|
[345] | 673 | std::cout << " - MDMA connected" << std::endl; |
---|
| 674 | |
---|
[428] | 675 | /////////////////////////////// Components in I/O cluster |
---|
[345] | 676 | |
---|
[508] | 677 | if (io) |
---|
[428] | 678 | { |
---|
| 679 | // BDEV |
---|
| 680 | bdev->p_clk (this->p_clk); |
---|
[345] | 681 | bdev->p_resetn (this->p_resetn); |
---|
| 682 | bdev->p_irq (signal_irq_bdev); |
---|
| 683 | bdev->p_vci_target (signal_vci_tgt_bdev); |
---|
| 684 | bdev->p_vci_initiator (signal_vci_ini_bdev); |
---|
| 685 | |
---|
[360] | 686 | // wrapper tgt BDEV |
---|
| 687 | wt_bdev->p_clk (this->p_clk); |
---|
| 688 | wt_bdev->p_resetn (this->p_resetn); |
---|
| 689 | wt_bdev->p_dspin_cmd (signal_dspin_cmd_bdev_t); |
---|
| 690 | wt_bdev->p_dspin_rsp (signal_dspin_rsp_bdev_t); |
---|
| 691 | wt_bdev->p_vci (signal_vci_tgt_bdev); |
---|
| 692 | |
---|
| 693 | // wrapper ini BDEV |
---|
| 694 | wi_bdev->p_clk (this->p_clk); |
---|
| 695 | wi_bdev->p_resetn (this->p_resetn); |
---|
| 696 | wi_bdev->p_dspin_cmd (signal_dspin_cmd_bdev_i); |
---|
| 697 | wi_bdev->p_dspin_rsp (signal_dspin_rsp_bdev_i); |
---|
| 698 | wi_bdev->p_vci (signal_vci_ini_bdev); |
---|
| 699 | |
---|
[345] | 700 | std::cout << " - BDEV connected" << std::endl; |
---|
| 701 | |
---|
| 702 | // FBUF |
---|
| 703 | fbuf->p_clk (this->p_clk); |
---|
| 704 | fbuf->p_resetn (this->p_resetn); |
---|
| 705 | fbuf->p_vci (signal_vci_tgt_fbuf); |
---|
| 706 | |
---|
[360] | 707 | // wrapper tgt FBUF |
---|
| 708 | wt_fbuf->p_clk (this->p_clk); |
---|
| 709 | wt_fbuf->p_resetn (this->p_resetn); |
---|
| 710 | wt_fbuf->p_dspin_cmd (signal_dspin_cmd_fbuf_t); |
---|
| 711 | wt_fbuf->p_dspin_rsp (signal_dspin_rsp_fbuf_t); |
---|
| 712 | wt_fbuf->p_vci (signal_vci_tgt_fbuf); |
---|
| 713 | |
---|
[345] | 714 | std::cout << " - FBUF connected" << std::endl; |
---|
| 715 | |
---|
| 716 | // MNIC |
---|
| 717 | mnic->p_clk (this->p_clk); |
---|
| 718 | mnic->p_resetn (this->p_resetn); |
---|
| 719 | mnic->p_vci (signal_vci_tgt_mnic); |
---|
[508] | 720 | for (size_t i = 0; i < nic_channels; i++) |
---|
[345] | 721 | { |
---|
[548] | 722 | mnic->p_rx_irq[i] (signal_irq_mnic_rx[i]); |
---|
| 723 | mnic->p_tx_irq[i] (signal_irq_mnic_tx[i]); |
---|
[345] | 724 | } |
---|
| 725 | |
---|
[360] | 726 | // wrapper tgt MNIC |
---|
| 727 | wt_mnic->p_clk (this->p_clk); |
---|
| 728 | wt_mnic->p_resetn (this->p_resetn); |
---|
| 729 | wt_mnic->p_dspin_cmd (signal_dspin_cmd_mnic_t); |
---|
| 730 | wt_mnic->p_dspin_rsp (signal_dspin_rsp_mnic_t); |
---|
| 731 | wt_mnic->p_vci (signal_vci_tgt_mnic); |
---|
| 732 | |
---|
[345] | 733 | std::cout << " - MNIC connected" << std::endl; |
---|
| 734 | |
---|
[475] | 735 | // CHBUF |
---|
| 736 | chbuf->p_clk (this->p_clk); |
---|
| 737 | chbuf->p_resetn (this->p_resetn); |
---|
| 738 | chbuf->p_vci_target (signal_vci_tgt_chbuf); |
---|
| 739 | chbuf->p_vci_initiator (signal_vci_ini_chbuf); |
---|
[508] | 740 | for (size_t i = 0; i < chbufdma_channels; i++) |
---|
[475] | 741 | { |
---|
| 742 | chbuf->p_irq[i] (signal_irq_chbuf[i]); |
---|
| 743 | } |
---|
| 744 | |
---|
| 745 | // wrapper tgt CHBUF |
---|
| 746 | wt_chbuf->p_clk (this->p_clk); |
---|
| 747 | wt_chbuf->p_resetn (this->p_resetn); |
---|
| 748 | wt_chbuf->p_dspin_cmd (signal_dspin_cmd_chbuf_t); |
---|
| 749 | wt_chbuf->p_dspin_rsp (signal_dspin_rsp_chbuf_t); |
---|
| 750 | wt_chbuf->p_vci (signal_vci_tgt_chbuf); |
---|
| 751 | |
---|
| 752 | // wrapper ini CHBUF |
---|
| 753 | wi_chbuf->p_clk (this->p_clk); |
---|
| 754 | wi_chbuf->p_resetn (this->p_resetn); |
---|
| 755 | wi_chbuf->p_dspin_cmd (signal_dspin_cmd_chbuf_i); |
---|
| 756 | wi_chbuf->p_dspin_rsp (signal_dspin_rsp_chbuf_i); |
---|
| 757 | wi_chbuf->p_vci (signal_vci_ini_chbuf); |
---|
| 758 | |
---|
| 759 | std::cout << " - CHBUF connected" << std::endl; |
---|
| 760 | |
---|
[345] | 761 | // BROM |
---|
| 762 | brom->p_clk (this->p_clk); |
---|
| 763 | brom->p_resetn (this->p_resetn); |
---|
| 764 | brom->p_vci (signal_vci_tgt_brom); |
---|
| 765 | |
---|
[360] | 766 | // wrapper tgt BROM |
---|
| 767 | wt_brom->p_clk (this->p_clk); |
---|
| 768 | wt_brom->p_resetn (this->p_resetn); |
---|
| 769 | wt_brom->p_dspin_cmd (signal_dspin_cmd_brom_t); |
---|
| 770 | wt_brom->p_dspin_rsp (signal_dspin_rsp_brom_t); |
---|
| 771 | wt_brom->p_vci (signal_vci_tgt_brom); |
---|
| 772 | |
---|
[345] | 773 | std::cout << " - BROM connected" << std::endl; |
---|
| 774 | |
---|
| 775 | // MTTY |
---|
| 776 | mtty->p_clk (this->p_clk); |
---|
| 777 | mtty->p_resetn (this->p_resetn); |
---|
| 778 | mtty->p_vci (signal_vci_tgt_mtty); |
---|
[508] | 779 | for (size_t i = 0; i < nb_ttys; i++) |
---|
[345] | 780 | { |
---|
[428] | 781 | mtty->p_irq[i] (signal_irq_mtty[i]); |
---|
[345] | 782 | } |
---|
| 783 | |
---|
[360] | 784 | // wrapper tgt MTTY |
---|
| 785 | wt_mtty->p_clk (this->p_clk); |
---|
| 786 | wt_mtty->p_resetn (this->p_resetn); |
---|
| 787 | wt_mtty->p_dspin_cmd (signal_dspin_cmd_mtty_t); |
---|
| 788 | wt_mtty->p_dspin_rsp (signal_dspin_rsp_mtty_t); |
---|
| 789 | wt_mtty->p_vci (signal_vci_tgt_mtty); |
---|
| 790 | |
---|
[547] | 791 | |
---|
| 792 | // Sim Helper |
---|
| 793 | simhelper->p_clk (this->p_clk); |
---|
| 794 | simhelper->p_resetn (this->p_resetn); |
---|
| 795 | simhelper->p_vci (signal_vci_tgt_simh); |
---|
| 796 | |
---|
| 797 | // wrapper tgt Sim Helper |
---|
| 798 | wt_simhelper->p_clk (this->p_clk); |
---|
| 799 | wt_simhelper->p_resetn (this->p_resetn); |
---|
| 800 | wt_simhelper->p_dspin_cmd (signal_dspin_cmd_simh_t); |
---|
| 801 | wt_simhelper->p_dspin_rsp (signal_dspin_rsp_simh_t); |
---|
| 802 | wt_simhelper->p_vci (signal_vci_tgt_simh); |
---|
| 803 | |
---|
[345] | 804 | std::cout << " - MTTY connected" << std::endl; |
---|
| 805 | } |
---|
| 806 | } // end constructor |
---|
| 807 | |
---|
[508] | 808 | |
---|
| 809 | |
---|
| 810 | template<size_t dspin_cmd_width, |
---|
| 811 | size_t dspin_rsp_width, |
---|
| 812 | typename vci_param_int, |
---|
| 813 | typename vci_param_ext> TsarXbarCluster<dspin_cmd_width, |
---|
| 814 | dspin_rsp_width, |
---|
| 815 | vci_param_int, |
---|
| 816 | vci_param_ext>::~TsarXbarCluster() { |
---|
| 817 | |
---|
[512] | 818 | dealloc_elems<DspinInput<dspin_cmd_width> > (p_cmd_in, 4, 3); |
---|
| 819 | dealloc_elems<DspinOutput<dspin_cmd_width> >(p_cmd_out, 4, 3); |
---|
| 820 | dealloc_elems<DspinInput<dspin_rsp_width> > (p_rsp_in, 4, 2); |
---|
| 821 | dealloc_elems<DspinOutput<dspin_rsp_width> >(p_rsp_out, 4, 2); |
---|
| 822 | |
---|
[508] | 823 | for (size_t p = 0; p < n_procs; p++) |
---|
| 824 | { |
---|
| 825 | delete proc[p]; |
---|
| 826 | delete wi_proc[p]; |
---|
| 827 | } |
---|
| 828 | |
---|
| 829 | delete memc; |
---|
| 830 | delete wt_memc; |
---|
| 831 | delete xram; |
---|
| 832 | delete xicu; |
---|
| 833 | delete wt_xicu; |
---|
| 834 | delete mdma; |
---|
| 835 | delete wt_mdma; |
---|
| 836 | delete wi_mdma; |
---|
| 837 | delete xbar_cmd_d; |
---|
| 838 | delete xbar_rsp_d; |
---|
| 839 | delete xbar_m2p_c; |
---|
| 840 | delete xbar_p2m_c; |
---|
| 841 | delete xbar_clack_c; |
---|
| 842 | delete router_cmd; |
---|
| 843 | delete router_rsp; |
---|
| 844 | if (brom != NULL) |
---|
| 845 | { |
---|
| 846 | delete brom; |
---|
| 847 | delete wt_brom; |
---|
| 848 | delete fbuf; |
---|
| 849 | delete wt_fbuf; |
---|
| 850 | delete bdev; |
---|
| 851 | delete wt_bdev; |
---|
| 852 | delete wi_bdev; |
---|
| 853 | delete mnic; |
---|
| 854 | delete wt_mnic; |
---|
| 855 | delete chbuf; |
---|
| 856 | delete wt_chbuf; |
---|
| 857 | delete wi_chbuf; |
---|
| 858 | delete mtty; |
---|
| 859 | delete wt_mtty; |
---|
[547] | 860 | delete simhelper; |
---|
| 861 | delete wt_simhelper; |
---|
[508] | 862 | } |
---|
| 863 | } |
---|
| 864 | |
---|
| 865 | |
---|
[396] | 866 | }} |
---|
[345] | 867 | |
---|
| 868 | // Local Variables: |
---|
[508] | 869 | // tab-width: 4 |
---|
| 870 | // c-basic-offset: 4 |
---|
[345] | 871 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
---|
| 872 | // indent-tabs-mode: nil |
---|
| 873 | // End: |
---|
| 874 | |
---|
[508] | 875 | // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|
[345] | 876 | |
---|
| 877 | |
---|
| 878 | |
---|