[255] | 1 | ////////////////////////////////////////////////////////////////////////////// |
---|
| 2 | // File: tsarv4_cluster_mmu.c |
---|
| 3 | // Author: Alain Greiner |
---|
| 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: |
---|
| 9 | // - It uses the virtual_dspin_router as distributed global interconnect |
---|
| 10 | // - It uses the vci_local_crossbar as local interconnect |
---|
| 11 | // - It uses the vci_cc_vcache_wrapper_v4 |
---|
| 12 | // - It uses the vci_mem_cache_v4 |
---|
| 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 |
---|
| 17 | // - The peripherals MTTY, BDEV, FBUF, and the boot BROM are in the cluster |
---|
| 18 | // containing address 0xBFC00000. |
---|
| 19 | // - The Multi-TTY component controls up to 15 terminals. |
---|
| 20 | // - Each Multi-DMA component controls up to 8 DMA channels. |
---|
| 21 | // - The DMA IRQs are connected to IRQ_IN[8]...IRQ_IN[15] |
---|
| 22 | // - The TTY IRQs are connected to IRQ_IN[16]...IRQ_IN[30] |
---|
| 23 | // - The BDEV IRQ is connected to IRQ_IN[31] |
---|
| 24 | ////////////////////////////////////////////////////////////////////////////////// |
---|
| 25 | |
---|
[189] | 26 | #include "../include/tsarv4_cluster_mmu.h" |
---|
| 27 | |
---|
| 28 | namespace soclib { |
---|
| 29 | namespace caba { |
---|
| 30 | |
---|
| 31 | ////////////////////////////////////////////////////////////////////////// |
---|
| 32 | // Constructor |
---|
| 33 | ////////////////////////////////////////////////////////////////////////// |
---|
| 34 | template<typename vci_param, typename iss_t, int cmd_width, int rsp_width> |
---|
[255] | 35 | TsarV4ClusterMmu<vci_param, iss_t, cmd_width, rsp_width>::TsarV4ClusterMmu( |
---|
| 36 | sc_module_name insname, |
---|
| 37 | size_t nb_procs, |
---|
| 38 | size_t nb_ttys, |
---|
| 39 | size_t nb_dmas, |
---|
| 40 | size_t x_id, |
---|
| 41 | size_t y_id, |
---|
| 42 | size_t cluster_id, |
---|
| 43 | const soclib::common::MappingTable &mtd, |
---|
| 44 | const soclib::common::MappingTable &mtc, |
---|
| 45 | const soclib::common::MappingTable &mtx, |
---|
| 46 | size_t x_width, |
---|
| 47 | size_t y_width, |
---|
| 48 | size_t tgtid_memc, |
---|
| 49 | size_t tgtid_xicu, |
---|
[263] | 50 | size_t tgtid_mdma, |
---|
[255] | 51 | size_t tgtid_fbuf, |
---|
| 52 | size_t tgtid_mtty, |
---|
| 53 | size_t tgtid_brom, |
---|
[263] | 54 | size_t tgtid_mnic, |
---|
[255] | 55 | size_t tgtid_bdev, |
---|
| 56 | size_t memc_ways, |
---|
| 57 | size_t memc_sets, |
---|
| 58 | size_t l1_i_ways, |
---|
| 59 | size_t l1_i_sets, |
---|
| 60 | size_t l1_d_ways, |
---|
| 61 | size_t l1_d_sets, |
---|
| 62 | size_t xram_latency, |
---|
| 63 | bool io, |
---|
| 64 | size_t xfb, |
---|
| 65 | size_t yfb, |
---|
| 66 | char* disk_name, |
---|
| 67 | size_t block_size, |
---|
[263] | 68 | size_t nic_channels, |
---|
| 69 | char* nic_rx_name, |
---|
| 70 | char* nic_tx_name, |
---|
| 71 | uint32_t nic_timeout, |
---|
[255] | 72 | const Loader &loader, |
---|
| 73 | uint32_t frozen_cycles, |
---|
| 74 | uint32_t debug_start_cycle, |
---|
| 75 | bool memc_debug_ok, |
---|
| 76 | bool proc_debug_ok) |
---|
[249] | 77 | : soclib::caba::BaseModule(insname), |
---|
| 78 | p_clk("clk"), |
---|
[255] | 79 | p_resetn("resetn") |
---|
[189] | 80 | |
---|
[255] | 81 | { |
---|
| 82 | // Vectors of ports definition |
---|
[189] | 83 | |
---|
[255] | 84 | p_cmd_in = alloc_elems<DspinInput<cmd_width> >("p_cmd_in", 2, 4); |
---|
| 85 | p_cmd_out = alloc_elems<DspinOutput<cmd_width> >("p_cmd_out", 2, 4); |
---|
| 86 | p_rsp_in = alloc_elems<DspinInput<rsp_width> >("p_rsp_in", 2, 4); |
---|
| 87 | p_rsp_out = alloc_elems<DspinOutput<rsp_width> >("p_rsp_out", 2, 4); |
---|
[189] | 88 | |
---|
[255] | 89 | // Components definition |
---|
[189] | 90 | |
---|
[255] | 91 | // on direct network : local srcid[proc] in [0..nb_procs-1] |
---|
| 92 | // on direct network : local srcid[mdma] = nb_procs |
---|
| 93 | // on direct network : local srcid[bdev] = nb_procs + 1 |
---|
[189] | 94 | |
---|
[255] | 95 | // on coherence network : local srcid[proc] in [0...nb_procs-1] |
---|
| 96 | // on coherence network : local srcid[memc] = nb_procs |
---|
[189] | 97 | |
---|
[255] | 98 | std::cout << " - building proc_" << x_id << "_" << y_id << "-*" << std::endl; |
---|
[189] | 99 | |
---|
[255] | 100 | for (size_t p = 0; p < nb_procs; p++) |
---|
| 101 | { |
---|
| 102 | std::ostringstream sproc; |
---|
| 103 | sproc << "proc_" << x_id << "_" << y_id << "_" << p; |
---|
| 104 | proc[p] = new VciCcVCacheWrapperV4<vci_param, iss_t>( |
---|
| 105 | sproc.str().c_str(), |
---|
| 106 | cluster_id*nb_procs + p, |
---|
| 107 | mtd, // Mapping Table Direct |
---|
| 108 | mtc, // Mapping Table Coherence |
---|
| 109 | IntTab(cluster_id,p), // SRCID_D |
---|
| 110 | IntTab(cluster_id,p), // SRCID_C |
---|
| 111 | IntTab(cluster_id,p), // TGTID_C |
---|
| 112 | 8, // ITLB ways |
---|
| 113 | 8, // ITLB sets |
---|
| 114 | 8, // DTLB ways |
---|
| 115 | 8, // DTLB sets |
---|
| 116 | l1_i_ways,l1_i_sets,16, // ICACHE size |
---|
| 117 | l1_d_ways,l1_d_sets,16, // DCACHE size |
---|
| 118 | 4, // WBUF nlines |
---|
| 119 | 4, // WBUF nwords |
---|
| 120 | x_width, |
---|
| 121 | y_width, |
---|
| 122 | nb_procs, // MEMC local index |
---|
| 123 | frozen_cycles, // max frozen cycles |
---|
| 124 | debug_start_cycle, |
---|
| 125 | proc_debug_ok); |
---|
| 126 | } |
---|
[189] | 127 | |
---|
[255] | 128 | std::cout << " - building memc_" << x_id << "_" << y_id << std::endl; |
---|
[189] | 129 | |
---|
[255] | 130 | std::ostringstream smemc; |
---|
| 131 | smemc << "memc_" << x_id << "_" << y_id; |
---|
| 132 | memc = new VciMemCacheV4<vci_param>( |
---|
[249] | 133 | smemc.str().c_str(), |
---|
| 134 | mtd, mtc, mtx, |
---|
[255] | 135 | IntTab(cluster_id), // SRCID_X |
---|
| 136 | IntTab(cluster_id, nb_procs), // SRCID_C |
---|
| 137 | IntTab(cluster_id, tgtid_memc), // TGTID_D |
---|
| 138 | IntTab(cluster_id, nb_procs), // TGTID_C |
---|
| 139 | memc_ways, memc_sets, 16, // CACHE SIZE |
---|
| 140 | 4096, // HEAP SIZE |
---|
| 141 | 8, // TRANSACTION TABLE DEPTH |
---|
| 142 | 8, // UPDATE TABLE DEPTH |
---|
[249] | 143 | debug_start_cycle, |
---|
[255] | 144 | memc_debug_ok); |
---|
[189] | 145 | |
---|
[255] | 146 | std::cout << " - building xram_" << x_id << "_" << y_id << std::endl; |
---|
[189] | 147 | |
---|
[255] | 148 | std::ostringstream sxram; |
---|
| 149 | sxram << "xram_" << x_id << "_" << y_id; |
---|
| 150 | xram = new VciSimpleRam<vci_param>( |
---|
[249] | 151 | sxram.str().c_str(), |
---|
| 152 | IntTab(cluster_id), |
---|
| 153 | mtx, |
---|
| 154 | loader, |
---|
| 155 | xram_latency); |
---|
[189] | 156 | |
---|
[255] | 157 | std::cout << " - building xicu_" << x_id << "_" << y_id << std::endl; |
---|
[189] | 158 | |
---|
[255] | 159 | std::ostringstream sicu; |
---|
| 160 | sicu << "xicu_" << x_id << "_" << y_id; |
---|
| 161 | xicu = new VciXicu<vci_param>( |
---|
[249] | 162 | sicu.str().c_str(), |
---|
[255] | 163 | mtd, // mapping table |
---|
| 164 | IntTab(cluster_id, tgtid_xicu), // TGTID_D |
---|
| 165 | nb_procs, // number of timer IRQs |
---|
| 166 | 32, // number of hard IRQs |
---|
| 167 | 0, // number of soft IRQs |
---|
| 168 | nb_procs); // number of output IRQs |
---|
[189] | 169 | |
---|
[255] | 170 | std::cout << " - building dma_" << x_id << "_" << y_id << std::endl; |
---|
[189] | 171 | |
---|
[255] | 172 | std::ostringstream sdma; |
---|
| 173 | sdma << "dma_" << x_id << "_" << y_id; |
---|
| 174 | mdma = new VciMultiDma<vci_param>( |
---|
[249] | 175 | sdma.str().c_str(), |
---|
| 176 | mtd, |
---|
[255] | 177 | IntTab(cluster_id, nb_procs), // SRCID |
---|
[249] | 178 | IntTab(cluster_id, tgtid_mdma), // TGTID |
---|
| 179 | 64, // burst size |
---|
[255] | 180 | nb_procs); // number of IRQs |
---|
[189] | 181 | |
---|
[255] | 182 | std::cout << " - building xbard_" << x_id << "_" << y_id << std::endl; |
---|
[189] | 183 | |
---|
[255] | 184 | size_t nb_direct_initiators = nb_procs + 1; |
---|
| 185 | size_t nb_direct_targets = 3; |
---|
| 186 | if ( io ) |
---|
| 187 | { |
---|
| 188 | nb_direct_initiators = nb_procs + 2; |
---|
[263] | 189 | nb_direct_targets = 8; |
---|
[255] | 190 | } |
---|
| 191 | std::ostringstream sd; |
---|
| 192 | sd << "xbard_" << x_id << "_" << y_id; |
---|
| 193 | xbard = new VciLocalCrossbar<vci_param>( |
---|
[249] | 194 | sd.str().c_str(), |
---|
| 195 | mtd, |
---|
[255] | 196 | IntTab(cluster_id), // cluster initiator index |
---|
| 197 | IntTab(cluster_id), // cluster target index |
---|
| 198 | nb_direct_initiators, // number of initiators |
---|
| 199 | nb_direct_targets); // number of targets |
---|
[189] | 200 | |
---|
[255] | 201 | std::cout << " - building xbarc_" << x_id << "_" << y_id << std::endl; |
---|
[189] | 202 | |
---|
[255] | 203 | std::ostringstream sc; |
---|
| 204 | sc << "xbarc_" << x_id << "_" << y_id; |
---|
| 205 | xbarc = new VciLocalCrossbar<vci_param>( |
---|
[249] | 206 | sc.str().c_str(), |
---|
| 207 | mtc, |
---|
[255] | 208 | IntTab(cluster_id), // cluster initiator index |
---|
| 209 | IntTab(cluster_id), // cluster target index |
---|
| 210 | nb_procs + 1, // number of initiators |
---|
| 211 | nb_procs + 1); // number of targets |
---|
[189] | 212 | |
---|
[255] | 213 | std::cout << " - building wrappers in cluster_" << x_id << "_" << y_id << std::endl; |
---|
[189] | 214 | |
---|
[255] | 215 | std::ostringstream wid; |
---|
| 216 | wid << "iniwrapperd_" << x_id << "_" << y_id; |
---|
| 217 | iniwrapperd = new VciVdspinInitiatorWrapper<vci_param,cmd_width,rsp_width>( |
---|
[249] | 218 | wid.str().c_str(), |
---|
| 219 | 4, // cmd fifo depth |
---|
| 220 | 4); // rsp fifo depth |
---|
[189] | 221 | |
---|
[255] | 222 | std::ostringstream wtd; |
---|
| 223 | wtd << "tgtwrapperd_" << x_id << "_" << y_id; |
---|
| 224 | tgtwrapperd = new VciVdspinTargetWrapper<vci_param,cmd_width,rsp_width>( |
---|
[249] | 225 | wtd.str().c_str(), |
---|
| 226 | 4, // cmd fifo depth |
---|
| 227 | 4); // rsp fifo depth |
---|
[189] | 228 | |
---|
[255] | 229 | std::ostringstream wic; |
---|
| 230 | wic << "iniwrapperc_" << x_id << "_" << y_id; |
---|
| 231 | iniwrapperc = new VciVdspinInitiatorWrapper<vci_param,cmd_width,rsp_width>( |
---|
[249] | 232 | wic.str().c_str(), |
---|
| 233 | 4, // cmd fifo depth |
---|
| 234 | 4); // rsp fifo depth |
---|
[189] | 235 | |
---|
[255] | 236 | std::ostringstream wtc; |
---|
| 237 | wtc << "tgtwrapperc_" << x_id << "_" << y_id; |
---|
| 238 | tgtwrapperc = new VciVdspinTargetWrapper<vci_param,cmd_width,rsp_width>( |
---|
| 239 | wtc.str().c_str(), |
---|
[249] | 240 | 4, // cmd fifo depth |
---|
| 241 | 4); // rsp fifo depth |
---|
[189] | 242 | |
---|
[255] | 243 | std::cout << " - building cmdrouter_" << x_id << "_" << y_id << std::endl; |
---|
[189] | 244 | |
---|
[255] | 245 | std::ostringstream scmd; |
---|
| 246 | scmd << "cmdrouter_" << x_id << "_" << y_id; |
---|
| 247 | cmdrouter = new VirtualDspinRouter<cmd_width>( |
---|
[249] | 248 | scmd.str().c_str(), |
---|
| 249 | x_id,y_id, // coordinate in the mesh |
---|
| 250 | x_width, y_width, // x & y fields width |
---|
| 251 | 4,4); // input & output fifo depths |
---|
[189] | 252 | |
---|
[255] | 253 | std::cout << " - building rsprouter_" << x_id << "_" << y_id << std::endl; |
---|
[189] | 254 | |
---|
[255] | 255 | std::ostringstream srsp; |
---|
| 256 | srsp << "rsprouter_" << x_id << "_" << y_id; |
---|
| 257 | rsprouter = new VirtualDspinRouter<rsp_width>( |
---|
[249] | 258 | srsp.str().c_str(), |
---|
| 259 | x_id,y_id, // coordinates in mesh |
---|
| 260 | x_width, y_width, // x & y fields width |
---|
| 261 | 4,4); // input & output fifo depths |
---|
[189] | 262 | |
---|
[255] | 263 | // IO cluster components |
---|
| 264 | if ( io ) |
---|
| 265 | { |
---|
| 266 | std::cout << " - building brom" << std::endl; |
---|
| 267 | |
---|
| 268 | brom = new VciSimpleRam<vci_param>( |
---|
[249] | 269 | "brom", |
---|
| 270 | IntTab(cluster_id, tgtid_brom), |
---|
| 271 | mtd, |
---|
| 272 | loader); |
---|
[189] | 273 | |
---|
[255] | 274 | std::cout << " - building fbuf" << std::endl; |
---|
| 275 | |
---|
| 276 | fbuf = new VciFrameBuffer<vci_param>( |
---|
[249] | 277 | "fbuf", |
---|
| 278 | IntTab(cluster_id, tgtid_fbuf), |
---|
| 279 | mtd, |
---|
| 280 | xfb, yfb); |
---|
[189] | 281 | |
---|
[255] | 282 | std::cout << " - building fbuf" << std::endl; |
---|
| 283 | |
---|
| 284 | bdev = new VciBlockDeviceTsarV4<vci_param>( |
---|
[249] | 285 | "bdev", |
---|
| 286 | mtd, |
---|
[255] | 287 | IntTab(cluster_id, nb_procs+1), |
---|
[249] | 288 | IntTab(cluster_id, tgtid_bdev), |
---|
| 289 | disk_name, |
---|
[255] | 290 | block_size, |
---|
[261] | 291 | 64); // burst size |
---|
[189] | 292 | |
---|
[263] | 293 | std::cout << " - building mnic" << std::endl; |
---|
| 294 | |
---|
| 295 | mnic = new VciMultiNic<vci_param>( |
---|
| 296 | "mnic", |
---|
| 297 | IntTab(cluster_id, tgtid_mnic), |
---|
| 298 | mtd, |
---|
| 299 | nic_channels, |
---|
| 300 | nic_rx_name, |
---|
| 301 | nic_tx_name, |
---|
[298] | 302 | 0, // default mac address MAC4 |
---|
| 303 | 0 ); // default mac address MAC2 |
---|
[263] | 304 | |
---|
[255] | 305 | std::cout << " - building mtty" << std::endl; |
---|
| 306 | |
---|
| 307 | std::vector<std::string> vect_names; |
---|
| 308 | for( size_t tid = 0 ; tid < (nb_ttys) ; tid++ ) |
---|
| 309 | { |
---|
| 310 | std::ostringstream term_name; |
---|
| 311 | term_name << "term" << tid; |
---|
| 312 | vect_names.push_back(term_name.str().c_str()); |
---|
| 313 | } |
---|
| 314 | mtty = new VciMultiTty<vci_param>( |
---|
[249] | 315 | "mtty", |
---|
| 316 | IntTab(cluster_id, tgtid_mtty), |
---|
| 317 | mtd, |
---|
[255] | 318 | vect_names); |
---|
| 319 | } |
---|
[189] | 320 | |
---|
[255] | 321 | std::cout << std::endl; |
---|
[189] | 322 | |
---|
[255] | 323 | //////////////////////////////////// |
---|
| 324 | // Connections are defined here |
---|
| 325 | //////////////////////////////////// |
---|
[189] | 326 | |
---|
[255] | 327 | // CMDROUTER and RSPROUTER |
---|
| 328 | cmdrouter->p_clk (this->p_clk); |
---|
| 329 | cmdrouter->p_resetn (this->p_resetn); |
---|
| 330 | rsprouter->p_clk (this->p_clk); |
---|
| 331 | rsprouter->p_resetn (this->p_resetn); |
---|
| 332 | for (int x = 0; x < 2; x++) |
---|
| 333 | { |
---|
| 334 | for(int y = 0; y < 4; y++) |
---|
| 335 | { |
---|
| 336 | cmdrouter->p_out[x][y] (this->p_cmd_out[x][y]); |
---|
| 337 | cmdrouter->p_in[x][y] (this->p_cmd_in[x][y]); |
---|
| 338 | rsprouter->p_out[x][y] (this->p_rsp_out[x][y]); |
---|
| 339 | rsprouter->p_in[x][y] (this->p_rsp_in[x][y]); |
---|
| 340 | } |
---|
| 341 | } |
---|
[189] | 342 | |
---|
[255] | 343 | cmdrouter->p_out[0][4] (signal_dspin_cmd_g2l_d); |
---|
| 344 | cmdrouter->p_out[1][4] (signal_dspin_cmd_g2l_c); |
---|
| 345 | cmdrouter->p_in[0][4] (signal_dspin_cmd_l2g_d); |
---|
| 346 | cmdrouter->p_in[1][4] (signal_dspin_cmd_l2g_c); |
---|
[189] | 347 | |
---|
[255] | 348 | rsprouter->p_out[0][4] (signal_dspin_rsp_g2l_d); |
---|
| 349 | rsprouter->p_out[1][4] (signal_dspin_rsp_g2l_c); |
---|
| 350 | rsprouter->p_in[0][4] (signal_dspin_rsp_l2g_d); |
---|
| 351 | rsprouter->p_in[1][4] (signal_dspin_rsp_l2g_c); |
---|
[189] | 352 | |
---|
[255] | 353 | std::cout << " - CMD & RSP routers connected" << std::endl; |
---|
[189] | 354 | |
---|
[255] | 355 | // VCI/DSPIN WRAPPERS |
---|
| 356 | iniwrapperd->p_clk (this->p_clk); |
---|
| 357 | iniwrapperd->p_resetn (this->p_resetn); |
---|
| 358 | iniwrapperd->p_vci (signal_vci_l2g_d); |
---|
| 359 | iniwrapperd->p_dspin_out (signal_dspin_cmd_l2g_d); |
---|
| 360 | iniwrapperd->p_dspin_in (signal_dspin_rsp_g2l_d); |
---|
[189] | 361 | |
---|
[255] | 362 | tgtwrapperd->p_clk (this->p_clk); |
---|
| 363 | tgtwrapperd->p_resetn (this->p_resetn); |
---|
| 364 | tgtwrapperd->p_vci (signal_vci_g2l_d); |
---|
| 365 | tgtwrapperd->p_dspin_out (signal_dspin_rsp_l2g_d); |
---|
| 366 | tgtwrapperd->p_dspin_in (signal_dspin_cmd_g2l_d); |
---|
[189] | 367 | |
---|
[255] | 368 | iniwrapperc->p_clk (this->p_clk); |
---|
| 369 | iniwrapperc->p_resetn (this->p_resetn); |
---|
| 370 | iniwrapperc->p_vci (signal_vci_l2g_c); |
---|
| 371 | iniwrapperc->p_dspin_out (signal_dspin_cmd_l2g_c); |
---|
| 372 | iniwrapperc->p_dspin_in (signal_dspin_rsp_g2l_c); |
---|
[189] | 373 | |
---|
[255] | 374 | tgtwrapperc->p_clk (this->p_clk); |
---|
| 375 | tgtwrapperc->p_resetn (this->p_resetn); |
---|
| 376 | tgtwrapperc->p_vci (signal_vci_g2l_c); |
---|
| 377 | tgtwrapperc->p_dspin_out (signal_dspin_rsp_l2g_c); |
---|
| 378 | tgtwrapperc->p_dspin_in (signal_dspin_cmd_g2l_c); |
---|
[189] | 379 | |
---|
[255] | 380 | std::cout << " - VCI/DSPIN wrappers connected" << std::endl; |
---|
[189] | 381 | |
---|
[255] | 382 | // CROSSBAR direct |
---|
| 383 | xbard->p_clk (this->p_clk); |
---|
| 384 | xbard->p_resetn (this->p_resetn); |
---|
| 385 | xbard->p_initiator_to_up (signal_vci_l2g_d); |
---|
| 386 | xbard->p_target_to_up (signal_vci_g2l_d); |
---|
[189] | 387 | |
---|
[255] | 388 | xbard->p_to_target[tgtid_memc] (signal_vci_tgt_d_memc); |
---|
| 389 | xbard->p_to_target[tgtid_xicu] (signal_vci_tgt_d_xicu); |
---|
| 390 | xbard->p_to_target[tgtid_mdma] (signal_vci_tgt_d_mdma); |
---|
[189] | 391 | |
---|
[255] | 392 | xbard->p_to_initiator[nb_procs] (signal_vci_ini_d_mdma); |
---|
[189] | 393 | |
---|
[255] | 394 | for (size_t p = 0; p < nb_procs; p++) |
---|
| 395 | { |
---|
| 396 | xbard->p_to_initiator[p] (signal_vci_ini_d_proc[p]); |
---|
| 397 | } |
---|
[189] | 398 | |
---|
[255] | 399 | if ( io ) |
---|
| 400 | { |
---|
| 401 | xbard->p_to_target[tgtid_mtty] (signal_vci_tgt_d_mtty); |
---|
| 402 | xbard->p_to_target[tgtid_brom] (signal_vci_tgt_d_brom); |
---|
| 403 | xbard->p_to_target[tgtid_bdev] (signal_vci_tgt_d_bdev); |
---|
| 404 | xbard->p_to_target[tgtid_fbuf] (signal_vci_tgt_d_fbuf); |
---|
[263] | 405 | xbard->p_to_target[tgtid_mnic] (signal_vci_tgt_d_mnic); |
---|
[249] | 406 | |
---|
[255] | 407 | xbard->p_to_initiator[nb_procs+1] (signal_vci_ini_d_bdev); |
---|
| 408 | } |
---|
[249] | 409 | |
---|
[255] | 410 | std::cout << " - Direct crossbar connected" << std::endl; |
---|
[249] | 411 | |
---|
[255] | 412 | // CROSSBAR coherence |
---|
| 413 | xbarc->p_clk (this->p_clk); |
---|
| 414 | xbarc->p_resetn (this->p_resetn); |
---|
| 415 | xbarc->p_initiator_to_up (signal_vci_l2g_c); |
---|
| 416 | xbarc->p_target_to_up (signal_vci_g2l_c); |
---|
| 417 | xbarc->p_to_initiator[nb_procs] (signal_vci_ini_c_memc); |
---|
| 418 | xbarc->p_to_target[nb_procs] (signal_vci_tgt_c_memc); |
---|
| 419 | for (size_t p = 0; p < nb_procs; p++) |
---|
| 420 | { |
---|
| 421 | xbarc->p_to_target[p] (signal_vci_tgt_c_proc[p]); |
---|
| 422 | xbarc->p_to_initiator[p] (signal_vci_ini_c_proc[p]); |
---|
| 423 | } |
---|
[249] | 424 | |
---|
[255] | 425 | std::cout << " - Coherence crossbar connected" << std::endl; |
---|
[249] | 426 | |
---|
[255] | 427 | // Processors |
---|
| 428 | for (size_t p = 0; p < nb_procs; p++) |
---|
| 429 | { |
---|
| 430 | proc[p]->p_clk (this->p_clk); |
---|
| 431 | proc[p]->p_resetn (this->p_resetn); |
---|
| 432 | proc[p]->p_vci_ini_d (signal_vci_ini_d_proc[p]); |
---|
| 433 | proc[p]->p_vci_ini_c (signal_vci_ini_c_proc[p]); |
---|
| 434 | proc[p]->p_vci_tgt_c (signal_vci_tgt_c_proc[p]); |
---|
| 435 | proc[p]->p_irq[0] (signal_proc_it[p]); |
---|
| 436 | for ( size_t j = 1 ; j < 6 ; j++) |
---|
| 437 | { |
---|
| 438 | proc[p]->p_irq[j] (signal_false); |
---|
| 439 | } |
---|
| 440 | } |
---|
[249] | 441 | |
---|
[255] | 442 | std::cout << " - Processors connected" << std::endl; |
---|
[249] | 443 | |
---|
[255] | 444 | // XICU |
---|
| 445 | xicu->p_clk (this->p_clk); |
---|
| 446 | xicu->p_resetn (this->p_resetn); |
---|
| 447 | xicu->p_vci (signal_vci_tgt_d_xicu); |
---|
| 448 | for ( size_t p=0 ; p<nb_procs ; p++) |
---|
| 449 | { |
---|
| 450 | xicu->p_irq[p] (signal_proc_it[p]); |
---|
| 451 | } |
---|
| 452 | for ( size_t i=0 ; i<32 ; i++) |
---|
| 453 | { |
---|
| 454 | if ( io ) // I/O cluster |
---|
| 455 | { |
---|
| 456 | if (i < 8) xicu->p_hwi[i] (signal_false); |
---|
| 457 | else if (i < (8 + nb_dmas)) xicu->p_hwi[i] (signal_irq_mdma[i-8]); |
---|
| 458 | else if (i < 16) xicu->p_hwi[i] (signal_false); |
---|
| 459 | else if (i < (16 + nb_ttys)) xicu->p_hwi[i] (signal_irq_mtty[i-16]); |
---|
| 460 | else if (i < 31) xicu->p_hwi[i] (signal_false); |
---|
| 461 | else xicu->p_hwi[i] (signal_irq_bdev); |
---|
| 462 | } |
---|
| 463 | else // other clusters |
---|
| 464 | { |
---|
| 465 | if (i < 8) xicu->p_hwi[i] (signal_false); |
---|
| 466 | else if (i < (8 + nb_dmas)) xicu->p_hwi[i] (signal_irq_mdma[i-8]); |
---|
| 467 | else xicu->p_hwi[i] (signal_false); |
---|
| 468 | } |
---|
| 469 | } |
---|
[249] | 470 | |
---|
[255] | 471 | std::cout << " - XICU connected" << std::endl; |
---|
[249] | 472 | |
---|
[255] | 473 | // MEMC |
---|
| 474 | memc->p_clk (this->p_clk); |
---|
| 475 | memc->p_resetn (this->p_resetn); |
---|
| 476 | memc->p_vci_ixr (signal_vci_xram); |
---|
| 477 | memc->p_vci_tgt (signal_vci_tgt_d_memc); |
---|
| 478 | memc->p_vci_ini (signal_vci_ini_c_memc); |
---|
| 479 | memc->p_vci_tgt_cleanup (signal_vci_tgt_c_memc); |
---|
[249] | 480 | |
---|
[255] | 481 | std::cout << " - MEMC connected" << std::endl; |
---|
[249] | 482 | |
---|
[255] | 483 | // XRAM |
---|
| 484 | xram->p_clk (this->p_clk); |
---|
| 485 | xram->p_resetn (this->p_resetn); |
---|
[263] | 486 | xram->p_vci (signal_vci_xram); |
---|
[249] | 487 | |
---|
[255] | 488 | std::cout << " - XRAM connected" << std::endl; |
---|
[249] | 489 | |
---|
[255] | 490 | // CDMA |
---|
| 491 | mdma->p_clk (this->p_clk); |
---|
| 492 | mdma->p_resetn (this->p_resetn); |
---|
| 493 | mdma->p_vci_target (signal_vci_tgt_d_mdma); |
---|
| 494 | mdma->p_vci_initiator (signal_vci_ini_d_mdma); |
---|
| 495 | for (size_t i=0 ; i<nb_dmas ; i++) |
---|
| 496 | { |
---|
| 497 | mdma->p_irq[i] (signal_irq_mdma[i]); |
---|
| 498 | } |
---|
| 499 | |
---|
| 500 | std::cout << " - MDMA connected" << std::endl; |
---|
| 501 | |
---|
| 502 | // Components in I/O cluster |
---|
| 503 | |
---|
| 504 | if ( io ) |
---|
| 505 | { |
---|
| 506 | // BDEV |
---|
[263] | 507 | bdev->p_clk (this->p_clk); |
---|
| 508 | bdev->p_resetn (this->p_resetn); |
---|
| 509 | bdev->p_irq (signal_irq_bdev); |
---|
| 510 | bdev->p_vci_target (signal_vci_tgt_d_bdev); |
---|
| 511 | bdev->p_vci_initiator (signal_vci_ini_d_bdev); |
---|
[255] | 512 | |
---|
| 513 | std::cout << " - BDEV connected" << std::endl; |
---|
| 514 | |
---|
| 515 | // FBUF |
---|
[263] | 516 | fbuf->p_clk (this->p_clk); |
---|
| 517 | fbuf->p_resetn (this->p_resetn); |
---|
| 518 | fbuf->p_vci (signal_vci_tgt_d_fbuf); |
---|
[255] | 519 | |
---|
| 520 | std::cout << " - FBUF connected" << std::endl; |
---|
| 521 | |
---|
[263] | 522 | // MNIC |
---|
| 523 | mnic->p_clk (this->p_clk); |
---|
| 524 | mnic->p_resetn (this->p_resetn); |
---|
| 525 | mnic->p_vci (signal_vci_tgt_d_mnic); |
---|
| 526 | for ( size_t i=0 ; i<nic_channels ; i++ ) |
---|
| 527 | { |
---|
| 528 | mnic->p_rx_irq[i] (signal_irq_mnic_rx[i]); |
---|
| 529 | mnic->p_tx_irq[i] (signal_irq_mnic_tx[i]); |
---|
| 530 | } |
---|
| 531 | |
---|
| 532 | std::cout << " - MNIC connected" << std::endl; |
---|
| 533 | |
---|
[255] | 534 | // BROM |
---|
[263] | 535 | brom->p_clk (this->p_clk); |
---|
| 536 | brom->p_resetn (this->p_resetn); |
---|
| 537 | brom->p_vci (signal_vci_tgt_d_brom); |
---|
[255] | 538 | |
---|
| 539 | std::cout << " - BROM connected" << std::endl; |
---|
| 540 | |
---|
| 541 | // MTTY |
---|
[263] | 542 | mtty->p_clk (this->p_clk); |
---|
| 543 | mtty->p_resetn (this->p_resetn); |
---|
| 544 | mtty->p_vci (signal_vci_tgt_d_mtty); |
---|
[255] | 545 | for ( size_t i=0 ; i<nb_ttys ; i++ ) |
---|
| 546 | { |
---|
[263] | 547 | mtty->p_irq[i] (signal_irq_mtty[i]); |
---|
[255] | 548 | } |
---|
| 549 | |
---|
| 550 | std::cout << " - MTTY connected" << std::endl; |
---|
| 551 | } |
---|
| 552 | } // end constructor |
---|
| 553 | |
---|
[189] | 554 | /////////////////////////////////////////////////////////////////////////// |
---|
| 555 | // destructor |
---|
| 556 | /////////////////////////////////////////////////////////////////////////// |
---|
| 557 | template<typename vci_param, typename iss_t, int cmd_width, int rsp_width> |
---|
[255] | 558 | TsarV4ClusterMmu<vci_param, iss_t, cmd_width, rsp_width>::~TsarV4ClusterMmu() {} |
---|
[189] | 559 | |
---|
[249] | 560 | } |
---|
| 561 | } |
---|
| 562 | |
---|
| 563 | |
---|
| 564 | // Local Variables: |
---|
| 565 | // tab-width: 3 |
---|
| 566 | // c-basic-offset: 3 |
---|
| 567 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
---|
| 568 | // indent-tabs-mode: nil |
---|
| 569 | // End: |
---|
| 570 | |
---|
| 571 | // vim: filetype=cpp:expandtab:shiftwidth=3:tabstop=3:softtabstop=3 |
---|
| 572 | |
---|
| 573 | |
---|
| 574 | |
---|