Changeset 695
- Timestamp:
- May 18, 2014, 8:33:04 PM (11 years ago)
- Location:
- branches/fault_tolerance/platform/tsar_generic_iob
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/fault_tolerance/platform/tsar_generic_iob/top.cpp
r658 r695 118 118 #include <cstdarg> 119 119 #include <stdint.h> 120 #include <string> 120 121 121 122 #include "gdbserver.h" … … 131 132 132 133 #include "alloc_elems.h" 133 134 /////////////////////////////////////////////////// 135 // OS 136 /////////////////////////////////////////////////// 137 #define USE_ALMOS 0 138 139 #define almos_bootloader_pathname "bootloader.bin" 140 #define almos_kernel_pathname "kernel-soclib.bin@0xbfc10000:D" 141 #define almos_archinfo_pathname "arch-info.bin@0xBFC08000:D" 142 143 /////////////////////////////////////////////////// 144 // Parallelisation 145 /////////////////////////////////////////////////// 134 #include "hard_config.h" 135 136 //////////////////////////////////////////////////////////////////////// 137 // Parallelization 138 //////////////////////////////////////////////////////////////////////// 139 146 140 #define USE_OPENMP 0 147 141 … … 150 144 #endif 151 145 152 /////////////////////////////////////////////////////////// 146 //////////////////////////////////////////////////////////////////////// 153 147 // DSPIN parameters 154 /////////////////////////////////////////////////////////// 155 156 #define dspin_int_cmd_width 157 #define dspin_int_rsp_width 158 159 #define dspin_ram_cmd_width 160 #define dspin_ram_rsp_width 161 162 /////////////////////////////////////////////////////////// 148 //////////////////////////////////////////////////////////////////////// 149 150 #define dspin_int_cmd_width 39 151 #define dspin_int_rsp_width 32 152 153 #define dspin_ram_cmd_width 64 154 #define dspin_ram_rsp_width 64 155 156 //////////////////////////////////////////////////////////////////////// 163 157 // VCI fields width for the 3 VCI networks 164 /////////////////////////////////////////////////////////// 158 //////////////////////////////////////////////////////////////////////// 165 159 166 160 #define vci_cell_width_int 4 … … 177 171 #define vci_wrplen_width 1 178 172 179 //////////////////////////////////////////////////////////// 180 // Main Hardware Parameters values 181 //////////////////////i///////////////////////////////////// 182 183 #define X_WIDTH 4 184 #define Y_WIDTH 4 185 #define X_MAX (1<<X_WIDTH) 186 #define Y_MAX (1<<Y_WIDTH) 187 188 //////////////////////////////////////////////////////////// 173 //////////////////////////////////////////////////////////////////////// 189 174 // Secondary Hardware Parameters values 190 ////////////////////// i/////////////////////////////////////191 192 #define XRAM_LATENCY 193 194 #define MEMC_WAYS 195 #define MEMC_SETS 196 197 #define L1_IWAYS 198 #define L1_ISETS 199 200 #define L1_DWAYS 201 #define L1_DSETS 202 203 #define FBUF_X_SIZE 204 #define FBUF_Y_SIZE 205 206 #define BDEV_SECTOR_SIZE 207 #define BDEV_IMAGE_NAME "../../../giet_vm/hdd/virt_hdd.dmg"208 209 #define NIC_RX_NAME "giet_vm/nic/rx_packets.txt"210 #define NIC_TX_NAME "giet_vm/nic/tx_packets.txt"211 #define NIC_TIMEOUT 212 213 #define cluster(x,y) ((y) + ((x)<<4))214 215 //////////////////////////////////////////////////////////// 175 //////////////////////////////////////////////////////////////////////// 176 177 #define XRAM_LATENCY 0 178 179 #define MEMC_WAYS 16 180 #define MEMC_SETS 256 181 182 #define L1_IWAYS 4 183 #define L1_ISETS 64 184 185 #define L1_DWAYS 4 186 #define L1_DSETS 64 187 188 #define FBUF_X_SIZE 128 189 #define FBUF_Y_SIZE 128 190 191 #define BDEV_SECTOR_SIZE 512 192 #define BDEV_IMAGE_NAME "/dev/null" 193 194 #define NIC_RX_NAME "/dev/null" 195 #define NIC_TX_NAME "/dev/null" 196 #define NIC_TIMEOUT 10000 197 198 #define cluster(x,y) TsarIobClusterType::clusterId((x),(y)) 199 200 //////////////////////////////////////////////////////////////////////// 216 201 // Software to be loaded in ROM & RAM 217 ////////////////////// i/////////////////////////////////////218 219 #define BOOT_SOFT_NAME "../../softs/tsar_boot/preloader.elf"220 221 //////////////////////////////////////////////////////////// 202 //////////////////////////////////////////////////////////////////////// 203 204 #define BOOT_SOFT_NAME "/dev/null" 205 206 //////////////////////////////////////////////////////////////////////// 222 207 // DEBUG Parameters default values 223 //////////////////////i///////////////////////////////////// 224 225 #define MAX_FROZEN_CYCLES 10000 226 227 ///////////////////////////////////////////////////////// 228 // Physical segments definition 229 ///////////////////////////////////////////////////////// 230 231 // Non replicated peripherals (must be in cluster 0) 232 233 #define BROM_BASE 0x00BFC00000 234 #define BROM_SIZE 0x0000010000 // 64 Kbytes 235 236 #define IOBX_BASE 0x00BE000000 237 #define IOBX_SIZE 0x0000001000 // 4 Kbytes 238 239 #define BDEV_BASE 0x00B3000000 240 #define BDEV_SIZE 0x0000008000 // 4 Kbytes 241 242 #define MTTY_BASE 0x00B4000000 243 #define MTTY_SIZE (0x0000001000 * 16) // 4 Kbytes 244 245 #define MNIC_BASE 0x00B5000000 246 #define MNIC_SIZE 0x0000080000 // 512 Kbytes 247 248 #define CDMA_BASE 0x00B6000000 249 #define CDMA_SIZE (0x0000001000 * 2) // 4 Kbytes per channel 250 251 #define FBUF_BASE 0x00B7000000 252 #define FBUF_SIZE (800 * 600 * 2) 253 254 // Replicated peripherals : address is incremented by a cluster offset 255 // offset = cluster(x,y) << (address_width-x_width-y_width); 256 257 #define XRAM_BASE 0x0000000000 258 #define XRAM_SIZE 0x0010000000 // 256 Mbytes 259 260 #define XICU_BASE 0x00B0000000 261 #define XICU_SIZE 0x0000001000 // 4 Kbytes 262 263 #define MDMA_BASE 0x00B1000000 264 #define MDMA_SIZE 0x0000001000 * 4 // 4 Kbytes per channel 265 266 // Replicated mem segments (XRAM) : address is incremented by a cluster offset 267 // offset = cluster(x,y) << (address_width-x_width-y_width); 268 269 #define MEMC_BASE 0x00B2000000 270 #define MEMC_SIZE 0x0000001000 // 4 Kbytes 208 //////////////////////////////////////////////////////////////////////// 209 210 #define MAX_FROZEN_CYCLES 10000 271 211 272 212 //////////////////////////////////////////////////////////////////////// … … 291 231 //////////////////////////////////////////////////////////////////////// 292 232 293 #define PROC_LOCAL_SRCID 0x0 // from 0 to 7 294 #define MDMA_LOCAL_SRCID 0x8 295 #define IOBX_LOCAL_SRCID 0x9 296 #define MEMC_LOCAL_SRCID 0xA 297 #define CDMA_LOCAL_SRCID 0xE // hard-coded in dspin_tsar 298 #define BDEV_LOCAL_SRCID 0xF // hard-coded in dspin_tsar 299 300 /////////////////////////////////////////////////////////////////////// 301 // TGT_ID and INI_ID port indexing for INT local interconnect 302 /////////////////////////////////////////////////////////////////////// 303 304 #define INT_MEMC_TGT_ID 0 305 #define INT_XICU_TGT_ID 1 306 #define INT_BROM_TGT_ID 2 307 #define INT_MDMA_TGT_ID 3 308 #define INT_IOBX_TGT_ID 4 309 310 #define INT_PROC_INI_ID 0 // from 0 to 7 311 #define INT_MDMA_INI_ID nb_procs 312 #define INT_IOBX_INI_ID (nb_procs + 1) 313 314 /////////////////////////////////////////////////////////////////////// 315 // TGT_ID and INI_ID port indexing for RAM local interconnect 316 /////////////////////////////////////////////////////////////////////// 317 318 #define RAM_XRAM_TGT_ID 0 319 320 #define RAM_MEMC_INI_ID 0 321 #define RAM_IOBX_INI_ID 1 233 #define PROC_LOCAL_SRCID 0x0 // from 0 to 7 234 #define MDMA_LOCAL_SRCID 0x8 235 #define IOBX_LOCAL_SRCID 0x9 236 #define MEMC_LOCAL_SRCID 0xA 237 #define CDMA_LOCAL_SRCID 0xE // hard-coded in dspin_tsar 238 #define BDEV_LOCAL_SRCID 0xF // hard-coded in dspin_tsar 322 239 323 240 /////////////////////////////////////////////////////////////////////// … … 339 256 340 257 //////////////////////////////////////////////////////////////////////// 341 int _main(int argc, char *argv[]) 342 //////////////////////////////////////////////////////////////////////// 343 { 258 int _main(int argc, char *argv[]) { 344 259 using namespace sc_core; 345 260 using namespace soclib::caba; 346 261 using namespace soclib::common; 347 262 348 char soft_name[256] = BOOT_SOFT_NAME; // path name: binary code349 size_tncycles = 1000000000; // simulated cycles350 char disk_name[256] = BDEV_IMAGE_NAME; // path name: disk image351 char nic_rx_name[256] = NIC_RX_NAME; // path name: rx packets file352 char nic_tx_name[256] = NIC_TX_NAME; // path name: tx packets file353 ssize_t threads_nr = 1; // simulator's threads number263 char soft_name[256] = BOOT_SOFT_NAME; // path: binary code 264 uint64_t ncycles = 1000000000; // simulated cycles 265 char disk_name[256] = BDEV_IMAGE_NAME; // path: disk image 266 char nic_rx_name[256] = NIC_RX_NAME; // path: rx packets file 267 char nic_tx_name[256] = NIC_TX_NAME; // path: tx packets file 268 ssize_t threads_nr = 1; // simulator's threads 354 269 bool debug_ok = false; // trace activated 355 270 size_t debug_period = 1; // trace period … … 359 274 uint32_t debug_from = 0; // trace start cycle 360 275 uint32_t frozen_cycles = MAX_FROZEN_CYCLES; // monitoring frozen procs 361 size_t block_size = BDEV_SECTOR_SIZE; // disk block size 362 size_t nb_procs = 1; 363 size_t x_size = 2; 364 size_t y_size = 2; 365 size_t nb_tty_channels = 1; 366 size_t nb_nic_channels = 1; 276 const size_t block_size = BDEV_SECTOR_SIZE; // disk block size 277 const size_t x_size = X_SIZE; 278 const size_t y_size = Y_SIZE; 367 279 368 280 assert((X_WIDTH == 4) and (Y_WIDTH == 4)); 369 281 370 282 ////////////// command line arguments ////////////////////// 371 if (argc > 1) 372 { 373 for (int n = 1; n < argc; n = n + 2) 374 { 375 if ((strcmp(argv[n],"-NCYCLES") == 0) && (n+1<argc)) 376 { 377 ncycles = atoi(argv[n+1]); 283 if (argc > 1) { 284 for (int n = 1; n < argc; n = n + 2) { 285 if ((strcmp(argv[n],"-NCYCLES") == 0) && ((n+1) < argc)) { 286 ncycles = strtoll(argv[n+1], NULL, 0); 378 287 continue; 379 288 } 380 if ((strcmp(argv[n],"-SOFT") == 0) && (n+1<argc) ) 381 { 289 if ((strcmp(argv[n],"-SOFT") == 0) && ((n+1) < argc) ) { 382 290 strcpy(soft_name, argv[n+1]); 383 291 continue; 384 292 } 385 if ((strcmp(argv[n],"-DISK") == 0) && (n+1<argc) ) 386 { 293 if ((strcmp(argv[n],"-DISK") == 0) && ((n+1) < argc) ) { 387 294 strcpy(disk_name, argv[n+1]); 388 295 continue; 389 296 } 390 if ((strcmp(argv[n],"-NPROCS") == 0) && (n+1<argc)) 391 { 392 nb_procs = atoi(argv[n+1]); 393 assert((nb_procs > 0) && (nb_procs < 5)); 297 if ((strcmp(argv[n],"-DEBUG") == 0) && ((n+1) < argc) ) { 298 debug_ok = true; 299 debug_from = strtol(argv[n+1], NULL, 0); 394 300 continue; 395 301 } 396 if ((strcmp(argv[n],"-XSIZE") == 0) && (n+1<argc)) 397 { 398 x_size = atoi(argv[n+1]); 399 assert((x_size > 0) && (x_size < X_MAX)); 400 continue; 401 } 402 if ((strcmp(argv[n],"-YSIZE") == 0) && (n+1<argc)) 403 { 404 y_size = atoi(argv[n+1]); 405 assert((y_size > 0) && (y_size < Y_MAX)); 406 continue; 407 } 408 if ((strcmp(argv[n],"-DEBUG") == 0) && (n+1<argc) ) 409 { 410 debug_ok = true; 411 debug_from = atoi(argv[n+1]); 412 continue; 413 } 414 if ((strcmp(argv[n],"-MEMCID") == 0) && (n+1<argc) ) 415 { 416 debug_memc_id = atoi(argv[n+1]); 302 if ((strcmp(argv[n],"-MEMCID") == 0) && ((n+1) < argc) ) { 303 debug_memc_id = strtol(argv[n+1], NULL, 0); 417 304 size_t x = debug_memc_id >> Y_WIDTH; 418 305 size_t y = debug_memc_id & ((1 << Y_WIDTH) - 1); … … 420 307 continue; 421 308 } 422 if ((strcmp(argv[n],"-IOB") == 0) && (n+1<argc) ) 423 { 424 debug_iob = (atoi(argv[n+1]) != 0) ? 1 : 0; 309 if ((strcmp(argv[n],"-IOB") == 0) && ((n+1) < argc) ) { 310 debug_iob = (strtol(argv[n+1], NULL, 0) != 0) ? 1 : 0; 425 311 continue; 426 312 } 427 if ((strcmp(argv[n],"-PROCID") == 0) && (n+1<argc) ) 428 { 429 debug_proc_id = atoi(argv[n+1]); 430 size_t cluster_xy = debug_proc_id / nb_procs ; 313 if ((strcmp(argv[n],"-PROCID") == 0) && ((n+1) < argc) ) { 314 debug_proc_id = strtol(argv[n+1], NULL, 0); 315 size_t cluster_xy = debug_proc_id / NB_PROCS ; 431 316 size_t x = cluster_xy >> Y_WIDTH; 432 317 size_t y = cluster_xy & ((1 << Y_WIDTH) - 1); … … 434 319 continue; 435 320 } 436 if ((strcmp(argv[n], "-THREADS") == 0) && ((n+1) < argc)) 437 { 438 threads_nr = atoi(argv[n+1]); 321 if ((strcmp(argv[n], "-THREADS") == 0) && ((n+1) < argc)) { 322 threads_nr = strtol(argv[n+1], NULL, 0); 439 323 assert(threads_nr > 0); 440 324 continue; 441 325 } 442 if ((strcmp(argv[n], "-FROZEN") == 0) && (n+1 < argc)) 443 { 444 frozen_cycles = atoi(argv[n+1]); 326 if ((strcmp(argv[n], "-FROZEN") == 0) && ((n+1) < argc)) { 327 frozen_cycles = strtol(argv[n+1], NULL, 0); 445 328 assert(frozen_cycles > 0); 446 329 continue; 447 330 } 448 if ((strcmp(argv[n], "-PERIOD") == 0) && (n+1 < argc)) 449 { 450 debug_period = atoi(argv[n+1]); 331 if ((strcmp(argv[n], "-PERIOD") == 0) && ((n+1) < argc)) { 332 debug_period = strtol(argv[n+1], NULL, 0); 451 333 assert(debug_period > 0); 452 334 continue; … … 454 336 455 337 std::cout << " Arguments are (key,value) couples.\n" 456 << " The order is not important.\n" 457 << " Accepted arguments are :\n\n" 458 << " -NCYCLES number of simulated_cycles\n" 459 << " -SOFT pathname for embedded soft\n" 460 << " -DISK pathname for disk image\n" 461 << " -NPROCS number of processors per cluster\n" 462 << " -XSIZE number of clusters on X\n" 463 << " -YSIZE number of clusters on Y\n" 464 << " -DEBUG debug start cycle\n" 465 << " -MEMCID index of memc to trace\n" 466 << " -IOB debug IOBs if non_zero_value\n\n" 467 << " -PROCID index of proc to trace\n" 468 << " -THREADS simulator's threads number\n" 469 << " -FROZEN max number of frozen cycles\n" 470 << " -PERIOD number of cycles between trace\n\n"; 338 << " The order is not important.\n" 339 << " Accepted arguments are :\n\n" 340 << " -NCYCLES number of simulated_cycles\n" 341 << " -SOFT pathname for embedded soft\n" 342 << " -DISK pathname for disk image\n" 343 << " -DEBUG debug start cycle\n" 344 << " -MEMCID index of memc to trace\n" 345 << " -IOB debug IOBs if non_zero_value\n\n" 346 << " -PROCID index of proc to trace\n" 347 << " -THREADS simulator's threads number\n" 348 << " -FROZEN max number of frozen cycles\n" 349 << " -PERIOD number of cycles between trace\n\n"; 471 350 exit(0); 472 351 } 473 352 } 474 353 475 // one DMA channel per proc 476 size_t nb_dma_channels = nb_procs; 477 478 // clusters containing IOB0 and IOB1 479 size_t cluster_iob0 = cluster(0,0); 480 size_t cluster_iob1 = cluster(x_size - 1, y_size - 1); 481 482 assert( (nb_tty_channels < 16) and 483 "The NB_TTY_CHANNELS parameter must be smaller than 16" ); 484 485 assert( (nb_nic_channels == 1) and 486 "The NB_NIC_CHANNELS parameter must be 1" ); 354 assert( (NB_TTY_CHANNELS < 16) and 355 "The NB_TTY_CHANNELS parameter must be smaller than 16" ); 356 357 assert( (NB_NIC_CHANNELS == 1) and 358 "The NB_NIC_CHANNELS parameter must be 1" ); 487 359 488 360 std::cout << std::endl; 489 361 std::cout << " - X_SIZE = " << x_size << std::endl; 490 362 std::cout << " - Y_SIZE = " << y_size << std::endl; 491 std::cout << " - NB_PROCS = " << nb_procs<< std::endl;492 std::cout << " - NB_DMA_CHANNELS = " << nb_dma_channels<< std::endl;493 std::cout << " - NB_TTY_CHANNELS = " << nb_tty_channels<< std::endl;494 std::cout << " - NB_NIC_CHANNELS = " << nb_nic_channels<< std::endl;363 std::cout << " - NB_PROCS = " << NB_PROCS << std::endl; 364 std::cout << " - NB_DMA_CHANNELS = " << NB_DMA_CHANNELS << std::endl; 365 std::cout << " - NB_TTY_CHANNELS = " << NB_TTY_CHANNELS << std::endl; 366 std::cout << " - NB_NIC_CHANNELS = " << NB_NIC_CHANNELS << std::endl; 495 367 std::cout << " - MEMC_WAYS = " << MEMC_WAYS << std::endl; 496 368 std::cout << " - MEMC_SETS = " << MEMC_SETS << std::endl; … … 508 380 // Define VciParams objects 509 381 typedef soclib::caba::VciParams<vci_cell_width_int, 510 511 512 513 514 515 516 517 518 382 vci_plen_width, 383 vci_address_width, 384 vci_rerror_width, 385 vci_clen_width, 386 vci_rflag_width, 387 vci_srcid_width, 388 vci_pktid_width, 389 vci_trdid_width, 390 vci_wrplen_width> vci_param_int; 519 391 520 392 typedef soclib::caba::VciParams<vci_cell_width_ext, 521 vci_plen_width, 522 vci_address_width, 523 vci_rerror_width, 524 vci_clen_width, 525 vci_rflag_width, 526 vci_srcid_width, 527 vci_pktid_width, 528 vci_trdid_width, 529 vci_wrplen_width> vci_param_ext; 393 vci_plen_width, 394 vci_address_width, 395 vci_rerror_width, 396 vci_clen_width, 397 vci_rflag_width, 398 vci_srcid_width, 399 vci_pktid_width, 400 vci_trdid_width, 401 vci_wrplen_width> vci_param_ext; 402 403 // Clusters 404 typedef TsarIobCluster<vci_param_int, vci_param_ext, dspin_int_cmd_width, 405 dspin_int_rsp_width, dspin_ram_cmd_width, dspin_ram_rsp_width> 406 TsarIobClusterType; 407 408 // clusters containing IOB0 and IOB1 409 size_t cluster_iob0 = cluster(0, 0); 410 size_t cluster_iob1 = cluster(x_size - 1, y_size - 1); 530 411 531 412 ///////////////////////////////////////////////////////////////////// … … 539 420 vci_address_width, 540 421 IntTab(X_WIDTH + Y_WIDTH, 16 - X_WIDTH - Y_WIDTH), 541 IntTab(X_WIDTH + Y_WIDTH, vci_ srcid_width- X_WIDTH - Y_WIDTH),422 IntTab(X_WIDTH + Y_WIDTH, vci_param_int::S - X_WIDTH - Y_WIDTH), 542 423 0x00FF000000); 543 424 544 for (size_t x = 0; x < x_size; x++) 545 { 546 for (size_t y = 0; y < y_size; y++) 547 { 425 for (size_t x = 0; x < x_size; x++) { 426 for (size_t y = 0; y < y_size; y++) { 548 427 uint64_t offset = ((uint64_t)cluster(x,y)) 549 428 << (vci_address_width - X_WIDTH - Y_WIDTH); 550 bool config = true;551 bool cacheable = true;429 const bool config = true; 430 const bool cacheable = true; 552 431 553 432 // the five following segments are defined in all clusters … … 556 435 smemc_conf << "int_seg_memc_conf_" << x << "_" << y; 557 436 maptab_int.add(Segment(smemc_conf.str(), MEMC_BASE+offset, MEMC_SIZE, 558 559 437 IntTab(cluster(x,y),INT_MEMC_TGT_ID), 438 not cacheable, config )); 560 439 561 440 std::ostringstream smemc_xram; 562 441 smemc_xram << "int_seg_memc_xram_" << x << "_" << y; 563 442 maptab_int.add(Segment(smemc_xram.str(), XRAM_BASE+offset, XRAM_SIZE, 564 565 443 IntTab(cluster(x,y),INT_MEMC_TGT_ID), 444 cacheable)); 566 445 567 446 std::ostringstream sxicu; 568 447 sxicu << "int_seg_xicu_" << x << "_" << y; 569 448 maptab_int.add(Segment(sxicu.str(), XICU_BASE+offset, XICU_SIZE, 570 571 449 IntTab(cluster(x,y),INT_XICU_TGT_ID), 450 not cacheable)); 572 451 573 452 std::ostringstream sbrom; 574 453 sbrom << "int_seg_brom_" << x << "_" << y; 575 454 maptab_int.add(Segment(sbrom.str(), BROM_BASE+offset, BROM_SIZE, 576 IntTab(cluster(x,y),INT_BROM_TGT_ID), 577 cacheable)); 455 IntTab(cluster(x,y),INT_BROM_TGT_ID), 456 cacheable)); 457 458 std::ostringstream smtty; 459 smtty << "int_seg_mtty_" << x << "_" << y; 460 maptab_int.add(Segment(smtty.str(), MTTY_BASE+offset, MTTY_SIZE, 461 IntTab(cluster(x,y),INT_MTTY_TGT_ID), 462 not cacheable)); 578 463 579 464 std::ostringstream smdma; 580 465 smdma << "int_seg_mdma_" << x << "_" << y; 581 466 maptab_int.add(Segment(smdma.str(), MDMA_BASE+offset, MDMA_SIZE, 582 583 467 IntTab(cluster(x,y),INT_MDMA_TGT_ID), 468 not cacheable)); 584 469 585 470 // the following segments are only defined in cluster_iob0 or in 586 471 // cluster_iob1 587 if ((cluster(x,y) == cluster_iob0) || (cluster(x,y) == cluster_iob1))588 {472 if ((cluster(x,y) == cluster_iob0) || 473 (cluster(x,y) == cluster_iob1)) { 589 474 std::ostringstream siobx; 590 475 siobx << "int_seg_iobx_" << x << "_" << y; 591 476 maptab_int.add(Segment(siobx.str(), IOBX_BASE+offset, IOBX_SIZE, 592 593 477 IntTab(cluster(x,y), INT_IOBX_TGT_ID), 478 not cacheable, config )); 594 479 595 480 std::ostringstream stty; 596 481 stty << "int_seg_mtty_" << x << "_" << y; 597 maptab_int.add(Segment(stty.str(), MTTY_BASE+offset, MTTY_SIZE,598 599 482 maptab_int.add(Segment(stty.str(), XTTY_BASE+offset, XTTY_SIZE, 483 IntTab(cluster(x,y), INT_IOBX_TGT_ID), 484 not cacheable)); 600 485 601 486 std::ostringstream sfbf; 602 487 sfbf << "int_seg_fbuf_" << x << "_" << y; 603 488 maptab_int.add(Segment(sfbf.str(), FBUF_BASE+offset, FBUF_SIZE, 604 605 489 IntTab(cluster(x,y), INT_IOBX_TGT_ID), 490 not cacheable)); 606 491 607 492 std::ostringstream sbdv; 608 493 sbdv << "int_seg_bdev_" << x << "_" << y; 609 494 maptab_int.add(Segment(sbdv.str(), BDEV_BASE+offset, BDEV_SIZE, 610 611 495 IntTab(cluster(x,y), INT_IOBX_TGT_ID), 496 not cacheable)); 612 497 613 498 std::ostringstream snic; 614 499 snic << "int_seg_mnic_" << x << "_" << y; 615 500 maptab_int.add(Segment(snic.str(), MNIC_BASE+offset, MNIC_SIZE, 616 617 501 IntTab(cluster(x,y), INT_IOBX_TGT_ID), 502 not cacheable)); 618 503 619 504 std::ostringstream sdma; 620 505 sdma << "int_seg_cdma_" << x << "_" << y; 621 506 maptab_int.add(Segment(sdma.str(), CDMA_BASE+offset, CDMA_SIZE, 622 623 507 IntTab(cluster(x,y), INT_IOBX_TGT_ID), 508 not cacheable)); 624 509 } 625 510 … … 628 513 629 514 maptab_int.srcid_map(IntTab(cluster(x,y), MDMA_LOCAL_SRCID), 630 515 IntTab(cluster(x,y), INT_MDMA_INI_ID)); 631 516 maptab_int.srcid_map(IntTab(cluster(x,y), IOBX_LOCAL_SRCID), 632 IntTab(cluster(x,y), INT_IOBX_INI_ID)); 633 634 for ( size_t p = 0 ; p < nb_procs ; p++ ) 635 { 517 IntTab(cluster(x,y), INT_IOBX_INI_ID)); 518 519 for ( size_t p = 0 ; p < NB_PROCS ; p++ ) { 636 520 maptab_int.srcid_map(IntTab(cluster(x,y), PROC_LOCAL_SRCID + p), 637 521 IntTab(cluster(x,y), INT_PROC_INI_ID + p)); 638 522 } 639 523 } … … 641 525 std::cout << "INT network " << maptab_int << std::endl; 642 526 643 ///////////////////////////////////////////////////////////////////////// 644 // RAM network mapping table 645 // - two levels address decoding for commands 646 // - two levels srcid decoding for responses 647 // - 2 local initiators (MEMC, IOBX) per cluster 648 // (IOBX component only in cluster_iob0 and cluster_iob1) 649 // - 1 local target (XRAM) per cluster 650 //////////////////////////////////////////////////////////////////////// 651 MappingTable maptab_ram( 652 vci_address_width, 653 IntTab(X_WIDTH + Y_WIDTH, 16 - X_WIDTH - Y_WIDTH), 654 IntTab(X_WIDTH + Y_WIDTH, vci_srcid_width - X_WIDTH - Y_WIDTH), 655 0x00FF000000); 656 657 for (size_t x = 0; x < x_size; x++) 658 { 659 for (size_t y = 0; y < y_size ; y++) 660 { 661 uint64_t offset = ((uint64_t)cluster(x,y)) 662 << (vci_address_width - X_WIDTH - Y_WIDTH); 663 664 std::ostringstream sxram; 665 sxram << "ext_seg_xram_" << x << "_" << y; 666 maptab_ram.add(Segment(sxram.str(), XRAM_BASE+offset, 667 XRAM_SIZE, IntTab(cluster(x,y), 0), false)); 668 } 669 } 670 671 // This define the mapping between the initiators SRCID 672 // and the port index on the RAM local interconnect. 673 // External initiator have two alias SRCID (iob0 / iob1) 674 675 maptab_ram.srcid_map(IntTab(cluster_iob0, CDMA_LOCAL_SRCID), 676 IntTab(cluster_iob0, RAM_IOBX_INI_ID)); 677 maptab_ram.srcid_map(IntTab(cluster_iob1, CDMA_LOCAL_SRCID), 678 IntTab(cluster_iob1, RAM_IOBX_INI_ID)); 679 maptab_ram.srcid_map(IntTab(cluster_iob0, BDEV_LOCAL_SRCID), 680 IntTab(cluster_iob0, RAM_IOBX_INI_ID)); 681 maptab_ram.srcid_map(IntTab(cluster_iob1, BDEV_LOCAL_SRCID), 682 IntTab(cluster_iob1, RAM_IOBX_INI_ID)); 683 maptab_ram.srcid_map(IntTab(cluster_iob1, MEMC_LOCAL_SRCID), 684 IntTab(cluster_iob1, RAM_MEMC_INI_ID)); 685 686 std::cout << "RAM network " << maptab_ram << std::endl; 687 688 /////////////////////////////////////////////////////////////////////// 689 // IOX network mapping table 690 // - two levels address decoding for commands 691 // - two levels srcid decoding for responses 692 // - 4 initiators (IOB0, IOB1, BDEV, CDMA) 693 // - 8 targets (IOB0, IOB1, BDEV, CDMA, MTTY, FBUF, BROM, MNIC) 694 /////////////////////////////////////////////////////////////////////// 695 MappingTable maptab_iox( 696 vci_address_width, 697 IntTab(X_WIDTH + Y_WIDTH, 16 - X_WIDTH - Y_WIDTH), 698 IntTab(X_WIDTH + Y_WIDTH, vci_srcid_width - X_WIDTH - Y_WIDTH), 699 0x00FF000000); 700 701 // compute base addresses for cluster_iob0 and cluster_iob1 702 uint64_t iob0_base = ((uint64_t)cluster_iob0) 703 << (vci_address_width - X_WIDTH - Y_WIDTH); 704 uint64_t iob1_base = ((uint64_t)cluster_iob1) 705 << (vci_address_width - X_WIDTH - Y_WIDTH); 706 707 // Each peripheral can be accessed through two segments, 708 // depending on the used IOB (IOB0 or IOB1). 709 maptab_iox.add(Segment("iox_seg_mtty_0", MTTY_BASE + iob0_base, MTTY_SIZE, 710 IntTab(cluster_iob0, IOX_MTTY_TGT_ID), false)); 711 maptab_iox.add(Segment("iox_seg_mtty_1", MTTY_BASE + iob1_base, MTTY_SIZE, 712 IntTab(cluster_iob1, IOX_MTTY_TGT_ID), false)); 713 maptab_iox.add(Segment("iox_seg_fbuf_0", FBUF_BASE + iob0_base, FBUF_SIZE, 714 IntTab(cluster_iob0, IOX_FBUF_TGT_ID), false)); 715 maptab_iox.add(Segment("iox_seg_fbuf_1", FBUF_BASE + iob1_base, FBUF_SIZE, 716 IntTab(cluster_iob1, IOX_FBUF_TGT_ID), false)); 717 maptab_iox.add(Segment("iox_seg_bdev_0", BDEV_BASE + iob0_base, BDEV_SIZE, 718 IntTab(cluster_iob0, IOX_BDEV_TGT_ID), false)); 719 maptab_iox.add(Segment("iox_seg_bdev_1", BDEV_BASE + iob1_base, BDEV_SIZE, 720 IntTab(cluster_iob1, IOX_BDEV_TGT_ID), false)); 721 maptab_iox.add(Segment("iox_seg_mnic_0", MNIC_BASE + iob0_base, MNIC_SIZE, 722 IntTab(cluster_iob0, IOX_MNIC_TGT_ID), false)); 723 maptab_iox.add(Segment("iox_seg_mnic_1", MNIC_BASE + iob1_base, MNIC_SIZE, 724 IntTab(cluster_iob1, IOX_MNIC_TGT_ID), false)); 725 maptab_iox.add(Segment("iox_seg_cdma_0", CDMA_BASE + iob0_base, CDMA_SIZE, 726 IntTab(cluster_iob0, IOX_CDMA_TGT_ID), false)); 727 maptab_iox.add(Segment("iox_seg_cdma_1", CDMA_BASE + iob1_base, CDMA_SIZE, 728 IntTab(cluster_iob1, IOX_CDMA_TGT_ID), false)); 729 730 // Each physical RAM can be accessed through IOB0, or through IOB1. 731 // if IOMMU is not activated, addresses are 40 bits (physical addresses), 732 // and the choice depends on on address bit A[39]. 733 // if IOMMU is activated the addresses use only 32 bits (virtual 734 // addresses), and the choice depends on address bit A[31]. 735 for (size_t x = 0; x < x_size; x++) 736 { 737 for (size_t y = 0; y < y_size ; y++) 738 { 739 uint64_t offset = ((uint64_t)cluster(x,y)) 740 << (vci_address_width - X_WIDTH - Y_WIDTH); 741 742 // send command to XRAM through IOB0 743 if ( x < (x_size/2) ) 744 { 745 std::ostringstream siob0; 746 siob0 << "iox_seg_xram_" << x << "_" << y; 747 maptab_iox.add(Segment(siob0.str(), offset, 0x80000000, 748 IntTab(cluster_iob0,IOX_IOB0_TGT_ID), 749 false)); 750 } 751 // send command to XRAM through IOB1 752 else 753 { 754 std::ostringstream siob1; 755 siob1 << "iox_seg_xram_" << x << "_" << y; 756 maptab_iox.add(Segment(siob1.str(), offset, 0x80000000, 757 IntTab(cluster_iob1,IOX_IOB1_TGT_ID), 758 false)); 759 } 760 } 761 } 762 // useful when IOMMU activated 763 maptab_iox.add(Segment("iox_seg_xram", 0xc0000000, 0x40000000, 764 IntTab(cluster_iob1,IOX_IOB1_TGT_ID), false)); 765 766 // This define the mapping between the initiators (identified by the SRCID) 767 // and the port index on the IOX local interconnect. 768 // External initiator have two alias SRCID (iob0 / iob1 access) 769 770 maptab_iox.srcid_map(IntTab(cluster_iob0, CDMA_LOCAL_SRCID), 771 IntTab(cluster_iob0, IOX_CDMA_INI_ID)); 772 maptab_iox.srcid_map(IntTab(cluster_iob1, CDMA_LOCAL_SRCID), 773 IntTab(cluster_iob1, IOX_CDMA_INI_ID)); 774 maptab_iox.srcid_map(IntTab(cluster_iob0, BDEV_LOCAL_SRCID), 775 IntTab(cluster_iob0, IOX_BDEV_INI_ID)); 776 maptab_iox.srcid_map(IntTab(cluster_iob1, BDEV_LOCAL_SRCID), 777 IntTab(cluster_iob0, IOX_BDEV_INI_ID)); 778 779 for (size_t x = 0; x < x_size; x++) 780 { 781 for (size_t y = 0; y < y_size ; y++) 782 { 783 size_t iob = (x < (x_size / 2)) ? IOX_IOB0_INI_ID 784 : IOX_IOB1_INI_ID; 785 786 for (size_t p = 0 ; p < nb_procs ; p++) 787 { 788 maptab_iox.srcid_map(IntTab(cluster(x,y), PROC_LOCAL_SRCID + p), 789 IntTab(cluster(x,y), iob)); 790 } 791 maptab_iox.srcid_map(IntTab( cluster(x,y), MDMA_LOCAL_SRCID), 792 IntTab( cluster(x,y), IOX_IOB0_INI_ID)); 793 } 794 } 795 796 std::cout << "IOX network " << maptab_iox << std::endl; 797 798 //////////////////// 799 // Signals 800 //////////////////// 801 802 sc_clock signal_clk("clk"); 803 sc_signal<bool> signal_resetn("resetn"); 804 805 sc_signal<bool> signal_irq_false; 806 sc_signal<bool> signal_irq_bdev; 807 sc_signal<bool> signal_irq_mnic_rx[1]; 808 sc_signal<bool> signal_irq_mnic_tx[1]; 809 sc_signal<bool> signal_irq_mtty[16]; 810 sc_signal<bool> signal_irq_cdma[1*2]; 811 812 // DSPIN signals for loopback in cluster_iob0 & cluster_iob1 813 DspinSignals<dspin_ram_cmd_width> signal_dspin_cmd_iob0_loopback; 814 DspinSignals<dspin_ram_rsp_width> signal_dspin_rsp_iob0_loopback; 815 DspinSignals<dspin_ram_cmd_width> signal_dspin_cmd_iob1_loopback; 816 DspinSignals<dspin_ram_rsp_width> signal_dspin_rsp_iob1_loopback; 817 818 // VCI signals for IOX network 819 VciSignals<vci_param_ext> signal_vci_ini_iob0("signal_vci_ini_iob0"); 820 VciSignals<vci_param_ext> signal_vci_ini_iob1("signal_vci_ini_iob1"); 821 VciSignals<vci_param_ext> signal_vci_ini_bdev("signal_vci_ini_bdev"); 822 VciSignals<vci_param_ext> signal_vci_ini_cdma("signal_vci_ini_cdma"); 823 824 VciSignals<vci_param_ext> signal_vci_tgt_iob0("signal_vci_tgt_iob0"); 825 VciSignals<vci_param_ext> signal_vci_tgt_iob1("signal_vci_tgt_iob1"); 826 VciSignals<vci_param_ext> signal_vci_tgt_mtty("signal_vci_tgt_mtty"); 827 VciSignals<vci_param_ext> signal_vci_tgt_fbuf("signal_vci_tgt_fbuf"); 828 VciSignals<vci_param_ext> signal_vci_tgt_mnic("signal_vci_tgt_mnic"); 829 VciSignals<vci_param_ext> signal_vci_tgt_bdev("signal_vci_tgt_bdev"); 830 VciSignals<vci_param_ext> signal_vci_tgt_cdma("signal_vci_tgt_cdma"); 527 ///////////////////////////////////////////////////////////////////////// 528 // RAM network mapping table 529 // - two levels address decoding for commands 530 // - two levels srcid decoding for responses 531 // - 2 local initiators (MEMC, IOBX) per cluster 532 // (IOBX component only in cluster_iob0 and cluster_iob1) 533 // - 1 local target (XRAM) per cluster 534 //////////////////////////////////////////////////////////////////////// 535 MappingTable maptab_ram( 536 vci_address_width, 537 IntTab(X_WIDTH + Y_WIDTH, 16 - X_WIDTH - Y_WIDTH), 538 IntTab(X_WIDTH + Y_WIDTH, vci_param_int::S - X_WIDTH - Y_WIDTH), 539 0x00FF000000); 540 541 for (size_t x = 0; x < x_size; x++) { 542 for (size_t y = 0; y < y_size ; y++) { 543 uint64_t offset = ((uint64_t)cluster(x,y)) 544 << (vci_address_width - X_WIDTH - Y_WIDTH); 545 546 std::ostringstream sxram; 547 sxram << "ext_seg_xram_" << x << "_" << y; 548 maptab_ram.add(Segment(sxram.str(), XRAM_BASE+offset, XRAM_SIZE, 549 IntTab(cluster(x,y), 0), false)); 550 } 551 } 552 553 // This define the mapping between the initiators SRCID 554 // and the port index on the RAM local interconnect. 555 // External initiator have two alias SRCID (iob0 / iob1) 556 557 maptab_ram.srcid_map(IntTab(cluster_iob0, CDMA_LOCAL_SRCID), 558 IntTab(cluster_iob0, RAM_IOBX_INI_ID)); 559 maptab_ram.srcid_map(IntTab(cluster_iob1, CDMA_LOCAL_SRCID), 560 IntTab(cluster_iob1, RAM_IOBX_INI_ID)); 561 maptab_ram.srcid_map(IntTab(cluster_iob0, BDEV_LOCAL_SRCID), 562 IntTab(cluster_iob0, RAM_IOBX_INI_ID)); 563 maptab_ram.srcid_map(IntTab(cluster_iob1, BDEV_LOCAL_SRCID), 564 IntTab(cluster_iob1, RAM_IOBX_INI_ID)); 565 maptab_ram.srcid_map(IntTab(cluster_iob1, MEMC_LOCAL_SRCID), 566 IntTab(cluster_iob1, RAM_MEMC_INI_ID)); 567 568 std::cout << "RAM network " << maptab_ram << std::endl; 569 570 /////////////////////////////////////////////////////////////////////// 571 // IOX network mapping table 572 // - two levels address decoding for commands 573 // - two levels srcid decoding for responses 574 // - 4 initiators (IOB0, IOB1, BDEV, CDMA) 575 // - 8 targets (IOB0, IOB1, BDEV, CDMA, MTTY, FBUF, BROM, MNIC) 576 /////////////////////////////////////////////////////////////////////// 577 MappingTable maptab_iox( 578 vci_address_width, 579 IntTab(X_WIDTH + Y_WIDTH, 16 - X_WIDTH - Y_WIDTH), 580 IntTab(X_WIDTH + Y_WIDTH, vci_srcid_width - X_WIDTH - Y_WIDTH), 581 0x00FF000000); 582 583 // compute base addresses for cluster_iob0 and cluster_iob1 584 uint64_t iob0_base = ((uint64_t)cluster_iob0) 585 << (vci_address_width - X_WIDTH - Y_WIDTH); 586 uint64_t iob1_base = ((uint64_t)cluster_iob1) 587 << (vci_address_width - X_WIDTH - Y_WIDTH); 588 589 // Each peripheral can be accessed through two segments, 590 // depending on the used IOB (IOB0 or IOB1). 591 maptab_iox.add(Segment("iox_seg_mtty_0", XTTY_BASE + iob0_base, XTTY_SIZE, 592 IntTab(cluster_iob0, IOX_MTTY_TGT_ID), false)); 593 maptab_iox.add(Segment("iox_seg_mtty_1", XTTY_BASE + iob1_base, XTTY_SIZE, 594 IntTab(cluster_iob1, IOX_MTTY_TGT_ID), false)); 595 maptab_iox.add(Segment("iox_seg_fbuf_0", FBUF_BASE + iob0_base, FBUF_SIZE, 596 IntTab(cluster_iob0, IOX_FBUF_TGT_ID), false)); 597 maptab_iox.add(Segment("iox_seg_fbuf_1", FBUF_BASE + iob1_base, FBUF_SIZE, 598 IntTab(cluster_iob1, IOX_FBUF_TGT_ID), false)); 599 maptab_iox.add(Segment("iox_seg_bdev_0", BDEV_BASE + iob0_base, BDEV_SIZE, 600 IntTab(cluster_iob0, IOX_BDEV_TGT_ID), false)); 601 maptab_iox.add(Segment("iox_seg_bdev_1", BDEV_BASE + iob1_base, BDEV_SIZE, 602 IntTab(cluster_iob1, IOX_BDEV_TGT_ID), false)); 603 maptab_iox.add(Segment("iox_seg_mnic_0", MNIC_BASE + iob0_base, MNIC_SIZE, 604 IntTab(cluster_iob0, IOX_MNIC_TGT_ID), false)); 605 maptab_iox.add(Segment("iox_seg_mnic_1", MNIC_BASE + iob1_base, MNIC_SIZE, 606 IntTab(cluster_iob1, IOX_MNIC_TGT_ID), false)); 607 maptab_iox.add(Segment("iox_seg_cdma_0", CDMA_BASE + iob0_base, CDMA_SIZE, 608 IntTab(cluster_iob0, IOX_CDMA_TGT_ID), false)); 609 maptab_iox.add(Segment("iox_seg_cdma_1", CDMA_BASE + iob1_base, CDMA_SIZE, 610 IntTab(cluster_iob1, IOX_CDMA_TGT_ID), false)); 611 612 // Each physical RAM can be accessed through IOB0, or through IOB1. 613 // if IOMMU is not activated, addresses are 40 bits (physical addresses), 614 // and the choice depends on on address bit A[39]. 615 // if IOMMU is activated the addresses use only 32 bits (virtual 616 // addresses), and the choice depends on address bit A[31]. 617 for (size_t x = 0; x < x_size; x++) { 618 for (size_t y = 0; y < y_size ; y++) { 619 uint64_t offset = static_cast<uint64_t>(cluster(x,y)) 620 << (vci_address_width - X_WIDTH - Y_WIDTH); 621 622 // send command to XRAM through IOB0 623 if ( x < (x_size/2) ) { 624 std::ostringstream siob0; 625 siob0 << "iox_seg_xram_" << x << "_" << y; 626 maptab_iox.add(Segment(siob0.str(), 627 XRAM_BASE + offset, XRAM_SIZE, 628 IntTab(cluster_iob0,IOX_IOB0_TGT_ID), 629 false)); 630 } 631 // send command to XRAM through IOB1 632 else { 633 std::ostringstream siob1; 634 siob1 << "iox_seg_xram_" << x << "_" << y; 635 maptab_iox.add(Segment(siob1.str(), 636 XRAM_BASE + offset, XRAM_SIZE, 637 IntTab(cluster_iob1,IOX_IOB1_TGT_ID), 638 false)); 639 } 640 } 641 } 642 // useful when IOMMU activated 643 //maptab_iox.add(Segment("iox_seg_xram", 0xc0000000, 0x40000000, 644 // IntTab(cluster_iob1,IOX_IOB1_TGT_ID), false)); 645 646 // This define the mapping between the initiators (identified by the SRCID) 647 // and the port index on the IOX local interconnect. 648 // External initiator have two alias SRCID (iob0 / iob1 access) 649 650 maptab_iox.srcid_map(IntTab(cluster_iob0, CDMA_LOCAL_SRCID), 651 IntTab(cluster_iob0, IOX_CDMA_INI_ID)); 652 maptab_iox.srcid_map(IntTab(cluster_iob1, CDMA_LOCAL_SRCID), 653 IntTab(cluster_iob1, IOX_CDMA_INI_ID)); 654 maptab_iox.srcid_map(IntTab(cluster_iob0, BDEV_LOCAL_SRCID), 655 IntTab(cluster_iob0, IOX_BDEV_INI_ID)); 656 maptab_iox.srcid_map(IntTab(cluster_iob1, BDEV_LOCAL_SRCID), 657 IntTab(cluster_iob0, IOX_BDEV_INI_ID)); 658 659 for (size_t x = 0; x < x_size; x++) { 660 for (size_t y = 0; y < y_size ; y++) { 661 size_t iob = (x < (x_size / 2)) ? IOX_IOB0_INI_ID : IOX_IOB1_INI_ID; 662 663 for (size_t p = 0 ; p < NB_PROCS ; p++) { 664 maptab_iox.srcid_map(IntTab(cluster(x,y), PROC_LOCAL_SRCID + p), 665 IntTab(cluster(x,y), iob)); 666 } 667 maptab_iox.srcid_map(IntTab( cluster(x,y), MDMA_LOCAL_SRCID), 668 IntTab( cluster(x,y), IOX_IOB0_INI_ID)); 669 } 670 } 671 672 std::cout << "IOX network " << maptab_iox << std::endl; 673 674 //////////////////// 675 // Signals 676 //////////////////// 677 678 sc_clock signal_clk("clk"); 679 sc_signal<bool> signal_resetn("resetn"); 680 681 sc_signal<bool> signal_irq_false; 682 sc_signal<bool> signal_irq_bdev; 683 sc_signal<bool> signal_irq_mnic_rx[NB_NIC_CHANNELS]; 684 sc_signal<bool> signal_irq_mnic_tx[NB_NIC_CHANNELS]; 685 sc_signal<bool> signal_irq_mtty[NB_TTY_CHANNELS]; 686 sc_signal<bool> signal_irq_cdma[NB_NIC_CHANNELS*2]; 687 688 // DSPIN signals for loopback in cluster_iob0 & cluster_iob1 689 DspinSignals<dspin_ram_cmd_width> signal_dspin_cmd_iob0_loopback; 690 DspinSignals<dspin_ram_rsp_width> signal_dspin_rsp_iob0_loopback; 691 DspinSignals<dspin_ram_cmd_width> signal_dspin_cmd_iob1_loopback; 692 DspinSignals<dspin_ram_rsp_width> signal_dspin_rsp_iob1_loopback; 693 694 // VCI signals for IOX network 695 VciSignals<vci_param_ext> signal_vci_ini_iob0("signal_vci_ini_iob0"); 696 VciSignals<vci_param_ext> signal_vci_ini_iob1("signal_vci_ini_iob1"); 697 VciSignals<vci_param_ext> signal_vci_ini_bdev("signal_vci_ini_bdev"); 698 VciSignals<vci_param_ext> signal_vci_ini_cdma("signal_vci_ini_cdma"); 699 700 VciSignals<vci_param_ext> signal_vci_tgt_iob0("signal_vci_tgt_iob0"); 701 VciSignals<vci_param_ext> signal_vci_tgt_iob1("signal_vci_tgt_iob1"); 702 VciSignals<vci_param_ext> signal_vci_tgt_mtty("signal_vci_tgt_mtty"); 703 VciSignals<vci_param_ext> signal_vci_tgt_fbuf("signal_vci_tgt_fbuf"); 704 VciSignals<vci_param_ext> signal_vci_tgt_mnic("signal_vci_tgt_mnic"); 705 VciSignals<vci_param_ext> signal_vci_tgt_bdev("signal_vci_tgt_bdev"); 706 VciSignals<vci_param_ext> signal_vci_tgt_cdma("signal_vci_tgt_cdma"); 831 707 832 708 // Horizontal inter-clusters INT network DSPIN … … 919 795 //////////////////////////// 920 796 921 #if USE_ALMOS922 soclib::common::Loader loader(almos_bootloader_pathname,923 almos_archinfo_pathname,924 almos_kernel_pathname);925 #else926 797 soclib::common::Loader loader(soft_name); 927 #endif928 798 929 799 typedef soclib::common::GdbServer<soclib::common::Mips32ElIss> proc_iss; … … 935 805 936 806 std::cout << std::endl << "External Bus and Peripherals" << std::endl 937 807 << std::endl; 938 808 939 809 // IOX network 940 810 VciIoxNetwork<vci_param_ext>* iox_network; 941 811 iox_network = new VciIoxNetwork<vci_param_ext>("iox_network", 942 943 944 812 maptab_iox, 813 7, // number of targets 814 4 ); // number of initiators 945 815 946 816 // Network Controller 947 817 VciMultiNic<vci_param_ext>* mnic; 948 818 mnic = new VciMultiNic<vci_param_ext>("mnic", 949 950 951 nb_nic_channels,952 953 954 955 819 IntTab(0, IOX_MNIC_TGT_ID), 820 maptab_iox, 821 NB_NIC_CHANNELS, 822 0, // mac_4 address 823 0, // mac_2 address 824 nic_rx_name, 825 nic_tx_name); 956 826 957 827 // Frame Buffer 958 828 VciFrameBuffer<vci_param_ext>* fbuf; 959 829 fbuf = new VciFrameBuffer<vci_param_ext>("fbuf", 960 961 962 830 IntTab(0, IOX_FBUF_TGT_ID), 831 maptab_iox, 832 FBUF_X_SIZE, FBUF_Y_SIZE ); 963 833 964 834 // Block Device … … 968 838 VciBlockDeviceTsar<vci_param_ext>* bdev; 969 839 bdev = new VciBlockDeviceTsar<vci_param_ext>("bdev", 970 971 972 973 974 975 976 840 maptab_iox, 841 IntTab(0, BDEV_LOCAL_SRCID), 842 IntTab(0, IOX_BDEV_TGT_ID), 843 disk_name, 844 block_size, 845 64, // burst size (bytes) 846 0 ); // disk latency 977 847 978 848 // Chained Buffer DMA controller 979 849 VciChbufDma<vci_param_ext>* cdma; 980 850 cdma = new VciChbufDma<vci_param_ext>("cdma", 981 982 983 984 985 2 * nb_nic_channels);851 maptab_iox, 852 IntTab(0, CDMA_LOCAL_SRCID), 853 IntTab(0, IOX_CDMA_TGT_ID), 854 64, // burst size (bytes) 855 2 * NB_NIC_CHANNELS); 986 856 // Multi-TTY controller 987 857 std::vector<std::string> vect_names; 988 for( size_t tid = 0 ; tid < nb_tty_channels; tid++ )858 for( size_t tid = 0 ; tid < NB_TTY_CHANNELS ; tid++ ) 989 859 { 990 860 std::ostringstream term_name; 991 term_name << " term" << tid;861 term_name << "mtty_iox_" << tid; 992 862 vect_names.push_back(term_name.str().c_str()); 993 863 } 994 864 VciMultiTty<vci_param_ext>* mtty; 995 865 mtty = new VciMultiTty<vci_param_ext>("mtty_iox", 996 IntTab(0, IOX_MTTY_TGT_ID), 997 maptab_iox, 998 vect_names); 999 // Clusters 1000 typedef TsarIobCluster<vci_param_int, vci_param_ext, dspin_int_cmd_width, 1001 dspin_int_rsp_width, dspin_ram_cmd_width, dspin_ram_rsp_width> 1002 TsarIobClusterType; 1003 866 IntTab(0, IOX_MTTY_TGT_ID), 867 maptab_iox, 868 vect_names); 869 1004 870 TsarIobClusterType* clusters[x_size][y_size]; 1005 871 1006 872 #if USE_OPENMP 1007 873 #pragma omp parallel 1008 874 { 1009 875 #pragma omp for 1010 876 #endif 1011 877 1012 for(size_t i = 0; i < (x_size * y_size); i++) 1013 { 1014 size_t x = i / y_size; 1015 size_t y = i % y_size; 878 for(size_t i = 0; i < (x_size * y_size); i++) { 879 size_t x = i / y_size; 880 size_t y = i % y_size; 1016 881 1017 882 #if USE_OPENMP 1018 883 #pragma omp critical 1019 884 { 1020 885 #endif 1021 886 std::cout << std::endl; … … 1029 894 debug_ok && (cluster(x,y) == debug_memc_id); 1030 895 bool proc_debug = 1031 debug_ok && (cluster(x,y) == (debug_proc_id / nb_procs));896 debug_ok && (cluster(x,y) == (debug_proc_id / NB_PROCS)); 1032 897 1033 898 TsarIobClusterType::ClusterParams params = { 1034 899 .insname = sc.str().c_str(), 1035 .nb_procs = nb_procs, 1036 .nb_dmas = nb_dma_channels, 900 1037 901 .x_id = x, 1038 902 .y_id = y, 1039 .x_size = x_size, 1040 .y_size = y_size, 903 1041 904 .mt_int = maptab_int, 1042 905 .mt_ext = maptab_ram, 1043 906 .mt_iox = maptab_iox, 1044 .x_width = X_WIDTH, 1045 .y_width = Y_WIDTH, 1046 .l_width = vci_srcid_width - X_WIDTH - Y_WIDTH, 1047 .int_memc_tgtid = INT_MEMC_TGT_ID, 1048 .int_xicu_tgtid = INT_XICU_TGT_ID, 1049 .int_mdma_tgtid = INT_MDMA_TGT_ID, 1050 .int_iobx_tgtid = INT_IOBX_TGT_ID, 1051 .int_brom_tgtid = INT_BROM_TGT_ID, 1052 .int_proc_srcid = INT_PROC_INI_ID, 1053 .int_mdma_srcid = INT_MDMA_INI_ID, 1054 .int_iobx_srcid = INT_IOBX_INI_ID, 1055 .ext_xram_tgtid = RAM_XRAM_TGT_ID, 1056 .ext_memc_srcid = RAM_MEMC_INI_ID, 1057 .ext_iobx_srcid = RAM_IOBX_INI_ID, 907 1058 908 .memc_ways = MEMC_WAYS, 1059 909 .memc_sets = MEMC_SETS, … … 1063 913 .l1_d_sets = L1_DSETS, 1064 914 .xram_latency = XRAM_LATENCY, 915 1065 916 .loader = loader, 917 1066 918 .frozen_cycles = frozen_cycles, 1067 919 .debug_start_cycle = debug_from, … … 1074 926 1075 927 #if USE_OPENMP 1076 928 } // end critical 1077 929 #endif 1078 930 } // end for 1079 931 #if USE_OPENMP 1080 932 } 1081 933 #endif 1082 934 1083 std::cout << std::endl; 1084 1085 /////////////////////////////////////////////////////////////////////////// 1086 // Net-list 1087 /////////////////////////////////////////////////////////////////////////// 1088 1089 // IOX network connexion 1090 iox_network->p_clk (signal_clk); 1091 iox_network->p_resetn (signal_resetn); 1092 iox_network->p_to_ini[IOX_IOB0_INI_ID] (signal_vci_ini_iob0); 1093 iox_network->p_to_ini[IOX_IOB1_INI_ID] (signal_vci_ini_iob1); 1094 iox_network->p_to_ini[IOX_BDEV_INI_ID] (signal_vci_ini_bdev); 1095 iox_network->p_to_ini[IOX_CDMA_INI_ID] (signal_vci_ini_cdma); 1096 iox_network->p_to_tgt[IOX_IOB0_TGT_ID] (signal_vci_tgt_iob0); 1097 iox_network->p_to_tgt[IOX_IOB1_TGT_ID] (signal_vci_tgt_iob1); 1098 iox_network->p_to_tgt[IOX_MTTY_TGT_ID] (signal_vci_tgt_mtty); 1099 iox_network->p_to_tgt[IOX_FBUF_TGT_ID] (signal_vci_tgt_fbuf); 1100 iox_network->p_to_tgt[IOX_MNIC_TGT_ID] (signal_vci_tgt_mnic); 1101 iox_network->p_to_tgt[IOX_BDEV_TGT_ID] (signal_vci_tgt_bdev); 1102 iox_network->p_to_tgt[IOX_CDMA_TGT_ID] (signal_vci_tgt_cdma); 1103 1104 // BDEV connexion 1105 bdev->p_clk (signal_clk); 1106 bdev->p_resetn (signal_resetn); 1107 bdev->p_irq (signal_irq_bdev); 1108 1109 // For AHCI 1110 // bdev->p_channel_irq[0] (signal_irq_bdev); 1111 1112 bdev->p_vci_target (signal_vci_tgt_bdev); 1113 bdev->p_vci_initiator (signal_vci_ini_bdev); 1114 1115 std::cout << " - BDEV connected" << std::endl; 1116 1117 // FBUF connexion 1118 fbuf->p_clk (signal_clk); 1119 fbuf->p_resetn (signal_resetn); 1120 fbuf->p_vci (signal_vci_tgt_fbuf); 1121 1122 std::cout << " - FBUF connected" << std::endl; 1123 1124 // MNIC connexion 1125 mnic->p_clk (signal_clk); 1126 mnic->p_resetn (signal_resetn); 1127 mnic->p_vci (signal_vci_tgt_mnic); 1128 for ( size_t i=0 ; i<nb_nic_channels ; i++ ) 1129 { 1130 mnic->p_rx_irq[i] (signal_irq_mnic_rx[i]); 1131 mnic->p_tx_irq[i] (signal_irq_mnic_tx[i]); 1132 } 1133 1134 std::cout << " - MNIC connected" << std::endl; 1135 1136 // MTTY connexion 1137 mtty->p_clk (signal_clk); 1138 mtty->p_resetn (signal_resetn); 1139 mtty->p_vci (signal_vci_tgt_mtty); 1140 for ( size_t i=0 ; i<nb_tty_channels ; i++ ) 1141 { 1142 mtty->p_irq[i] (signal_irq_mtty[i]); 1143 } 1144 1145 std::cout << " - MTTY connected" << std::endl; 1146 1147 // CDMA connexion 1148 cdma->p_clk (signal_clk); 1149 cdma->p_resetn (signal_resetn); 1150 cdma->p_vci_target (signal_vci_tgt_cdma); 1151 cdma->p_vci_initiator (signal_vci_ini_cdma); 1152 for ( size_t i=0 ; i<(nb_nic_channels*2) ; i++) 1153 { 1154 cdma->p_irq[i] (signal_irq_cdma[i]); 1155 } 1156 1157 std::cout << " - CDMA connected" << std::endl; 1158 1159 // IRQ connexions from external peripherals (cluster_iob0 only) 1160 // IRQ_MNIC_RX -> IRQ[08] to IRQ[09] 1161 // IRQ_MNIC_TX -> IRQ[10] to IRQ[11] 1162 // IRQ_CDMA -> IRQ[12] to IRQ[15] 1163 // IRQ_MTTY -> IRQ[16] to IRQ[30] 1164 // IRQ_BDEV -> IRQ[31] 1165 1166 size_t mx = 16 + nb_tty_channels; 1167 for ( size_t n=0 ; n<32 ; n++ ) 1168 { 1169 if ( n < 8 ) (*clusters[0][0]->p_irq[n]) (signal_irq_false); 1170 else if ( n < 10 ) (*clusters[0][0]->p_irq[n]) (signal_irq_false); 1171 else if ( n < 12 ) (*clusters[0][0]->p_irq[n]) (signal_irq_false); 1172 else if ( n < 16 ) (*clusters[0][0]->p_irq[n]) (signal_irq_false); 1173 else if ( n < mx ) (*clusters[0][0]->p_irq[n]) (signal_irq_mtty[n-16]); 1174 else if ( n < 31 ) (*clusters[0][0]->p_irq[n]) (signal_irq_false); 1175 else (*clusters[0][0]->p_irq[n]) (signal_irq_bdev); 1176 } 1177 1178 // IOB0 cluster connexion to IOX network 1179 (*clusters[0][0]->p_vci_iob_iox_ini) (signal_vci_ini_iob0); 1180 (*clusters[0][0]->p_vci_iob_iox_tgt) (signal_vci_tgt_iob0); 1181 1182 // IOB1 cluster connexion to IOX network 1183 (*clusters[x_size-1][y_size-1]->p_vci_iob_iox_ini) (signal_vci_ini_iob1); 1184 (*clusters[x_size-1][y_size-1]->p_vci_iob_iox_tgt) (signal_vci_tgt_iob1); 1185 1186 // All clusters Clock & RESET connexions 1187 for ( size_t x = 0; x < (x_size); x++ ) 1188 { 1189 for (size_t y = 0; y < y_size; y++) 1190 { 1191 clusters[x][y]->p_clk (signal_clk); 1192 clusters[x][y]->p_resetn (signal_resetn); 1193 } 1194 } 935 std::cout << std::endl; 936 937 /////////////////////////////////////////////////////////////////////////// 938 // Net-list 939 /////////////////////////////////////////////////////////////////////////// 940 941 // IOX network connexion 942 iox_network->p_clk (signal_clk); 943 iox_network->p_resetn (signal_resetn); 944 iox_network->p_to_ini[IOX_IOB0_INI_ID] (signal_vci_ini_iob0); 945 iox_network->p_to_ini[IOX_IOB1_INI_ID] (signal_vci_ini_iob1); 946 iox_network->p_to_ini[IOX_BDEV_INI_ID] (signal_vci_ini_bdev); 947 iox_network->p_to_ini[IOX_CDMA_INI_ID] (signal_vci_ini_cdma); 948 iox_network->p_to_tgt[IOX_IOB0_TGT_ID] (signal_vci_tgt_iob0); 949 iox_network->p_to_tgt[IOX_IOB1_TGT_ID] (signal_vci_tgt_iob1); 950 iox_network->p_to_tgt[IOX_MTTY_TGT_ID] (signal_vci_tgt_mtty); 951 iox_network->p_to_tgt[IOX_FBUF_TGT_ID] (signal_vci_tgt_fbuf); 952 iox_network->p_to_tgt[IOX_MNIC_TGT_ID] (signal_vci_tgt_mnic); 953 iox_network->p_to_tgt[IOX_BDEV_TGT_ID] (signal_vci_tgt_bdev); 954 iox_network->p_to_tgt[IOX_CDMA_TGT_ID] (signal_vci_tgt_cdma); 955 956 // BDEV connexion 957 bdev->p_clk (signal_clk); 958 bdev->p_resetn (signal_resetn); 959 bdev->p_irq (signal_irq_bdev); 960 961 // For AHCI 962 // bdev->p_channel_irq[0] (signal_irq_bdev); 963 964 bdev->p_vci_target (signal_vci_tgt_bdev); 965 bdev->p_vci_initiator (signal_vci_ini_bdev); 966 967 std::cout << " - BDEV connected" << std::endl; 968 969 // FBUF connexion 970 fbuf->p_clk (signal_clk); 971 fbuf->p_resetn (signal_resetn); 972 fbuf->p_vci (signal_vci_tgt_fbuf); 973 974 std::cout << " - FBUF connected" << std::endl; 975 976 // MNIC connexion 977 mnic->p_clk (signal_clk); 978 mnic->p_resetn (signal_resetn); 979 mnic->p_vci (signal_vci_tgt_mnic); 980 for ( size_t i=0 ; i<NB_NIC_CHANNELS ; i++ ) 981 { 982 mnic->p_rx_irq[i] (signal_irq_mnic_rx[i]); 983 mnic->p_tx_irq[i] (signal_irq_mnic_tx[i]); 984 } 985 986 std::cout << " - MNIC connected" << std::endl; 987 988 // MTTY connexion 989 mtty->p_clk (signal_clk); 990 mtty->p_resetn (signal_resetn); 991 mtty->p_vci (signal_vci_tgt_mtty); 992 for ( size_t i=0 ; i<NB_TTY_CHANNELS ; i++ ) { 993 mtty->p_irq[i] (signal_irq_mtty[i]); 994 } 995 996 std::cout << " - MTTY connected" << std::endl; 997 998 // CDMA connexion 999 cdma->p_clk (signal_clk); 1000 cdma->p_resetn (signal_resetn); 1001 cdma->p_vci_target (signal_vci_tgt_cdma); 1002 cdma->p_vci_initiator (signal_vci_ini_cdma); 1003 for ( size_t i=0 ; i<(NB_NIC_CHANNELS*2) ; i++) { 1004 cdma->p_irq[i] (signal_irq_cdma[i]); 1005 } 1006 1007 std::cout << " - CDMA connected" << std::endl; 1008 1009 // IRQ connexions from external peripherals (cluster_iob0 only) 1010 // IRQ_MNIC_RX -> IRQ[08] to IRQ[09] 1011 // IRQ_MNIC_TX -> IRQ[10] to IRQ[11] 1012 // IRQ_CDMA -> IRQ[12] to IRQ[15] 1013 // IRQ_MTTY -> IRQ[16] to IRQ[30] 1014 // IRQ_BDEV -> IRQ[31] 1015 1016 size_t mx = 16 + NB_TTY_CHANNELS; 1017 for ( size_t n=0 ; n<32 ; n++ ) { 1018 if ( n < 8 ) (*clusters[0][0]->p_irq[n]) (signal_irq_false); 1019 else if ( n < 10 ) (*clusters[0][0]->p_irq[n]) (signal_irq_false); 1020 else if ( n < 12 ) (*clusters[0][0]->p_irq[n]) (signal_irq_false); 1021 else if ( n < 16 ) (*clusters[0][0]->p_irq[n]) (signal_irq_false); 1022 else if ( n < mx ) (*clusters[0][0]->p_irq[n]) (signal_irq_mtty[n-16]); 1023 else if ( n < 31 ) (*clusters[0][0]->p_irq[n]) (signal_irq_false); 1024 else (*clusters[0][0]->p_irq[n]) (signal_irq_bdev); 1025 } 1026 1027 // IOB0 cluster connexion to IOX network 1028 (*clusters[0][0]->p_vci_iob_iox_ini) (signal_vci_ini_iob0); 1029 (*clusters[0][0]->p_vci_iob_iox_tgt) (signal_vci_tgt_iob0); 1030 1031 // IOB1 cluster connexion to IOX network 1032 (*clusters[x_size-1][y_size-1]->p_vci_iob_iox_ini) (signal_vci_ini_iob1); 1033 (*clusters[x_size-1][y_size-1]->p_vci_iob_iox_tgt) (signal_vci_tgt_iob1); 1034 1035 // All clusters Clock & RESET connexions 1036 for ( size_t x = 0; x < (x_size); x++ ) { 1037 for (size_t y = 0; y < y_size; y++) { 1038 clusters[x][y]->p_clk (signal_clk); 1039 clusters[x][y]->p_resetn (signal_resetn); 1040 } 1041 } 1195 1042 1196 1043 const int& NORTH = VirtualDspinRouter<dspin_int_cmd_width>::NORTH; … … 1200 1047 1201 1048 // Inter Clusters horizontal connections 1202 if (x_size > 1) 1203 { 1204 for (size_t x = 0; x < (x_size-1); x++) 1205 { 1206 for (size_t y = 0; y < y_size; y++) 1207 { 1208 for (size_t k = 0; k < 3; k++) 1209 { 1049 if (x_size > 1) { 1050 for (size_t x = 0; x < (x_size-1); x++) { 1051 for (size_t y = 0; y < y_size; y++) { 1052 for (size_t k = 0; k < 3; k++) { 1210 1053 clusters[x][y]->p_dspin_int_cmd_out[EAST][k]( 1211 1054 signal_dspin_int_cmd_h_inc[x][y][k]); … … 1218 1061 } 1219 1062 1220 for (size_t k = 0; k < 2; k++) 1221 { 1063 for (size_t k = 0; k < 2; k++) { 1222 1064 clusters[x][y]->p_dspin_int_rsp_out[EAST][k]( 1223 1065 signal_dspin_int_rsp_h_inc[x][y][k]); … … 1251 1093 1252 1094 std::cout << std::endl << "Horizontal connections established" 1253 1095 << std::endl; 1254 1096 1255 1097 // Inter Clusters vertical connections 1256 if (y_size > 1) 1257 { 1258 for (size_t y = 0; y < (y_size-1); y++) 1259 { 1260 for (size_t x = 0; x < x_size; x++) 1261 { 1262 for (size_t k = 0; k < 3; k++) 1263 { 1098 if (y_size > 1) { 1099 for (size_t y = 0; y < (y_size-1); y++) { 1100 for (size_t x = 0; x < x_size; x++) { 1101 for (size_t k = 0; k < 3; k++) { 1264 1102 clusters[x][y]->p_dspin_int_cmd_out[NORTH][k]( 1265 1103 signal_dspin_int_cmd_v_inc[x][y][k]); … … 1272 1110 } 1273 1111 1274 for (size_t k = 0; k < 2; k++) 1275 { 1112 for (size_t k = 0; k < 2; k++) { 1276 1113 clusters[x][y]->p_dspin_int_rsp_out[NORTH][k]( 1277 1114 signal_dspin_int_rsp_v_inc[x][y][k]); … … 1307 1144 1308 1145 // East & West boundary cluster connections 1309 for (size_t y = 0; y < y_size; y++) 1310 { 1311 for (size_t k = 0; k < 3; k++) 1312 { 1146 for (size_t y = 0; y < y_size; y++) { 1147 for (size_t k = 0; k < 3; k++) { 1313 1148 clusters[0][y]->p_dspin_int_cmd_in[WEST][k]( 1314 1149 signal_dspin_false_int_cmd_in[0][y][WEST][k]); … … 1321 1156 } 1322 1157 1323 for (size_t k = 0; k < 2; k++) 1324 { 1158 for (size_t k = 0; k < 2; k++) { 1325 1159 clusters[0][y]->p_dspin_int_rsp_in[WEST][k]( 1326 1160 signal_dspin_false_int_rsp_in[0][y][WEST][k]); … … 1334 1168 1335 1169 // handling IOB to RAM network connection in cluster_iob0 1336 if( y == 0 ) 1337 { 1170 if( y == 0 ) { 1338 1171 (*clusters[0][0]->p_dspin_iob_cmd_out)( 1339 1172 signal_dspin_cmd_iob0_loopback); … … 1349 1182 signal_dspin_rsp_iob0_loopback); 1350 1183 } 1351 else 1352 { 1184 else { 1353 1185 clusters[0][y]->p_dspin_ram_cmd_in[WEST]( 1354 1186 signal_dspin_false_ram_cmd_in[0][y][WEST]); … … 1362 1194 1363 1195 // handling IOB to RAM network connection in cluster_iob1 1364 if( y == y_size-1 ) 1365 { 1196 if( y == y_size-1 ) { 1366 1197 (*clusters[x_size-1][y_size-1]->p_dspin_iob_cmd_out)( 1367 1198 signal_dspin_cmd_iob1_loopback); … … 1379 1210 signal_dspin_rsp_iob1_loopback); 1380 1211 } 1381 else 1382 { 1212 else { 1383 1213 clusters[x_size-1][y]->p_dspin_ram_cmd_in[EAST]( 1384 1214 signal_dspin_false_ram_cmd_in[x_size-1][y][EAST]); … … 1395 1225 1396 1226 // North & South boundary clusters connections 1397 for (size_t x = 0; x < x_size; x++) 1398 { 1399 for (size_t k = 0; k < 3; k++) 1400 { 1227 for (size_t x = 0; x < x_size; x++) { 1228 for (size_t k = 0; k < 3; k++) { 1401 1229 clusters[x][0]->p_dspin_int_cmd_in[SOUTH][k]( 1402 1230 signal_dspin_false_int_cmd_in[x][0][SOUTH][k]); … … 1409 1237 } 1410 1238 1411 for (size_t k = 0; k < 2; k++) 1412 { 1239 for (size_t k = 0; k < 2; k++) { 1413 1240 clusters[x][0]->p_dspin_int_rsp_in[SOUTH][k]( 1414 1241 signal_dspin_false_int_rsp_in[x][0][SOUTH][k]); … … 1441 1268 1442 1269 std::cout << "North & South boundaries established" << std::endl 1443 1270 << std::endl; 1444 1271 1445 1272 //////////////////////////////////////////////////////// … … 1454 1281 1455 1282 // network boundaries signals 1456 for (size_t x = 0; x < x_size ; x++) 1457 { 1458 for (size_t y = 0; y < y_size ; y++) 1459 { 1460 for (size_t a = 0; a < 4; a++) 1461 { 1462 for (size_t k = 0; k < 3; k++) 1463 { 1283 for (size_t x = 0; x < x_size ; x++) { 1284 for (size_t y = 0; y < y_size ; y++) { 1285 for (size_t a = 0; a < 4; a++) { 1286 for (size_t k = 0; k < 3; k++) { 1464 1287 signal_dspin_false_int_cmd_in[x][y][a][k].write = false; 1465 1288 signal_dspin_false_int_cmd_in[x][y][a][k].read = true; … … 1468 1291 } 1469 1292 1470 for (size_t k = 0; k < 2; k++) 1471 { 1293 for (size_t k = 0; k < 2; k++) { 1472 1294 signal_dspin_false_int_rsp_in[x][y][a][k].write = false; 1473 1295 signal_dspin_false_int_rsp_in[x][y][a][k].read = true; … … 1489 1311 } 1490 1312 1491 sc_start(sc_core::sc_time(1, SC_NS)); 1492 signal_resetn = true; 1493 1494 for (size_t n = 1; n < ncycles; n++) 1495 { 1496 // Monitor a specific address for one L1 cache 1497 // clusters[1][1]->proc[0]->cache_monitor(0x50090ULL); 1498 1499 // Monitor a specific address for one L2 cache 1500 // clusters[0][0]->memc->cache_monitor( 0x170000ULL); 1501 1502 // Monitor a specific address for one XRAM 1503 // if (n == 3000000) 1504 // clusters[0][0]->xram->start_monitor( 0x170000ULL , 64); 1505 1506 if (debug_ok and (n > debug_from) and (n % debug_period == 0)) 1507 { 1508 std::cout << " ***********************" 1509 << " cycle " << std::dec << n 1510 << " ***********************" 1511 << std::endl; 1512 1513 // trace proc[debug_proc_id] 1514 if ( debug_proc_id != 0xFFFFFFFF ) 1515 { 1516 size_t l = debug_proc_id % nb_procs ; 1517 size_t cluster_xy = debug_proc_id / nb_procs ; 1518 size_t x = cluster_xy >> Y_WIDTH; 1519 size_t y = cluster_xy & ((1 << Y_WIDTH) - 1); 1520 1521 clusters[x][y]->proc[l]->print_trace(1); 1522 1523 std::ostringstream proc_signame; 1524 proc_signame << "[SIG]PROC_" << x << "_" << y << "_" << l ; 1525 clusters[x][y]->signal_int_vci_ini_proc[l].print_trace( 1526 proc_signame.str()); 1527 1528 clusters[x][y]->xicu->print_trace(l); 1529 1530 std::ostringstream xicu_signame; 1531 xicu_signame << "[SIG]XICU_" << x << "_" << y; 1532 clusters[x][y]->signal_int_vci_tgt_xicu.print_trace( 1533 xicu_signame.str()); 1534 1535 if( clusters[x][y]->signal_proc_it[l].read() ) 1536 std::cout << "### IRQ_PROC_" << std::dec 1537 << x << "_" << y << "_" << l 1538 << " ACTIVE" << std::endl; 1313 sc_start(sc_core::sc_time(1, SC_NS)); 1314 signal_resetn = true; 1315 1316 struct timeval t1, t2; 1317 const uint64_t stats_period = 100000; 1318 gettimeofday(&t1, NULL); 1319 for (uint64_t n = 1; n < ncycles; n++) { 1320 // stats display 1321 if((n % stats_period) == 0) { 1322 gettimeofday(&t2, NULL); 1323 1324 uint64_t ms1 = (uint64_t) t1.tv_sec * 1000 + 1325 (uint64_t) t1.tv_usec / 1000; 1326 uint64_t ms2 = (uint64_t) t2.tv_sec * 1000 + 1327 (uint64_t) t2.tv_usec / 1000; 1328 double freq = (double) stats_period / (ms2 - ms1); 1329 1330 std::cerr << "Platform Clock Frequency: " << freq << " Khz" 1331 << std::endl; 1332 1333 gettimeofday(&t1, NULL); 1334 } 1335 1336 if (debug_ok and (n > debug_from) and ((n % debug_period) == 0)) { 1337 std::cout << " ***********************" 1338 << " cycle " << std::dec << n 1339 << " ***********************" 1340 << std::endl; 1341 1342 // trace proc[debug_proc_id] 1343 if ( debug_proc_id != 0xFFFFFFFF ) { 1344 size_t l = debug_proc_id % NB_PROCS ; 1345 size_t cluster_xy = debug_proc_id / NB_PROCS ; 1346 size_t x = cluster_xy >> Y_WIDTH; 1347 size_t y = cluster_xy & ((1 << Y_WIDTH) - 1); 1348 1349 clusters[x][y]->proc[l]->print_trace(1); 1350 1351 std::ostringstream proc_signame; 1352 proc_signame << "[SIG]PROC_" << x << "_" << y << "_" << l ; 1353 clusters[x][y]->signal_int_vci_ini_proc[l].print_trace( 1354 proc_signame.str()); 1355 1356 clusters[x][y]->xicu->print_trace(l); 1357 1358 std::ostringstream xicu_signame; 1359 xicu_signame << "[SIG]XICU_" << x << "_" << y; 1360 clusters[x][y]->signal_int_vci_tgt_xicu.print_trace( 1361 xicu_signame.str()); 1362 1363 if( clusters[x][y]->signal_proc_it[l].read() ) { 1364 std::cout << "### IRQ_PROC_" << std::dec 1365 << x << "_" << y << "_" << l 1366 << " ACTIVE" << std::endl; 1539 1367 } 1540 1541 // trace INT network 1542 // clusters[0][0]->int_xbar_cmd_d->print_trace(); 1543 // clusters[0][0]->int_xbar_rsp_d->print_trace(); 1544 1545 // clusters[0][0]->signal_int_dspin_cmd_l2g_d.print_trace( 1546 // "[SIG] INT_CMD_L2G_D_0_0"); 1547 // clusters[0][0]->signal_int_dspin_rsp_g2l_d.print_trace( 1548 // "[SIG] INT_RSP_G2L_D_0_0"); 1549 1550 // clusters[0][0]->int_router_cmd->print_trace(0); 1551 // clusters[0][0]->int_router_rsp->print_trace(0); 1552 1553 // trace INT_CMD_D xbar and router in cluster 0_1 1554 // clusters[0][1]->int_router_cmd->print_trace(0); 1555 // clusters[0][1]->int_router_rsp->print_trace(0); 1556 1557 // clusters[0][1]->signal_int_dspin_cmd_g2l_d.print_trace( 1558 // "[SIG] INT_CMD_G2L_D_0_0"); 1559 // clusters[0][1]->signal_int_dspin_rsp_l2g_d.print_trace( 1560 // "[SIG] INT_RSP_L2G_D_0_0"); 1561 1562 // clusters[0][1]->int_xbar_cmd_d->print_trace(); 1563 // clusters[0][1]->int_xbar_rsp_d->print_trace(); 1564 1565 // trace memc[debug_memc_id] 1566 if ( debug_memc_id != 0xFFFFFFFF ) 1567 { 1568 size_t x = debug_memc_id >> Y_WIDTH; 1569 size_t y = debug_memc_id & ((1 << Y_WIDTH) - 1); 1570 1571 clusters[x][y]->memc->print_trace(0); 1572 std::ostringstream smemc_tgt; 1573 smemc_tgt << "[SIG]MEMC_TGT_" << x << "_" << y; 1574 clusters[x][y]->signal_int_vci_tgt_memc.print_trace( 1575 smemc_tgt.str()); 1576 std::ostringstream smemc_ini; 1577 smemc_ini << "[SIG]MEMC_INI_" << x << "_" << y; 1578 clusters[x][y]->signal_ram_vci_ini_memc.print_trace( 1579 smemc_ini.str()); 1580 clusters[x][y]->xram->print_trace(); 1581 std::ostringstream sxram_tgt; 1582 sxram_tgt << "[SIG]XRAM_TGT_" << x << "_" << y; 1583 clusters[x][y]->signal_ram_vci_tgt_xram.print_trace( 1584 sxram_tgt.str()); 1585 } 1586 1587 // trace RAM network routers 1588 // for( size_t cluster = 0 ; cluster < XMAX*YMAX ; cluster++ ) 1589 // { 1590 // size_t x = cluster / YMAX; 1591 // size_t y = cluster % YMAX; 1592 // clusters[x][y]->ram_router_cmd->print_trace(); 1593 // clusters[x][y]->ram_router_rsp->print_trace(); 1594 // } 1595 1596 // trace iob, iox and external peripherals 1597 if ( debug_iob ) 1598 { 1599 clusters[0][0]->iob->print_trace(); 1600 clusters[0][0]->signal_int_vci_tgt_iobx.print_trace( 1601 "[SIG]IOB0_INT_TGT"); 1602 clusters[0][0]->signal_int_vci_ini_iobx.print_trace( 1603 "[SIG]IOB0_INT_INI"); 1604 clusters[0][0]->signal_ram_vci_ini_iobx.print_trace( 1605 "[SIG]IOB0_RAM_INI"); 1606 1607 signal_vci_ini_iob0.print_trace("[SIG]IOB0_IOX_INI"); 1608 signal_vci_tgt_iob0.print_trace("[SIG]IOB0_IOX_TGT"); 1609 1610 // signal_dspin_cmd_iob0_loopback.print_trace( 1611 // "[SIG]IOB0_CMD_LOOPBACK"); 1612 // signal_dspin_rsp_iob0_loopback.print_trace( 1613 // "[SIG]IOB0_RSP_LOOPBACK"); 1614 1615 cdma->print_trace(); 1616 signal_vci_tgt_cdma.print_trace("[SIG]IOX_CDMA_TGT"); 1617 signal_vci_ini_cdma.print_trace("[SIG]IOX_CDMA_INI"); 1618 1619 // mtty->print_trace(); 1620 // signal_vci_tgt_mtty.print_trace("[SIG]IOX_MTTY_TGT"); 1621 1622 // bdev->print_trace(); 1623 // signal_vci_tgt_bdev.print_trace("[SIG]IOX_BDEV_TGT"); 1624 // signal_vci_ini_bdev.print_trace("[SIG]IOX_BDEV_INI"); 1625 1626 // fbuf->print_trace(); 1627 // signal_vci_tgt_fbuf.print_trace("[SIG]FBUF"); 1628 1629 iox_network->print_trace(); 1630 1631 // interrupts 1632 if (signal_irq_bdev) std::cout << "### IRQ_BDEV ACTIVATED" 1633 << std::endl; 1634 } 1635 } 1636 1637 sc_start(sc_core::sc_time(1, SC_NS)); 1638 } 1368 } 1369 1370 // trace INT network 1371 // clusters[0][0]->int_xbar_d->print_trace(); 1372 1373 // clusters[0][0]->signal_int_dspin_cmd_l2g_d.print_trace( 1374 // "[SIG] INT_CMD_L2G_D_0_0"); 1375 // clusters[0][0]->signal_int_dspin_rsp_g2l_d.print_trace( 1376 // "[SIG] INT_RSP_G2L_D_0_0"); 1377 1378 // clusters[0][0]->int_router_cmd->print_trace(0); 1379 // clusters[0][0]->int_router_rsp->print_trace(0); 1380 1381 // trace INT_CMD_D xbar and router in cluster 0_1 1382 // clusters[0][1]->int_router_cmd->print_trace(0); 1383 // clusters[0][1]->int_router_rsp->print_trace(0); 1384 1385 // clusters[0][1]->signal_int_dspin_cmd_g2l_d.print_trace( 1386 // "[SIG] INT_CMD_G2L_D_0_0"); 1387 // clusters[0][1]->signal_int_dspin_rsp_l2g_d.print_trace( 1388 // "[SIG] INT_RSP_L2G_D_0_0"); 1389 1390 // clusters[0][1]->int_xbar_cmd_d->print_trace(); 1391 1392 // trace memc[debug_memc_id] 1393 if ( debug_memc_id != 0xFFFFFFFF ) { 1394 size_t x = debug_memc_id >> Y_WIDTH; 1395 size_t y = debug_memc_id & ((1 << Y_WIDTH) - 1); 1396 1397 clusters[x][y]->memc->print_trace(0); 1398 std::ostringstream smemc_tgt; 1399 smemc_tgt << "[SIG]MEMC_TGT_" << x << "_" << y; 1400 clusters[x][y]->signal_int_vci_tgt_memc.print_trace( 1401 smemc_tgt.str()); 1402 std::ostringstream smemc_ini; 1403 smemc_ini << "[SIG]MEMC_INI_" << x << "_" << y; 1404 clusters[x][y]->signal_ram_vci_ini_memc.print_trace( 1405 smemc_ini.str()); 1406 clusters[x][y]->xram->print_trace(); 1407 std::ostringstream sxram_tgt; 1408 sxram_tgt << "[SIG]XRAM_TGT_" << x << "_" << y; 1409 clusters[x][y]->signal_ram_vci_tgt_xram.print_trace( 1410 sxram_tgt.str()); 1411 } 1412 1413 // trace iob, iox and external peripherals 1414 if ( debug_iob ) { 1415 clusters[0][0]->iob->print_trace(); 1416 clusters[0][0]->signal_int_vci_tgt_iobx.print_trace( 1417 "[SIG]IOB0_INT_TGT"); 1418 clusters[0][0]->signal_int_vci_ini_iobx.print_trace( 1419 "[SIG]IOB0_INT_INI"); 1420 clusters[0][0]->signal_ram_vci_ini_iobx.print_trace( 1421 "[SIG]IOB0_RAM_INI"); 1422 1423 signal_vci_ini_iob0.print_trace("[SIG]IOB0_IOX_INI"); 1424 signal_vci_tgt_iob0.print_trace("[SIG]IOB0_IOX_TGT"); 1425 1426 cdma->print_trace(); 1427 signal_vci_tgt_cdma.print_trace("[SIG]IOX_CDMA_TGT"); 1428 signal_vci_ini_cdma.print_trace("[SIG]IOX_CDMA_INI"); 1429 1430 iox_network->print_trace(); 1431 1432 // interrupts 1433 if (signal_irq_bdev) std::cout << "### IRQ_BDEV ACTIVATED" 1434 << std::endl; 1435 } 1436 } 1437 sc_start(sc_core::sc_time(1, SC_NS)); 1438 } 1639 1439 1640 1440 delete iox_network; … … 1645 1445 delete mtty; 1646 1446 1647 for(size_t x = 0; x < x_size; x++) 1648 { 1649 for(size_t y = 0; y < y_size; y++) 1650 { 1447 for(size_t x = 0; x < x_size; x++) { 1448 for(size_t y = 0; y < y_size; y++) { 1651 1449 delete clusters[x][y]; 1652 1450 } 1653 1451 } 1654 1655 1452 return EXIT_SUCCESS; 1656 1453 } 1657 1454 1658 int sc_main (int argc, char *argv[]) 1659 { 1455 int sc_main (int argc, char *argv[]) { 1660 1456 try { 1661 1457 return _main(argc, argv); -
branches/fault_tolerance/platform/tsar_generic_iob/tsar_iob_cluster/caba/metadata/tsar_iob_cluster.sd
r658 r695 3 3 4 4 Module('caba:tsar_iob_cluster', 5 5 classname = 'soclib::caba::TsarIobCluster', 6 6 7 8 7 tmpl_parameters = [ 8 parameter.Module('vci_param_int', default = 'caba:vci_param', 9 9 cell_size = parameter.Reference('vci_data_width_int')), 10 10 parameter.Module('vci_param_ext', default = 'caba:vci_param', 11 11 cell_size = parameter.Reference('vci_data_width_ext')), 12 13 14 15 16 12 parameter.Int('dspin_int_cmd_width'), 13 parameter.Int('dspin_int_rsp_width'), 14 parameter.Int('dspin_ram_cmd_width'), 15 parameter.Int('dspin_ram_rsp_width'), 16 ], 17 17 18 header_files = [ 18 header_files = [ 19 '../source/include/tsar_iob_cluster.h', 19 20 '../source/include/tsar_iob_cluster.h', 20 21 ], 21 22 22 23 implementation_files = [ 23 24 '../source/src/tsar_iob_cluster.cpp', 24 25 ], 25 26 26 27 28 29 30 27 uses = [ 28 Uses('caba:base_module'), 29 Uses('common:mapping_table'), 30 Uses('common:iss2'), 31 Uses('common:elf_file_loader'), 31 32 32 33 # internal network components 33 34 Uses('caba:vci_cc_vcache_wrapper', 34 35 cell_size = parameter.Reference('vci_data_width_int'), 35 36 dspin_in_width = parameter.Reference('dspin_int_cmd_width'), … … 38 39 gdb_iss_t = 'common:mips32el'), 39 40 40 41 Uses('caba:vci_mem_cache', 41 42 memc_cell_size_int = parameter.Reference('vci_data_width_int'), 42 43 memc_cell_size_ext = parameter.Reference('vci_data_width_ext'), … … 47 48 cell_size = parameter.Reference('vci_data_width_int')), 48 49 49 50 Uses('caba:vci_simple_rom', 50 51 cell_size = parameter.Reference('vci_data_width_int')), 51 52 52 Uses('caba:vci_multi_dma', 53 Uses('caba:vci_multi_tty', 54 cell_size = parameter.Reference('vci_data_width_int')), 55 56 Uses('caba:vci_multi_dma', 53 57 cell_size = parameter.Reference('vci_data_width_int')), 54 58 … … 92 96 flit_width = parameter.Reference('dspin_ram_rsp_width')), 93 97 94 98 Uses('caba:vci_simple_ram', 95 99 cell_size = parameter.Reference('vci_data_width_ext')), 96 100 … … 99 103 iob_cell_size_int = parameter.Reference('vci_data_width_int'), 100 104 iob_cell_size_ext = parameter.Reference('vci_data_width_ext')), 101 105 ], 102 106 103 104 105 107 ports = [ 108 Port('caba:bit_in', 'p_resetn', auto = 'resetn'), 109 Port('caba:clock_in', 'p_clk', auto = 'clock'), 106 110 107 111 Port('caba:dspin_output', 'p_int_cmd_out', [4, 3], 108 112 dspin_data_size = parameter.Reference('dspin_int_cmd_width')), 109 113 Port('caba:dspin_input', 'p_int_cmd_in', [4, 3], 110 114 dspin_data_size = parameter.Reference('dspin_int_cmd_width')), 111 115 Port('caba:dspin_output', 'p_int_rsp_out', [4, 2], 112 116 dspin_data_size = parameter.Reference('dspin_int_rsp_width')), 113 117 Port('caba:dspin_input', 'p_int_rsp_in', [4, 2], 114 118 dspin_data_size = parameter.Reference('dspin_int_rsp_width')), 115 119 116 120 Port('caba:dspin_output', 'p_ram_cmd_out', [4], 117 121 dspin_data_size = parameter.Reference('dspin_ram_cmd_width')), 118 122 Port('caba:dspin_input', 'p_ram_cmd_in', [4], 119 123 dspin_data_size = parameter.Reference('dspin_ram_cmd_width')), 120 124 Port('caba:dspin_output', 'p_ram_rsp_out', [4], 121 125 dspin_data_size = parameter.Reference('dspin_ram_rsp_width')), 122 126 Port('caba:dspin_input', 'p_ram_rsp_in', [4], 123 127 dspin_data_size = parameter.Reference('dspin_ram_rsp_width')), 124 128 ], 125 129 ) 126 130 -
branches/fault_tolerance/platform/tsar_generic_iob/tsar_iob_cluster/caba/source/include/tsar_iob_cluster.h
r658 r695 32 32 #include "vci_cc_vcache_wrapper.h" 33 33 #include "vci_io_bridge.h" 34 #include "vci_multi_tty.h" 35 #include "hard_config.h" 36 37 /////////////////////////////////////////////////////////////////////// 38 // Number of channels for debug TTY (may be 0) 39 /////////////////////////////////////////////////////////////////////// 40 #define NB_DEBUG_TTY_CHANNELS 1 41 42 /////////////////////////////////////////////////////////////////////// 43 // TGT_ID and INI_ID port indexing for INT local interconnect 44 /////////////////////////////////////////////////////////////////////// 45 46 #define INT_MEMC_TGT_ID 0 47 #define INT_XICU_TGT_ID 1 48 #define INT_BROM_TGT_ID 2 49 #define INT_MDMA_TGT_ID 3 50 #define INT_MTTY_TGT_ID 4 51 #define INT_IOBX_TGT_ID (4 + (NB_DEBUG_TTY_CHANNELS ? 1 : 0)) 52 53 #define INT_PROC_INI_ID 0 // from 0 to 7 54 #define INT_MDMA_INI_ID NB_PROCS 55 #define INT_IOBX_INI_ID (NB_PROCS + 1) 56 57 /////////////////////////////////////////////////////////////////////// 58 // TGT_ID and INI_ID port indexing for RAM local interconnect 59 /////////////////////////////////////////////////////////////////////// 60 61 #define RAM_XRAM_TGT_ID 0 62 63 #define RAM_MEMC_INI_ID 0 64 #define RAM_IOBX_INI_ID 1 34 65 35 66 namespace soclib { namespace caba { … … 81 112 sc_signal<bool> signal_proc_it[8]; 82 113 sc_signal<bool> signal_irq_mdma[8]; 114 sc_signal<bool> signal_irq_mtty[8]; 83 115 sc_signal<bool> signal_irq_memc; 84 116 … … 104 136 VciSignals<vci_param_int> signal_int_vci_tgt_xicu; 105 137 VciSignals<vci_param_int> signal_int_vci_tgt_brom; 138 VciSignals<vci_param_int> signal_int_vci_tgt_mtty; 106 139 VciSignals<vci_param_int> signal_int_vci_tgt_mdma; 107 140 VciSignals<vci_param_int> signal_int_vci_tgt_iobx; … … 122 155 DspinSignals<dspin_int_cmd_width> signal_int_dspin_cmd_brom_t; 123 156 DspinSignals<dspin_int_rsp_width> signal_int_dspin_rsp_brom_t; 157 DspinSignals<dspin_int_cmd_width> signal_int_dspin_cmd_mtty_t; 158 DspinSignals<dspin_int_rsp_width> signal_int_dspin_rsp_mtty_t; 124 159 DspinSignals<dspin_int_cmd_width> signal_int_dspin_cmd_mdma_t; 125 160 DspinSignals<dspin_int_rsp_width> signal_int_dspin_rsp_mdma_t; … … 186 221 VciIntDspinTargetWrapperType* brom_int_wt; 187 222 223 VciMultiTty<vci_param_int>* mtty; 224 VciIntDspinTargetWrapperType* mtty_int_wt; 225 188 226 DspinLocalCrossbar<dspin_int_cmd_width>* int_xbar_cmd_d; 189 227 DspinLocalCrossbar<dspin_int_rsp_width>* int_xbar_rsp_d; … … 213 251 sc_module_name insname; 214 252 215 size_t nb_procs;216 size_t nb_dmas;217 253 size_t x_id; 218 254 size_t y_id; 219 size_t x_size;220 size_t y_size;221 255 222 256 const soclib::common::MappingTable &mt_int; 223 257 const soclib::common::MappingTable &mt_ext; 224 258 const soclib::common::MappingTable &mt_iox; 225 226 size_t x_width;227 size_t y_width;228 size_t l_width;229 230 size_t int_memc_tgtid;231 size_t int_xicu_tgtid;232 size_t int_mdma_tgtid;233 size_t int_iobx_tgtid;234 size_t int_brom_tgtid;235 size_t int_proc_srcid;236 size_t int_mdma_srcid;237 size_t int_iobx_srcid;238 size_t ext_xram_tgtid;239 size_t ext_memc_srcid;240 size_t ext_iobx_srcid;241 259 242 260 size_t memc_ways; … … 257 275 }; 258 276 277 // utility functions 278 static uint32_t clusterId(size_t x_id, size_t y_id) { 279 return ((x_id << Y_WIDTH) | y_id); 280 }; 281 259 282 // cluster constructor 260 283 TsarIobCluster(struct ClusterParams& params); -
branches/fault_tolerance/platform/tsar_generic_iob/tsar_iob_cluster/caba/source/src/tsar_iob_cluster.cpp
r658 r695 33 33 ////////////////////////////////////////////////////////////////////////// 34 34 tmpl(/**/)::TsarIobCluster(struct ClusterParams& params) : 35 soclib::caba::BaseModule(params.insname), p_clk("clk"), p_resetn("resetn") 36 { 37 assert((params.x_id < params.x_size) and (params.y_id < params.y_size)); 38 39 this->m_procs = params.nb_procs; 40 size_t cluster_id = (params.x_id << 4) + params.y_id; 41 42 size_t cluster_iob0 = 0; 43 size_t cluster_iob1 = ((params.x_size - 1) << 4) + params.y_size - 1; 35 soclib::caba::BaseModule(params.insname), 36 p_clk("clk"), 37 p_resetn("resetn") { 38 39 assert((params.x_id < X_MAX) && (params.y_id < Y_MAX)); 40 41 size_t cid = this->clusterId(params.x_id, params.y_id); 42 size_t cluster_iob0 = this->clusterId(0, 0); 43 size_t cluster_iob1 = this->clusterId(X_SIZE - 1, Y_SIZE - 1); 44 size_t is_iob0 = (cid == cluster_iob0); 45 size_t is_iob1 = (cid == cluster_iob1); 46 bool is_io_cluster = is_iob0 || is_iob1; 47 48 size_t l_width = vci_param_int::S - X_WIDTH - Y_WIDTH; 44 49 45 50 // Vectors of DSPIN ports for inter-cluster communications … … 63 68 64 69 // ports in cluster_iob0 and cluster_iob1 only 65 if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) ) 66 { 70 p_vci_iob_iox_ini = NULL; 71 p_vci_iob_iox_tgt = NULL; 72 p_dspin_iob_cmd_out = NULL; 73 p_dspin_iob_rsp_in = NULL; 74 if ( is_io_cluster ) { 67 75 // VCI ports from IOB to IOX network 68 76 p_vci_iob_iox_ini = new soclib::caba::VciInitiator<vci_param_ext>; … … 70 78 71 79 // DSPIN ports from IOB to RAM network 72 p_dspin_iob_cmd_out = 73 new soclib::caba::DspinOutput<dspin_ram_cmd_width>; 74 p_dspin_iob_rsp_in = 75 new soclib::caba::DspinInput<dspin_ram_rsp_width>; 76 } 77 else 78 { 79 p_vci_iob_iox_ini = NULL; 80 p_vci_iob_iox_tgt = NULL; 81 p_dspin_iob_cmd_out = NULL; 82 p_dspin_iob_rsp_in = NULL; 80 p_dspin_iob_cmd_out = new soclib::caba::DspinOutput<dspin_ram_cmd_width>; 81 p_dspin_iob_rsp_in = new soclib::caba::DspinInput<dspin_ram_rsp_width>; 83 82 } 84 83 85 84 // IRQ ports in cluster_iob0 only 86 for ( size_t n = 0 ; n < 32 ; n++ ) 87 { 88 if ( cluster_id == cluster_iob0 ) 89 { 90 p_irq[n] = new sc_in<bool>; 91 } 92 else 93 { 94 p_irq[n] = NULL; 95 } 85 for ( size_t n = 0 ; n < 32 ; n++ ) { 86 p_irq[n] = ( is_iob0 ) ? new sc_in<bool> : NULL; 96 87 } 97 88 … … 101 92 102 93 //////////// PROCS 103 for (size_t p = 0; p < params.nb_procs; p++) 104 { 94 for (size_t p = 0; p < NB_PROCS; p++) { 105 95 std::ostringstream s_proc; 106 96 s_proc << "proc_" << params.x_id << "_" << params.y_id << "_" << p; 107 97 proc[p] = new VciCcVCacheWrapperType ( 108 98 s_proc.str().c_str(), 109 c luster_id * params.nb_procs+ p,99 cid * NB_PROCS + p, 110 100 params.mt_int, 111 IntTab(c luster_id,p),112 (c luster_id << params.l_width) + p,101 IntTab(cid,p), 102 (cid << l_width) + p, 113 103 8, 8, 114 104 8, 8, … … 116 106 params.l1_d_ways, params.l1_d_sets, 16, 117 107 4, 4, 118 params.x_width, params.y_width,108 X_WIDTH, Y_WIDTH, 119 109 params.frozen_cycles, 120 110 params.debug_start_cycle, params.proc_debug_ok); 121 111 112 proc[p]->set_dcache_paddr_ext_reset(cid); 113 proc[p]->set_icache_paddr_ext_reset(cid); 114 122 115 std::ostringstream s_wi_proc; 123 s_wi_proc << "proc_wi_" << params.x_id << "_" << params.y_id << "_" 124 << p; 116 s_wi_proc << "proc_wi_" << params.x_id << "_" << params.y_id << "_" << p; 125 117 proc_wi[p] = new VciIntDspinInitiatorWrapperType( 126 118 s_wi_proc.str().c_str(), 127 params.x_width + params.y_width + params.l_width);119 vci_param_int::S); 128 120 } 129 121 … … 135 127 params.mt_int, 136 128 params.mt_ext, 137 IntTab(c luster_id, params.ext_memc_srcid),138 IntTab(c luster_id, params.int_memc_tgtid),139 params.x_width,140 params.y_width,129 IntTab(cid, RAM_MEMC_INI_ID), 130 IntTab(cid, INT_MEMC_TGT_ID), 131 X_WIDTH, 132 Y_WIDTH, 141 133 params.memc_ways, params.memc_sets, 16, 142 134 3, 143 135 4096, 144 8, 145 8, 146 8, 136 8, 8, 8, 147 137 params.debug_start_cycle, 148 138 params.memc_debug_ok); … … 152 142 memc_int_wt = new VciIntDspinTargetWrapperType ( 153 143 s_wt_memc.str().c_str(), 154 params.x_width + params.y_width + params.l_width);144 vci_param_int::S); 155 145 156 146 std::ostringstream s_wi_memc; … … 158 148 memc_ram_wi = new VciExtDspinInitiatorWrapperType ( 159 149 s_wi_memc.str().c_str(), 160 params.x_width + params.y_width + params.l_width);150 vci_param_int::S); 161 151 162 152 /////////// LOCAL ROM 153 std::ostringstream s_brom; 154 s_brom << "brom_" << params.x_id << "_" << params.y_id; 163 155 brom = new VciSimpleRom<vci_param_int>( 164 "brom",165 IntTab(c luster_id, params.int_brom_tgtid),156 s_brom.str().c_str(), 157 IntTab(cid, INT_BROM_TGT_ID), 166 158 params.mt_int, 167 159 params.loader, 168 params.x_width + params.y_width);160 X_WIDTH + Y_WIDTH); 169 161 170 162 std::ostringstream s_wt_brom; … … 172 164 brom_int_wt = new VciIntDspinTargetWrapperType ( 173 165 s_wt_brom.str().c_str(), 174 params.x_width + params.y_width + params.l_width); 166 vci_param_int::S); 167 168 // Multi-TTY controller 169 mtty = NULL; 170 mtty_int_wt = NULL; 171 if (NB_DEBUG_TTY_CHANNELS) { 172 assert(NB_DEBUG_TTY_CHANNELS < 8); 173 174 std::ostringstream s_mtty; 175 s_mtty << "mtty_" << params.x_id << "_" << params.y_id; 176 std::vector<std::string> vect_names; 177 for( size_t tid = 0 ; tid < NB_DEBUG_TTY_CHANNELS ; tid++ ) { 178 std::ostringstream term_name; 179 term_name << s_mtty.str() << "_" << tid; 180 vect_names.push_back(term_name.str().c_str()); 181 } 182 mtty = new VciMultiTty<vci_param_int>( 183 s_mtty.str().c_str(), 184 IntTab(cid, INT_MTTY_TGT_ID), 185 params.mt_int, 186 vect_names); 187 188 std::ostringstream s_wt_mtty; 189 s_wt_mtty << "mtty_wt_" << params.x_id << "_" << params.y_id; 190 mtty_int_wt = new VciIntDspinTargetWrapperType ( 191 s_wt_mtty.str().c_str(), 192 vci_param_int::S); 193 } 175 194 176 195 /////////// XICU … … 180 199 s_xicu.str().c_str(), 181 200 params.mt_int, 182 IntTab(c luster_id,params.int_xicu_tgtid),201 IntTab(cid, INT_XICU_TGT_ID), 183 202 32, 32, 32, 184 params.nb_procs);203 NB_PROCS); 185 204 186 205 std::ostringstream s_wt_xicu; … … 188 207 xicu_int_wt = new VciIntDspinTargetWrapperType ( 189 208 s_wt_xicu.str().c_str(), 190 params.x_width + params.y_width + params.l_width);209 vci_param_int::S); 191 210 192 211 //////////// MDMA … … 196 215 s_mdma.str().c_str(), 197 216 params.mt_int, 198 IntTab(c luster_id, params.nb_procs),199 IntTab(c luster_id, params.int_mdma_tgtid),217 IntTab(cid, NB_PROCS), 218 IntTab(cid, INT_MDMA_TGT_ID), 200 219 64, 201 params.nb_dmas);220 NB_DMA_CHANNELS); 202 221 203 222 std::ostringstream s_wt_mdma; … … 205 224 mdma_int_wt = new VciIntDspinTargetWrapperType( 206 225 s_wt_mdma.str().c_str(), 207 params.x_width + params.y_width + params.l_width);226 vci_param_int::S); 208 227 209 228 std::ostringstream s_wi_mdma; … … 211 230 mdma_int_wi = new VciIntDspinInitiatorWrapperType( 212 231 s_wi_mdma.str().c_str(), 213 params.x_width + params.y_width + params.l_width);232 vci_param_int::S); 214 233 215 234 /////////// Direct LOCAL_XBAR(S) 216 size_t nb_direct_initiators = params.nb_procs+ 1;235 size_t nb_direct_initiators = NB_PROCS + 1; 217 236 size_t nb_direct_targets = 4; 218 if ((cluster_id == cluster_iob0) or (cluster_id == cluster_iob1)) 219 { 220 nb_direct_initiators = params.nb_procs + 2; 221 nb_direct_targets = 5; 237 if (NB_DEBUG_TTY_CHANNELS) { 238 nb_direct_targets++; 239 } 240 if ( is_io_cluster ) { 241 nb_direct_initiators++; 242 nb_direct_targets++; 222 243 } 223 244 … … 228 249 params.mt_int, 229 250 params.x_id, params.y_id, 230 params.x_width, params.y_width, params.l_width,251 X_WIDTH, Y_WIDTH, l_width, 231 252 nb_direct_initiators, 232 253 nb_direct_targets, … … 242 263 params.mt_int, 243 264 params.x_id, params.y_id, 244 params.x_width, params.y_width, params.l_width,265 X_WIDTH, Y_WIDTH, l_width, 245 266 nb_direct_targets, 246 267 nb_direct_initiators, … … 257 278 params.mt_int, 258 279 params.x_id, params.y_id, 259 params.x_width, params.y_width, params.l_width,280 X_WIDTH, Y_WIDTH, l_width, 260 281 1, 261 params.nb_procs,282 NB_PROCS, 262 283 2, 2, 263 284 true, … … 271 292 params.mt_int, 272 293 params.x_id, params.y_id, 273 params.x_width, params.y_width, 0,274 params.nb_procs,294 X_WIDTH, Y_WIDTH, 0, 295 NB_PROCS, 275 296 1, 276 297 2, 2, … … 281 302 std::ostringstream s_int_xbar_clack_c; 282 303 s_int_xbar_clack_c << "int_xbar_clack_c_" << params.x_id << "_" 283 << params.y_id;304 << params.y_id; 284 305 int_xbar_clack_c = new DspinLocalCrossbar<dspin_int_cmd_width>( 285 306 s_int_xbar_clack_c.str().c_str(), 286 307 params.mt_int, 287 308 params.x_id, params.y_id, 288 params.x_width, params.y_width, params.l_width,309 X_WIDTH, Y_WIDTH, l_width, 289 310 1, 290 params.nb_procs,311 NB_PROCS, 291 312 1, 1, 292 313 true, … … 299 320 int_router_cmd = new VirtualDspinRouter<dspin_int_cmd_width>( 300 321 s_int_router_cmd.str().c_str(), 301 params.x_id, params.y_id,302 params.x_width, params.y_width,322 params.x_id, params.y_id, 323 X_WIDTH, Y_WIDTH, 303 324 3, 304 325 4,4); … … 308 329 int_router_rsp = new VirtualDspinRouter<dspin_int_rsp_width>( 309 330 s_int_router_rsp.str().c_str(), 310 params.x_id, params.y_id,311 params.x_width, params.y_width,331 params.x_id, params.y_id, 332 X_WIDTH, Y_WIDTH, 312 333 2, 313 334 4,4); … … 318 339 xram = new VciSimpleRam<vci_param_ext>( 319 340 s_xram.str().c_str(), 320 IntTab(c luster_id, params.ext_xram_tgtid),341 IntTab(cid, RAM_XRAM_TGT_ID), 321 342 params.mt_ext, 322 343 params.loader, … … 327 348 xram_ram_wt = new VciExtDspinTargetWrapperType( 328 349 s_wt_xram.str().c_str(), 329 params.x_width + params.y_width + params.l_width);350 vci_param_int::S); 330 351 331 352 ///////////// RAM ROUTER(S) 332 353 std::ostringstream s_ram_router_cmd; 333 354 s_ram_router_cmd << "ram_router_cmd_" << params.x_id << "_" << params.y_id; 334 size_t is_iob0 = (params.x_id == 0) and (params.y_id == 0);335 size_t is_iob1 = (params.x_id == (params.x_size-1)) and336 (params.y_id == (params.y_size-1));337 355 ram_router_cmd = new DspinRouterTsar<dspin_ram_cmd_width>( 338 356 s_ram_router_cmd.str().c_str(), 339 357 params.x_id, params.y_id, 340 params.x_width, 341 params.y_width, 358 X_WIDTH, Y_WIDTH, 342 359 4, 4, 343 is_iob0, 344 is_iob1, 360 is_iob0, is_iob1, 345 361 false, 346 params.l_width);362 l_width); 347 363 348 364 std::ostringstream s_ram_router_rsp; … … 351 367 s_ram_router_rsp.str().c_str(), 352 368 params.x_id, params.y_id, 353 params.x_width, 354 params.y_width, 369 X_WIDTH, Y_WIDTH, 355 370 4, 4, 356 is_iob0, 357 is_iob1, 371 is_iob0, is_iob1, 358 372 true, 359 params.l_width);373 l_width); 360 374 361 375 ////////////////////// I/O CLUSTER ONLY /////////////////////// 362 if ((cluster_id == cluster_iob0) or (cluster_id == cluster_iob1)) 363 { 376 iob = NULL; 377 iob_int_wi = NULL; 378 iob_int_wt = NULL; 379 iob_ram_wi = NULL; 380 if ( is_io_cluster ) { 364 381 /////////// IO_BRIDGE 365 382 size_t iox_local_id; 366 size_t global_id;367 383 bool has_irqs; 368 if (cluster_id == cluster_iob0 ) 369 { 384 if ( is_iob0 ) { 370 385 iox_local_id = 0; 371 global_id = cluster_iob0;372 386 has_irqs = true; 373 387 } 374 else 375 { 388 else { 376 389 iox_local_id = 1; 377 global_id = cluster_iob1;378 390 has_irqs = false; 379 391 } … … 386 398 params.mt_int, 387 399 params.mt_iox, 388 IntTab( global_id, params.int_iobx_tgtid),389 IntTab( global_id, params.int_iobx_srcid),390 IntTab( global_id, iox_local_id ),400 IntTab(cid, INT_IOBX_TGT_ID), 401 IntTab(cid, INT_IOBX_INI_ID), 402 IntTab(cid, iox_local_id ), 391 403 has_irqs, 392 404 16, … … 400 412 iob_int_wi = new VciIntDspinInitiatorWrapperType( 401 413 s_iob_int_wi.str().c_str(), 402 params.x_width + params.y_width + params.l_width);414 vci_param_int::S); 403 415 404 416 std::ostringstream s_iob_int_wt; … … 406 418 iob_int_wt = new VciIntDspinTargetWrapperType( 407 419 s_iob_int_wt.str().c_str(), 408 params.x_width + params.y_width + params.l_width);420 vci_param_int::S); 409 421 410 422 std::ostringstream s_iob_ram_wi; … … 412 424 iob_ram_wi = new VciExtDspinInitiatorWrapperType( 413 425 s_iob_ram_wi.str().c_str(), 414 params.x_width + params.y_width + params.l_width); 415 } 416 else 417 { 418 iob = NULL; 419 iob_int_wi = NULL; 420 iob_int_wt = NULL; 421 iob_ram_wi = NULL; 426 vci_param_int::S); 422 427 } 423 428 … … 426 431 //////////////////////////////////// 427 432 428 // on coherence network : local srcid[proc] in [0... nb_procs-1]429 // : local srcid[memc] = nb_procs433 // on coherence network : local srcid[proc] in [0...NB_PROCS-1] 434 // : local srcid[memc] = NB_PROCS 430 435 // In cluster_iob0, 32 HWI interrupts from external peripherals 431 436 // are connected to the XICU ports p_hwi[0:31] … … 438 443 int_router_rsp->p_resetn (this->p_resetn); 439 444 440 for (int i = 0; i < 4; i++) 441 { 442 for(int k = 0; k < 3; k++) 443 { 445 for (int i = 0; i < 4; i++) { 446 for(int k = 0; k < 3; k++) { 444 447 int_router_cmd->p_out[i][k] (this->p_dspin_int_cmd_out[i][k]); 445 448 int_router_cmd->p_in[i][k] (this->p_dspin_int_cmd_in[i][k]); 446 449 } 447 448 for(int k = 0; k < 2; k++) 449 { 450 for(int k = 0; k < 2; k++) { 450 451 int_router_rsp->p_out[i][k] (this->p_dspin_int_rsp_out[i][k]); 451 452 int_router_rsp->p_in[i][k] (this->p_dspin_int_rsp_in[i][k]); … … 472 473 int_xbar_cmd_d->p_global_in (signal_int_dspin_cmd_g2l_d); 473 474 474 int_xbar_cmd_d->p_local_out[params.int_memc_tgtid]( 475 signal_int_dspin_cmd_memc_t); 476 int_xbar_cmd_d->p_local_out[params.int_xicu_tgtid]( 477 signal_int_dspin_cmd_xicu_t); 478 int_xbar_cmd_d->p_local_out[params.int_brom_tgtid]( 479 signal_int_dspin_cmd_brom_t); 480 int_xbar_cmd_d->p_local_out[params.int_mdma_tgtid]( 481 signal_int_dspin_cmd_mdma_t); 482 int_xbar_cmd_d->p_local_in[params.int_mdma_srcid]( 483 signal_int_dspin_cmd_mdma_i); 484 485 for (size_t p = 0; p < params.nb_procs; p++) { 486 int_xbar_cmd_d->p_local_in[params.int_proc_srcid + p]( 475 int_xbar_cmd_d->p_local_out[INT_MEMC_TGT_ID] (signal_int_dspin_cmd_memc_t); 476 int_xbar_cmd_d->p_local_out[INT_XICU_TGT_ID] (signal_int_dspin_cmd_xicu_t); 477 int_xbar_cmd_d->p_local_out[INT_BROM_TGT_ID] (signal_int_dspin_cmd_brom_t); 478 int_xbar_cmd_d->p_local_out[INT_MDMA_TGT_ID] (signal_int_dspin_cmd_mdma_t); 479 if (NB_DEBUG_TTY_CHANNELS) { 480 int_xbar_cmd_d->p_local_out[INT_MTTY_TGT_ID] (signal_int_dspin_cmd_mtty_t); 481 } 482 int_xbar_cmd_d->p_local_in[INT_MDMA_INI_ID] (signal_int_dspin_cmd_mdma_i); 483 484 for (size_t p = 0; p < NB_PROCS; p++) { 485 int_xbar_cmd_d->p_local_in[INT_PROC_INI_ID + p]( 487 486 signal_int_dspin_cmd_proc_i[p]); 488 487 } 489 488 490 if ((cluster_id == cluster_iob0) or (cluster_id == cluster_iob1)) 491 { 492 int_xbar_cmd_d->p_local_out[params.int_iobx_tgtid]( 489 if ( is_io_cluster ) { 490 int_xbar_cmd_d->p_local_out[INT_IOBX_TGT_ID]( 493 491 signal_int_dspin_cmd_iobx_t); 494 int_xbar_cmd_d->p_local_in[ params.int_iobx_srcid](492 int_xbar_cmd_d->p_local_in[INT_IOBX_INI_ID]( 495 493 signal_int_dspin_cmd_iobx_i); 496 494 } … … 502 500 int_xbar_rsp_d->p_global_in (signal_int_dspin_rsp_g2l_d); 503 501 504 int_xbar_rsp_d->p_local_in[params.int_memc_tgtid]( 505 signal_int_dspin_rsp_memc_t); 506 int_xbar_rsp_d->p_local_in[params.int_xicu_tgtid]( 507 signal_int_dspin_rsp_xicu_t); 508 int_xbar_rsp_d->p_local_in[params.int_brom_tgtid]( 509 signal_int_dspin_rsp_brom_t); 510 int_xbar_rsp_d->p_local_in[params.int_mdma_tgtid]( 511 signal_int_dspin_rsp_mdma_t); 512 513 int_xbar_rsp_d->p_local_out[params.int_mdma_srcid]( 514 signal_int_dspin_rsp_mdma_i); 515 for (size_t p = 0; p < params.nb_procs; p++) 516 int_xbar_rsp_d->p_local_out[params.int_proc_srcid + p]( 502 int_xbar_rsp_d->p_local_in[INT_MEMC_TGT_ID] (signal_int_dspin_rsp_memc_t); 503 int_xbar_rsp_d->p_local_in[INT_XICU_TGT_ID] (signal_int_dspin_rsp_xicu_t); 504 int_xbar_rsp_d->p_local_in[INT_BROM_TGT_ID] (signal_int_dspin_rsp_brom_t); 505 if (NB_DEBUG_TTY_CHANNELS) { 506 int_xbar_rsp_d->p_local_in[INT_MTTY_TGT_ID] (signal_int_dspin_rsp_mtty_t); 507 } 508 int_xbar_rsp_d->p_local_in[INT_MDMA_TGT_ID] (signal_int_dspin_rsp_mdma_t); 509 510 int_xbar_rsp_d->p_local_out[INT_MDMA_INI_ID](signal_int_dspin_rsp_mdma_i); 511 for (size_t p = 0; p < NB_PROCS; p++) 512 int_xbar_rsp_d->p_local_out[INT_PROC_INI_ID + p]( 517 513 signal_int_dspin_rsp_proc_i[p]); 518 514 519 if ((cluster_id == cluster_iob0) or (cluster_id == cluster_iob1)) 520 { 521 int_xbar_rsp_d->p_local_in[params.int_iobx_tgtid]( 515 if ( is_io_cluster ) { 516 int_xbar_rsp_d->p_local_in[INT_IOBX_TGT_ID]( 522 517 signal_int_dspin_rsp_iobx_t); 523 int_xbar_rsp_d->p_local_out[ params.int_iobx_srcid](518 int_xbar_rsp_d->p_local_out[INT_IOBX_INI_ID]( 524 519 signal_int_dspin_rsp_iobx_i); 525 520 } … … 531 526 int_xbar_m2p_c->p_global_in (signal_int_dspin_m2p_g2l_c); 532 527 int_xbar_m2p_c->p_local_in[0] (signal_int_dspin_m2p_memc); 533 for (size_t p = 0; p < params.nb_procs; p++) 534 { 528 for (size_t p = 0; p < NB_PROCS; p++) { 535 529 int_xbar_m2p_c->p_local_out[p] (signal_int_dspin_m2p_proc[p]); 536 530 } … … 542 536 int_xbar_p2m_c->p_global_in (signal_int_dspin_p2m_g2l_c); 543 537 int_xbar_p2m_c->p_local_out[0] (signal_int_dspin_p2m_memc); 544 for (size_t p = 0; p < params.nb_procs; p++) 545 { 538 for (size_t p = 0; p < NB_PROCS; p++) { 546 539 int_xbar_p2m_c->p_local_in[p] (signal_int_dspin_p2m_proc[p]); 547 540 } … … 553 546 int_xbar_clack_c->p_global_in (signal_int_dspin_clack_g2l_c); 554 547 int_xbar_clack_c->p_local_in[0] (signal_int_dspin_clack_memc); 555 for (size_t p = 0; p < params.nb_procs; p++) 556 { 548 for (size_t p = 0; p < NB_PROCS; p++) { 557 549 int_xbar_clack_c->p_local_out[p] (signal_int_dspin_clack_proc[p]); 558 550 } 559 551 560 552 //////////////////////////////////// Processors 561 for (size_t p = 0; p < params.nb_procs; p++) 562 { 553 for (size_t p = 0; p < NB_PROCS; p++) { 563 554 proc[p]->p_clk (this->p_clk); 564 555 proc[p]->p_resetn (this->p_resetn); … … 568 559 proc[p]->p_dspin_clack (signal_int_dspin_clack_proc[p]); 569 560 proc[p]->p_irq[0] (signal_proc_it[p]); 570 for ( size_t j = 1 ; j < 6 ; j++) 571 { 561 for ( size_t j = 1 ; j < 6 ; j++) { 572 562 proc[p]->p_irq[j] (signal_false); 573 563 } … … 584 574 xicu->p_resetn (this->p_resetn); 585 575 xicu->p_vci (signal_int_vci_tgt_xicu); 586 for ( size_t p = 0 ; p < params.nb_procs ; p++) 587 { 576 for ( size_t p = 0 ; p < NB_PROCS ; p++) { 588 577 xicu->p_irq[p] (signal_proc_it[p]); 589 578 } 590 for ( size_t i=0 ; i<32 ; i++) 591 { 592 if (cluster_id == cluster_iob0) 579 for ( size_t i=0 ; i<32 ; i++) { 580 if ( is_iob0 ) 593 581 xicu->p_hwi[i] (*(this->p_irq[i])); 594 582 else … … 639 627 brom_int_wt->p_vci (signal_int_vci_tgt_brom); 640 628 629 if (NB_DEBUG_TTY_CHANNELS) { 630 //////////////////////////////////// MTTY 631 mtty->p_clk (this->p_clk); 632 mtty->p_resetn (this->p_resetn); 633 mtty->p_vci (signal_int_vci_tgt_mtty); 634 635 for ( size_t i=0 ; i < NB_DEBUG_TTY_CHANNELS ; i++ ) { 636 mtty->p_irq[i] (signal_irq_mtty[i]); 637 } 638 639 //wrapper to INT network 640 mtty_int_wt->p_clk (this->p_clk); 641 mtty_int_wt->p_resetn (this->p_resetn); 642 mtty_int_wt->p_dspin_cmd (signal_int_dspin_cmd_mtty_t); 643 mtty_int_wt->p_dspin_rsp (signal_int_dspin_rsp_mtty_t); 644 mtty_int_wt->p_vci (signal_int_vci_tgt_mtty); 645 } 646 641 647 //////////////////////////////////// XRAM 642 648 xram->p_clk (this->p_clk); … … 656 662 mdma->p_vci_target (signal_int_vci_tgt_mdma); 657 663 mdma->p_vci_initiator (signal_int_vci_ini_mdma); 658 for (size_t i = 0 ; i < params.nb_dmas; i++)664 for (size_t i = 0 ; i < NB_DMA_CHANNELS ; i++) 659 665 mdma->p_irq[i] (signal_irq_mdma[i]); 660 666 … … 678 684 ram_router_rsp->p_clk (this->p_clk); 679 685 ram_router_rsp->p_resetn (this->p_resetn); 680 for( size_t n=0 ; n<4 ; n++) 681 { 686 for( size_t n=0 ; n<4 ; n++) { 682 687 ram_router_cmd->p_out[n] (this->p_dspin_ram_cmd_out[n]); 683 688 ram_router_cmd->p_in[n] (this->p_dspin_ram_cmd_in[n]); … … 691 696 692 697 ///////////////////////// IOB exists only in cluster_iob0 & cluster_iob1. 693 if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) ) 694 { 698 if ( is_io_cluster ) { 695 699 // IO bridge 696 700 iob->p_clk (this->p_clk); … … 702 706 iob->p_vci_ini_ram (signal_ram_vci_ini_iobx); 703 707 704 if ( cluster_id == cluster_iob0 )708 if ( is_iob0 ) 705 709 for ( size_t n = 0 ; n < 32 ; n++ ) 706 710 (*iob->p_irq[n]) (*(this->p_irq[n])); … … 729 733 } // end constructor 730 734 731 tmpl(/**/)::~TsarIobCluster() 732 { 735 tmpl(/**/)::~TsarIobCluster() { 733 736 if (p_vci_iob_iox_ini) delete p_vci_iob_iox_ini; 734 737 if (p_vci_iob_iox_tgt) delete p_vci_iob_iox_tgt; … … 740 743 if (iob_ram_wi) delete iob_ram_wi; 741 744 742 for (size_t n = 0 ; n < 32 ; n++) 743 { 745 for (size_t n = 0 ; n < 32 ; n++) { 744 746 if (p_irq[n]) delete p_irq[n]; 745 747 } 746 748 747 for (size_t p = 0; p < m_procs; p++) 748 { 749 for (size_t p = 0; p < NB_PROCS; p++) { 749 750 delete proc[p]; 750 751 delete proc_wi[p]; … … 758 759 delete brom; 759 760 delete brom_int_wt; 761 delete mtty; 762 delete mtty_int_wt; 760 763 delete mdma; 761 764 delete mdma_int_wt;
Note: See TracChangeset
for help on using the changeset viewer.