- Timestamp:
- Jul 10, 2014, 2:35:05 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/platforms/tsar_generic_iob/top.cpp
r747 r748 9 9 // an external bus (i.e. Hypertransport) to access 7 external peripherals: 10 10 // 11 // - BROM : boot ROM12 11 // - FBUF : Frame Buffer 13 12 // - MTTY : multi TTY (one channel) … … 44 43 // - IOPIC HWI[8] connected to IRQ_BDEV 45 44 // - IOPIC HWI[9] connected to IRQ_TTY_RX[0] 45 // - IOPIC HWI[31:9] unused (grounded) 46 46 // 47 47 // Besides the external peripherals, each cluster contains one XICU component, … … 228 228 //////////////////////i///////////////////////////////////// 229 229 230 #define MAX_FROZEN_CYCLES 200000 00230 #define MAX_FROZEN_CYCLES 200000 231 231 232 232 ///////////////////////////////////////////////////////// … … 276 276 #define INT_XICU_TGT_ID 1 277 277 #define INT_MDMA_TGT_ID 2 278 #define INT_IOBX_TGT_ID 3 278 #define INT_BROM_TGT_ID 3 279 #define INT_IOBX_TGT_ID 4 279 280 280 281 #define INT_PROC_INI_ID 0 // from 0 to (NB_PROCS_MAX-1) … … 299 300 #define IOX_MNIC_TGT_ID 2 300 301 #define IOX_CDMA_TGT_ID 3 301 #define IOX_BROM_TGT_ID 4 302 #define IOX_MTTY_TGT_ID 5 303 #define IOX_IOPI_TGT_ID 6 304 #define IOX_IOB0_TGT_ID 7 305 #define IOX_IOB1_TGT_ID 8 302 #define IOX_MTTY_TGT_ID 4 303 #define IOX_IOPI_TGT_ID 5 304 #define IOX_IOB0_TGT_ID 6 305 #define IOX_IOB1_TGT_ID 7 306 306 307 307 #define IOX_BDEV_INI_ID 0 … … 349 349 if ((strcmp(argv[n],"-NCYCLES") == 0) && (n+1<argc)) 350 350 { 351 ncycles = atoi(argv[n+1]);351 ncycles = strtol(argv[n+1], NULL, 0); 352 352 } 353 353 else if ((strcmp(argv[n],"-SOFT") == 0) && (n+1<argc) ) … … 358 358 { 359 359 debug_ok = true; 360 debug_from = atoi(argv[n+1]);360 debug_from = strtol(argv[n+1], NULL, 0); 361 361 } 362 362 else if ((strcmp(argv[n],"-DISK") == 0) && (n+1<argc) ) … … 366 366 else if ((strcmp(argv[n],"-MEMCID") == 0) && (n+1<argc) ) 367 367 { 368 debug_memc_id = atoi(argv[n+1]);368 debug_memc_id = strtol(argv[n+1], NULL, 0); 369 369 size_t x = debug_memc_id >> 4; 370 370 size_t y = debug_memc_id & 0xF; … … 377 377 else if ((strcmp(argv[n],"-XRAMID") == 0) && (n+1<argc) ) 378 378 { 379 debug_xram_id = atoi(argv[n+1]);379 debug_xram_id = strtol(argv[n+1], NULL, 0); 380 380 size_t x = debug_xram_id >> 4; 381 381 size_t y = debug_xram_id & 0xF; … … 388 388 else if ((strcmp(argv[n],"-IOB") == 0) && (n+1<argc) ) 389 389 { 390 debug_iob = atoi(argv[n+1]);390 debug_iob = strtol(argv[n+1], NULL, 0); 391 391 } 392 392 else if ((strcmp(argv[n],"-PROCID") == 0) && (n+1<argc) ) 393 393 { 394 debug_proc_id = atoi(argv[n+1]);394 debug_proc_id = strtol(argv[n+1], NULL, 0); 395 395 size_t cluster_xy = debug_proc_id / NB_PROCS_MAX ; 396 396 size_t x = cluster_xy >> 4; … … 404 404 else if ((strcmp(argv[n], "-THREADS") == 0) && ((n+1) < argc)) 405 405 { 406 threads_nr = atoi(argv[n+1]);406 threads_nr = strtol(argv[n+1], NULL, 0); 407 407 threads_nr = (threads_nr < 1) ? 1 : threads_nr; 408 408 } 409 409 else if ((strcmp(argv[n], "-FROZEN") == 0) && (n+1 < argc)) 410 410 { 411 frozen_cycles = atoi(argv[n+1]);411 frozen_cycles = strtol(argv[n+1], NULL, 0); 412 412 } 413 413 else if ((strcmp(argv[n], "-PERIOD") == 0) && (n+1 < argc)) 414 414 { 415 debug_period = atoi(argv[n+1]);415 debug_period = strtol(argv[n+1], NULL, 0); 416 416 } 417 417 else … … 436 436 } 437 437 438 // Activate Distributed Boot (set by environment variable) 439 // When this is activated, every processor boots with its instruction and data 440 // physical address extension register initialized to its cluster index 441 // (X_LOCAL, Y_LOCAL). To support this feature, a distributed ROM is 442 // implemented in each cluster. 443 444 const bool distributed_boot = (getenv("DISTRIBUTED_BOOT") != NULL); 445 438 446 // checking hardware parameters 439 447 assert( (XMAX <= 16) and … … 466 474 << " - RAM_LATENCY = " << XRAM_LATENCY << std::endl 467 475 << " - MAX_FROZEN = " << frozen_cycles << std::endl 476 << " - DIST_BOOT = " << distributed_boot << std::endl 468 477 << " - DEBUG_PROCID = " << debug_proc_id << std::endl 469 478 << " - DEBUG_MEMCID = " << debug_memc_id << std::endl … … 544 553 IntTab(cluster(x,y), INT_MDMA_TGT_ID), not cacheable)); 545 554 555 std::ostringstream sbrom; 556 sbrom << "int_seg_brom_" << x << "_" << y; 557 maptab_int.add(Segment(sbrom.str(), SEG_ROM_BASE+offset, SEG_ROM_SIZE, 558 IntTab(cluster(x,y), INT_BROM_TGT_ID), cacheable)); 559 546 560 // the following segments are only defined in cluster_iob0 or in cluster_iob1 547 561 … … 572 586 maptab_int.add(Segment(snic.str(), SEG_NIC_BASE+offset, SEG_NIC_SIZE, 573 587 IntTab(cluster(x,y), INT_IOBX_TGT_ID), not cacheable)); 574 575 std::ostringstream srom;576 srom << "int_seg_brom_" << x << "_" << y;577 maptab_int.add(Segment(srom.str(), SEG_ROM_BASE+offset, SEG_ROM_SIZE,578 IntTab(cluster(x,y), INT_IOBX_TGT_ID), cacheable ));579 588 580 589 std::ostringstream sdma; … … 698 707 maptab_iox.add(Segment("iox_seg_cdma_0", SEG_CMA_BASE + iob0_base, SEG_CMA_SIZE, 699 708 IntTab(0, IOX_CDMA_TGT_ID), false)); 700 maptab_iox.add(Segment("iox_seg_brom_0", SEG_ROM_BASE + iob0_base, SEG_ROM_SIZE,701 IntTab(0, IOX_BROM_TGT_ID), false));702 709 maptab_iox.add(Segment("iox_seg_iopi_0", SEG_PIC_BASE + iob0_base, SEG_PIC_SIZE, 703 710 IntTab(0, IOX_IOPI_TGT_ID), false)); … … 718 725 maptab_iox.add(Segment("iox_seg_cdma_1", SEG_CMA_BASE + iob1_base, SEG_CMA_SIZE, 719 726 IntTab(0, IOX_CDMA_TGT_ID), false)); 720 maptab_iox.add(Segment("iox_seg_brom_1", SEG_ROM_BASE + iob1_base, SEG_ROM_SIZE,721 IntTab(0, IOX_BROM_TGT_ID), false));722 727 maptab_iox.add(Segment("iox_seg_iopi_1", SEG_PIC_BASE + iob1_base, SEG_PIC_SIZE, 723 728 IntTab(0, IOX_IOPI_TGT_ID), false)); … … 813 818 VciSignals<vci_param_ext> signal_vci_tgt_fbuf("signal_vci_tgt_fbuf"); 814 819 VciSignals<vci_param_ext> signal_vci_tgt_mnic("signal_vci_tgt_mnic"); 815 VciSignals<vci_param_ext> signal_vci_tgt_brom("signal_vci_tgt_brom");816 820 VciSignals<vci_param_ext> signal_vci_tgt_bdev("signal_vci_tgt_bdev"); 817 821 VciSignals<vci_param_ext> signal_vci_tgt_cdma("signal_vci_tgt_cdma"); … … 901 905 902 906 const size_t nb_iox_initiators = (cluster_iob0 != cluster_iob1) ? 5 : 4; 903 const size_t nb_iox_targets = (cluster_iob0 != cluster_iob1) ? 9 : 8;907 const size_t nb_iox_targets = (cluster_iob0 != cluster_iob1) ? 8 : 7; 904 908 905 909 // IOX network … … 909 913 nb_iox_targets, 910 914 nb_iox_initiators ); 911 // boot ROM 912 VciSimpleRom<vci_param_ext>* brom; 913 brom = new VciSimpleRom<vci_param_ext>( "brom", 914 IntTab(0, IOX_BROM_TGT_ID), 915 maptab_iox, 916 loader ); 915 917 916 // Network Controller 918 917 VciMultiNic<vci_param_ext>* mnic; … … 976 975 IntTab(0, IOX_IOPI_TGT_ID), 977 976 32 ); // number of input HWI 977 978 978 // Clusters 979 979 TsarIobCluster<vci_param_int, … … 1041 1041 INT_XICU_TGT_ID, 1042 1042 INT_MDMA_TGT_ID, 1043 INT_BROM_TGT_ID, 1043 1044 INT_IOBX_TGT_ID, 1044 1045 … … 1065 1066 XCU_NB_INPUTS, 1066 1067 1068 distributed_boot, 1069 1067 1070 loader, 1068 1071 … … 1100 1103 iox_network->p_to_tgt[IOX_FBUF_TGT_ID] (signal_vci_tgt_fbuf); 1101 1104 iox_network->p_to_tgt[IOX_MNIC_TGT_ID] (signal_vci_tgt_mnic); 1102 iox_network->p_to_tgt[IOX_BROM_TGT_ID] (signal_vci_tgt_brom);1103 1105 iox_network->p_to_tgt[IOX_BDEV_TGT_ID] (signal_vci_tgt_bdev); 1104 1106 iox_network->p_to_tgt[IOX_CDMA_TGT_ID] (signal_vci_tgt_cdma); … … 1138 1140 1139 1141 std::cout << " - MNIC connected" << std::endl; 1140 1141 // BROM connexion1142 brom->p_clk (signal_clk);1143 brom->p_resetn (signal_resetn);1144 brom->p_vci (signal_vci_tgt_brom);1145 1146 std::cout << " - BROM connected" << std::endl;1147 1142 1148 1143 // MTTY connexion … … 1423 1418 1424 1419 // Monitor a specific address for one L2 cache 1425 // clusters[0][0]->memc->cache_monitor( 0x1 542c0ULL, true ); // single word1420 // clusters[0][0]->memc->cache_monitor( 0x170000ULL); 1426 1421 1427 1422 // Monitor a specific address for one XRAM … … 1440 1435 size_t x = cluster_xy >> 4; 1441 1436 size_t y = cluster_xy & 0xF; 1442 1443 clusters[x][y]->proc[l]->print_trace( 0x40);1437 1438 clusters[x][y]->proc[l]->print_trace(1); 1444 1439 std::ostringstream proc_signame; 1445 1440 proc_signame << "[SIG]PROC_" << x << "_" << y << "_" << l ; … … 1451 1446 clusters[x][y]->signal_int_vci_tgt_xicu.print_trace(xicu_signame.str()); 1452 1447 1453 clusters[x][y]->mdma->print_trace(); 1454 std::ostringstream mdma_signame; 1455 mdma_signame << "[SIG]MDMA_" << x << "_" << y; 1456 clusters[x][y]->signal_int_vci_tgt_mdma.print_trace(mdma_signame.str()); 1457 1458 // local interrupts in cluster(x,y) 1459 if( clusters[x][y]->signal_irq_memc.read() ) 1460 std::cout << "### IRQ_MMC_" << std::dec << x << "_" << y 1461 << " ACTIVE" << std::endl; 1462 1463 for ( size_t c = 0 ; c < NB_DMA_CHANNELS ; c++ ) 1464 { 1465 if( clusters[x][y]->signal_irq_mdma[c].read() ) 1466 std::cout << "### IRQ_DMA_" << std::dec << x << "_" << y << "_" << c 1467 << " ACTIVE" << std::endl; 1468 } 1469 1470 for ( size_t c = 0 ; c < NB_PROCS_MAX ; c++ ) 1471 { 1472 if( clusters[x][y]->signal_proc_it[c].read() ) 1473 std::cout << "### IRQ_PROC_" << std::dec << x << "_" << y << "_" << c 1474 << " ACTIVE" << std::endl; 1475 } 1448 // clusters[x][y]->mdma->print_trace(); 1449 // std::ostringstream mdma_signame; 1450 // mdma_signame << "[SIG]MDMA_" << x << "_" << y; 1451 // clusters[x][y]->signal_int_vci_tgt_mdma.print_trace(mdma_signame.str()); 1452 1453 if( clusters[x][y]->signal_proc_it[l].read() ) 1454 std::cout << "### IRQ_PROC_" << std::dec 1455 << x << "_" << y << "_" << l << " ACTIVE" << std::endl; 1476 1456 } 1477 1457 … … 1521 1501 // clusters[0][0]->signal_ram_vci_ini_iobx.print_trace( "[SIG]IOB0_RAM_INI"); 1522 1502 1523 //signal_vci_ini_iob0.print_trace("[SIG]IOB0_IOX_INI");1524 //signal_vci_tgt_iob0.print_trace("[SIG]IOB0_IOX_TGT");1503 signal_vci_ini_iob0.print_trace("[SIG]IOB0_IOX_INI"); 1504 signal_vci_tgt_iob0.print_trace("[SIG]IOB0_IOX_TGT"); 1525 1505 1526 1506 // cdma->print_trace(); … … 1528 1508 // signal_vci_ini_cdma.print_trace("[SIG]IOX_CDMA_INI"); 1529 1509 1530 // brom->print_trace();1531 // signal_vci_tgt_brom.print_trace("[SIG]IOX_BROM_TGT");1532 1533 1510 // mtty->print_trace(); 1534 1511 // signal_vci_tgt_mtty.print_trace("[SIG]IOX_MTTY_TGT"); … … 1538 1515 signal_vci_ini_bdev.print_trace("[SIG]BDEV_INI"); 1539 1516 1540 //mnic->print_trace();1541 //signal_vci_tgt_mnic.print_trace("[SIG]MNIC_TGT");1517 mnic->print_trace(); 1518 signal_vci_tgt_mnic.print_trace("[SIG]MNIC_TGT"); 1542 1519 1543 1520 // fbuf->print_trace();
Note: See TracChangeset
for help on using the changeset viewer.