Changeset 750 for branches/reconfiguration
- Timestamp:
- Jul 16, 2014, 7:13:46 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/platforms/tsar_generic_iob/top.cpp
r748 r750 118 118 #include <cstdlib> 119 119 #include <cstdarg> 120 #include <climits> 120 121 #include <stdint.h> 121 122 … … 321 322 322 323 char soft_name[256] = BOOT_SOFT_NAME; // pathname: binary code 323 size_t ncycles = 1000000000;// simulated cycles324 size_t ncycles = UINT_MAX; // simulated cycles 324 325 char disk_name[256] = BDEV_IMAGE_NAME; // pathname: disk image 325 326 char nic_rx_name[256] = NIC_RX_NAME; // pathname: rx packets file … … 843 844 844 845 // Mesh boundaries INT network DSPIN 845 DspinSignals<dspin_int_cmd_width>**** signal_dspin_false_int_cmd_in = 846 alloc_elems<DspinSignals<dspin_int_cmd_width> >("signal_dspin_false_int_cmd_in", XMAX, YMAX, 4, 3); 847 DspinSignals<dspin_int_cmd_width>**** signal_dspin_false_int_cmd_out = 848 alloc_elems<DspinSignals<dspin_int_cmd_width> >("signal_dspin_false_int_cmd_out", XMAX, YMAX, 4, 3); 849 DspinSignals<dspin_int_rsp_width>**** signal_dspin_false_int_rsp_in = 850 alloc_elems<DspinSignals<dspin_int_rsp_width> >("signal_dspin_false_int_rsp_in", XMAX, YMAX, 4, 2); 851 DspinSignals<dspin_int_rsp_width>**** signal_dspin_false_int_rsp_out = 852 alloc_elems<DspinSignals<dspin_int_rsp_width> >("signal_dspin_false_int_rsp_out", XMAX, YMAX, 4, 2); 853 846 DspinSignals<dspin_int_cmd_width> signal_dspin_false_int_cmd_in; 847 DspinSignals<dspin_int_cmd_width> signal_dspin_false_int_cmd_out; 848 DspinSignals<dspin_int_rsp_width> signal_dspin_false_int_rsp_in; 849 DspinSignals<dspin_int_rsp_width> signal_dspin_false_int_rsp_out; 854 850 855 851 // Horizontal inter-clusters RAM network DSPIN … … 874 870 875 871 // Mesh boundaries RAM network DSPIN 876 DspinSignals<dspin_ram_cmd_width>*** signal_dspin_false_ram_cmd_in = 877 alloc_elems<DspinSignals<dspin_ram_cmd_width> >("signal_dspin_false_ram_cmd_in", XMAX, YMAX, 4); 878 DspinSignals<dspin_ram_cmd_width>*** signal_dspin_false_ram_cmd_out = 879 alloc_elems<DspinSignals<dspin_ram_cmd_width> >("signal_dspin_false_ram_cmd_out", XMAX, YMAX, 4); 880 DspinSignals<dspin_ram_rsp_width>*** signal_dspin_false_ram_rsp_in = 881 alloc_elems<DspinSignals<dspin_ram_rsp_width> >("signal_dspin_false_ram_rsp_in", XMAX, YMAX, 4); 882 DspinSignals<dspin_ram_rsp_width>*** signal_dspin_false_ram_rsp_out = 883 alloc_elems<DspinSignals<dspin_ram_rsp_width> >("signal_dspin_false_ram_rsp_out", XMAX, YMAX, 4); 872 DspinSignals<dspin_ram_cmd_width> signal_dspin_false_ram_cmd_in; 873 DspinSignals<dspin_ram_cmd_width> signal_dspin_false_ram_cmd_out; 874 DspinSignals<dspin_ram_rsp_width> signal_dspin_false_ram_rsp_in; 875 DspinSignals<dspin_ram_rsp_width> signal_dspin_false_ram_rsp_out; 884 876 885 877 //////////////////////////// … … 1283 1275 for (size_t k = 0; k < 3; k++) 1284 1276 { 1285 clusters[0][y]->p_dspin_int_cmd_in[WEST][k] (signal_dspin_false_int_cmd_in [0][y][WEST][k]);1286 clusters[0][y]->p_dspin_int_cmd_out[WEST][k] (signal_dspin_false_int_cmd_out [0][y][WEST][k]);1287 clusters[XMAX-1][y]->p_dspin_int_cmd_in[EAST][k] (signal_dspin_false_int_cmd_in [XMAX-1][y][EAST][k]);1288 clusters[XMAX-1][y]->p_dspin_int_cmd_out[EAST][k] (signal_dspin_false_int_cmd_out [XMAX-1][y][EAST][k]);1277 clusters[0][y]->p_dspin_int_cmd_in[WEST][k] (signal_dspin_false_int_cmd_in); 1278 clusters[0][y]->p_dspin_int_cmd_out[WEST][k] (signal_dspin_false_int_cmd_out); 1279 clusters[XMAX-1][y]->p_dspin_int_cmd_in[EAST][k] (signal_dspin_false_int_cmd_in); 1280 clusters[XMAX-1][y]->p_dspin_int_cmd_out[EAST][k] (signal_dspin_false_int_cmd_out); 1289 1281 } 1290 1282 1291 1283 for (size_t k = 0; k < 2; k++) 1292 1284 { 1293 clusters[0][y]->p_dspin_int_rsp_in[WEST][k] (signal_dspin_false_int_rsp_in [0][y][WEST][k]);1294 clusters[0][y]->p_dspin_int_rsp_out[WEST][k] (signal_dspin_false_int_rsp_out [0][y][WEST][k]);1295 clusters[XMAX-1][y]->p_dspin_int_rsp_in[EAST][k] (signal_dspin_false_int_rsp_in [XMAX-1][y][EAST][k]);1296 clusters[XMAX-1][y]->p_dspin_int_rsp_out[EAST][k] (signal_dspin_false_int_rsp_out [XMAX-1][y][EAST][k]);1285 clusters[0][y]->p_dspin_int_rsp_in[WEST][k] (signal_dspin_false_int_rsp_in); 1286 clusters[0][y]->p_dspin_int_rsp_out[WEST][k] (signal_dspin_false_int_rsp_out); 1287 clusters[XMAX-1][y]->p_dspin_int_rsp_in[EAST][k] (signal_dspin_false_int_rsp_in); 1288 clusters[XMAX-1][y]->p_dspin_int_rsp_out[EAST][k] (signal_dspin_false_int_rsp_out); 1297 1289 } 1298 1290 1299 clusters[0][y]->p_dspin_ram_cmd_in[WEST] (signal_dspin_false_ram_cmd_in [0][y][WEST]);1300 clusters[0][y]->p_dspin_ram_cmd_out[WEST] (signal_dspin_false_ram_cmd_out [0][y][WEST]);1301 clusters[0][y]->p_dspin_ram_rsp_in[WEST] (signal_dspin_false_ram_rsp_in [0][y][WEST]);1302 clusters[0][y]->p_dspin_ram_rsp_out[WEST] (signal_dspin_false_ram_rsp_out [0][y][WEST]);1303 1304 clusters[XMAX-1][y]->p_dspin_ram_cmd_in[EAST] (signal_dspin_false_ram_cmd_in [XMAX-1][y][EAST]);1305 clusters[XMAX-1][y]->p_dspin_ram_cmd_out[EAST] (signal_dspin_false_ram_cmd_out [XMAX-1][y][EAST]);1306 clusters[XMAX-1][y]->p_dspin_ram_rsp_in[EAST] (signal_dspin_false_ram_rsp_in [XMAX-1][y][EAST]);1307 clusters[XMAX-1][y]->p_dspin_ram_rsp_out[EAST] (signal_dspin_false_ram_rsp_out [XMAX-1][y][EAST]);1291 clusters[0][y]->p_dspin_ram_cmd_in[WEST] (signal_dspin_false_ram_cmd_in); 1292 clusters[0][y]->p_dspin_ram_cmd_out[WEST] (signal_dspin_false_ram_cmd_out); 1293 clusters[0][y]->p_dspin_ram_rsp_in[WEST] (signal_dspin_false_ram_rsp_in); 1294 clusters[0][y]->p_dspin_ram_rsp_out[WEST] (signal_dspin_false_ram_rsp_out); 1295 1296 clusters[XMAX-1][y]->p_dspin_ram_cmd_in[EAST] (signal_dspin_false_ram_cmd_in); 1297 clusters[XMAX-1][y]->p_dspin_ram_cmd_out[EAST] (signal_dspin_false_ram_cmd_out); 1298 clusters[XMAX-1][y]->p_dspin_ram_rsp_in[EAST] (signal_dspin_false_ram_rsp_in); 1299 clusters[XMAX-1][y]->p_dspin_ram_rsp_out[EAST] (signal_dspin_false_ram_rsp_out); 1308 1300 } 1309 1301 … … 1315 1307 for (size_t k = 0; k < 3; k++) 1316 1308 { 1317 clusters[x][0]->p_dspin_int_cmd_in[SOUTH][k] (signal_dspin_false_int_cmd_in [x][0][SOUTH][k]);1318 clusters[x][0]->p_dspin_int_cmd_out[SOUTH][k] (signal_dspin_false_int_cmd_out [x][0][SOUTH][k]);1319 clusters[x][YMAX-1]->p_dspin_int_cmd_in[NORTH][k] (signal_dspin_false_int_cmd_in [x][YMAX-1][NORTH][k]);1320 clusters[x][YMAX-1]->p_dspin_int_cmd_out[NORTH][k] (signal_dspin_false_int_cmd_out [x][YMAX-1][NORTH][k]);1309 clusters[x][0]->p_dspin_int_cmd_in[SOUTH][k] (signal_dspin_false_int_cmd_in); 1310 clusters[x][0]->p_dspin_int_cmd_out[SOUTH][k] (signal_dspin_false_int_cmd_out); 1311 clusters[x][YMAX-1]->p_dspin_int_cmd_in[NORTH][k] (signal_dspin_false_int_cmd_in); 1312 clusters[x][YMAX-1]->p_dspin_int_cmd_out[NORTH][k] (signal_dspin_false_int_cmd_out); 1321 1313 } 1322 1314 1323 1315 for (size_t k = 0; k < 2; k++) 1324 1316 { 1325 clusters[x][0]->p_dspin_int_rsp_in[SOUTH][k] (signal_dspin_false_int_rsp_in [x][0][SOUTH][k]);1326 clusters[x][0]->p_dspin_int_rsp_out[SOUTH][k] (signal_dspin_false_int_rsp_out [x][0][SOUTH][k]);1327 clusters[x][YMAX-1]->p_dspin_int_rsp_in[NORTH][k] (signal_dspin_false_int_rsp_in [x][YMAX-1][NORTH][k]);1328 clusters[x][YMAX-1]->p_dspin_int_rsp_out[NORTH][k] (signal_dspin_false_int_rsp_out [x][YMAX-1][NORTH][k]);1317 clusters[x][0]->p_dspin_int_rsp_in[SOUTH][k] (signal_dspin_false_int_rsp_in); 1318 clusters[x][0]->p_dspin_int_rsp_out[SOUTH][k] (signal_dspin_false_int_rsp_out); 1319 clusters[x][YMAX-1]->p_dspin_int_rsp_in[NORTH][k] (signal_dspin_false_int_rsp_in); 1320 clusters[x][YMAX-1]->p_dspin_int_rsp_out[NORTH][k] (signal_dspin_false_int_rsp_out); 1329 1321 } 1330 1322 1331 clusters[x][0]->p_dspin_ram_cmd_in[SOUTH] (signal_dspin_false_ram_cmd_in [x][0][SOUTH]);1332 clusters[x][0]->p_dspin_ram_cmd_out[SOUTH] (signal_dspin_false_ram_cmd_out [x][0][SOUTH]);1333 clusters[x][0]->p_dspin_ram_rsp_in[SOUTH] (signal_dspin_false_ram_rsp_in [x][0][SOUTH]);1334 clusters[x][0]->p_dspin_ram_rsp_out[SOUTH] (signal_dspin_false_ram_rsp_out [x][0][SOUTH]);1335 1336 clusters[x][YMAX-1]->p_dspin_ram_cmd_in[NORTH] (signal_dspin_false_ram_cmd_in [x][YMAX-1][NORTH]);1337 clusters[x][YMAX-1]->p_dspin_ram_cmd_out[NORTH] (signal_dspin_false_ram_cmd_out [x][YMAX-1][NORTH]);1338 clusters[x][YMAX-1]->p_dspin_ram_rsp_in[NORTH] (signal_dspin_false_ram_rsp_in [x][YMAX-1][NORTH]);1339 clusters[x][YMAX-1]->p_dspin_ram_rsp_out[NORTH] (signal_dspin_false_ram_rsp_out [x][YMAX-1][NORTH]);1323 clusters[x][0]->p_dspin_ram_cmd_in[SOUTH] (signal_dspin_false_ram_cmd_in); 1324 clusters[x][0]->p_dspin_ram_cmd_out[SOUTH] (signal_dspin_false_ram_cmd_out); 1325 clusters[x][0]->p_dspin_ram_rsp_in[SOUTH] (signal_dspin_false_ram_rsp_in); 1326 clusters[x][0]->p_dspin_ram_rsp_out[SOUTH] (signal_dspin_false_ram_rsp_out); 1327 1328 clusters[x][YMAX-1]->p_dspin_ram_cmd_in[NORTH] (signal_dspin_false_ram_cmd_in); 1329 clusters[x][YMAX-1]->p_dspin_ram_cmd_out[NORTH] (signal_dspin_false_ram_cmd_out); 1330 clusters[x][YMAX-1]->p_dspin_ram_rsp_in[NORTH] (signal_dspin_false_ram_rsp_in); 1331 clusters[x][YMAX-1]->p_dspin_ram_rsp_out[NORTH] (signal_dspin_false_ram_rsp_out); 1340 1332 } 1341 1333 … … 1351 1343 signal_irq_false = false; 1352 1344 1353 // network boundaries signals 1354 for (size_t x = 0; x < XMAX ; x++) 1345 signal_dspin_false_int_cmd_in.write = false; 1346 signal_dspin_false_int_cmd_out.read = true; 1347 signal_dspin_false_int_rsp_in.write = false; 1348 signal_dspin_false_int_rsp_out.read = true; 1349 signal_dspin_false_ram_cmd_in.write = false; 1350 signal_dspin_false_ram_cmd_out.read = true; 1351 signal_dspin_false_ram_rsp_in.write = false; 1352 signal_dspin_false_ram_rsp_out.read = true; 1353 1354 sc_start(sc_core::sc_time(1, SC_NS)); 1355 signal_resetn = true; 1356 1357 // simulation loop 1358 struct timeval t1,t2; 1359 const size_t stats_period = 100000; // cycles 1360 1361 if (ncycles == UINT_MAX) 1355 1362 { 1356 for (size_t y = 0; y < YMAX ; y++) 1363 int n = 0; 1364 while(1) 1357 1365 { 1358 for (size_t a = 0; a < 4; a++) 1359 { 1360 for (size_t k = 0; k < 3; k++) 1361 { 1362 signal_dspin_false_int_cmd_in[x][y][a][k].write = false; 1363 signal_dspin_false_int_cmd_in[x][y][a][k].read = true; 1364 signal_dspin_false_int_cmd_out[x][y][a][k].write = false; 1365 signal_dspin_false_int_cmd_out[x][y][a][k].read = true; 1366 } 1367 1368 for (size_t k = 0; k < 2; k++) 1369 { 1370 signal_dspin_false_int_rsp_in[x][y][a][k].write = false; 1371 signal_dspin_false_int_rsp_in[x][y][a][k].read = true; 1372 signal_dspin_false_int_rsp_out[x][y][a][k].write = false; 1373 signal_dspin_false_int_rsp_out[x][y][a][k].read = true; 1374 } 1375 1376 signal_dspin_false_ram_cmd_in[x][y][a].write = false; 1377 signal_dspin_false_ram_cmd_in[x][y][a].read = true; 1378 signal_dspin_false_ram_cmd_out[x][y][a].write = false; 1379 signal_dspin_false_ram_cmd_out[x][y][a].read = true; 1380 1381 signal_dspin_false_ram_rsp_in[x][y][a].write = false; 1382 signal_dspin_false_ram_rsp_in[x][y][a].read = true; 1383 signal_dspin_false_ram_rsp_out[x][y][a].write = false; 1384 signal_dspin_false_ram_rsp_out[x][y][a].read = true; 1385 } 1366 gettimeofday(&t1, NULL); 1367 sc_start(sc_core::sc_time(stats_period, SC_NS)); 1368 gettimeofday(&t2, NULL); 1369 1370 n += stats_period; 1371 1372 uint64_t ms1 = (uint64_t) t1.tv_sec * 1000ULL + 1373 (uint64_t) t1.tv_usec / 1000; 1374 uint64_t ms2 = (uint64_t) t2.tv_sec * 1000ULL + 1375 (uint64_t) t2.tv_usec / 1000; 1376 std::cerr << "### cycle = " << n 1377 << " / frequency = " 1378 << (double) stats_period / (double) (ms2 - ms1) << "Khz" 1379 << std::endl; 1386 1380 } 1381 1382 return EXIT_SUCCESS; 1387 1383 } 1388 1384 1389 sc_start(sc_core::sc_time(1, SC_NS)); 1390 signal_resetn = true; 1391 1392 1393 // simulation loop 1394 struct timeval t1,t2; 1395 gettimeofday(&t1, NULL); 1396 1397 for (size_t n = 1; n < ncycles; n++) 1398 { 1399 // stats display 1400 if( (n % 1000000) == 0) 1401 { 1402 gettimeofday(&t2, NULL); 1403 1404 uint64_t ms1 = (uint64_t) t1.tv_sec * 1000ULL + 1405 (uint64_t) t1.tv_usec / 1000; 1406 uint64_t ms2 = (uint64_t) t2.tv_sec * 1000ULL + 1407 (uint64_t) t2.tv_usec / 1000; 1408 std::cerr << "### cycle = " << n 1409 << " / frequency = " 1410 << (double) 1000000 / (double) (ms2 - ms1) << "Khz" 1411 << std::endl; 1412 1413 gettimeofday(&t1, NULL); 1414 } 1415 1416 // Monitor a specific address for one L1 cache 1417 // clusters[1][1]->proc[0]->cache_monitor(0x50090ULL); 1418 1419 // Monitor a specific address for one L2 cache 1420 // clusters[0][0]->memc->cache_monitor( 0x170000ULL); 1421 1422 // Monitor a specific address for one XRAM 1423 // if (n == 3000000) clusters[0][0]->xram->start_monitor( 0x170000ULL , 64); 1424 1425 if (debug_ok and (n > debug_from) and (n % debug_period == 0)) 1426 { 1427 std::cout << "****************** cycle " << std::dec << n ; 1428 std::cout << " ************************************************" << std::endl; 1429 1430 // trace proc[debug_proc_id] 1431 if ( debug_proc_id != 0xFFFFFFFF ) 1432 { 1433 size_t l = debug_proc_id % NB_PROCS_MAX ; 1434 size_t cluster_xy = debug_proc_id / NB_PROCS_MAX ; 1435 size_t x = cluster_xy >> 4; 1436 size_t y = cluster_xy & 0xF; 1437 1438 clusters[x][y]->proc[l]->print_trace(1); 1439 std::ostringstream proc_signame; 1440 proc_signame << "[SIG]PROC_" << x << "_" << y << "_" << l ; 1441 clusters[x][y]->signal_int_vci_ini_proc[l].print_trace(proc_signame.str()); 1442 1443 clusters[x][y]->xicu->print_trace(l); 1444 std::ostringstream xicu_signame; 1445 xicu_signame << "[SIG]XICU_" << x << "_" << y; 1446 clusters[x][y]->signal_int_vci_tgt_xicu.print_trace(xicu_signame.str()); 1447 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; 1456 } 1457 1458 // trace memc[debug_memc_id] 1459 if ( debug_memc_id != 0xFFFFFFFF ) 1460 { 1461 size_t x = debug_memc_id >> 4; 1462 size_t y = debug_memc_id & 0xF; 1463 1464 clusters[x][y]->memc->print_trace(0); 1465 std::ostringstream smemc_tgt; 1466 smemc_tgt << "[SIG]MEMC_TGT_" << x << "_" << y; 1467 clusters[x][y]->signal_int_vci_tgt_memc.print_trace(smemc_tgt.str()); 1468 std::ostringstream smemc_ini; 1469 smemc_ini << "[SIG]MEMC_INI_" << x << "_" << y; 1470 clusters[x][y]->signal_ram_vci_ini_memc.print_trace(smemc_ini.str()); 1471 1472 clusters[x][y]->xram->print_trace(); 1473 std::ostringstream sxram_tgt; 1474 sxram_tgt << "[SIG]XRAM_TGT_" << x << "_" << y; 1475 clusters[x][y]->signal_ram_vci_tgt_xram.print_trace(sxram_tgt.str()); 1476 } 1477 1478 1479 // trace XRAM and XRAM network routers in cluster[debug_xram_id] 1480 if ( debug_xram_id != 0xFFFFFFFF ) 1481 { 1482 size_t x = debug_xram_id >> 4; 1483 size_t y = debug_xram_id & 0xF; 1484 1485 clusters[x][y]->xram->print_trace(); 1486 std::ostringstream sxram_tgt; 1487 sxram_tgt << "[SIG]XRAM_TGT_" << x << "_" << y; 1488 clusters[x][y]->signal_ram_vci_tgt_xram.print_trace(sxram_tgt.str()); 1489 1490 clusters[x][y]->ram_router_cmd->print_trace(); 1491 clusters[x][y]->ram_router_rsp->print_trace(); 1492 } 1493 1494 // trace iob, iox and external peripherals 1495 if ( debug_iob ) 1496 { 1497 clusters[0][0]->iob->print_trace(); 1498 clusters[XMAX-1][YMAX-1]->iob->print_trace(); 1499 // clusters[0][0]->signal_int_vci_tgt_iobx.print_trace( "[SIG]IOB0_INT_TGT"); 1500 // clusters[0][0]->signal_int_vci_ini_iobx.print_trace( "[SIG]IOB0_INT_INI"); 1501 // clusters[0][0]->signal_ram_vci_ini_iobx.print_trace( "[SIG]IOB0_RAM_INI"); 1502 1503 signal_vci_ini_iob0.print_trace("[SIG]IOB0_IOX_INI"); 1504 signal_vci_tgt_iob0.print_trace("[SIG]IOB0_IOX_TGT"); 1505 1506 // cdma->print_trace(); 1507 // signal_vci_tgt_cdma.print_trace("[SIG]IOX_CDMA_TGT"); 1508 // signal_vci_ini_cdma.print_trace("[SIG]IOX_CDMA_INI"); 1509 1510 // mtty->print_trace(); 1511 // signal_vci_tgt_mtty.print_trace("[SIG]IOX_MTTY_TGT"); 1512 1513 bdev->print_trace(); 1514 signal_vci_tgt_bdev.print_trace("[SIG]BDEV_TGT"); 1515 signal_vci_ini_bdev.print_trace("[SIG]BDEV_INI"); 1516 1517 mnic->print_trace(); 1518 signal_vci_tgt_mnic.print_trace("[SIG]MNIC_TGT"); 1519 1520 // fbuf->print_trace(); 1521 // signal_vci_tgt_fbuf.print_trace("[SIG]FBUF"); 1522 1523 iopi->print_trace(); 1524 signal_vci_ini_iopi.print_trace("[SIG]IOPI_INI"); 1525 signal_vci_tgt_iopi.print_trace("[SIG]IOPI_TGT"); 1526 iox_network->print_trace(); 1527 1528 // interrupts 1529 if (signal_irq_bdev) std::cout << "### IRQ_BDEV ACTIVE" << std::endl; 1530 if (signal_irq_mtty_rx) std::cout << "### IRQ_MTTY ACTIVE" << std::endl; 1531 if (signal_irq_mnic_rx[0]) std::cout << "### IRQ_MNIC_RX[0] ACTIVE" << std::endl; 1532 if (signal_irq_mnic_rx[1]) std::cout << "### IRQ_MNIC_RX[1] ACTIVE" << std::endl; 1533 if (signal_irq_mnic_tx[0]) std::cout << "### IRQ_MNIC_TX[0] ACTIVE" << std::endl; 1534 if (signal_irq_mnic_tx[1]) std::cout << "### IRQ_MNIC_TX[1] ACTIVE" << std::endl; 1535 } 1536 } 1537 1538 sc_start(sc_core::sc_time(1, SC_NS)); 1539 } 1540 return EXIT_SUCCESS; 1385 gettimeofday(&t1, NULL); 1386 for (size_t n = 1; n < ncycles; n++) 1387 { 1388 // stats display 1389 if( (n % stats_period) == 0) 1390 { 1391 gettimeofday(&t2, NULL); 1392 1393 uint64_t ms1 = (uint64_t) t1.tv_sec * 1000ULL + 1394 (uint64_t) t1.tv_usec / 1000; 1395 uint64_t ms2 = (uint64_t) t2.tv_sec * 1000ULL + 1396 (uint64_t) t2.tv_usec / 1000; 1397 std::cerr << "### cycle = " << n 1398 << " / frequency = " 1399 << (double) stats_period / (double) (ms2 - ms1) << "Khz" 1400 << std::endl; 1401 1402 gettimeofday(&t1, NULL); 1403 } 1404 1405 // Monitor a specific address for one L1 cache 1406 // clusters[1][1]->proc[0]->cache_monitor(0x50090ULL); 1407 1408 // Monitor a specific address for one L2 cache 1409 // clusters[0][0]->memc->cache_monitor( 0x170000ULL); 1410 1411 // Monitor a specific address for one XRAM 1412 // if (n == 3000000) clusters[0][0]->xram->start_monitor( 0x170000ULL , 64); 1413 1414 if (debug_ok and (n > debug_from) and (n % debug_period == 0)) 1415 { 1416 std::cout << "****************** cycle " << std::dec << n ; 1417 std::cout << " ************************************************" << std::endl; 1418 1419 // trace proc[debug_proc_id] 1420 if ( debug_proc_id != 0xFFFFFFFF ) 1421 { 1422 size_t l = debug_proc_id % NB_PROCS_MAX ; 1423 size_t cluster_xy = debug_proc_id / NB_PROCS_MAX ; 1424 size_t x = cluster_xy >> 4; 1425 size_t y = cluster_xy & 0xF; 1426 1427 clusters[x][y]->proc[l]->print_trace(1); 1428 std::ostringstream proc_signame; 1429 proc_signame << "[SIG]PROC_" << x << "_" << y << "_" << l ; 1430 clusters[x][y]->signal_int_vci_ini_proc[l].print_trace(proc_signame.str()); 1431 1432 clusters[x][y]->xicu->print_trace(l); 1433 std::ostringstream xicu_signame; 1434 xicu_signame << "[SIG]XICU_" << x << "_" << y; 1435 clusters[x][y]->signal_int_vci_tgt_xicu.print_trace(xicu_signame.str()); 1436 1437 // clusters[x][y]->mdma->print_trace(); 1438 // std::ostringstream mdma_signame; 1439 // mdma_signame << "[SIG]MDMA_" << x << "_" << y; 1440 // clusters[x][y]->signal_int_vci_tgt_mdma.print_trace(mdma_signame.str()); 1441 1442 if( clusters[x][y]->signal_proc_it[l].read() ) 1443 std::cout << "### IRQ_PROC_" << std::dec 1444 << x << "_" << y << "_" << l << " ACTIVE" << std::endl; 1445 } 1446 1447 // trace memc[debug_memc_id] 1448 if ( debug_memc_id != 0xFFFFFFFF ) 1449 { 1450 size_t x = debug_memc_id >> 4; 1451 size_t y = debug_memc_id & 0xF; 1452 1453 clusters[x][y]->memc->print_trace(0); 1454 std::ostringstream smemc_tgt; 1455 smemc_tgt << "[SIG]MEMC_TGT_" << x << "_" << y; 1456 clusters[x][y]->signal_int_vci_tgt_memc.print_trace(smemc_tgt.str()); 1457 std::ostringstream smemc_ini; 1458 smemc_ini << "[SIG]MEMC_INI_" << x << "_" << y; 1459 clusters[x][y]->signal_ram_vci_ini_memc.print_trace(smemc_ini.str()); 1460 1461 clusters[x][y]->xram->print_trace(); 1462 std::ostringstream sxram_tgt; 1463 sxram_tgt << "[SIG]XRAM_TGT_" << x << "_" << y; 1464 clusters[x][y]->signal_ram_vci_tgt_xram.print_trace(sxram_tgt.str()); 1465 } 1466 1467 1468 // trace XRAM and XRAM network routers in cluster[debug_xram_id] 1469 if ( debug_xram_id != 0xFFFFFFFF ) 1470 { 1471 size_t x = debug_xram_id >> 4; 1472 size_t y = debug_xram_id & 0xF; 1473 1474 clusters[x][y]->xram->print_trace(); 1475 std::ostringstream sxram_tgt; 1476 sxram_tgt << "[SIG]XRAM_TGT_" << x << "_" << y; 1477 clusters[x][y]->signal_ram_vci_tgt_xram.print_trace(sxram_tgt.str()); 1478 1479 clusters[x][y]->ram_router_cmd->print_trace(); 1480 clusters[x][y]->ram_router_rsp->print_trace(); 1481 } 1482 1483 // trace iob, iox and external peripherals 1484 if ( debug_iob ) 1485 { 1486 clusters[0][0]->iob->print_trace(); 1487 clusters[XMAX-1][YMAX-1]->iob->print_trace(); 1488 // clusters[0][0]->signal_int_vci_tgt_iobx.print_trace( "[SIG]IOB0_INT_TGT"); 1489 // clusters[0][0]->signal_int_vci_ini_iobx.print_trace( "[SIG]IOB0_INT_INI"); 1490 // clusters[0][0]->signal_ram_vci_ini_iobx.print_trace( "[SIG]IOB0_RAM_INI"); 1491 1492 signal_vci_ini_iob0.print_trace("[SIG]IOB0_IOX_INI"); 1493 signal_vci_tgt_iob0.print_trace("[SIG]IOB0_IOX_TGT"); 1494 1495 // cdma->print_trace(); 1496 // signal_vci_tgt_cdma.print_trace("[SIG]IOX_CDMA_TGT"); 1497 // signal_vci_ini_cdma.print_trace("[SIG]IOX_CDMA_INI"); 1498 1499 // mtty->print_trace(); 1500 // signal_vci_tgt_mtty.print_trace("[SIG]IOX_MTTY_TGT"); 1501 1502 bdev->print_trace(); 1503 signal_vci_tgt_bdev.print_trace("[SIG]BDEV_TGT"); 1504 signal_vci_ini_bdev.print_trace("[SIG]BDEV_INI"); 1505 1506 mnic->print_trace(); 1507 signal_vci_tgt_mnic.print_trace("[SIG]MNIC_TGT"); 1508 1509 // fbuf->print_trace(); 1510 // signal_vci_tgt_fbuf.print_trace("[SIG]FBUF"); 1511 1512 iopi->print_trace(); 1513 signal_vci_ini_iopi.print_trace("[SIG]IOPI_INI"); 1514 signal_vci_tgt_iopi.print_trace("[SIG]IOPI_TGT"); 1515 iox_network->print_trace(); 1516 1517 // interrupts 1518 if (signal_irq_bdev) std::cout << "### IRQ_BDEV ACTIVE" << std::endl; 1519 if (signal_irq_mtty_rx) std::cout << "### IRQ_MTTY ACTIVE" << std::endl; 1520 if (signal_irq_mnic_rx[0]) std::cout << "### IRQ_MNIC_RX[0] ACTIVE" << std::endl; 1521 if (signal_irq_mnic_rx[1]) std::cout << "### IRQ_MNIC_RX[1] ACTIVE" << std::endl; 1522 if (signal_irq_mnic_tx[0]) std::cout << "### IRQ_MNIC_TX[0] ACTIVE" << std::endl; 1523 if (signal_irq_mnic_tx[1]) std::cout << "### IRQ_MNIC_TX[1] ACTIVE" << std::endl; 1524 } 1525 } 1526 1527 sc_start(sc_core::sc_time(1, SC_NS)); 1528 } 1529 return EXIT_SUCCESS; 1541 1530 } 1542 1531
Note: See TracChangeset
for help on using the changeset viewer.