Changeset 1023 for trunk/platforms/tsar_generic_xbar/top.cpp
- Timestamp:
- Oct 21, 2015, 11:48:40 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/tsar_generic_xbar/top.cpp
r1012 r1023 271 271 int64_t debug_from = 0; // trace start cycle 272 272 int64_t frozen_cycles = MAX_FROZEN_CYCLES; // monitoring frozen processor 273 size_t cluster_io_id; // index of cluster containing IOs274 273 int64_t reset_counters = -1; 275 274 int64_t dump_counters = -1; … … 280 279 281 280 ////////////// command line arguments ////////////////////// 282 if (argc > 1) 283 { 284 for (int n = 1; n < argc; n = n + 2) 285 { 286 if ((strcmp(argv[n], "-NCYCLES") == 0) && (n + 1 < argc)) 287 { 281 if (argc > 1) { 282 for (int n = 1; n < argc; n = n + 2) { 283 if ((strcmp(argv[n], "-NCYCLES") == 0) && (n + 1 < argc)) { 288 284 ncycles = (int64_t) strtol(argv[n + 1], NULL, 0); 289 285 } 290 else if ((strcmp(argv[n], "-SOFT") == 0) && (n + 1 < argc)) 291 { 286 else if ((strcmp(argv[n], "-SOFT") == 0) && (n + 1 < argc)) { 292 287 #ifdef USE_ALMOS 293 288 assert( 0 && "Can't define almos soft name" ); … … 297 292 #endif 298 293 } 299 else if ((strcmp(argv[n],"-DISK") == 0) && (n + 1 < argc)) 300 { 294 else if ((strcmp(argv[n],"-DISK") == 0) && (n + 1 < argc)) { 301 295 strcpy(disk_name, argv[n + 1]); 302 296 } 303 else if ((strcmp(argv[n],"-DEBUG") == 0) && (n + 1 < argc)) 304 { 297 else if ((strcmp(argv[n],"-DEBUG") == 0) && (n + 1 < argc)) { 305 298 debug_ok = true; 306 299 debug_from = (int64_t) strtol(argv[n + 1], NULL, 0); 307 300 } 308 else if ((strcmp(argv[n], "-MEMCID") == 0) && (n + 1 < argc)) 309 { 301 else if ((strcmp(argv[n], "-MEMCID") == 0) && (n + 1 < argc)) { 310 302 debug_memc_id = (size_t) strtol(argv[n + 1], NULL, 0); 311 303 #ifdef USE_ALMOS … … 320 312 #endif 321 313 } 322 else if ((strcmp(argv[n], "-PROCID") == 0) && (n + 1 < argc)) 323 { 314 else if ((strcmp(argv[n], "-PROCID") == 0) && (n + 1 < argc)) { 324 315 debug_proc_id = (size_t) strtol(argv[n + 1], NULL, 0); 325 316 #ifdef USE_ALMOS … … 335 326 #endif 336 327 } 337 else if ((strcmp(argv[n], "-THREADS") == 0) && ((n + 1) < argc)) 338 { 328 else if ((strcmp(argv[n], "-THREADS") == 0) && ((n + 1) < argc)) { 339 329 threads_nr = (ssize_t) strtol(argv[n + 1], NULL, 0); 340 330 threads_nr = (threads_nr < 1) ? 1 : threads_nr; 341 331 } 342 else if ((strcmp(argv[n], "-FROZEN") == 0) && (n + 1 < argc)) 343 { 332 else if ((strcmp(argv[n], "-FROZEN") == 0) && (n + 1 < argc)) { 344 333 frozen_cycles = (int64_t) strtol(argv[n + 1], NULL, 0); 345 334 } 346 else if ((strcmp(argv[n], "-PERIOD") == 0) && (n + 1 < argc)) 347 { 335 else if ((strcmp(argv[n], "-PERIOD") == 0) && (n + 1 < argc)) { 348 336 debug_period = (size_t) strtol(argv[n + 1], NULL, 0); 349 337 } 350 else if ((strcmp(argv[n], "--reset-counters") == 0) && (n + 1 < argc)) 351 { 338 else if ((strcmp(argv[n], "--reset-counters") == 0) && (n + 1 < argc)) { 352 339 reset_counters = (int64_t) strtol(argv[n + 1], NULL, 0); 353 340 do_reset_counters = true; 354 341 } 355 else if ((strcmp(argv[n], "--dump-counters") == 0) && (n + 1 < argc)) 356 { 342 else if ((strcmp(argv[n], "--dump-counters") == 0) && (n + 1 < argc)) { 357 343 dump_counters = (int64_t) strtol(argv[n + 1], NULL, 0); 358 344 do_dump_counters = true; 359 345 } 360 else 361 { 346 else { 362 347 std::cout << " Arguments are (key,value) couples." << std::endl; 363 348 std::cout << " The order is not important." << std::endl; … … 461 446 else if (X_SIZE <= 4) x_width = 2; 462 447 else if (X_SIZE <= 8) x_width = 3; 463 else x_width = 4;448 else x_width = 4; 464 449 465 450 if (Y_SIZE == 1) y_width = 0; … … 467 452 else if (Y_SIZE <= 4) y_width = 2; 468 453 else if (Y_SIZE <= 8) y_width = 3; 469 else y_width = 4;454 else y_width = 4; 470 455 471 456 #else … … 480 465 481 466 #endif 482 483 // index of cluster containing IOs484 cluster_io_id = 0x00bfc00000ULL >> (vci_address_width - x_width - y_width);485 486 467 487 468 ///////////////////// … … 495 476 0x00FF800000); 496 477 497 for (size_t x = 0; x < X_SIZE; x++) 498 { 499 for (size_t y = 0; y < Y_SIZE; y++) 500 { 478 for (size_t x = 0; x < X_SIZE; x++) { 479 for (size_t y = 0; y < Y_SIZE; y++) { 501 480 sc_uint<vci_address_width> offset; 502 481 offset = (sc_uint<vci_address_width>) cluster(x,y) … … 518 497 IntTab(cluster(x,y), RAM_TGTID), true)); 519 498 520 if ( cluster(x,y) == cluster_io_id ) 521 { 499 if (x == X_IO && y == Y_IO) { 522 500 maptabd.add(Segment("seg_mtty", SEG_TTY_BASE, SEG_TTY_SIZE, 523 501 IntTab(cluster(x,y),TTY_TGTID), false)); … … 545 523 0xFFFF000000ULL); 546 524 547 for (size_t x = 0; x < X_SIZE; x++) 548 { 549 for (size_t y = 0; y < Y_SIZE ; y++) 550 { 525 for (size_t x = 0; x < X_SIZE; x++) { 526 for (size_t y = 0; y < Y_SIZE ; y++) { 551 527 552 528 sc_uint<vci_address_width> offset; … … 672 648 #pragma omp for 673 649 #endif 674 for (size_t i = 0; i < (X_SIZE * Y_SIZE); i++) 675 { 650 for (size_t i = 0; i < (X_SIZE * Y_SIZE); i++) { 676 651 size_t x = i / Y_SIZE; 677 652 size_t y = i % Y_SIZE; … … 704 679 y_width, 705 680 vci_srcid_width - x_width - y_width, // l_id width, 681 P_WIDTH, 706 682 RAM_TGTID, 707 683 XCU_TGTID, … … 722 698 IRQ_PER_PROCESSOR, 723 699 XRAM_LATENCY, 724 (cluster(x,y) == cluster_io_id),700 x == X_IO && y == Y_IO, 725 701 FBF_X_SIZE, 726 702 FBF_Y_SIZE, … … 752 728 753 729 // Clock & RESET 754 for ( size_t x = 0; x < (X_SIZE); x++){755 for ( size_t y = 0; y < Y_SIZE; y++){756 clusters[x][y]->p_clk 757 clusters[x][y]->p_resetn 730 for (int x = 0; x < X_SIZE; x++) { 731 for (int y = 0; y < Y_SIZE; y++) { 732 clusters[x][y]->p_clk (signal_clk); 733 clusters[x][y]->p_resetn (signal_resetn); 758 734 } 759 735 } 760 736 761 737 // Inter Clusters horizontal connections 762 if (X_SIZE > 1) { 763 for (size_t x = 0; x < (X_SIZE-1); x++) { 764 for (size_t y = 0; y < (Y_SIZE); y++) { 765 clusters[x][y]->p_cmd_out[EAST] (signal_dspin_h_cmd_inc[x][y]); 766 clusters[x+1][y]->p_cmd_in[WEST] (signal_dspin_h_cmd_inc[x][y]); 767 clusters[x][y]->p_cmd_in[EAST] (signal_dspin_h_cmd_dec[x][y]); 768 clusters[x+1][y]->p_cmd_out[WEST] (signal_dspin_h_cmd_dec[x][y]); 769 770 clusters[x][y]->p_rsp_out[EAST] (signal_dspin_h_rsp_inc[x][y]); 771 clusters[x+1][y]->p_rsp_in[WEST] (signal_dspin_h_rsp_inc[x][y]); 772 clusters[x][y]->p_rsp_in[EAST] (signal_dspin_h_rsp_dec[x][y]); 773 clusters[x+1][y]->p_rsp_out[WEST] (signal_dspin_h_rsp_dec[x][y]); 774 775 clusters[x][y]->p_m2p_out[EAST] (signal_dspin_h_m2p_inc[x][y]); 776 clusters[x+1][y]->p_m2p_in[WEST] (signal_dspin_h_m2p_inc[x][y]); 777 clusters[x][y]->p_m2p_in[EAST] (signal_dspin_h_m2p_dec[x][y]); 778 clusters[x+1][y]->p_m2p_out[WEST] (signal_dspin_h_m2p_dec[x][y]); 779 780 clusters[x][y]->p_p2m_out[EAST] (signal_dspin_h_p2m_inc[x][y]); 781 clusters[x+1][y]->p_p2m_in[WEST] (signal_dspin_h_p2m_inc[x][y]); 782 clusters[x][y]->p_p2m_in[EAST] (signal_dspin_h_p2m_dec[x][y]); 783 clusters[x+1][y]->p_p2m_out[WEST] (signal_dspin_h_p2m_dec[x][y]); 784 785 clusters[x][y]->p_cla_out[EAST] (signal_dspin_h_cla_inc[x][y]); 786 clusters[x+1][y]->p_cla_in[WEST] (signal_dspin_h_cla_inc[x][y]); 787 clusters[x][y]->p_cla_in[EAST] (signal_dspin_h_cla_dec[x][y]); 788 clusters[x+1][y]->p_cla_out[WEST] (signal_dspin_h_cla_dec[x][y]); 789 } 790 } 738 for (int x = 0; x < X_SIZE - 1; x++) { 739 for (int y = 0; y < Y_SIZE; y++) { 740 clusters[x][y]->p_cmd_out[EAST] (signal_dspin_h_cmd_inc[x][y]); 741 clusters[x + 1][y]->p_cmd_in[WEST] (signal_dspin_h_cmd_inc[x][y]); 742 clusters[x][y]->p_cmd_in[EAST] (signal_dspin_h_cmd_dec[x][y]); 743 clusters[x + 1][y]->p_cmd_out[WEST] (signal_dspin_h_cmd_dec[x][y]); 744 745 clusters[x][y]->p_rsp_out[EAST] (signal_dspin_h_rsp_inc[x][y]); 746 clusters[x + 1][y]->p_rsp_in[WEST] (signal_dspin_h_rsp_inc[x][y]); 747 clusters[x][y]->p_rsp_in[EAST] (signal_dspin_h_rsp_dec[x][y]); 748 clusters[x + 1][y]->p_rsp_out[WEST] (signal_dspin_h_rsp_dec[x][y]); 749 750 clusters[x][y]->p_m2p_out[EAST] (signal_dspin_h_m2p_inc[x][y]); 751 clusters[x + 1][y]->p_m2p_in[WEST] (signal_dspin_h_m2p_inc[x][y]); 752 clusters[x][y]->p_m2p_in[EAST] (signal_dspin_h_m2p_dec[x][y]); 753 clusters[x + 1][y]->p_m2p_out[WEST] (signal_dspin_h_m2p_dec[x][y]); 754 755 clusters[x][y]->p_p2m_out[EAST] (signal_dspin_h_p2m_inc[x][y]); 756 clusters[x + 1][y]->p_p2m_in[WEST] (signal_dspin_h_p2m_inc[x][y]); 757 clusters[x][y]->p_p2m_in[EAST] (signal_dspin_h_p2m_dec[x][y]); 758 clusters[x + 1][y]->p_p2m_out[WEST] (signal_dspin_h_p2m_dec[x][y]); 759 760 clusters[x][y]->p_cla_out[EAST] (signal_dspin_h_cla_inc[x][y]); 761 clusters[x + 1][y]->p_cla_in[WEST] (signal_dspin_h_cla_inc[x][y]); 762 clusters[x][y]->p_cla_in[EAST] (signal_dspin_h_cla_dec[x][y]); 763 clusters[x + 1][y]->p_cla_out[WEST] (signal_dspin_h_cla_dec[x][y]); 764 } 791 765 } 792 766 std::cout << std::endl << "Horizontal connections done" << std::endl; 793 767 794 768 // Inter Clusters vertical connections 795 if (Y_SIZE > 1) { 796 for (size_t y = 0; y < (Y_SIZE-1); y++) { 797 for (size_t x = 0; x < X_SIZE; x++) { 798 clusters[x][y]->p_cmd_out[NORTH] (signal_dspin_v_cmd_inc[x][y]); 799 clusters[x][y+1]->p_cmd_in[SOUTH] (signal_dspin_v_cmd_inc[x][y]); 800 clusters[x][y]->p_cmd_in[NORTH] (signal_dspin_v_cmd_dec[x][y]); 801 clusters[x][y+1]->p_cmd_out[SOUTH] (signal_dspin_v_cmd_dec[x][y]); 802 803 clusters[x][y]->p_rsp_out[NORTH] (signal_dspin_v_rsp_inc[x][y]); 804 clusters[x][y+1]->p_rsp_in[SOUTH] (signal_dspin_v_rsp_inc[x][y]); 805 clusters[x][y]->p_rsp_in[NORTH] (signal_dspin_v_rsp_dec[x][y]); 806 clusters[x][y+1]->p_rsp_out[SOUTH] (signal_dspin_v_rsp_dec[x][y]); 807 808 clusters[x][y]->p_m2p_out[NORTH] (signal_dspin_v_m2p_inc[x][y]); 809 clusters[x][y+1]->p_m2p_in[SOUTH] (signal_dspin_v_m2p_inc[x][y]); 810 clusters[x][y]->p_m2p_in[NORTH] (signal_dspin_v_m2p_dec[x][y]); 811 clusters[x][y+1]->p_m2p_out[SOUTH] (signal_dspin_v_m2p_dec[x][y]); 812 813 clusters[x][y]->p_p2m_out[NORTH] (signal_dspin_v_p2m_inc[x][y]); 814 clusters[x][y+1]->p_p2m_in[SOUTH] (signal_dspin_v_p2m_inc[x][y]); 815 clusters[x][y]->p_p2m_in[NORTH] (signal_dspin_v_p2m_dec[x][y]); 816 clusters[x][y+1]->p_p2m_out[SOUTH] (signal_dspin_v_p2m_dec[x][y]); 817 818 clusters[x][y]->p_cla_out[NORTH] (signal_dspin_v_cla_inc[x][y]); 819 clusters[x][y+1]->p_cla_in[SOUTH] (signal_dspin_v_cla_inc[x][y]); 820 clusters[x][y]->p_cla_in[NORTH] (signal_dspin_v_cla_dec[x][y]); 821 clusters[x][y+1]->p_cla_out[SOUTH] (signal_dspin_v_cla_dec[x][y]); 822 } 823 } 769 for (int y = 0; y < Y_SIZE - 1; y++) { 770 for (int x = 0; x < X_SIZE; x++) { 771 clusters[x][y]->p_cmd_out[NORTH] (signal_dspin_v_cmd_inc[x][y]); 772 clusters[x][y + 1]->p_cmd_in[SOUTH] (signal_dspin_v_cmd_inc[x][y]); 773 clusters[x][y]->p_cmd_in[NORTH] (signal_dspin_v_cmd_dec[x][y]); 774 clusters[x][y + 1]->p_cmd_out[SOUTH] (signal_dspin_v_cmd_dec[x][y]); 775 776 clusters[x][y]->p_rsp_out[NORTH] (signal_dspin_v_rsp_inc[x][y]); 777 clusters[x][y + 1]->p_rsp_in[SOUTH] (signal_dspin_v_rsp_inc[x][y]); 778 clusters[x][y]->p_rsp_in[NORTH] (signal_dspin_v_rsp_dec[x][y]); 779 clusters[x][y + 1]->p_rsp_out[SOUTH] (signal_dspin_v_rsp_dec[x][y]); 780 781 clusters[x][y]->p_m2p_out[NORTH] (signal_dspin_v_m2p_inc[x][y]); 782 clusters[x][y + 1]->p_m2p_in[SOUTH] (signal_dspin_v_m2p_inc[x][y]); 783 clusters[x][y]->p_m2p_in[NORTH] (signal_dspin_v_m2p_dec[x][y]); 784 clusters[x][y + 1]->p_m2p_out[SOUTH] (signal_dspin_v_m2p_dec[x][y]); 785 786 clusters[x][y]->p_p2m_out[NORTH] (signal_dspin_v_p2m_inc[x][y]); 787 clusters[x][y + 1]->p_p2m_in[SOUTH] (signal_dspin_v_p2m_inc[x][y]); 788 clusters[x][y]->p_p2m_in[NORTH] (signal_dspin_v_p2m_dec[x][y]); 789 clusters[x][y + 1]->p_p2m_out[SOUTH] (signal_dspin_v_p2m_dec[x][y]); 790 791 clusters[x][y]->p_cla_out[NORTH] (signal_dspin_v_cla_inc[x][y]); 792 clusters[x][y + 1]->p_cla_in[SOUTH] (signal_dspin_v_cla_inc[x][y]); 793 clusters[x][y]->p_cla_in[NORTH] (signal_dspin_v_cla_dec[x][y]); 794 clusters[x][y + 1]->p_cla_out[SOUTH] (signal_dspin_v_cla_dec[x][y]); 795 } 824 796 } 825 797 std::cout << std::endl << "Vertical connections done" << std::endl; 826 798 827 799 // East & West boundary cluster connections 828 for (size_t y = 0; y < (Y_SIZE); y++) {800 for (size_t y = 0; y < Y_SIZE; y++) { 829 801 clusters[0][y]->p_cmd_in[WEST] (signal_dspin_bound_cmd_in[0][y][WEST]); 830 802 clusters[0][y]->p_cmd_out[WEST] (signal_dspin_bound_cmd_out[0][y][WEST]); 831 clusters[X_SIZE -1][y]->p_cmd_in[EAST] (signal_dspin_bound_cmd_in[X_SIZE-1][y][EAST]);832 clusters[X_SIZE -1][y]->p_cmd_out[EAST] (signal_dspin_bound_cmd_out[X_SIZE-1][y][EAST]);803 clusters[X_SIZE - 1][y]->p_cmd_in[EAST] (signal_dspin_bound_cmd_in[X_SIZE - 1][y][EAST]); 804 clusters[X_SIZE - 1][y]->p_cmd_out[EAST] (signal_dspin_bound_cmd_out[X_SIZE - 1][y][EAST]); 833 805 834 806 clusters[0][y]->p_rsp_in[WEST] (signal_dspin_bound_rsp_in[0][y][WEST]); 835 807 clusters[0][y]->p_rsp_out[WEST] (signal_dspin_bound_rsp_out[0][y][WEST]); 836 clusters[X_SIZE -1][y]->p_rsp_in[EAST] (signal_dspin_bound_rsp_in[X_SIZE-1][y][EAST]);837 clusters[X_SIZE -1][y]->p_rsp_out[EAST] (signal_dspin_bound_rsp_out[X_SIZE-1][y][EAST]);808 clusters[X_SIZE - 1][y]->p_rsp_in[EAST] (signal_dspin_bound_rsp_in[X_SIZE - 1][y][EAST]); 809 clusters[X_SIZE - 1][y]->p_rsp_out[EAST] (signal_dspin_bound_rsp_out[X_SIZE - 1][y][EAST]); 838 810 839 811 clusters[0][y]->p_m2p_in[WEST] (signal_dspin_bound_m2p_in[0][y][WEST]); 840 812 clusters[0][y]->p_m2p_out[WEST] (signal_dspin_bound_m2p_out[0][y][WEST]); 841 clusters[X_SIZE -1][y]->p_m2p_in[EAST] (signal_dspin_bound_m2p_in[X_SIZE-1][y][EAST]);842 clusters[X_SIZE -1][y]->p_m2p_out[EAST] (signal_dspin_bound_m2p_out[X_SIZE-1][y][EAST]);813 clusters[X_SIZE - 1][y]->p_m2p_in[EAST] (signal_dspin_bound_m2p_in[X_SIZE - 1][y][EAST]); 814 clusters[X_SIZE - 1][y]->p_m2p_out[EAST] (signal_dspin_bound_m2p_out[X_SIZE - 1][y][EAST]); 843 815 844 816 clusters[0][y]->p_p2m_in[WEST] (signal_dspin_bound_p2m_in[0][y][WEST]); 845 817 clusters[0][y]->p_p2m_out[WEST] (signal_dspin_bound_p2m_out[0][y][WEST]); 846 clusters[X_SIZE -1][y]->p_p2m_in[EAST] (signal_dspin_bound_p2m_in[X_SIZE-1][y][EAST]);847 clusters[X_SIZE -1][y]->p_p2m_out[EAST] (signal_dspin_bound_p2m_out[X_SIZE-1][y][EAST]);818 clusters[X_SIZE - 1][y]->p_p2m_in[EAST] (signal_dspin_bound_p2m_in[X_SIZE - 1][y][EAST]); 819 clusters[X_SIZE - 1][y]->p_p2m_out[EAST] (signal_dspin_bound_p2m_out[X_SIZE - 1][y][EAST]); 848 820 849 821 clusters[0][y]->p_cla_in[WEST] (signal_dspin_bound_cla_in[0][y][WEST]); 850 822 clusters[0][y]->p_cla_out[WEST] (signal_dspin_bound_cla_out[0][y][WEST]); 851 clusters[X_SIZE -1][y]->p_cla_in[EAST] (signal_dspin_bound_cla_in[X_SIZE-1][y][EAST]);852 clusters[X_SIZE -1][y]->p_cla_out[EAST] (signal_dspin_bound_cla_out[X_SIZE-1][y][EAST]);823 clusters[X_SIZE - 1][y]->p_cla_in[EAST] (signal_dspin_bound_cla_in[X_SIZE - 1][y][EAST]); 824 clusters[X_SIZE - 1][y]->p_cla_out[EAST] (signal_dspin_bound_cla_out[X_SIZE - 1][y][EAST]); 853 825 } 854 826 … … 859 831 clusters[x][0]->p_cmd_in[SOUTH] (signal_dspin_bound_cmd_in[x][0][SOUTH]); 860 832 clusters[x][0]->p_cmd_out[SOUTH] (signal_dspin_bound_cmd_out[x][0][SOUTH]); 861 clusters[x][Y_SIZE -1]->p_cmd_in[NORTH] (signal_dspin_bound_cmd_in[x][Y_SIZE-1][NORTH]);862 clusters[x][Y_SIZE -1]->p_cmd_out[NORTH] (signal_dspin_bound_cmd_out[x][Y_SIZE-1][NORTH]);833 clusters[x][Y_SIZE - 1]->p_cmd_in[NORTH] (signal_dspin_bound_cmd_in[x][Y_SIZE - 1][NORTH]); 834 clusters[x][Y_SIZE - 1]->p_cmd_out[NORTH](signal_dspin_bound_cmd_out[x][Y_SIZE - 1][NORTH]); 863 835 864 836 clusters[x][0]->p_rsp_in[SOUTH] (signal_dspin_bound_rsp_in[x][0][SOUTH]); 865 837 clusters[x][0]->p_rsp_out[SOUTH] (signal_dspin_bound_rsp_out[x][0][SOUTH]); 866 clusters[x][Y_SIZE -1]->p_rsp_in[NORTH] (signal_dspin_bound_rsp_in[x][Y_SIZE-1][NORTH]);867 clusters[x][Y_SIZE -1]->p_rsp_out[NORTH] (signal_dspin_bound_rsp_out[x][Y_SIZE-1][NORTH]);838 clusters[x][Y_SIZE - 1]->p_rsp_in[NORTH] (signal_dspin_bound_rsp_in[x][Y_SIZE - 1][NORTH]); 839 clusters[x][Y_SIZE - 1]->p_rsp_out[NORTH](signal_dspin_bound_rsp_out[x][Y_SIZE - 1][NORTH]); 868 840 869 841 clusters[x][0]->p_m2p_in[SOUTH] (signal_dspin_bound_m2p_in[x][0][SOUTH]); 870 842 clusters[x][0]->p_m2p_out[SOUTH] (signal_dspin_bound_m2p_out[x][0][SOUTH]); 871 clusters[x][Y_SIZE -1]->p_m2p_in[NORTH] (signal_dspin_bound_m2p_in[x][Y_SIZE-1][NORTH]);872 clusters[x][Y_SIZE -1]->p_m2p_out[NORTH] (signal_dspin_bound_m2p_out[x][Y_SIZE-1][NORTH]);843 clusters[x][Y_SIZE - 1]->p_m2p_in[NORTH] (signal_dspin_bound_m2p_in[x][Y_SIZE - 1][NORTH]); 844 clusters[x][Y_SIZE - 1]->p_m2p_out[NORTH](signal_dspin_bound_m2p_out[x][Y_SIZE - 1][NORTH]); 873 845 874 846 clusters[x][0]->p_p2m_in[SOUTH] (signal_dspin_bound_p2m_in[x][0][SOUTH]); 875 847 clusters[x][0]->p_p2m_out[SOUTH] (signal_dspin_bound_p2m_out[x][0][SOUTH]); 876 clusters[x][Y_SIZE -1]->p_p2m_in[NORTH] (signal_dspin_bound_p2m_in[x][Y_SIZE-1][NORTH]);877 clusters[x][Y_SIZE -1]->p_p2m_out[NORTH] (signal_dspin_bound_p2m_out[x][Y_SIZE-1][NORTH]);848 clusters[x][Y_SIZE - 1]->p_p2m_in[NORTH] (signal_dspin_bound_p2m_in[x][Y_SIZE - 1][NORTH]); 849 clusters[x][Y_SIZE - 1]->p_p2m_out[NORTH](signal_dspin_bound_p2m_out[x][Y_SIZE - 1][NORTH]); 878 850 879 851 clusters[x][0]->p_cla_in[SOUTH] (signal_dspin_bound_cla_in[x][0][SOUTH]); 880 852 clusters[x][0]->p_cla_out[SOUTH] (signal_dspin_bound_cla_out[x][0][SOUTH]); 881 clusters[x][Y_SIZE -1]->p_cla_in[NORTH] (signal_dspin_bound_cla_in[x][Y_SIZE-1][NORTH]);882 clusters[x][Y_SIZE -1]->p_cla_out[NORTH] (signal_dspin_bound_cla_out[x][Y_SIZE-1][NORTH]);853 clusters[x][Y_SIZE - 1]->p_cla_in[NORTH] (signal_dspin_bound_cla_in[x][Y_SIZE - 1][NORTH]); 854 clusters[x][Y_SIZE - 1]->p_cla_out[NORTH](signal_dspin_bound_cla_out[x][Y_SIZE - 1][NORTH]); 883 855 } 884 856 … … 893 865 GdbServer<Mips32ElIss> > * > l1_caches; 894 866 895 for ( size_t x = 0; x < X_SIZE; x++) {896 for ( size_t y = 0; y < Y_SIZE; y++) {867 for (int x = 0; x < X_SIZE; x++) { 868 for (int y = 0; y < Y_SIZE; y++) { 897 869 for (int proc = 0; proc < NB_PROCS_MAX; proc++) { 898 870 l1_caches.push_back(clusters[x][y]->proc[proc]); … … 901 873 } 902 874 903 for ( size_t x = 0; x < X_SIZE; x++) {904 for ( size_t y = 0; y < Y_SIZE; y++) {875 for (int x = 0; x < X_SIZE; x++) { 876 for (int y = 0; y < Y_SIZE; y++) { 905 877 clusters[x][y]->memc->set_vcache_list(l1_caches); 906 878 } … … 913 885 sc_trace_file * tf = sc_create_vcd_trace_file("my_trace_file"); 914 886 915 if (X_SIZE > 1){ 916 for (size_t x = 0; x < (X_SIZE-1); x++){ 917 for (size_t y = 0; y < Y_SIZE; y++){ 918 for (size_t k = 0; k < 3; k++){ 919 signal_dspin_h_cmd_inc[x][y][k].trace(tf, "dspin_h_cmd_inc"); 920 signal_dspin_h_cmd_dec[x][y][k].trace(tf, "dspin_h_cmd_dec"); 921 } 922 923 for (size_t k = 0; k < 2; k++){ 924 signal_dspin_h_rsp_inc[x][y][k].trace(tf, "dspin_h_rsp_inc"); 925 signal_dspin_h_rsp_dec[x][y][k].trace(tf, "dspin_h_rsp_dec"); 926 } 927 } 928 } 929 } 930 931 if (Y_SIZE > 1) { 932 for (size_t y = 0; y < (Y_SIZE-1); y++){ 933 for (size_t x = 0; x < X_SIZE; x++){ 934 for (size_t k = 0; k < 3; k++){ 935 signal_dspin_v_cmd_inc[x][y][k].trace(tf, "dspin_v_cmd_inc"); 936 signal_dspin_v_cmd_dec[x][y][k].trace(tf, "dspin_v_cmd_dec"); 937 } 938 939 for (size_t k = 0; k < 2; k++){ 940 signal_dspin_v_rsp_inc[x][y][k].trace(tf, "dspin_v_rsp_inc"); 941 signal_dspin_v_rsp_dec[x][y][k].trace(tf, "dspin_v_rsp_dec"); 942 } 943 } 944 } 945 } 946 947 for (size_t x = 0; x < (X_SIZE); x++){ 948 for (size_t y = 0; y < Y_SIZE; y++){ 887 for (int x = 0; x < X_SIZE - 1; x++) { 888 for (int y = 0; y < Y_SIZE; y++) { 889 for (int k = 0; k < 3; k++) { 890 signal_dspin_h_cmd_inc[x][y][k].trace(tf, "dspin_h_cmd_inc"); 891 signal_dspin_h_cmd_dec[x][y][k].trace(tf, "dspin_h_cmd_dec"); 892 } 893 894 for (int k = 0; k < 2; k++) { 895 signal_dspin_h_rsp_inc[x][y][k].trace(tf, "dspin_h_rsp_inc"); 896 signal_dspin_h_rsp_dec[x][y][k].trace(tf, "dspin_h_rsp_dec"); 897 } 898 } 899 } 900 901 for (int y = 0; y < Y_SIZE - 1; y++) { 902 for (int x = 0; x < X_SIZE; x++) { 903 for (int k = 0; k < 3; k++) { 904 signal_dspin_v_cmd_inc[x][y][k].trace(tf, "dspin_v_cmd_inc"); 905 signal_dspin_v_cmd_dec[x][y][k].trace(tf, "dspin_v_cmd_dec"); 906 } 907 908 for (int k = 0; k < 2; k++) { 909 signal_dspin_v_rsp_inc[x][y][k].trace(tf, "dspin_v_rsp_inc"); 910 signal_dspin_v_rsp_dec[x][y][k].trace(tf, "dspin_v_rsp_dec"); 911 } 912 } 913 } 914 915 for (int x = 0; x < (X_SIZE); x++) { 916 for (int y = 0; y < Y_SIZE; y++) { 949 917 std::ostringstream signame; 950 918 signame << "cluster" << x << "_" << y; … … 994 962 } 995 963 } 964 // @M debug fu** 965 clusters[0][0]->signal_dspin_m2p_proc[2].read = true; 996 966 997 967 sc_start(sc_core::sc_time(1, SC_NS)); … … 1008 978 } 1009 979 1010 for (int64_t n = 1; n < ncycles && !stop_called; n++) 1011 { 1012 if ((n % max_cycles) == 0) 1013 { 1014 1015 if (gettimeofday(&t2, NULL) != 0) 1016 { 980 for (int64_t n = 1; n < ncycles && !stop_called; n++) { 981 if ((n % max_cycles) == 0) { 982 983 if (gettimeofday(&t2, NULL) != 0) { 1017 984 perror("gettimeofday"); 1018 985 return EXIT_FAILURE; … … 1047 1014 } 1048 1015 1049 if ((n > debug_from) and (n % debug_period == 0)) 1050 { 1016 if ((n > debug_from) and (n % debug_period == 0)) { 1051 1017 std::cout << "****************** cycle " << std::dec << n ; 1052 1018 std::cout << "************************************************" << std::endl; 1053 1019 1054 for (size_t x = 0; x < X_SIZE ; x++) {1055 for (size_t y = 0; y < Y_SIZE ; y++) {1020 for (size_t x = 0; x < X_SIZE ; x++) { 1021 for (size_t y = 0; y < Y_SIZE ; y++) { 1056 1022 for (int proc = 0; proc < NB_PROCS_MAX; proc++) { 1023 if (x == 0 && y == 0 && proc == 2) { 1024 continue; 1025 } 1057 1026 clusters[x][y]->proc[proc]->print_trace(); 1058 1027 std::ostringstream proc_signame; … … 1141 1110 1142 1111 // Free memory 1143 for (size_t i = 0; i < (X_SIZE * Y_SIZE); i++) 1144 { 1112 for (size_t i = 0; i < (X_SIZE * Y_SIZE); i++) { 1145 1113 size_t x = i / Y_SIZE; 1146 1114 size_t y = i % Y_SIZE; … … 1148 1116 } 1149 1117 1150 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cmd_inc, X_SIZE -1, Y_SIZE);1151 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cmd_dec, X_SIZE -1, Y_SIZE);1152 1153 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_rsp_inc, X_SIZE -1, Y_SIZE);1154 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_rsp_dec, X_SIZE -1, Y_SIZE);1155 1156 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_m2p_inc, X_SIZE -1, Y_SIZE);1157 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_m2p_dec, X_SIZE -1, Y_SIZE);1158 1159 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_p2m_inc, X_SIZE -1, Y_SIZE);1160 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_p2m_dec, X_SIZE -1, Y_SIZE);1161 1162 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cla_inc, X_SIZE -1, Y_SIZE);1163 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cla_dec, X_SIZE -1, Y_SIZE);1164 1165 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cmd_inc, X_SIZE, Y_SIZE -1);1166 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cmd_dec, X_SIZE, Y_SIZE -1);1167 1168 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_rsp_inc, X_SIZE, Y_SIZE -1);1169 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_rsp_dec, X_SIZE, Y_SIZE -1);1170 1171 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_m2p_inc, X_SIZE, Y_SIZE -1);1172 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_m2p_dec, X_SIZE, Y_SIZE -1);1173 1174 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_p2m_inc, X_SIZE, Y_SIZE -1);1175 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_p2m_dec, X_SIZE, Y_SIZE -1);1176 1177 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cla_inc, X_SIZE, Y_SIZE -1);1178 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cla_dec, X_SIZE, Y_SIZE -1);1118 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cmd_inc, X_SIZE - 1, Y_SIZE); 1119 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cmd_dec, X_SIZE - 1, Y_SIZE); 1120 1121 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_rsp_inc, X_SIZE - 1, Y_SIZE); 1122 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_rsp_dec, X_SIZE - 1, Y_SIZE); 1123 1124 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_m2p_inc, X_SIZE - 1, Y_SIZE); 1125 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_m2p_dec, X_SIZE - 1, Y_SIZE); 1126 1127 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_p2m_inc, X_SIZE - 1, Y_SIZE); 1128 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_p2m_dec, X_SIZE - 1, Y_SIZE); 1129 1130 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cla_inc, X_SIZE - 1, Y_SIZE); 1131 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cla_dec, X_SIZE - 1, Y_SIZE); 1132 1133 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cmd_inc, X_SIZE, Y_SIZE - 1); 1134 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cmd_dec, X_SIZE, Y_SIZE - 1); 1135 1136 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_rsp_inc, X_SIZE, Y_SIZE - 1); 1137 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_rsp_dec, X_SIZE, Y_SIZE - 1); 1138 1139 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_m2p_inc, X_SIZE, Y_SIZE - 1); 1140 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_m2p_dec, X_SIZE, Y_SIZE - 1); 1141 1142 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_p2m_inc, X_SIZE, Y_SIZE - 1); 1143 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_p2m_dec, X_SIZE, Y_SIZE - 1); 1144 1145 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cla_inc, X_SIZE, Y_SIZE - 1); 1146 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cla_dec, X_SIZE, Y_SIZE - 1); 1179 1147 1180 1148 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_cmd_in, X_SIZE, Y_SIZE, 4); … … 1204 1172 void voidhandler(int dummy = 0) {} 1205 1173 1206 int sc_main (int argc, char *argv[]) 1207 { 1174 int sc_main (int argc, char *argv[]) { 1208 1175 signal(SIGINT, handler); 1209 1176 signal(SIGPIPE, voidhandler); … … 1213 1180 } catch (std::exception &e) { 1214 1181 std::cout << e.what() << std::endl; 1215 } catch (...) { 1182 } 1183 catch (...) { 1216 1184 std::cout << "Unknown exception occured" << std::endl; 1217 1185 throw;
Note: See TracChangeset
for help on using the changeset viewer.