Ignore:
Timestamp:
Oct 21, 2015, 11:48:40 AM (9 years ago)
Author:
meunier
Message:
  • Update the scripts to use a common file hard_params.py in both gen_arch_info and gen_hdd
  • Adding the P_WIDTH parameter in the topcell
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/platforms/tsar_generic_xbar/top.cpp

    r1012 r1023  
    271271   int64_t  debug_from        = 0;                  // trace start cycle
    272272   int64_t  frozen_cycles     = MAX_FROZEN_CYCLES;  // monitoring frozen processor
    273    size_t   cluster_io_id;                         // index of cluster containing IOs
    274273   int64_t  reset_counters    = -1;
    275274   int64_t  dump_counters     = -1;
     
    280279
    281280   ////////////// 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)) {
    288284            ncycles = (int64_t) strtol(argv[n + 1], NULL, 0);
    289285         }
    290          else if ((strcmp(argv[n], "-SOFT") == 0) && (n + 1 < argc))
    291          {
     286         else if ((strcmp(argv[n], "-SOFT") == 0) && (n + 1 < argc)) {
    292287#ifdef USE_ALMOS
    293288            assert( 0 && "Can't define almos soft name" );
     
    297292#endif
    298293         }
    299          else if ((strcmp(argv[n],"-DISK") == 0) && (n + 1 < argc))
    300          {
     294         else if ((strcmp(argv[n],"-DISK") == 0) && (n + 1 < argc)) {
    301295            strcpy(disk_name, argv[n + 1]);
    302296         }
    303          else if ((strcmp(argv[n],"-DEBUG") == 0) && (n + 1 < argc))
    304          {
     297         else if ((strcmp(argv[n],"-DEBUG") == 0) && (n + 1 < argc)) {
    305298            debug_ok = true;
    306299            debug_from = (int64_t) strtol(argv[n + 1], NULL, 0);
    307300         }
    308          else if ((strcmp(argv[n], "-MEMCID") == 0) && (n + 1 < argc))
    309          {
     301         else if ((strcmp(argv[n], "-MEMCID") == 0) && (n + 1 < argc)) {
    310302            debug_memc_id = (size_t) strtol(argv[n + 1], NULL, 0);
    311303#ifdef USE_ALMOS
     
    320312#endif
    321313         }
    322          else if ((strcmp(argv[n], "-PROCID") == 0) && (n + 1 < argc))
    323          {
     314         else if ((strcmp(argv[n], "-PROCID") == 0) && (n + 1 < argc)) {
    324315            debug_proc_id = (size_t) strtol(argv[n + 1], NULL, 0);
    325316#ifdef USE_ALMOS
     
    335326#endif
    336327         }
    337          else if ((strcmp(argv[n], "-THREADS") == 0) && ((n + 1) < argc))
    338          {
     328         else if ((strcmp(argv[n], "-THREADS") == 0) && ((n + 1) < argc)) {
    339329            threads_nr = (ssize_t) strtol(argv[n + 1], NULL, 0);
    340330            threads_nr = (threads_nr < 1) ? 1 : threads_nr;
    341331         }
    342          else if ((strcmp(argv[n], "-FROZEN") == 0) && (n + 1 < argc))
    343          {
     332         else if ((strcmp(argv[n], "-FROZEN") == 0) && (n + 1 < argc)) {
    344333            frozen_cycles = (int64_t) strtol(argv[n + 1], NULL, 0);
    345334         }
    346          else if ((strcmp(argv[n], "-PERIOD") == 0) && (n + 1 < argc))
    347          {
     335         else if ((strcmp(argv[n], "-PERIOD") == 0) && (n + 1 < argc)) {
    348336            debug_period = (size_t) strtol(argv[n + 1], NULL, 0);
    349337         }
    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)) {
    352339            reset_counters = (int64_t) strtol(argv[n + 1], NULL, 0);
    353340            do_reset_counters = true;
    354341         }
    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)) {
    357343            dump_counters = (int64_t) strtol(argv[n + 1], NULL, 0);
    358344            do_dump_counters = true;
    359345         }
    360          else
    361          {
     346         else {
    362347            std::cout << "   Arguments are (key,value) couples." << std::endl;
    363348            std::cout << "   The order is not important." << std::endl;
     
    461446   else if (X_SIZE <= 4) x_width = 2;
    462447   else if (X_SIZE <= 8) x_width = 3;
    463    else                x_width = 4;
     448   else                  x_width = 4;
    464449
    465450   if      (Y_SIZE == 1) y_width = 0;
     
    467452   else if (Y_SIZE <= 4) y_width = 2;
    468453   else if (Y_SIZE <= 8) y_width = 3;
    469    else                y_width = 4;
     454   else                  y_width = 4;
    470455
    471456#else
     
    480465
    481466#endif
    482 
    483    // index of cluster containing IOs
    484    cluster_io_id = 0x00bfc00000ULL >> (vci_address_width - x_width - y_width);
    485 
    486467
    487468   /////////////////////
     
    495476                        0x00FF800000);
    496477
    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++) {
    501480         sc_uint<vci_address_width> offset;
    502481         offset = (sc_uint<vci_address_width>) cluster(x,y)
     
    518497                  IntTab(cluster(x,y), RAM_TGTID), true));
    519498
    520          if ( cluster(x,y) == cluster_io_id )
    521          {
     499         if (x == X_IO && y == Y_IO) {
    522500            maptabd.add(Segment("seg_mtty", SEG_TTY_BASE, SEG_TTY_SIZE,
    523501                        IntTab(cluster(x,y),TTY_TGTID), false));
     
    545523                        0xFFFF000000ULL);
    546524
    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++) {
    551527
    552528         sc_uint<vci_address_width> offset;
     
    672648#pragma omp for
    673649#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++) {
    676651            size_t x = i / Y_SIZE;
    677652            size_t y = i % Y_SIZE;
     
    704679                y_width,
    705680                vci_srcid_width - x_width - y_width,   // l_id width,
     681                P_WIDTH,
    706682                RAM_TGTID,
    707683                XCU_TGTID,
     
    722698                IRQ_PER_PROCESSOR,
    723699                XRAM_LATENCY,
    724                 (cluster(x,y) == cluster_io_id),
     700                x == X_IO && y == Y_IO,
    725701                FBF_X_SIZE,
    726702                FBF_Y_SIZE,
     
    752728
    753729   // 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                         (signal_clk);
    757          clusters[x][y]->p_resetn                      (signal_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);
    758734      }
    759735   }
    760736
    761737   // 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      }
    791765   }
    792766   std::cout << std::endl << "Horizontal connections done" << std::endl;
    793767
    794768   // 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      }
    824796   }
    825797   std::cout << std::endl << "Vertical connections done" << std::endl;
    826798
    827799   // 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++) {
    829801       clusters[0][y]->p_cmd_in[WEST]           (signal_dspin_bound_cmd_in[0][y][WEST]);
    830802       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]);
    833805
    834806       clusters[0][y]->p_rsp_in[WEST]           (signal_dspin_bound_rsp_in[0][y][WEST]);
    835807       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]);
    838810
    839811       clusters[0][y]->p_m2p_in[WEST]           (signal_dspin_bound_m2p_in[0][y][WEST]);
    840812       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]);
    843815
    844816       clusters[0][y]->p_p2m_in[WEST]           (signal_dspin_bound_p2m_in[0][y][WEST]);
    845817       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]);
    848820
    849821       clusters[0][y]->p_cla_in[WEST]           (signal_dspin_bound_cla_in[0][y][WEST]);
    850822       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]);
    853825   }
    854826
     
    859831       clusters[x][0]->p_cmd_in[SOUTH]          (signal_dspin_bound_cmd_in[x][0][SOUTH]);
    860832       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]);
    863835
    864836       clusters[x][0]->p_rsp_in[SOUTH]          (signal_dspin_bound_rsp_in[x][0][SOUTH]);
    865837       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]);
    868840
    869841       clusters[x][0]->p_m2p_in[SOUTH]          (signal_dspin_bound_m2p_in[x][0][SOUTH]);
    870842       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]);
    873845
    874846       clusters[x][0]->p_p2m_in[SOUTH]          (signal_dspin_bound_p2m_in[x][0][SOUTH]);
    875847       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]);
    878850
    879851       clusters[x][0]->p_cla_in[SOUTH]          (signal_dspin_bound_cla_in[x][0][SOUTH]);
    880852       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]);
    883855   }
    884856
     
    893865        GdbServer<Mips32ElIss> > * > l1_caches;
    894866
    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++) {
    897869         for (int proc = 0; proc < NB_PROCS_MAX; proc++) {
    898870            l1_caches.push_back(clusters[x][y]->proc[proc]);
     
    901873   }
    902874
    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++) {
    905877         clusters[x][y]->memc->set_vcache_list(l1_caches);
    906878      }
     
    913885   sc_trace_file * tf = sc_create_vcd_trace_file("my_trace_file");
    914886
    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++) {
    949917         std::ostringstream signame;
    950918         signame << "cluster" << x << "_" << y;
     
    994962       }
    995963   }
     964   // @M debug fu**
     965   clusters[0][0]->signal_dspin_m2p_proc[2].read = true;
    996966
    997967   sc_start(sc_core::sc_time(1, SC_NS));
     
    1008978      }
    1009979
    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) {
    1017984               perror("gettimeofday");
    1018985               return EXIT_FAILURE;
     
    10471014         }
    10481015
    1049          if ((n > debug_from) and (n % debug_period == 0))
    1050          {
     1016         if ((n > debug_from) and (n % debug_period == 0)) {
    10511017            std::cout << "****************** cycle " << std::dec << n ;
    10521018            std::cout << "************************************************" << std::endl;
    10531019
    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++) {
    10561022                  for (int proc = 0; proc < NB_PROCS_MAX; proc++) {
     1023                     if (x == 0 && y == 0 && proc == 2) {
     1024                        continue;
     1025                     }
    10571026                     clusters[x][y]->proc[proc]->print_trace();
    10581027                     std::ostringstream proc_signame;
     
    11411110
    11421111   // 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++) {
    11451113      size_t x = i / Y_SIZE;
    11461114      size_t y = i % Y_SIZE;
     
    11481116   }
    11491117
    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);
    11791147
    11801148   dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_cmd_in, X_SIZE, Y_SIZE, 4);
     
    12041172void voidhandler(int dummy = 0) {}
    12051173
    1206 int sc_main (int argc, char *argv[])
    1207 {
     1174int sc_main (int argc, char *argv[]) {
    12081175   signal(SIGINT, handler);
    12091176   signal(SIGPIPE, voidhandler);
     
    12131180   } catch (std::exception &e) {
    12141181      std::cout << e.what() << std::endl;
    1215    } catch (...) {
     1182   }
     1183   catch (...) {
    12161184      std::cout << "Unknown exception occured" << std::endl;
    12171185      throw;
Note: See TracChangeset for help on using the changeset viewer.