Ignore:
Timestamp:
Feb 16, 2017, 3:51:52 PM (8 years ago)
Author:
meunier
Message:
  • Update of tsar_xbar_cluster (scripts and openmp support)
Location:
trunk/platforms/tsar_generic_xbar
Files:
1 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/platforms/tsar_generic_xbar/scripts/counter_defs.py

    r1012 r1048  
    1111m_prot_name['hmesi'] = "HMESI"
    1212m_prot_name['wtidl'] = "WT IDEAL"
     13m_prot_name['th0'] = "TH. 0"
    1314
    1415m_app_name = {}
    15 m_app_name['mandel'] = "Mandelbrot"
     16m_app_name['barnes'] = "Barnes"
     17m_app_name['blackscholes'] = "Blackscholes"
     18m_app_name['cholesky'] = "Cholesky"
     19m_app_name['fal_sh_1'] = "False Sharing 1"
     20m_app_name['fal_sh_2'] = "False Sharing 2"
     21m_app_name['fft'] = "FFT"
     22m_app_name['fft_ga'] = "FFT"
    1623m_app_name['filter'] = "Convol"
    1724m_app_name['filt_ga'] = "Convol"
     25m_app_name['fmm'] = "FMM"
    1826m_app_name['histogram'] = "Histogram"
    1927m_app_name['histogram-pad'] = "Histogram"
     
    2230m_app_name['kmeans'] = "Kmeans"
    2331m_app_name['kmeans-opt'] = "Kmeans"
     32m_app_name['linear_regression'] = "Linear Reg."
     33m_app_name['lu'] = "LU"
     34m_app_name['mandel'] = "Mandelbrot"
     35m_app_name['mat_mult'] = "Matrix Mult."
     36m_app_name['mat_mult-opt'] = "Matrix Mult."
    2437m_app_name['pca'] = "PCA"
    2538m_app_name['pca-opt'] = "PCA"
    26 m_app_name['mat_mult'] = "Matrix Mult."
    27 m_app_name['mat_mult-opt'] = "Matrix Mult."
    28 m_app_name['barnes'] = "Barnes"
    29 m_app_name['fmm'] = "FMM"
    3039m_app_name['ocean'] = "Ocean"
     40m_app_name['radix'] = "Radix"
     41m_app_name['radix_ga'] = "Radix"
    3142m_app_name['raytrace'] = "Raytrace"
    3243m_app_name['radiosity'] = "Radiosity"
     44m_app_name['string_match'] = "String Match"
    3345m_app_name['waters'] = "Water Sp."
    3446m_app_name['watern'] = "Water Nsq."
    35 m_app_name['cholesky'] = "Cholesky"
    36 m_app_name['lu'] = "LU"
    37 m_app_name['fft'] = "FFT"
    38 m_app_name['radix'] = "Radix"
    39 m_app_name['fft_ga'] = "FFT"
    40 m_app_name['radix_ga'] = "Radix"
    4147
    4248m_metric_id = {}
     
    237243
    238244#colors = [ "\"#008000\"", "\"#000080\"", "\"#BADC98\"", "\"#BA98DC\"", "\"#98DCBA\"", "\"#98BADC\"", "\"#BA9876\"", "\"#BA7698\"", "\"#98BA76\"", "\"#9876BA\"", "\"#76BA98\"", "\"#7698BA\"" ]
    239 colors = [ "\"#008000\"", "\"#FEDCBA\"", "\"#BADC98\"", "\"#000080\"", "\"#98DCBA\"", "\"#98BADC\"", "\"#BA9876\"", "\"#BA7698\"", "\"#98BA76\"", "\"#9876BA\"", "\"#76BA98\"", "\"#7698BA\"" ]
    240 
    241 
     245colors = [ "\"#008000\"", "\"#FEDCBA\"", "\"#9876BA\"", "\"#000080\"", "\"#98DCBA\"", "\"#98BADC\"", "\"#BA9876\"", "\"#BA7698\"", "\"#98BA76\"", "\"#BADC98\"", "\"#76BA98\"", "\"#7698BA\"" ]
     246
     247
  • trunk/platforms/tsar_generic_xbar/scripts/create_graphs.py

    r1012 r1048  
    77
    88
     9apps = [ 'blackscholes', 'filt_ga', 'fft_ga', 'histo-opt', 'kmeans-opt', 'linear_regression', 'lu', 'mandel', 'pca-opt', 'radix_ga', 'string_match' ]
     10#apps = [ 'blackscholes', 'fft_ga', 'filt_ga', 'histo-opt', 'kmeans-opt', 'linear_regression', 'lu', 'mandel', 'pca-opt', 'radix_ga' ]
    911#apps = [ 'histo-opt', 'mandel', 'filt_ga', 'radix_ga', 'fft_ga', 'pca-opt', 'fft', 'radix', 'filter', 'kmeans-opt' ]
    10 apps = [ 'fft_ga', 'filt_ga', 'lu', 'radix_ga', 'histo-opt', 'mandel', 'pca-opt', 'kmeans-opt' ]
    1112#apps = [ 'histogram', 'mandel', 'filter', 'fft', 'fft_ga', 'filt_ga', 'pca', 'lu' ]  # radix radix_ga kmeans
    12 #apps = [ 'histo-opt', 'histogram2', 'histo-opt2' ]
    13 #nb_procs = [ 1, 4, 8, 16, 32, 64, 128, 256 ]
     13#apps = [ 'fal_sh_2' ]
    1414nb_procs = [ 1, 4, 8, 16, 32, 64, 128, 256 ]
    15 single_protocols = ['dhccp', 'hmesi']
    16 joint_protocols = ['dhccp', 'hmesi']
     15#nb_procs = [ 256 ]
     16single_protocols = ['dhccp', 'th0', 'hmesi', 'wtidl']
     17joint_protocols = ['dhccp', 'th0', 'hmesi', 'wtidl' ]
    1718#joint_protocols = []
    1819
     
    3132log_term_name = '_term_'
    3233
    33 coherence_tmpl = os.path.join(scripts_path, template_dir, 'coherence_template.gp') # 1 graph per appli
    34 speedup_tmpl   = os.path.join(scripts_path, template_dir, 'speedup_template.gp')
    35 metric_tmpl    = os.path.join(scripts_path, template_dir, 'metric_template.gp') # 1 graph per metric
    36 stacked_tmpl   = os.path.join(scripts_path, template_dir, 'stacked_template.gp')
     34coherence_tmpl     = os.path.join(scripts_path, template_dir, 'coherence_template.gp') # 1 graph per appli
     35speedup_tmpl       = os.path.join(scripts_path, template_dir, 'speedup_template.gp')
     36metric_tmpl        = os.path.join(scripts_path, template_dir, 'metric_template.gp') # 1 graph per metric
     37stacked_tmpl       = os.path.join(scripts_path, template_dir, 'stacked_template.gp')
     38cst_exec_time_tmpl = os.path.join(scripts_path, template_dir, 'cst_exec_time_template.gp')
    3739
    3840
     
    140142         metrics_val[prot][app][i]['direct_cost']     = metrics_val[prot][app][i]['read_cost']       + metrics_val[prot][app][i]['write_cost']
    141143         metrics_val[prot][app][i]['broadcast_cost']  = metrics_val[prot][app][i]['broadcast'] * 2 * (x * y - 1)
    142          metrics_val[prot][app][i]['coherence_cost']  = metrics_val[prot][app][i]['broadcast_cost']  + metrics_val[prot][app][i]['m_inv_cost'] + metrics_val[prot][app][i]['update_cost']
     144         #metrics_val[prot][app][i]['coherence_cost']  = metrics_val[prot][app][i]['broadcast_cost']  + metrics_val[prot][app][i]['m_inv_cost'] + metrics_val[prot][app][i]['update_cost']
     145         metrics_val[prot][app][i]['coherence_cost']  = metrics_val[prot][app][i]['broadcast_cost']  + metrics_val[prot][app][i]['m_inv_cost'] + metrics_val[prot][app][i]['update_cost'] + metrics_val[prot][app][i]['cleanup_cost'] + metrics_val[prot][app][i]['cleanup_d_cost'] + metrics_val[prot][app][i]['inval_ro_cost']
    143146         if metrics_val[prot][app][i]['broadcast'] < metrics_val[prot][app][i]['write_broadcast']:
    144147            # test to patch a bug in mem_cache
     
    159162subprocess.call([ 'mkdir', '-p', os.path.join(scripts_path, graph_dir) ])
    160163
    161 ############################################################
    162 ### Graph 1 : Coherence traffic Cost per application     ###
    163 ############################################################
    164 
    165 for prot in single_protocols:
    166    for app in apps:
    167       data_coherence_name = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_coherence.dat')
    168       gp_coherence_name   = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_coherence.gp')
    169    
    170       # Creating the data file
    171       width = 15
    172       content = ""
    173      
    174       for metric in [ '#nb_procs' ] + grouped_metrics:
    175          content += metric + " "
    176          nb_spaces = width - len(metric)
    177          content += nb_spaces * ' '
    178       content += "\n"
    179    
    180       for i in nb_procs:
    181          content += "%-15d " % i
    182          for metric in grouped_metrics:
    183             val = float(metrics_val[prot][app][i][metric]) / exec_time[prot][app][i] * 1000
    184             content += "%-15f " % val
    185          content += "\n"
    186      
    187       create_file(data_coherence_name, content)
    188    
    189       # Creating the gp file
    190       template_file = open(coherence_tmpl, 'r')
    191       template = template_file.read()
    192      
    193       plot_str = ""
    194       col = 2
    195       for metric in grouped_metrics:
    196          if metric != grouped_metrics[0]:
    197             plot_str += ", \\\n    "
    198          plot_str += "\"" + data_coherence_name + "\" using ($1):($" + str(col) + ") lc rgb " + colors[col - 2] + " title \"" + m_metric_name[metric] + "\" with linespoint"
    199          col += 1
    200       gp_commands = template % dict(app_name = m_app_name[app], nb_procs = nb_procs[-1] + 1, plot_str = plot_str, svg_name = os.path.join(graph_dir, prot + '_' + app + '_coherence'))
    201      
    202       create_file(gp_coherence_name, gp_commands)
    203      
    204       # Calling gnuplot
    205       print "gnuplot", gp_coherence_name
    206       subprocess.call([ 'gnuplot', gp_coherence_name ])
    207 
    208 
    209 ############################################################
    210 ### Graph 2 : Speedup per Application                    ###
    211 ############################################################
    212 
    213 for prot in single_protocols:
    214    for app in apps:
    215    
    216       data_speedup_name = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_speedup.dat')
    217       gp_speedup_name   = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_speedup.gp')
    218      
    219       # Creating data file
    220       width = 15
    221       content = "#nb_procs"
    222       nb_spaces = width - len(content)
    223       content += nb_spaces * ' '
    224       content += "speedup\n"
    225    
    226       for i in nb_procs:
    227          content += "%-15d " % i
    228          val = exec_time[prot][app][i]
    229          content += "%-15f\n" % (exec_time[prot][app][1] / float(val))
    230    
    231       plot_str = "\"" + data_speedup_name + "\" using ($1):($2) lc rgb \"#654387\" title \"Speedup\" with linespoint"
    232      
    233       create_file(data_speedup_name, content)
    234      
    235       # Creating the gp file
    236       template_file = open(speedup_tmpl, 'r')
    237       template = template_file.read()
    238      
    239       gp_commands = template % dict(appli = m_app_name[app], nb_procs = nb_procs[-1] + 1, plot_str = plot_str, svg_name = os.path.join(graph_dir, prot + '_' + app + '_speedup'))
    240      
    241       create_file(gp_speedup_name, gp_commands)
    242      
    243       # Calling gnuplot
    244       print "gnuplot", gp_speedup_name
    245       subprocess.call([ 'gnuplot', gp_speedup_name ])
    246 
    247 
    248 ############################################################
    249 ### Graph 3 : All speedups on the same Graph             ###
    250 ############################################################
    251 
    252 for prot in single_protocols:
    253    # This graph uses the same template as the graph 2
    254    data_speedup_name = os.path.join(scripts_path, gen_dir, prot + '_all_speedup.dat')
    255    gp_speedup_name   = os.path.join(scripts_path, gen_dir, prot + '_all_speedup.gp')
    256    
    257    # Creating data file
    258    width = 15
    259    content = "#nb_procs"
    260    nb_spaces = width - len(content)
    261    content += (nb_spaces + 1) * ' '
    262    for app in apps:
    263       content += app + " "
    264       content += (width - len(app)) * " "
    265    content += "\n"
    266    
    267    for i in nb_procs:
    268       content += "%-15d " % i
    269       for app in apps:
    270          val = exec_time[prot][app][i]
    271          content += "%-15f " % (exec_time[prot][app][1] / float(val))
    272       content += "\n"
    273    
    274    create_file(data_speedup_name, content)
    275    
    276    # Creating gp file
    277    template_file = open(speedup_tmpl, 'r')
    278    template = template_file.read()
    279    
    280    plot_str = ""
    281    col = 2
    282    for app in apps:
    283       if app != apps[0]:
    284          plot_str += ", \\\n     "
    285       plot_str += "\"" + data_speedup_name + "\" using ($1):($" + str(col) + ") lc rgb %s title \"" % (colors[col - 2])  + m_app_name[app] + "\" with linespoint"
    286       col += 1
    287    
    288    gp_commands = template % dict(appli = "All Applications", nb_procs = nb_procs[-1] + 1, plot_str = plot_str, svg_name = os.path.join(graph_dir, prot + '_all_speedup'))
    289      
    290    create_file(gp_speedup_name, gp_commands)
    291      
    292    # Calling gnuplot
    293    print "gnuplot", gp_speedup_name
    294    subprocess.call([ 'gnuplot', gp_speedup_name ])
    295 
    296 
    297 ############################################################
    298 ### Graph 4 : Graph per metric                           ###
    299 ############################################################
    300 
    301 # The following section creates the graphs grouped by measure (e.g. #broadcasts)
    302 # The template file cannot be easily created otherwise it would not be generic
    303 # in many ways. This is why it is mainly created here.
    304 # Graphs are created for metric in the "individual_metrics" list
    305 
    306 for prot in single_protocols:
    307    for metric in individual_metrics:
    308       data_metric_name = os.path.join(scripts_path, gen_dir, prot + '_' + metric + '.dat')
    309       gp_metric_name   = os.path.join(scripts_path, gen_dir, prot + '_' + metric + '.gp')
    310    
    311       # Creating the gp file
    312       # Setting xtics, i.e. number of procs for each application
    313       xtics_str = "("
    314       first = True
    315       xpos = 1
    316       app_labels = ""
    317       for num_appli in range(0, len(apps)):
    318          for i in nb_procs:
    319             if not first:
    320                xtics_str += ", "
    321             first = False
    322             if i == nb_procs[0]:
    323                xpos_first = xpos
    324             xtics_str += "\"%d\" %.1f" % (i, xpos)
    325             xpos_last = xpos
    326             xpos += 1.5
    327          xpos += 0.5
    328          app_name_xpos = float((xpos_first + xpos_last)) / 2
    329          app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos)
    330       xtics_str += ")"
    331    
    332       xmax_val = float(xpos - 1)
    333    
    334       # Writing the lines of "plot"
    335       plot_str = ""
    336       xpos = 0
    337       first = True
    338       column = 2
    339       for i in range(0, len(nb_procs)):
    340          if not first:
    341             plot_str += ", \\\n    "
    342          first = False
    343          plot_str += "\"%s\" using ($1+%.1f):($%d) lc rgb %s notitle with boxes" % (data_metric_name, xpos, column, colors[i])
    344          column += 1
    345          xpos += 1.5
    346    
    347       template_file = open(metric_tmpl, 'r')
    348       template = template_file.read()
    349    
    350       gp_commands = template % dict(xtics_str = xtics_str, app_labels = app_labels, ylabel_str = m_metric_name[metric], norm_factor_str = m_norm_factor_name[m_metric_norm[metric]], xmax_val = xmax_val, plot_str = plot_str, svg_name = os.path.join(graph_dir, prot + '_' + metric))
    351    
    352       create_file(gp_metric_name, gp_commands)
    353      
    354       # Creating the data file
    355       width = 15
    356       content = "#x_pos"
    357       nb_spaces = width - len(content)
    358       content += nb_spaces * ' '
    359       for i in nb_procs:
    360          content += "%-15d" % i
    361       content += "\n"
    362    
    363       x_pos = 1
    364       for app in apps:
    365          # Computation of x_pos
    366          content += "%-15f" % x_pos
    367          x_pos += len(nb_procs) * 1.5 + 0.5
    368          for i in nb_procs:
    369             if m_metric_norm[metric] == "N":
    370                content += "%-15d" % (metrics_val[prot][app][i][metric])
    371             elif m_metric_norm[metric] == "P":
    372                content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / i)
    373             elif m_metric_norm[metric] == "C":
    374                content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / exec_time[prot][app][i] * 1000)
    375             elif m_metric_norm[metric] == "W":
    376                content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][i]['total_write'])) # Number of writes
    377             elif m_metric_norm[metric] == "R":
    378                content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][i]['total_read'])) # Number of reads
    379             elif m_metric_norm[metric] == "D":
    380                content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][i]['total_direct'])) # Number of req.
    381             elif is_numeric(m_metric_norm[metric]):
    382                content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][int(m_metric_norm[metric])][metric]))
    383             else:
    384                assert(False)
    385    
    386          app_name = m_app_name[app]
    387          content += "#" + app_name + "\n"
    388      
    389       create_file(data_metric_name, content)
    390    
    391       # Calling gnuplot
    392       print "gnuplot", gp_metric_name
    393       subprocess.call([ 'gnuplot', gp_metric_name ])
    394 
    395 
    396 ############################################################
    397 ### Graph 5 : Stacked histogram with counters            ###
    398 ############################################################
    399 
    400 # The following section creates a stacked histogram containing
    401 # the metrics in the "stacked_metric" list
    402 # It is normalized per application w.r.t the values on 256 procs
    403 
    404 for prot in single_protocols:
    405    data_stacked_name = os.path.join(scripts_path, gen_dir, prot + '_stacked.dat')
    406    gp_stacked_name   = os.path.join(scripts_path, gen_dir, prot + '_stacked.gp')
    407    
    408    norm_factor_value = nb_procs[-1]
    409    
    410    # Creating the gp file
    411    template_file = open(stacked_tmpl, 'r')
    412    template = template_file.read()
    413    
    414    xtics_str = "("
    415    first = True
    416    xpos = 1
    417    app_labels = ""
    418    for num_appli in range(0, len(apps)):
    419       for i in nb_procs[1:len(nb_procs)]: # skipping values for 1 proc
    420          if not first:
    421             xtics_str += ", "
    422          first = False
    423          if i == nb_procs[1]:
    424             xpos_first = xpos
    425          xtics_str += "\"%d\" %d -1" % (i, xpos)
    426          xpos_last = xpos
    427          xpos += 1
    428       xpos += 1
    429       app_name_xpos = float((xpos_first + xpos_last)) / 2
    430       app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos)
    431    xtics_str += ")"
    432    
    433    plot_str = "newhistogram \"\""
    434    n = 1
    435    for stacked_metric in stacked_metrics:
    436       plot_str += ", \\\n    " + "'" + data_stacked_name + "'" + " using " + str(n) + " lc rgb " + colors[n] + " title \"" + m_metric_name[stacked_metric] + "\""
    437       n += 1
    438    
    439    ylabel_str = "Breakdown of Coherence Traffic Normalized w.r.t. \\nthe Values on %d Processors" % norm_factor_value
    440    content = template % dict(svg_name = os.path.join(graph_dir, prot + '_stacked'), xtics_str = xtics_str, plot_str = plot_str, ylabel_str = ylabel_str, app_labels = app_labels, prot_labels = "")
    441    
    442    create_file(gp_stacked_name, content)
    443    
    444    # Creating the data file
    445    # Values are normalized by application, w.r.t. the number of requests for a given number of procs
    446    content = "#"
    447    for stacked_metric in stacked_metrics:
    448       content += stacked_metric
    449       content += ' ' + ' ' * (15 - len(stacked_metric))
    450    content += "\n"
    451    for app in apps:
    452       if app != apps[0]:
    453          for i in range(0, len(stacked_metrics)):
    454             content += "%-15f" % 0.0
    455          content += "\n"
    456       for i in nb_procs[1:len(nb_procs)]:
    457          for stacked_metric in stacked_metrics:
    458             metric_val = metrics_val[prot][app][norm_factor_value]['total_stacked'] # Normalisation
    459             if metric_val != 0:
    460                content += "%-15f" % (float(metrics_val[prot][app][i][stacked_metric]) / metric_val)
    461             else:
    462                content += "%-15f" % 0
    463          content += "\n"
    464    
    465    create_file(data_stacked_name, content)
    466    # Calling gnuplot
    467    print "gnuplot", gp_stacked_name
    468    subprocess.call([ 'gnuplot', gp_stacked_name ])
     164#############################################################
     165#### Graph 1 : Coherence traffic Cost per application     ###
     166#############################################################
     167#
     168#for prot in single_protocols:
     169#   for app in apps:
     170#      data_coherence_name = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_coherence.dat')
     171#      gp_coherence_name   = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_coherence.gp')
     172#   
     173#      # Creating the data file
     174#      width = 15
     175#      content = ""
     176#     
     177#      for metric in [ '#nb_procs' ] + grouped_metrics:
     178#         content += metric + " "
     179#         nb_spaces = width - len(metric)
     180#         content += nb_spaces * ' '
     181#      content += "\n"
     182#   
     183#      for i in nb_procs:
     184#         content += "%-15d " % i
     185#         for metric in grouped_metrics:
     186#            #print "app : %s - prot : %s - i : %d" % (app, prot, i)
     187#            val = float(metrics_val[prot][app][i][metric]) / exec_time[prot][app][i] * 1000
     188#            content += "%-15f " % val
     189#         content += "\n"
     190#     
     191#      create_file(data_coherence_name, content)
     192#   
     193#      # Creating the gp file
     194#      template_file = open(coherence_tmpl, 'r')
     195#      template = template_file.read()
     196#     
     197#      plot_str = ""
     198#      col = 2
     199#      for metric in grouped_metrics:
     200#         if metric != grouped_metrics[0]:
     201#            plot_str += ", \\\n    "
     202#         plot_str += "\"" + data_coherence_name + "\" using ($1):($" + str(col) + ") lc rgb " + colors[col - 2] + " title \"" + m_metric_name[metric] + "\" with linespoint"
     203#         col += 1
     204#      gp_commands = template % dict(app_name = m_app_name[app], nb_procs = nb_procs[-1] + 1, plot_str = plot_str, svg_name = os.path.join(graph_dir, prot + '_' + app + '_coherence'))
     205#     
     206#      create_file(gp_coherence_name, gp_commands)
     207#     
     208#      # Calling gnuplot
     209#      print "gnuplot", gp_coherence_name
     210#      subprocess.call([ 'gnuplot', gp_coherence_name ])
     211#
     212#
     213#############################################################
     214#### Graph 2 : Speedup per Application                    ###
     215#############################################################
     216#
     217#if 1 in nb_procs:
     218#   for prot in single_protocols:
     219#      for app in apps:
     220#   
     221#         data_speedup_name = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_speedup.dat')
     222#         gp_speedup_name   = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_speedup.gp')
     223#         
     224#         # Creating data file
     225#         width = 15
     226#         content = "#nb_procs"
     227#         nb_spaces = width - len(content)
     228#         content += nb_spaces * ' '
     229#         content += "speedup\n"
     230#   
     231#         for i in nb_procs:
     232#            content += "%-15d " % i
     233#            val = exec_time[prot][app][i]
     234#            content += "%-15f\n" % (exec_time[prot][app][1] / float(val))
     235#   
     236#         plot_str = "\"" + data_speedup_name + "\" using ($1):($2) lc rgb \"#654387\" title \"Speedup\" with linespoint"
     237#         
     238#         create_file(data_speedup_name, content)
     239#         
     240#         # Creating the gp file
     241#         template_file = open(speedup_tmpl, 'r')
     242#         template = template_file.read()
     243#         
     244#         gp_commands = template % dict(appli = m_app_name[app], nb_procs = nb_procs[-1] + 1, plot_str = plot_str, svg_name = os.path.join(graph_dir, prot + '_' + app + '_speedup'))
     245#         
     246#         create_file(gp_speedup_name, gp_commands)
     247#         
     248#         # Calling gnuplot
     249#         print "gnuplot", gp_speedup_name
     250#         subprocess.call([ 'gnuplot', gp_speedup_name ])
     251#
     252#
     253#############################################################
     254#### Graph 3 : All speedups on the same Graph             ###
     255#############################################################
     256#
     257#if 1 in nb_procs:
     258#   for prot in single_protocols:
     259#      # This graph uses the same template as the graph 2
     260#      data_speedup_name = os.path.join(scripts_path, gen_dir, prot + '_all_speedup.dat')
     261#      gp_speedup_name   = os.path.join(scripts_path, gen_dir, prot + '_all_speedup.gp')
     262#     
     263#      # Creating data file
     264#      width = 15
     265#      content = "#nb_procs"
     266#      nb_spaces = width - len(content)
     267#      content += (nb_spaces + 1) * ' '
     268#      for app in apps:
     269#         content += app + " "
     270#         content += (width - len(app)) * " "
     271#      content += "\n"
     272#     
     273#      for i in nb_procs:
     274#         content += "%-15d " % i
     275#         for app in apps:
     276#            val = exec_time[prot][app][i]
     277#            content += "%-15f " % (exec_time[prot][app][1] / float(val))
     278#         content += "\n"
     279#     
     280#      create_file(data_speedup_name, content)
     281#     
     282#      # Creating gp file
     283#      template_file = open(speedup_tmpl, 'r')
     284#      template = template_file.read()
     285#     
     286#      plot_str = ""
     287#      col = 2
     288#      for app in apps:
     289#         if app != apps[0]:
     290#            plot_str += ", \\\n     "
     291#         plot_str += "\"" + data_speedup_name + "\" using ($1):($" + str(col) + ") lc rgb %s title \"" % (colors[col - 2])  + m_app_name[app] + "\" with linespoint"
     292#         col += 1
     293#     
     294#      gp_commands = template % dict(appli = "All Applications", nb_procs = nb_procs[-1] + 1, plot_str = plot_str, svg_name = os.path.join(graph_dir, prot + '_all_speedup'))
     295#         
     296#      create_file(gp_speedup_name, gp_commands)
     297#         
     298#      # Calling gnuplot
     299#      print "gnuplot", gp_speedup_name
     300#      subprocess.call([ 'gnuplot', gp_speedup_name ])
     301#
     302#
     303#############################################################
     304#### Graph 4 : Graph per metric                           ###
     305#############################################################
     306#
     307## The following section creates the graphs grouped by measure (e.g. #broadcasts)
     308## The template file cannot be easily created otherwise it would not be generic
     309## in many ways. This is why it is mainly created here.
     310## Graphs are created for metric in the "individual_metrics" list
     311#
     312#for prot in single_protocols:
     313#   for metric in individual_metrics:
     314#      data_metric_name = os.path.join(scripts_path, gen_dir, prot + '_' + metric + '.dat')
     315#      gp_metric_name   = os.path.join(scripts_path, gen_dir, prot + '_' + metric + '.gp')
     316#   
     317#      # Creating the gp file
     318#      # Setting xtics, i.e. number of procs for each application
     319#      xtics_str = "("
     320#      first = True
     321#      xpos = 1
     322#      app_labels = ""
     323#      for num_appli in range(0, len(apps)):
     324#         for i in nb_procs:
     325#            if not first:
     326#               xtics_str += ", "
     327#            first = False
     328#            if i == nb_procs[0]:
     329#               xpos_first = xpos
     330#            xtics_str += "\"%d\" %.1f" % (i, xpos)
     331#            xpos_last = xpos
     332#            xpos += 1.5
     333#         xpos += 0.5
     334#         app_name_xpos = float((xpos_first + xpos_last)) / 2
     335#         app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos)
     336#      xtics_str += ")"
     337#   
     338#      xmax_val = float(xpos - 1)
     339#   
     340#      # Writing the lines of "plot"
     341#      plot_str = ""
     342#      xpos = 0
     343#      first = True
     344#      column = 2
     345#      for i in range(0, len(nb_procs)):
     346#         if not first:
     347#            plot_str += ", \\\n    "
     348#         first = False
     349#         plot_str += "\"%s\" using ($1+%.1f):($%d) lc rgb %s notitle with boxes" % (data_metric_name, xpos, column, colors[i])
     350#         column += 1
     351#         xpos += 1.5
     352#   
     353#      template_file = open(metric_tmpl, 'r')
     354#      template = template_file.read()
     355#   
     356#      gp_commands = template % dict(xtics_str = xtics_str, app_labels = app_labels, ylabel_str = m_metric_name[metric], norm_factor_str = m_norm_factor_name[m_metric_norm[metric]], xmax_val = xmax_val, plot_str = plot_str, svg_name = os.path.join(graph_dir, prot + '_' + metric))
     357#   
     358#      create_file(gp_metric_name, gp_commands)
     359#     
     360#      # Creating the data file
     361#      width = 15
     362#      content = "#x_pos"
     363#      nb_spaces = width - len(content)
     364#      content += nb_spaces * ' '
     365#      for i in nb_procs:
     366#         content += "%-15d" % i
     367#      content += "\n"
     368#   
     369#      x_pos = 1
     370#      for app in apps:
     371#         # Computation of x_pos
     372#         content += "%-15f" % x_pos
     373#         x_pos += len(nb_procs) * 1.5 + 0.5
     374#         for i in nb_procs:
     375#            if m_metric_norm[metric] == "N":
     376#               content += "%-15d" % (metrics_val[prot][app][i][metric])
     377#            elif m_metric_norm[metric] == "P":
     378#               content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / i)
     379#            elif m_metric_norm[metric] == "C":
     380#               content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / exec_time[prot][app][i] * 1000)
     381#            elif m_metric_norm[metric] == "W":
     382#               content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][i]['total_write'])) # Number of writes
     383#            elif m_metric_norm[metric] == "R":
     384#               content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][i]['total_read'])) # Number of reads
     385#            elif m_metric_norm[metric] == "D":
     386#               content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][i]['total_direct'])) # Number of req.
     387#            elif is_numeric(m_metric_norm[metric]):
     388#               content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][int(m_metric_norm[metric])][metric]))
     389#            else:
     390#               assert(False)
     391#   
     392#         app_name = m_app_name[app]
     393#         content += "#" + app_name + "\n"
     394#     
     395#      create_file(data_metric_name, content)
     396#   
     397#      # Calling gnuplot
     398#      print "gnuplot", gp_metric_name
     399#      subprocess.call([ 'gnuplot', gp_metric_name ])
     400#
     401#
     402#############################################################
     403#### Graph 5 : Stacked histogram with counters            ###
     404#############################################################
     405#
     406## The following section creates a stacked histogram containing
     407## the metrics in the "stacked_metric" list
     408## It is normalized per application w.r.t the values on 256 procs
     409#
     410#for prot in single_protocols:
     411#   data_stacked_name = os.path.join(scripts_path, gen_dir, prot + '_stacked.dat')
     412#   gp_stacked_name   = os.path.join(scripts_path, gen_dir, prot + '_stacked.gp')
     413#   
     414#   norm_factor_value = nb_procs[-1]
     415#   
     416#   # Creating the gp file
     417#   template_file = open(stacked_tmpl, 'r')
     418#   template = template_file.read()
     419#   
     420#   xtics_str = "("
     421#   first = True
     422#   xpos = 1
     423#   app_labels = ""
     424#   for num_appli in range(0, len(apps)):
     425#      for i in nb_procs[1:len(nb_procs)]: # skipping values for 1 proc
     426#         if not first:
     427#            xtics_str += ", "
     428#         first = False
     429#         if i == nb_procs[1]:
     430#            xpos_first = xpos
     431#         xtics_str += "\"%d\" %d -1" % (i, xpos)
     432#         xpos_last = xpos
     433#         xpos += 1
     434#      xpos += 1
     435#      app_name_xpos = float((xpos_first + xpos_last)) / 2
     436#      app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos)
     437#   xtics_str += ")"
     438#   
     439#   plot_str = "newhistogram \"\""
     440#   n = 1
     441#   for stacked_metric in stacked_metrics:
     442#      plot_str += ", \\\n    " + "'" + data_stacked_name + "'" + " using " + str(n) + " lc rgb " + colors[n] + " title \"" + m_metric_name[stacked_metric] + "\""
     443#      n += 1
     444#   
     445#   ylabel_str = "Breakdown of Coherence Traffic Normalized w.r.t. \\nthe Values on %d Processors" % norm_factor_value
     446#   content = template % dict(svg_name = os.path.join(graph_dir, prot + '_stacked'), xtics_str = xtics_str, plot_str = plot_str, ylabel_str = ylabel_str, app_labels = app_labels, prot_labels = "")
     447#   
     448#   create_file(gp_stacked_name, content)
     449#   
     450#   # Creating the data file
     451#   # Values are normalized by application, w.r.t. the number of requests for a given number of procs
     452#   content = "#"
     453#   for stacked_metric in stacked_metrics:
     454#      content += stacked_metric
     455#      content += ' ' + ' ' * (15 - len(stacked_metric))
     456#   content += "\n"
     457#   for app in apps:
     458#      if app != apps[0]:
     459#         for i in range(0, len(stacked_metrics)):
     460#            content += "%-15f" % 0.0
     461#         content += "\n"
     462#      for i in nb_procs[1:len(nb_procs)]:
     463#         for stacked_metric in stacked_metrics:
     464#            metric_val = metrics_val[prot][app][norm_factor_value]['total_stacked'] # Normalisation
     465#            if metric_val != 0:
     466#               content += "%-15f" % (float(metrics_val[prot][app][i][stacked_metric]) / metric_val)
     467#            else:
     468#               content += "%-15f" % 0
     469#         content += "\n"
     470#   
     471#   create_file(data_stacked_name, content)
     472#   # Calling gnuplot
     473#   print "gnuplot", gp_stacked_name
     474#   subprocess.call([ 'gnuplot', gp_stacked_name ])
    469475
    470476
     
    508514            xpos += 3
    509515      app_name_xpos = float((xpos_first + xpos_last)) / 2
    510       app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos)
     516      app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,28\"\n" % (m_app_name[apps[num_appli]], app_name_xpos)
    511517      #xpos += 1
    512518   xtics_str += ")"
     
    518524      n += 1
    519525   
    520    ylabel_str = "Coherence Cost Compared to Direct Requests Cost,\\nNormalized per Application for each Number of Processors"
     526   ylabel_str = "Coherence Cost Vs. Direct Requests Cost,\\nNormalized w.r.t. Direct Requests Cost"
    521527   content = template % dict(svg_name = os.path.join(graph_dir, prot + '_rel_cost'), xtics_str = xtics_str, plot_str = plot_str, ylabel_str = ylabel_str, app_labels = app_labels, prot_labels = "")
    522528   
     
    581587
    582588
    583 for app in apps:
    584 
    585    data_speedup_name = os.path.join(scripts_path, gen_dir, 'joint_' + app + '_speedup.dat')
    586    gp_speedup_name   = os.path.join(scripts_path, gen_dir, 'joint_' + app + '_speedup.gp')
    587    
    588    # Creating data file
    589    width = 15
    590    content = "#nb_procs"
    591    nb_spaces = width - len(content)
    592    content += nb_spaces * ' '
    593    content += "speedup\n"
    594 
    595    for i in nb_procs:
    596       content += "%-15d " % i
    597       for prot in joint_protocols:
    598          val = exec_time[prot][app][i]
    599          content += "%-15f " % (exec_time[joint_protocols[0]][app][1] / float(val))
    600       content += "\n"
    601 
    602    create_file(data_speedup_name, content)
    603    
    604    # Creating the gp file
    605    template_file = open(speedup_tmpl, 'r')
    606    template = template_file.read()
    607  
    608    plot_str = ""
    609    col = 2
    610    for prot in joint_protocols:
    611       if prot != joint_protocols[0]:
    612          plot_str += ", \\\n     "
    613       plot_str += "\"" + data_speedup_name + "\" using ($1):($" + str(col) + ") lc rgb %s title \"" % (colors[col - 2])  + m_prot_name[prot] + "\" with linespoint"
    614       col += 1
    615  
    616    gp_commands = template % dict(appli = m_app_name[app] + " Normalized w.r.t. " + m_prot_name[joint_protocols[0]] + " on 1 Processor", nb_procs = nb_procs[-1] + 1, plot_str = plot_str, svg_name = os.path.join(graph_dir, 'joint_' + app + '_speedup'))
    617    
    618    create_file(gp_speedup_name, gp_commands)
    619    
    620    # Calling gnuplot
    621    print "gnuplot", gp_speedup_name
    622    subprocess.call([ 'gnuplot', gp_speedup_name ])
     589#if 1 in nb_procs:
     590#   for app in apps:
     591#   
     592#      data_speedup_name = os.path.join(scripts_path, gen_dir, 'joint_' + app + '_speedup.dat')
     593#      gp_speedup_name   = os.path.join(scripts_path, gen_dir, 'joint_' + app + '_speedup.gp')
     594#     
     595#      # Creating data file
     596#      width = 15
     597#      content = "#nb_procs"
     598#      nb_spaces = width - len(content)
     599#      content += nb_spaces * ' '
     600#      content += "speedup\n"
     601#   
     602#      for i in nb_procs:
     603#         content += "%-15d " % i
     604#         for prot in joint_protocols:
     605#            val = exec_time[prot][app][i]
     606#            content += "%-15f " % (exec_time[joint_protocols[0]][app][1] / float(val))
     607#         content += "\n"
     608#   
     609#      create_file(data_speedup_name, content)
     610#     
     611#      # Creating the gp file
     612#      template_file = open(speedup_tmpl, 'r')
     613#      template = template_file.read()
     614#     
     615#      plot_str = ""
     616#      col = 2
     617#      for prot in joint_protocols:
     618#         if prot != joint_protocols[0]:
     619#            plot_str += ", \\\n     "
     620#         plot_str += "\"" + data_speedup_name + "\" using ($1):($" + str(col) + ") lc rgb %s title \"" % (colors[col - 2])  + m_prot_name[prot] + "\" with linespoint"
     621#         col += 1
     622#     
     623#      gp_commands = template % dict(appli = m_app_name[app] + " Normalized w.r.t. " + m_prot_name[joint_protocols[0]] + " on 1 Processor", nb_procs = nb_procs[-1] + 1, plot_str = plot_str, svg_name = os.path.join(graph_dir, 'joint_' + app + '_speedup'))
     624#     
     625#      create_file(gp_speedup_name, gp_commands)
     626#     
     627#      # Calling gnuplot
     628#      print "gnuplot", gp_speedup_name
     629#      subprocess.call([ 'gnuplot', gp_speedup_name ])
    623630
    624631
     
    638645template_file = open(stacked_tmpl, 'r')
    639646template = template_file.read()
    640   
     647 
    641648xtics_str = "("
    642649first = True
    643 xpos = 1 # successive x position of the center of the first bar in a application
     650barwidth = 1
     651xpos = 1 # successive x position of the center of the first bar in an application
    644652app_labels = ""
    645653prot_labels = ""
     
    650658         x = 0 # local var for computing position of protocol names
    651659         for prot in joint_protocols:
    652             prot_labels += "set label \"%s\" at first %f, character 2 center font \"Times,10\"\n" % (m_prot_name[prot], float((xpos - 0.5)) + x) # -0.5 instead of +0.5, don't know why... (bug gnuplot?)
     660            prot_labels += "set label \"%s\" at first %f, character 2 center font \"Times,10\" rotate by 45\n" % (m_prot_name[prot], float((xpos - 0.5)) + x - 1) # -0.5 instead of +0.5, don't know why... (bug gnuplot?)
    653661            x += 2
    654662
     
    660668            xpos_first = xpos
    661669         xtics_str += "\"%d\" %f -1" % (i, float(xpos - 0.5 + len(joint_protocols)))
     670         #xtics_str += "\"\" %f -1" % (float(xpos - 0.5 + len(joint_protocols))) # not to have proc number displayed
    662671         xpos_last = xpos
    663          xpos += 1 + len(joint_protocols) * 2
    664    app_name_xpos = float((xpos_first + xpos_last)) / 2
     672         xpos += 1 + len(joint_protocols) * 2 * barwidth
     673   app_name_xpos = float((xpos_first + xpos_last)) / 2 + 2
    665674   app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos)
    666    xpos += 1
     675   #xpos += 1
    667676xtics_str += ")"
    668677
     
    673682   n += 1
    674683
    675 ylabel_str = "Coherence Cost and Direct Requests Cost,\\nNormalized per Application for each Number of Processors"
     684ylabel_str = "Coherence Cost vs. Direct Requests Cost,\\nNormalized per Application for each Number of Processors"
    676685content = template % dict(svg_name = os.path.join(graph_dir, 'joint_rel_cost'), xtics_str = xtics_str, plot_str = plot_str, ylabel_str = ylabel_str, app_labels = app_labels, prot_labels = prot_labels)
    677686
     
    800809
    801810
    802 
    803 
     811#########################################################################################################
     812### Graph 10: Normalized exec times with no log scale: when scalability is achieved by constant time  ###
     813#########################################################################################################
     814
     815
     816if 1 in nb_procs:
     817   for app in apps:
     818   
     819      data_speedup_name = os.path.join(scripts_path, gen_dir, 'joint_' + app + '_cst_exec_time.dat')
     820      gp_speedup_name   = os.path.join(scripts_path, gen_dir, 'joint_' + app + '_cst_exec_time.gp')
     821     
     822      # Creating data file
     823      width = 15
     824      content = "#nb_procs"
     825      nb_spaces = width - len(content)
     826      content += nb_spaces * ' '
     827      content += "norm_exec_time\n"
     828   
     829      for i in nb_procs:
     830         content += "%-15d " % i
     831         for prot in joint_protocols:
     832            val = exec_time[prot][app][i]
     833            content += "%-15f " % (float(val) / exec_time[joint_protocols[0]][app][1])
     834         content += "\n"
     835   
     836      create_file(data_speedup_name, content)
     837     
     838      # Creating the gp file
     839      template_file = open(cst_exec_time_tmpl, 'r')
     840      template = template_file.read()
     841     
     842      plot_str = ""
     843      col = 2
     844      for prot in joint_protocols:
     845         if prot != joint_protocols[0]:
     846            plot_str += ", \\\n     "
     847         plot_str += "\"" + data_speedup_name + "\" using ($1):($" + str(col) + ") lc rgb %s title \"" % (colors[col - 2])  + m_prot_name[prot] + "\" with linespoint"
     848         col += 1
     849     
     850      gp_commands = template % dict(appli = m_app_name[app] + " Normalized w.r.t. " + m_prot_name[joint_protocols[0]] + " on 1 Processor", nb_procs = nb_procs[-1] + 1, plot_str = plot_str, svg_name = os.path.join(graph_dir, 'joint_' + app + '_cst_exec_time'))
     851     
     852      create_file(gp_speedup_name, gp_commands)
     853     
     854      # Calling gnuplot
     855      print "gnuplot", gp_speedup_name
     856      subprocess.call([ 'gnuplot', gp_speedup_name ])
     857
     858
     859
  • trunk/platforms/tsar_generic_xbar/scripts/gen_arch_info.py

    r1023 r1048  
    2929    print "        BSTTY=0x%x" % bstty
    3030    print "        BSDMA=0x%x" % bsdma
     31    print "        BSHCRYPT=0" # Not supported
    3132    print " "
    3233    print " "
  • trunk/platforms/tsar_generic_xbar/scripts/run_simus.py

    r1023 r1048  
    1717bscpu = 0 # bootstrap CPU
    1818nb_procs = [ 4 ]
    19 #nb_procs = [ 1, 4, 8, 16, 32, 64, 128, 256 ]
     19#nb_procs = [ 1, 2, 4, 8, 16, 32, 64, 128, 256 ]
    2020rerun_stats = False
    21 use_omp = False
    22 protocol = 'rwt'
     21use_omp = True
     22protocol = 'dhccp'
    2323cpu_per_cluster = 4
    2424# mode must be one of 'test' and 'simu'
     
    2727#apps = [ 'cholesky', 'fft', 'fft_ga', 'filter', 'filt_ga', 'histogram', 'kmeans', 'lu', 'mandel', 'mat_mult', 'pca', 'radix_ga' ]
    2828#apps = [ 'histogram', 'mandel', 'filter', 'radix_ga', 'fft_ga', 'kmeans' ]
    29 #apps = [ 'blackscholes', 'linear_regression', 'string_match', 'swaptions', 'fluidanimate' ]
    30 apps = [ 'hello', 'taquin', '2048' ]
    31 
    32 
    33 # Variables which could be changed but ought not to because they are reflected in the create_graphs.py script
     29apps = [ 'fal_sh_2' ]
     30
     31#apps = [ 'pca-opt', 'blackscholes', 'fft_ga', 'filt_ga', 'histo-opt', 'kmeans-opt', 'linear_regression', 'lu', 'mandel', 'radix_ga', 'string_match' ]
     32#apps = [ 'pca-opt', 'blackscholes', 'fft_ga', 'filt_ga', 'histo-opt', 'kmeans-opt', 'linear_regression', 'lu', 'mandel', 'mat_mult-opt', 'radix_ga', 'string_match' ]
     33
    3434if mode == 'test':
    3535    data_dir = 'data_test'
    3636else:
    3737    data_dir = 'data'
    38 log_init_name = protocol + '_stdo_'
     38
     39# Variables which could be changed but ought not to because they are reflected in the create_graphs.py script
     40
     41log_stdo_name = protocol + '_stdo_'
    3942log_term_name = protocol + '_term_'
    4043
     44
    4145# Global Variables
    4246
    43 all_apps = [ '2048', 'blackscholes', 'boot_only', 'cholesky', 'fft', 'fft_ga', 'filter', 'filt_ga', 'fluidanimate', 'hello', 'histogram', 'histo-opt', 'kmeans', 'kmeans-opt', 'linear_regression', 'lu', 'mandel', 'mat_mult', 'mat_mult-opt', 'pca', 'pca-opt', 'radix', 'radix_ga', 'showimg', 'string_match', 'swaptions', 'taquin']
     47all_modes = ['simu', 'test']
     48all_apps = [ 'blackscholes', 'boot_only', 'cholesky', 'fal_sh_1', 'fal_sh_2', 'fft', 'fft_ga', 'filter', 'filt_ga', 'fluidanimate', 'hello', 'histogram', 'histo-opt', 'kmeans', 'kmeans-opt', 'linear_regression', 'lu', 'mandel', 'mat_mult', 'mat_mult-opt', 'pca', 'pca-opt', 'radix', 'radix_ga', 'showimg', 'string_match', 'swaptions', ]
    4449# to come: 'barnes', 'fmm', 'ocean', 'raytrace', 'radiosity', 'waters', 'watern'
    4550
     
    6065hard_config_name      = os.path.join(almos_path, "hard_config.h")
    6166bootloader_file_name  = os.path.join(almos_path, "bootloader-tsar-mipsel.bin")
    62 preloader_file_name   = os.path.join(almos_path, "preloader.elf")
     67#preloader_file_name   = os.path.join(almos_path, "preloader.elf")
    6368preloader_build_path  = os.path.join(almos_path, "build_preloader")
    6469bootloader_build_path = os.path.join(almos_path, "build_bootloader")
     
    227232    for common_module in common_modules:
    228233        f.write("config.addDescPath(\"%s/%s\")\n" % (tsar_dir, common_module))
    229     #f.write("\n")
    230234
    231235    if protocol == "dhccp":
     
    243247        f.write("config.addDescPath(\"%s/%s\")\n" % (arch_dir, specific_module))
    244248
    245     #f.write("\n")
    246249    f.close()
    247250
     
    330333    print "cd", preloader_src_dir
    331334    os.chdir(preloader_src_dir)
    332     cmd = ['make', hard_conf_path_set, bscpu_set, 'USE_DT=0', 'BUILD_DIR=%s' % (preloader_build_path)]
     335    cmd = ['make', hard_conf_path_set, bscpu_set, 'BLOCK_SIZE=4096', 'USE_32BIT=1', 'USE_DT=0', 'BUILD_DIR=%s' % (preloader_build_path)]
    333336    retval = print_and_call(cmd)
    334337    if retval != 0:
     
    406409        elif (app_name == "boot_only"):
    407410            shrc = "exec -p 0 /bin/boot_onl\n"
     411        elif (app_name == "fal_sh_1"):
     412            shrc = "exec -p 0 /bin/fal_sh_1 -n %(nproc)d -p %(niter)d\n" % dict(nproc = nprocs, niter = 100)
     413        elif (app_name == "fal_sh_2"):
     414            shrc = "exec -p 0 /bin/fal_sh_2 -n %(nproc)d -p %(niter)d\n" % dict(nproc = nprocs, niter = 100)
    408415        elif (app_name == "filter"):
    409416            shrc = "exec -p 0 /bin/filter -l 128 -c 128 -n %(nproc)d -i /etc/img128.raw\n" % dict(nproc = nprocs)
     
    460467        elif (app_name == "cholesky"):
    461468            shrc = "exec -p 0 /bin/cholesky -n%(nproc)d /etc/tk14.O\n" % dict(nproc = nprocs)
     469        elif (app_name == "fal_sh_1"):
     470            shrc = "exec -p 0 /bin/fal_sh_1 -n %(nproc)d -p %(niter)d\n" % dict(nproc = nprocs, niter = 10000)
     471        elif (app_name == "fal_sh_2"):
     472            shrc = "exec -p 0 /bin/fal_sh_2 -n %(nproc)d -p %(niter)d\n" % dict(nproc = nprocs, niter = 10000)
    462473        elif (app_name == "fft"):
    463474            shrc = "exec -p 0 /bin/fft -n%(nproc)d -m18\n" % dict(nproc = nprocs)
     
    533544print_and_call(cmd)
    534545
    535 #gen_sym_links()
    536546gen_soclib_conf()
    537547compile_almos()
     
    580590        else:
    581591            cmd = ['./simul.x']
    582         filename = os.path.join(scripts_path, data_dir, app + '_' + log_init_name + str(i))
     592        filename = os.path.join(scripts_path, data_dir, app + '_' + log_stdo_name + str(i))
    583593        output = print_and_popen(cmd, filename)
    584594 
     
    613623            else:
    614624                cmd = ['./simul.x', '--reset-counters', start2, '--dump-counters', end]
    615             filename = os.path.join(scripts_path, data_dir, app + '_' + log_init_name + str(i))
     625            filename = os.path.join(scripts_path, data_dir, app + '_' + log_stdo_name + str(i))
    616626            output = print_and_popen(cmd, filename)
    617627           
  • trunk/platforms/tsar_generic_xbar/scripts/templates/metric_template.gp

    r1012 r1048  
    11
    2 set terminal svg size 1000 300 fixed
     2set terminal svg size 1200 300 fixed
    33set output "%(svg_name)s.svg"
    44
  • trunk/platforms/tsar_generic_xbar/scripts/templates/speedup_template.gp

    r1012 r1048  
    33set output "%(svg_name)s.svg"
    44
    5 set ylabel "Speedup for %(appli)s" font "Times,12"
    6 set xlabel "Number of Cores" font "Times,12"
     5#set ylabel "Speedup for %(appli)s" font "Times,12"
     6#set xlabel "Number of Cores" font "Times,12"
    77
    88set xrange [1:%(nb_procs)d]
     
    1515set grid mytics
    1616
     17set ytics font "Times,16"
     18set xtics font "Times,16"
     19
    1720set logscale x 2
    1821set logscale y 2
  • trunk/platforms/tsar_generic_xbar/scripts/templates/stacked_template.gp

    r779 r1048  
    11
    2 set terminal svg size 1500 500 fixed
     2set terminal svg size 2500 500 fixed
    33set output "%(svg_name)s.svg"
    44
     
    2424
    2525# border : ne croise pas l'axe ; in : a l'interieur ; scale : taille (major,minor) ; offset : offset du texte
    26 set xtics border in scale 0.0,0.0 nomirror rotate by 0 offset character 0,0 font "Times,10"
     26set xtics border in scale 0.0,0.0 nomirror rotate by 0 offset character 0,0 font "Times,19"
    2727set ytics border out scale 1,0.5 nomirror norotate offset character 0,0
    2828
     
    3030
    3131set xlabel " "
    32 set ylabel "%(ylabel_str)s" font "Times,14"
     32set ylabel "%(ylabel_str)s" font "Times,24"
    3333
    3434%(app_labels)s
  • trunk/platforms/tsar_generic_xbar/top.cpp

    r1023 r1048  
    9595
    9696#define USE_ALMOS 1
    97 //#define USE_GIET
    98 
    99 #ifdef USE_ALMOS
    100 #ifdef USE_GIET
    101 #error "Can't use Two different OS"
    102 #endif
    103 #endif
    104 
    105 #ifndef USE_ALMOS
    106 #ifndef USE_GIET
    107 #error "You need to specify one OS"
    108 #endif
    109 #endif
     97
    11098
    11199#ifdef USE_ALMOS
     
    113101   #include "almos/hard_config.h"
    114102#endif
    115 #ifdef USE_GIET
    116    #define PREFIX_OS "giet_vm/"
    117 #endif
    118103
    119104///////////////////////////////////////////////////
     
    122107
    123108
    124 #if USE_OPENMP
    125 #include <omp.h>
     109#ifdef USE_OPENMP
     110    #include <omp.h>
    126111#endif
    127112
     
    152137#ifdef USE_ALMOS
    153138#define vci_address_width     32
    154 #endif
    155 #ifdef USE_GIET
    156 #define vci_address_width     40
    157139#endif
    158140#define vci_plen_width        8
     
    185167#define FBUF_Y_SIZE           1024
    186168#endif
    187 #ifdef USE_GIET
    188 #define FBUF_X_SIZE           128
    189 #define FBUF_Y_SIZE           128
    190 #endif
    191 
    192 #ifdef USE_GIET
    193 #define BDEV_SECTOR_SIZE      512
    194 #define BDEV_IMAGE_NAME       PREFIX_OS"display/images.raw"
    195 #endif
     169
    196170#ifdef USE_ALMOS
    197171#define BDEV_SECTOR_SIZE      4096
     
    214188#ifdef USE_ALMOS
    215189#define soft_name       PREFIX_OS"preloader.elf"
    216 #endif
    217 #ifdef USE_GIET
    218 #define soft_pathname   PREFIX_OS"soft.elf"
    219190#endif
    220191
     
    244215#endif
    245216
    246 #ifdef USE_ALMOS
    247    // 2^19 is the offset for the local id (8 bits for global ID :
    248    // 1 bit for Memcache or Peripheral, 4 for local peripheral id)
    249    // (Almos supports 32 bits physical addresses)
    250 #endif
    251 
    252217bool stop_called = false;
     218
     219using namespace sc_core;
     220using namespace soclib::caba;
     221using namespace soclib::common;
    253222
    254223/////////////////////////////////
    255224int _main(int argc, char *argv[])
    256225{
    257    using namespace sc_core;
    258    using namespace soclib::caba;
    259    using namespace soclib::common;
    260 
    261    const int64_t max_cycles   = 5000000;             // Maximum number of cycles simulated in one sc_start call
    262    int64_t ncycles            = 0x7FFFFFFFFFFFFFFF;  // simulated cycles
    263    char     disk_name[256]    = BDEV_IMAGE_NAME;    // pathname to the disk image
    264    char     nic_rx_name[256]  = NIC_RX_NAME;        // pathname to the rx packets file
    265    char     nic_tx_name[256]  = NIC_TX_NAME;        // pathname to the tx packets file
    266    ssize_t  threads_nr        = 1;                  // simulator's threads number
    267    bool     debug_ok          = false;              // trace activated
    268    size_t   debug_period      = 1;                  // trace period
    269    size_t   debug_memc_id     = 0;                  // index of memc to be traced
    270    size_t   debug_proc_id     = 0;                  // index of proc to be traced
    271    int64_t  debug_from        = 0;                  // trace start cycle
    272    int64_t  frozen_cycles     = MAX_FROZEN_CYCLES;  // monitoring frozen processor
    273    int64_t  reset_counters    = -1;
    274    int64_t  dump_counters     = -1;
    275    bool     do_reset_counters = false;
    276    bool     do_dump_counters  = false;
    277    struct   timeval t1, t2;
    278    uint64_t ms1, ms2;
    279 
    280    ////////////// command line arguments //////////////////////
    281    if (argc > 1) {
    282       for (int n = 1; n < argc; n = n + 2) {
    283          if ((strcmp(argv[n], "-NCYCLES") == 0) && (n + 1 < argc)) {
    284             ncycles = (int64_t) strtol(argv[n + 1], NULL, 0);
    285          }
    286          else if ((strcmp(argv[n], "-SOFT") == 0) && (n + 1 < argc)) {
     226
     227    const int64_t max_cycles   = 5000000;            // Maximum number of cycles simulated in one sc_start call
     228    int64_t  ncycles           = 0x7FFFFFFFFFFFFFFF; // simulated cycles
     229    char     disk_name[256]    = BDEV_IMAGE_NAME;    // pathname to the disk image
     230    char     nic_rx_name[256]  = NIC_RX_NAME;        // pathname to the rx packets file
     231    char     nic_tx_name[256]  = NIC_TX_NAME;        // pathname to the tx packets file
     232    ssize_t  threads_nr        = 1;                  // simulator's threads number
     233    bool     debug_ok          = false;              // trace activated
     234    size_t   debug_period      = 1;                  // trace period
     235    size_t   debug_memc_id     = 0;                  // index of memc to be traced
     236    size_t   debug_proc_id     = 0;                  // index of proc to be traced
     237    int64_t  debug_from        = 0;                  // trace start cycle
     238    int64_t  frozen_cycles     = MAX_FROZEN_CYCLES;  // monitoring frozen processor
     239    int64_t  reset_counters    = -1;
     240    int64_t  dump_counters     = -1;
     241    bool     do_reset_counters = false;
     242    bool     do_dump_counters  = false;
     243    struct   timeval t1, t2;
     244    uint64_t ms1, ms2;
     245
     246    ////////////// command line arguments //////////////////////
     247    if (argc > 1) {
     248        for (int n = 1; n < argc; n = n + 2) {
     249            if ((strcmp(argv[n], "-NCYCLES") == 0) && (n + 1 < argc)) {
     250                ncycles = (int64_t) strtol(argv[n + 1], NULL, 0);
     251            }
     252            else if ((strcmp(argv[n], "-SOFT") == 0) && (n + 1 < argc)) {
    287253#ifdef USE_ALMOS
    288             assert( 0 && "Can't define almos soft name" );
    289 #endif
    290 #ifdef USE_GIET
    291             strcpy(soft_name, argv[n + 1]);
    292 #endif
    293          }
    294          else if ((strcmp(argv[n],"-DISK") == 0) && (n + 1 < argc)) {
    295             strcpy(disk_name, argv[n + 1]);
    296          }
    297          else if ((strcmp(argv[n],"-DEBUG") == 0) && (n + 1 < argc)) {
    298             debug_ok = true;
    299             debug_from = (int64_t) strtol(argv[n + 1], NULL, 0);
    300          }
    301          else if ((strcmp(argv[n], "-MEMCID") == 0) && (n + 1 < argc)) {
    302             debug_memc_id = (size_t) strtol(argv[n + 1], NULL, 0);
     254                assert( 0 && "Can't define almos soft name" );
     255#endif
     256            }
     257            else if ((strcmp(argv[n],"-DISK") == 0) && (n + 1 < argc)) {
     258                strcpy(disk_name, argv[n + 1]);
     259            }
     260            else if ((strcmp(argv[n],"-DEBUG") == 0) && (n + 1 < argc)) {
     261                debug_ok = true;
     262                debug_from = (int64_t) strtol(argv[n + 1], NULL, 0);
     263            }
     264            else if ((strcmp(argv[n], "-MEMCID") == 0) && (n + 1 < argc)) {
     265                debug_memc_id = (size_t) strtol(argv[n + 1], NULL, 0);
    303266#ifdef USE_ALMOS
    304             assert((debug_memc_id < (X_SIZE * Y_SIZE)) &&
    305                    "debug_memc_id larger than X_SIZE * Y_SIZE" );
     267                assert((debug_memc_id < (X_SIZE * Y_SIZE)) &&
     268                        "debug_memc_id larger than X_SIZE * Y_SIZE" );
    306269#else
    307             size_t x = debug_memc_id >> Y_WIDTH;
    308             size_t y = debug_memc_id & ((1 << Y_WIDTH) - 1);
    309 
    310             assert( (x <= X_SIZE) and (y <= Y_SIZE) &&
    311                   "MEMCID parameter refers a not valid memory cache");
    312 #endif
    313          }
    314          else if ((strcmp(argv[n], "-PROCID") == 0) && (n + 1 < argc)) {
    315             debug_proc_id = (size_t) strtol(argv[n + 1], NULL, 0);
     270                size_t x = debug_memc_id >> Y_WIDTH;
     271                size_t y = debug_memc_id & ((1 << Y_WIDTH) - 1);
     272
     273                assert( (x <= X_SIZE) and (y <= Y_SIZE) &&
     274                        "MEMCID parameter refers a not valid memory cache");
     275#endif
     276            }
     277            else if ((strcmp(argv[n], "-PROCID") == 0) && (n + 1 < argc)) {
     278                debug_proc_id = (size_t) strtol(argv[n + 1], NULL, 0);
    316279#ifdef USE_ALMOS
    317             assert((debug_proc_id < (X_SIZE * Y_SIZE * NB_PROCS_MAX)) &&
    318                    "debug_proc_id larger than X_SIZE * Y_SIZE * NB_PROCS");
     280                assert((debug_proc_id < (X_SIZE * Y_SIZE * NB_PROCS_MAX)) &&
     281                        "debug_proc_id larger than X_SIZE * Y_SIZE * NB_PROCS");
    319282#else
    320             size_t cluster_xy = debug_proc_id / NB_PROCS_MAX ;
    321             size_t x = cluster_xy >> Y_WIDTH;
    322             size_t y = cluster_xy & ((1 << Y_WIDTH) - 1);
    323 
    324             assert( (x <= X_SIZE) and (y <= Y_SIZE) &&
    325                   "PROCID parameter refers a not valid processor");
    326 #endif
    327          }
    328          else if ((strcmp(argv[n], "-THREADS") == 0) && ((n + 1) < argc)) {
    329             threads_nr = (ssize_t) strtol(argv[n + 1], NULL, 0);
    330             threads_nr = (threads_nr < 1) ? 1 : threads_nr;
    331          }
    332          else if ((strcmp(argv[n], "-FROZEN") == 0) && (n + 1 < argc)) {
    333             frozen_cycles = (int64_t) strtol(argv[n + 1], NULL, 0);
    334          }
    335          else if ((strcmp(argv[n], "-PERIOD") == 0) && (n + 1 < argc)) {
    336             debug_period = (size_t) strtol(argv[n + 1], NULL, 0);
    337          }
    338          else if ((strcmp(argv[n], "--reset-counters") == 0) && (n + 1 < argc)) {
    339             reset_counters = (int64_t) strtol(argv[n + 1], NULL, 0);
    340             do_reset_counters = true;
    341          }
    342          else if ((strcmp(argv[n], "--dump-counters") == 0) && (n + 1 < argc)) {
    343             dump_counters = (int64_t) strtol(argv[n + 1], NULL, 0);
    344             do_dump_counters = true;
    345          }
    346          else {
    347             std::cout << "   Arguments are (key,value) couples." << std::endl;
    348             std::cout << "   The order is not important." << std::endl;
    349             std::cout << "   Accepted arguments are :" << std::endl << std::endl;
    350             std::cout << "     -SOFT pathname_for_embedded_soft" << std::endl;
    351             std::cout << "     -DISK pathname_for_disk_image" << std::endl;
    352             std::cout << "     -NCYCLES number_of_simulated_cycles" << std::endl;
    353             std::cout << "     -DEBUG debug_start_cycle" << std::endl;
    354             std::cout << "     -THREADS simulator's threads number" << std::endl;
    355             std::cout << "     -FROZEN max_number_of_lines" << std::endl;
    356             std::cout << "     -PERIOD number_of_cycles between trace" << std::endl;
    357             std::cout << "     -MEMCID index_memc_to_be_traced" << std::endl;
    358             std::cout << "     -PROCID index_proc_to_be_traced" << std::endl;
    359             exit(0);
    360          }
    361       }
    362    }
     283                size_t cluster_xy = debug_proc_id / NB_PROCS_MAX ;
     284                size_t x = cluster_xy >> Y_WIDTH;
     285                size_t y = cluster_xy & ((1 << Y_WIDTH) - 1);
     286
     287                assert( (x <= X_SIZE) and (y <= Y_SIZE) &&
     288                        "PROCID parameter refers a not valid processor");
     289#endif
     290            }
     291            else if ((strcmp(argv[n], "-THREADS") == 0) && ((n + 1) < argc)) {
     292                threads_nr = (ssize_t) strtol(argv[n + 1], NULL, 0);
     293                threads_nr = (threads_nr < 1) ? 1 : threads_nr;
     294            }
     295            else if ((strcmp(argv[n], "-FROZEN") == 0) && (n + 1 < argc)) {
     296                frozen_cycles = (int64_t) strtol(argv[n + 1], NULL, 0);
     297            }
     298            else if ((strcmp(argv[n], "-PERIOD") == 0) && (n + 1 < argc)) {
     299                debug_period = (size_t) strtol(argv[n + 1], NULL, 0);
     300            }
     301            else if ((strcmp(argv[n], "--reset-counters") == 0) && (n + 1 < argc)) {
     302                reset_counters = (int64_t) strtol(argv[n + 1], NULL, 0);
     303                do_reset_counters = true;
     304            }
     305            else if ((strcmp(argv[n], "--dump-counters") == 0) && (n + 1 < argc)) {
     306                dump_counters = (int64_t) strtol(argv[n + 1], NULL, 0);
     307                do_dump_counters = true;
     308            }
     309            else {
     310                std::cout << "   Arguments are (key,value) couples." << std::endl;
     311                std::cout << "   The order is not important." << std::endl;
     312                std::cout << "   Accepted arguments are :" << std::endl << std::endl;
     313                std::cout << "     -SOFT pathname_for_embedded_soft" << std::endl;
     314                std::cout << "     -DISK pathname_for_disk_image" << std::endl;
     315                std::cout << "     -NCYCLES number_of_simulated_cycles" << std::endl;
     316                std::cout << "     -DEBUG debug_start_cycle" << std::endl;
     317                std::cout << "     -THREADS simulator's threads number" << std::endl;
     318                std::cout << "     -FROZEN max_number_of_lines" << std::endl;
     319                std::cout << "     -PERIOD number_of_cycles between trace" << std::endl;
     320                std::cout << "     -MEMCID index_memc_to_be_traced" << std::endl;
     321                std::cout << "     -PROCID index_proc_to_be_traced" << std::endl;
     322                exit(0);
     323            }
     324        }
     325    }
    363326
    364327    // checking hardware parameters
     
    383346    assert( (NB_NIC_CHANNELS < 9) and
    384347            "The NB_NIC_CHANNELS parameter must be smaller than 9" );
    385 
    386 #ifdef USE_GIET
    387     assert( (vci_address_width == 40) and
    388             "VCI address width with the GIET must be 40 bits" );
    389 #endif
    390348
    391349#ifdef USE_ALMOS
     
    431389                                    vci_wrplen_width> vci_param_ext;
    432390
    433 #if USE_OPENMP
    434    omp_set_dynamic(false);
    435    omp_set_num_threads(threads_nr);
    436    std::cerr << "Built with openmp version " << _OPENMP << std::endl;
    437 #endif
    438 
    439    // Define parameters depending on mesh size
    440    size_t   x_width;
    441    size_t   y_width;
     391#ifdef USE_OPENMP
     392    omp_set_dynamic(false);
     393    omp_set_num_threads(threads_nr);
     394    std::cerr << "Built with openmp version " << _OPENMP << std::endl;
     395    std::cerr << "Run with " << threads_nr << " threads" << std::endl;
     396#endif
     397
     398    // Define parameters depending on mesh size
     399    size_t   x_width;
     400    size_t   y_width;
    442401
    443402#ifdef USE_ALMOS
    444    if      (X_SIZE == 1) x_width = 0;
    445    else if (X_SIZE == 2) x_width = 1;
    446    else if (X_SIZE <= 4) x_width = 2;
    447    else if (X_SIZE <= 8) x_width = 3;
    448    else                  x_width = 4;
    449 
    450    if      (Y_SIZE == 1) y_width = 0;
    451    else if (Y_SIZE == 2) y_width = 1;
    452    else if (Y_SIZE <= 4) y_width = 2;
    453    else if (Y_SIZE <= 8) y_width = 3;
    454    else                  y_width = 4;
     403    if      (X_SIZE == 1) x_width = 0;
     404    else if (X_SIZE == 2) x_width = 1;
     405    else if (X_SIZE <= 4) x_width = 2;
     406    else if (X_SIZE <= 8) x_width = 3;
     407    else                  x_width = 4;
     408
     409    if      (Y_SIZE == 1) y_width = 0;
     410    else if (Y_SIZE == 2) y_width = 1;
     411    else if (Y_SIZE <= 4) y_width = 2;
     412    else if (Y_SIZE <= 8) y_width = 3;
     413    else                  y_width = 4;
    455414
    456415#else
    457    size_t x_width = X_WIDTH;
    458    size_t y_width = Y_WIDTH;
    459 
    460    assert((X_WIDTH <= 4) and (Y_WIDTH <= 4) and
    461            "Up to 256 clusters");
    462 
    463    assert((X_SIZE <= (1 << X_WIDTH)) and (Y_SIZE <= (1 << Y_WIDTH)) and
    464            "The X_WIDTH and Y_WIDTH parameter are insufficient");
    465 
    466 #endif
    467 
    468    /////////////////////
    469    //  Mapping Tables
    470    /////////////////////
    471 
    472    // internal network
    473    MappingTable maptabd(vci_address_width,
    474                         IntTab(x_width + y_width, 16 - x_width - y_width),
    475                         IntTab(x_width + y_width, vci_srcid_width - x_width - y_width),
    476                         0x00FF800000);
    477 
    478    for (size_t x = 0; x < X_SIZE; x++) {
    479       for (size_t y = 0; y < Y_SIZE; y++) {
    480          sc_uint<vci_address_width> offset;
    481          offset = (sc_uint<vci_address_width>) cluster(x,y)
    482                    << (vci_address_width - x_width - y_width);
    483 
    484          std::ostringstream    si;
    485          si << "seg_xicu_" << x << "_" << y;
    486          maptabd.add(Segment(si.str(), SEG_XCU_BASE + offset, SEG_XCU_SIZE,
    487                   IntTab(cluster(x,y), XCU_TGTID), false));
    488 
    489          std::ostringstream    sd;
    490          sd << "seg_mdma_" << x << "_" << y;
    491          maptabd.add(Segment(sd.str(), SEG_DMA_BASE + offset, SEG_DMA_SIZE,
    492                   IntTab(cluster(x,y), DMA_TGTID), false));
    493 
    494          std::ostringstream    sh;
    495          sh << "seg_memc_" << x << "_" << y;
    496          maptabd.add(Segment(sh.str(), SEG_RAM_BASE + offset, SEG_RAM_SIZE,
    497                   IntTab(cluster(x,y), RAM_TGTID), true));
    498 
    499          if (x == X_IO && y == Y_IO) {
    500             maptabd.add(Segment("seg_mtty", SEG_TTY_BASE, SEG_TTY_SIZE,
    501                         IntTab(cluster(x,y),TTY_TGTID), false));
    502             maptabd.add(Segment("seg_fbuf", SEG_FBF_BASE, SEG_FBF_SIZE,
    503                         IntTab(cluster(x,y),FBF_TGTID), false));
    504             maptabd.add(Segment("seg_bdev", SEG_IOC_BASE, SEG_IOC_SIZE,
    505                         IntTab(cluster(x,y),IOC_TGTID), false));
    506             maptabd.add(Segment("seg_brom", SEG_ROM_BASE, SEG_ROM_SIZE,
    507                         IntTab(cluster(x,y),ROM_TGTID), true));
    508             maptabd.add(Segment("seg_mnic", SEG_NIC_BASE, SEG_NIC_SIZE,
    509                         IntTab(cluster(x,y),NIC_TGTID), false));
    510             maptabd.add(Segment("seg_cdma", SEG_CMA_BASE, SEG_CMA_SIZE,
    511                         IntTab(cluster(x,y),CMA_TGTID), false));
    512             maptabd.add(Segment("seg_simh", SEG_SIM_BASE, SEG_SIM_SIZE,
    513                         IntTab(cluster(x,y),SIM_TGTID), false));
    514          }
    515       }
    516    }
    517    std::cout << maptabd << std::endl;
    518 
    519    // external network
    520    MappingTable maptabx(vci_address_width,
    521                         IntTab(x_width + y_width),
    522                         IntTab(x_width + y_width),
    523                         0xFFFF000000ULL);
    524 
    525    for (size_t x = 0; x < X_SIZE; x++) {
    526       for (size_t y = 0; y < Y_SIZE ; y++) {
    527 
    528          sc_uint<vci_address_width> offset;
    529          offset = (sc_uint<vci_address_width>) cluster(x,y)
    530                    << (vci_address_width - x_width - y_width);
    531 
    532          std::ostringstream sh;
    533          sh << "x_seg_memc_" << x << "_" << y;
    534 
    535          maptabx.add(Segment(sh.str(), SEG_RAM_BASE + offset,
    536                      SEG_RAM_SIZE, IntTab(cluster(x,y)), false));
    537       }
    538    }
    539    std::cout << maptabx << std::endl;
    540 
    541    ////////////////////
    542    // Signals
    543    ///////////////////
    544 
    545    sc_clock           signal_clk("clk");
    546    sc_signal<bool>    signal_resetn("resetn");
    547 
    548    // Horizontal inter-clusters DSPIN signals
    549    DspinSignals<dspin_cmd_width>** signal_dspin_h_cmd_inc =
    550       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_inc", X_SIZE - 1, Y_SIZE);
    551    DspinSignals<dspin_cmd_width>** signal_dspin_h_cmd_dec =
    552       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_dec", X_SIZE - 1, Y_SIZE);
    553 
    554    DspinSignals<dspin_rsp_width>** signal_dspin_h_rsp_inc =
    555       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_rsp_inc", X_SIZE - 1, Y_SIZE);
    556    DspinSignals<dspin_rsp_width>** signal_dspin_h_rsp_dec =
    557       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_rsp_dec", X_SIZE - 1, Y_SIZE);
    558 
    559    DspinSignals<dspin_cmd_width>** signal_dspin_h_m2p_inc =
    560       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_m2p_inc", X_SIZE- 1 , Y_SIZE);
    561    DspinSignals<dspin_cmd_width>** signal_dspin_h_m2p_dec =
    562       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_m2p_dec", X_SIZE - 1, Y_SIZE);
    563 
    564    DspinSignals<dspin_rsp_width>** signal_dspin_h_p2m_inc =
    565       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_p2m_inc", X_SIZE - 1, Y_SIZE);
    566    DspinSignals<dspin_rsp_width>** signal_dspin_h_p2m_dec =
    567       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_p2m_dec", X_SIZE - 1, Y_SIZE);
    568 
    569    DspinSignals<dspin_cmd_width>** signal_dspin_h_cla_inc =
    570       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cla_inc", X_SIZE - 1, Y_SIZE);
    571    DspinSignals<dspin_cmd_width>** signal_dspin_h_cla_dec =
    572       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cla_dec", X_SIZE - 1, Y_SIZE);
    573 
    574    // Vertical inter-clusters DSPIN signals
    575    DspinSignals<dspin_cmd_width>** signal_dspin_v_cmd_inc =
    576       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_inc", X_SIZE, Y_SIZE - 1);
    577    DspinSignals<dspin_cmd_width>** signal_dspin_v_cmd_dec =
    578       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_dec", X_SIZE, Y_SIZE - 1);
    579 
    580    DspinSignals<dspin_rsp_width>** signal_dspin_v_rsp_inc =
    581       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_rsp_inc", X_SIZE, Y_SIZE - 1);
    582    DspinSignals<dspin_rsp_width>** signal_dspin_v_rsp_dec =
    583       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_rsp_dec", X_SIZE, Y_SIZE - 1);
    584 
    585    DspinSignals<dspin_cmd_width>** signal_dspin_v_m2p_inc =
    586       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_m2p_inc", X_SIZE, Y_SIZE - 1);
    587    DspinSignals<dspin_cmd_width>** signal_dspin_v_m2p_dec =
    588       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_m2p_dec", X_SIZE, Y_SIZE - 1);
    589 
    590    DspinSignals<dspin_rsp_width>** signal_dspin_v_p2m_inc =
    591       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_p2m_inc", X_SIZE, Y_SIZE - 1);
    592    DspinSignals<dspin_rsp_width>** signal_dspin_v_p2m_dec =
    593       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_p2m_dec", X_SIZE, Y_SIZE - 1);
    594 
    595    DspinSignals<dspin_cmd_width>** signal_dspin_v_cla_inc =
    596       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cla_inc", X_SIZE, Y_SIZE - 1);
    597    DspinSignals<dspin_cmd_width>** signal_dspin_v_cla_dec =
    598       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cla_dec", X_SIZE, Y_SIZE - 1);
    599 
    600    // Mesh boundaries DSPIN signals (Most of those signals are not used...)
    601    DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cmd_in =
    602       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cmd_in" , X_SIZE, Y_SIZE, 4);
    603    DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cmd_out =
    604       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cmd_out", X_SIZE, Y_SIZE, 4);
    605 
    606    DspinSignals<dspin_rsp_width>*** signal_dspin_bound_rsp_in =
    607       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_rsp_in" , X_SIZE, Y_SIZE, 4);
    608    DspinSignals<dspin_rsp_width>*** signal_dspin_bound_rsp_out =
    609       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_rsp_out", X_SIZE, Y_SIZE, 4);
    610 
    611    DspinSignals<dspin_cmd_width>*** signal_dspin_bound_m2p_in =
    612       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_m2p_in" , X_SIZE, Y_SIZE, 4);
    613    DspinSignals<dspin_cmd_width>*** signal_dspin_bound_m2p_out =
    614       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_m2p_out", X_SIZE, Y_SIZE, 4);
    615 
    616    DspinSignals<dspin_rsp_width>*** signal_dspin_bound_p2m_in =
    617       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_p2m_in" , X_SIZE, Y_SIZE, 4);
    618    DspinSignals<dspin_rsp_width>*** signal_dspin_bound_p2m_out =
    619       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_p2m_out", X_SIZE, Y_SIZE, 4);
    620 
    621    DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cla_in =
    622       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cla_in" , X_SIZE, Y_SIZE, 4);
    623    DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cla_out =
    624       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cla_out", X_SIZE, Y_SIZE, 4);
    625 
    626 
    627    ////////////////////////////
    628    //      Loader   
    629    ////////////////////////////
    630 
    631    soclib::common::Loader loader(soft_name);
    632 
    633    typedef soclib::common::GdbServer<soclib::common::Mips32ElIss> proc_iss;
    634    proc_iss::set_loader(loader);
    635 
    636    ////////////////////////////
    637    // Clusters construction
    638    ////////////////////////////
    639 
    640    TsarXbarCluster<dspin_cmd_width,
    641                    dspin_rsp_width,
    642                    vci_param_int,
    643                    vci_param_ext> * clusters[X_SIZE][Y_SIZE];
    644 
    645 #if USE_OPENMP
     416    size_t x_width = X_WIDTH;
     417    size_t y_width = Y_WIDTH;
     418
     419    assert((X_WIDTH <= 4) and (Y_WIDTH <= 4) and
     420            "Up to 256 clusters");
     421
     422    assert((X_SIZE <= (1 << X_WIDTH)) and (Y_SIZE <= (1 << Y_WIDTH)) and
     423            "The X_WIDTH and Y_WIDTH parameter are insufficient");
     424
     425#endif
     426
     427    /////////////////////
     428    //  Mapping Tables
     429    /////////////////////
     430
     431    // internal network
     432    MappingTable maptabd(vci_address_width,
     433                         IntTab(x_width + y_width, 16 - x_width - y_width),
     434                         IntTab(x_width + y_width, vci_srcid_width - x_width - y_width),
     435                         0x00FF800000);
     436
     437    for (size_t x = 0; x < X_SIZE; x++) {
     438       for (size_t y = 0; y < Y_SIZE; y++) {
     439          sc_uint<vci_address_width> offset;
     440          offset = (sc_uint<vci_address_width>) cluster(x,y)
     441                    << (vci_address_width - x_width - y_width);
     442
     443          std::ostringstream    si;
     444          si << "seg_xicu_" << x << "_" << y;
     445          maptabd.add(Segment(si.str(), SEG_XCU_BASE + offset, SEG_XCU_SIZE,
     446                   IntTab(cluster(x,y), XCU_TGTID), false));
     447
     448          std::ostringstream    sd;
     449          sd << "seg_mdma_" << x << "_" << y;
     450          maptabd.add(Segment(sd.str(), SEG_DMA_BASE + offset, SEG_DMA_SIZE,
     451                   IntTab(cluster(x,y), DMA_TGTID), false));
     452
     453          std::ostringstream    sh;
     454          sh << "seg_memc_" << x << "_" << y;
     455          maptabd.add(Segment(sh.str(), SEG_RAM_BASE + offset, SEG_RAM_SIZE,
     456                   IntTab(cluster(x,y), RAM_TGTID), true));
     457
     458          if (x == X_IO && y == Y_IO) {
     459             maptabd.add(Segment("seg_mtty", SEG_TTY_BASE, SEG_TTY_SIZE,
     460                         IntTab(cluster(x,y),TTY_TGTID), false));
     461             maptabd.add(Segment("seg_fbuf", SEG_FBF_BASE, SEG_FBF_SIZE,
     462                         IntTab(cluster(x,y),FBF_TGTID), false));
     463             maptabd.add(Segment("seg_bdev", SEG_IOC_BASE, SEG_IOC_SIZE,
     464                         IntTab(cluster(x,y),IOC_TGTID), false));
     465             maptabd.add(Segment("seg_brom", SEG_ROM_BASE, SEG_ROM_SIZE,
     466                         IntTab(cluster(x,y),ROM_TGTID), true));
     467             maptabd.add(Segment("seg_mnic", SEG_NIC_BASE, SEG_NIC_SIZE,
     468                         IntTab(cluster(x,y),NIC_TGTID), false));
     469             maptabd.add(Segment("seg_cdma", SEG_CMA_BASE, SEG_CMA_SIZE,
     470                         IntTab(cluster(x,y),CMA_TGTID), false));
     471             maptabd.add(Segment("seg_simh", SEG_SIM_BASE, SEG_SIM_SIZE,
     472                         IntTab(cluster(x,y),SIM_TGTID), false));
     473          }
     474       }
     475    }
     476    std::cout << maptabd << std::endl;
     477
     478    // external network
     479    MappingTable maptabx(vci_address_width,
     480                         IntTab(x_width + y_width),
     481                         IntTab(x_width + y_width),
     482                         0xFFFF000000ULL);
     483
     484    for (size_t x = 0; x < X_SIZE; x++) {
     485       for (size_t y = 0; y < Y_SIZE ; y++) {
     486
     487          sc_uint<vci_address_width> offset;
     488          offset = (sc_uint<vci_address_width>) cluster(x,y)
     489                    << (vci_address_width - x_width - y_width);
     490
     491          std::ostringstream sh;
     492          sh << "x_seg_memc_" << x << "_" << y;
     493
     494          maptabx.add(Segment(sh.str(), SEG_RAM_BASE + offset,
     495                      SEG_RAM_SIZE, IntTab(cluster(x,y)), false));
     496       }
     497    }
     498    std::cout << maptabx << std::endl;
     499
     500    ////////////////////
     501    // Signals
     502    ///////////////////
     503
     504    sc_clock           signal_clk("clk");
     505    sc_signal<bool>    signal_resetn("resetn");
     506
     507    // Horizontal inter-clusters DSPIN signals
     508    DspinSignals<dspin_cmd_width>** signal_dspin_h_cmd_inc =
     509       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_inc", X_SIZE - 1, Y_SIZE);
     510    DspinSignals<dspin_cmd_width>** signal_dspin_h_cmd_dec =
     511       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_dec", X_SIZE - 1, Y_SIZE);
     512
     513    DspinSignals<dspin_rsp_width>** signal_dspin_h_rsp_inc =
     514       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_rsp_inc", X_SIZE - 1, Y_SIZE);
     515    DspinSignals<dspin_rsp_width>** signal_dspin_h_rsp_dec =
     516       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_rsp_dec", X_SIZE - 1, Y_SIZE);
     517
     518    DspinSignals<dspin_cmd_width>** signal_dspin_h_m2p_inc =
     519       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_m2p_inc", X_SIZE- 1 , Y_SIZE);
     520    DspinSignals<dspin_cmd_width>** signal_dspin_h_m2p_dec =
     521       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_m2p_dec", X_SIZE - 1, Y_SIZE);
     522
     523    DspinSignals<dspin_rsp_width>** signal_dspin_h_p2m_inc =
     524       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_p2m_inc", X_SIZE - 1, Y_SIZE);
     525    DspinSignals<dspin_rsp_width>** signal_dspin_h_p2m_dec =
     526       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_p2m_dec", X_SIZE - 1, Y_SIZE);
     527
     528    DspinSignals<dspin_cmd_width>** signal_dspin_h_cla_inc =
     529       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cla_inc", X_SIZE - 1, Y_SIZE);
     530    DspinSignals<dspin_cmd_width>** signal_dspin_h_cla_dec =
     531       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cla_dec", X_SIZE - 1, Y_SIZE);
     532
     533    // Vertical inter-clusters DSPIN signals
     534    DspinSignals<dspin_cmd_width>** signal_dspin_v_cmd_inc =
     535       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_inc", X_SIZE, Y_SIZE - 1);
     536    DspinSignals<dspin_cmd_width>** signal_dspin_v_cmd_dec =
     537       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_dec", X_SIZE, Y_SIZE - 1);
     538
     539    DspinSignals<dspin_rsp_width>** signal_dspin_v_rsp_inc =
     540       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_rsp_inc", X_SIZE, Y_SIZE - 1);
     541    DspinSignals<dspin_rsp_width>** signal_dspin_v_rsp_dec =
     542       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_rsp_dec", X_SIZE, Y_SIZE - 1);
     543
     544    DspinSignals<dspin_cmd_width>** signal_dspin_v_m2p_inc =
     545       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_m2p_inc", X_SIZE, Y_SIZE - 1);
     546    DspinSignals<dspin_cmd_width>** signal_dspin_v_m2p_dec =
     547       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_m2p_dec", X_SIZE, Y_SIZE - 1);
     548
     549    DspinSignals<dspin_rsp_width>** signal_dspin_v_p2m_inc =
     550       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_p2m_inc", X_SIZE, Y_SIZE - 1);
     551    DspinSignals<dspin_rsp_width>** signal_dspin_v_p2m_dec =
     552       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_p2m_dec", X_SIZE, Y_SIZE - 1);
     553
     554    DspinSignals<dspin_cmd_width>** signal_dspin_v_cla_inc =
     555       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cla_inc", X_SIZE, Y_SIZE - 1);
     556    DspinSignals<dspin_cmd_width>** signal_dspin_v_cla_dec =
     557       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cla_dec", X_SIZE, Y_SIZE - 1);
     558
     559    // Mesh boundaries DSPIN signals (Most of those signals are not used...)
     560    DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cmd_in =
     561       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cmd_in" , X_SIZE, Y_SIZE, 4);
     562    DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cmd_out =
     563       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cmd_out", X_SIZE, Y_SIZE, 4);
     564
     565    DspinSignals<dspin_rsp_width>*** signal_dspin_bound_rsp_in =
     566       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_rsp_in" , X_SIZE, Y_SIZE, 4);
     567    DspinSignals<dspin_rsp_width>*** signal_dspin_bound_rsp_out =
     568       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_rsp_out", X_SIZE, Y_SIZE, 4);
     569
     570    DspinSignals<dspin_cmd_width>*** signal_dspin_bound_m2p_in =
     571       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_m2p_in" , X_SIZE, Y_SIZE, 4);
     572    DspinSignals<dspin_cmd_width>*** signal_dspin_bound_m2p_out =
     573       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_m2p_out", X_SIZE, Y_SIZE, 4);
     574
     575    DspinSignals<dspin_rsp_width>*** signal_dspin_bound_p2m_in =
     576       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_p2m_in" , X_SIZE, Y_SIZE, 4);
     577    DspinSignals<dspin_rsp_width>*** signal_dspin_bound_p2m_out =
     578       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_p2m_out", X_SIZE, Y_SIZE, 4);
     579
     580    DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cla_in =
     581       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cla_in" , X_SIZE, Y_SIZE, 4);
     582    DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cla_out =
     583       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cla_out", X_SIZE, Y_SIZE, 4);
     584
     585
     586    ////////////////////////////
     587    //      Loader   
     588    ////////////////////////////
     589
     590    soclib::common::Loader loader(soft_name);
     591
     592    typedef soclib::common::GdbServer<soclib::common::Mips32ElIss> proc_iss;
     593    proc_iss::set_loader(loader);
     594
     595    ////////////////////////////
     596    // Clusters construction
     597    ////////////////////////////
     598
     599    TsarXbarCluster<dspin_cmd_width,
     600                    dspin_rsp_width,
     601                    vci_param_int,
     602                    vci_param_ext> * clusters[X_SIZE][Y_SIZE];
     603
     604#ifdef USE_OPENMP
    646605#pragma omp parallel
     606#endif
    647607    {
     608#ifdef USE_OPENMP
    648609#pragma omp for
    649610#endif
    650         for (size_t i = 0; i  < (X_SIZE * Y_SIZE); i++) {
    651             size_t x = i / Y_SIZE;
    652             size_t y = i % Y_SIZE;
    653 
    654 #if USE_OPENMP
     611    for (size_t i = 0; i  < (X_SIZE * Y_SIZE); i++) {
     612        size_t x = i / Y_SIZE;
     613        size_t y = i % Y_SIZE;
     614
     615#ifdef USE_OPENMP
    655616#pragma omp critical
    656             {
    657 #endif
     617#endif
     618        {
    658619            std::cout << std::endl;
    659620            std::cout << "Cluster_" << x << "_" << y << std::endl;
     
    663624            sc << "cluster_" << x << "_" << y;
    664625            clusters[x][y] = new TsarXbarCluster<dspin_cmd_width,
    665                                                  dspin_rsp_width,
    666                                                  vci_param_int,
    667                                                  vci_param_ext>
    668             (
    669                 sc.str().c_str(),
    670                 NB_PROCS_MAX,
    671                 NB_TTY_CHANNELS,
    672                 NB_DMA_CHANNELS,
    673                 x,
    674                 y,
    675                 cluster(x,y),
    676                 maptabd,
    677                 maptabx,
    678                 x_width,
    679                 y_width,
    680                 vci_srcid_width - x_width - y_width,   // l_id width,
    681                 P_WIDTH,
    682                 RAM_TGTID,
    683                 XCU_TGTID,
    684                 DMA_TGTID,
    685                 FBF_TGTID,
    686                 TTY_TGTID,
    687                 ROM_TGTID,
    688                 NIC_TGTID,
    689                 CMA_TGTID,
    690                 IOC_TGTID,
    691                 SIM_TGTID,
    692                 MEMC_WAYS,
    693                 MEMC_SETS,
    694                 L1_IWAYS,
    695                 L1_ISETS,
    696                 L1_DWAYS,
    697                 L1_DSETS,
    698                 IRQ_PER_PROCESSOR,
    699                 XRAM_LATENCY,
    700                 x == X_IO && y == Y_IO,
    701                 FBF_X_SIZE,
    702                 FBF_Y_SIZE,
    703                 disk_name,
    704                 BDEV_SECTOR_SIZE,
    705                 NB_NIC_CHANNELS,
    706                 nic_rx_name,
    707                 nic_tx_name,
    708                 NIC_TIMEOUT,
    709                 NB_CMA_CHANNELS,
    710                 loader,
    711                 frozen_cycles,
    712                 debug_from,
    713                 debug_ok,
    714                 debug_ok
    715             );
    716 
    717 #if USE_OPENMP
    718             } // end critical
    719 #endif
    720         } // end for
    721 #if USE_OPENMP
    722     }
    723 #endif
    724 
    725    ///////////////////////////////////////////////////////////////
    726    //     Net-list
    727    ///////////////////////////////////////////////////////////////
    728 
    729    // Clock & RESET
    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);
    734       }
    735    }
    736 
    737    // Inter Clusters horizontal connections
    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       }
    765    }
    766    std::cout << std::endl << "Horizontal connections done" << std::endl;
    767 
    768    // Inter Clusters vertical connections
    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       }
    796    }
    797    std::cout << std::endl << "Vertical connections done" << std::endl;
    798 
    799    // East & West boundary cluster connections
    800    for (size_t y = 0; y < Y_SIZE; y++) {
    801        clusters[0][y]->p_cmd_in[WEST]           (signal_dspin_bound_cmd_in[0][y][WEST]);
    802        clusters[0][y]->p_cmd_out[WEST]          (signal_dspin_bound_cmd_out[0][y][WEST]);
    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]);
    805 
    806        clusters[0][y]->p_rsp_in[WEST]           (signal_dspin_bound_rsp_in[0][y][WEST]);
    807        clusters[0][y]->p_rsp_out[WEST]          (signal_dspin_bound_rsp_out[0][y][WEST]);
    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]);
    810 
    811        clusters[0][y]->p_m2p_in[WEST]           (signal_dspin_bound_m2p_in[0][y][WEST]);
    812        clusters[0][y]->p_m2p_out[WEST]          (signal_dspin_bound_m2p_out[0][y][WEST]);
    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]);
    815 
    816        clusters[0][y]->p_p2m_in[WEST]           (signal_dspin_bound_p2m_in[0][y][WEST]);
    817        clusters[0][y]->p_p2m_out[WEST]          (signal_dspin_bound_p2m_out[0][y][WEST]);
    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]);
    820 
    821        clusters[0][y]->p_cla_in[WEST]           (signal_dspin_bound_cla_in[0][y][WEST]);
    822        clusters[0][y]->p_cla_out[WEST]          (signal_dspin_bound_cla_out[0][y][WEST]);
    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]);
    825    }
    826 
    827    std::cout << std::endl << "West & East boundaries connections done" << std::endl;
    828 
    829    // North & South boundary clusters connections
    830    for (size_t x = 0; x < X_SIZE; x++) {
    831        clusters[x][0]->p_cmd_in[SOUTH]          (signal_dspin_bound_cmd_in[x][0][SOUTH]);
    832        clusters[x][0]->p_cmd_out[SOUTH]         (signal_dspin_bound_cmd_out[x][0][SOUTH]);
    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]);
    835 
    836        clusters[x][0]->p_rsp_in[SOUTH]          (signal_dspin_bound_rsp_in[x][0][SOUTH]);
    837        clusters[x][0]->p_rsp_out[SOUTH]         (signal_dspin_bound_rsp_out[x][0][SOUTH]);
    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]);
    840 
    841        clusters[x][0]->p_m2p_in[SOUTH]          (signal_dspin_bound_m2p_in[x][0][SOUTH]);
    842        clusters[x][0]->p_m2p_out[SOUTH]         (signal_dspin_bound_m2p_out[x][0][SOUTH]);
    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]);
    845 
    846        clusters[x][0]->p_p2m_in[SOUTH]          (signal_dspin_bound_p2m_in[x][0][SOUTH]);
    847        clusters[x][0]->p_p2m_out[SOUTH]         (signal_dspin_bound_p2m_out[x][0][SOUTH]);
    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]);
    850 
    851        clusters[x][0]->p_cla_in[SOUTH]          (signal_dspin_bound_cla_in[x][0][SOUTH]);
    852        clusters[x][0]->p_cla_out[SOUTH]         (signal_dspin_bound_cla_out[x][0][SOUTH]);
    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]);
    855    }
    856 
    857    std::cout << std::endl << "North & South boundaries connections done" << std::endl;
    858    std::cout << std::endl;
     626                dspin_rsp_width,
     627                vci_param_int,
     628                vci_param_ext>
     629                    (
     630                     sc.str().c_str(),
     631                     NB_PROCS_MAX,
     632                     NB_TTY_CHANNELS,
     633                     NB_DMA_CHANNELS,
     634                     x,
     635                     y,
     636                     cluster(x,y),
     637                     maptabd,
     638                     maptabx,
     639                     x_width,
     640                     y_width,
     641                     vci_srcid_width - x_width - y_width,   // l_id width,
     642                     P_WIDTH,
     643                     RAM_TGTID,
     644                     XCU_TGTID,
     645                     DMA_TGTID,
     646                     FBF_TGTID,
     647                     TTY_TGTID,
     648                     ROM_TGTID,
     649                     NIC_TGTID,
     650                     CMA_TGTID,
     651                     IOC_TGTID,
     652                     SIM_TGTID,
     653                     MEMC_WAYS,
     654                     MEMC_SETS,
     655                     L1_IWAYS,
     656                     L1_ISETS,
     657                     L1_DWAYS,
     658                     L1_DSETS,
     659                     IRQ_PER_PROCESSOR,
     660                     XRAM_LATENCY,
     661                     x == X_IO && y == Y_IO,
     662                     FBF_X_SIZE,
     663                     FBF_Y_SIZE,
     664                     disk_name,
     665                     BDEV_SECTOR_SIZE,
     666                     NB_NIC_CHANNELS,
     667                     nic_rx_name,
     668                     nic_tx_name,
     669                     NIC_TIMEOUT,
     670                     NB_CMA_CHANNELS,
     671                     loader,
     672                     frozen_cycles,
     673                     debug_from,
     674                     debug_ok,
     675                     debug_ok
     676                         );
     677
     678        }
     679    }
     680    }
     681
     682    ///////////////////////////////////////////////////////////////
     683    //     Net-list
     684    ///////////////////////////////////////////////////////////////
     685
     686    // Clock & RESET
     687    for (int x = 0; x < X_SIZE; x++) {
     688       for (int y = 0; y < Y_SIZE; y++) {
     689          clusters[x][y]->p_clk                      (signal_clk);
     690          clusters[x][y]->p_resetn                   (signal_resetn);
     691       }
     692    }
     693
     694    // Inter Clusters horizontal connections
     695    for (int x = 0; x < X_SIZE - 1; x++) {
     696       for (int y = 0; y < Y_SIZE; y++) {
     697          clusters[x][y]->p_cmd_out[EAST]      (signal_dspin_h_cmd_inc[x][y]);
     698          clusters[x + 1][y]->p_cmd_in[WEST]   (signal_dspin_h_cmd_inc[x][y]);
     699          clusters[x][y]->p_cmd_in[EAST]       (signal_dspin_h_cmd_dec[x][y]);
     700          clusters[x + 1][y]->p_cmd_out[WEST]  (signal_dspin_h_cmd_dec[x][y]);
     701
     702          clusters[x][y]->p_rsp_out[EAST]      (signal_dspin_h_rsp_inc[x][y]);
     703          clusters[x + 1][y]->p_rsp_in[WEST]   (signal_dspin_h_rsp_inc[x][y]);
     704          clusters[x][y]->p_rsp_in[EAST]       (signal_dspin_h_rsp_dec[x][y]);
     705          clusters[x + 1][y]->p_rsp_out[WEST]  (signal_dspin_h_rsp_dec[x][y]);
     706
     707          clusters[x][y]->p_m2p_out[EAST]      (signal_dspin_h_m2p_inc[x][y]);
     708          clusters[x + 1][y]->p_m2p_in[WEST]   (signal_dspin_h_m2p_inc[x][y]);
     709          clusters[x][y]->p_m2p_in[EAST]       (signal_dspin_h_m2p_dec[x][y]);
     710          clusters[x + 1][y]->p_m2p_out[WEST]  (signal_dspin_h_m2p_dec[x][y]);
     711
     712          clusters[x][y]->p_p2m_out[EAST]      (signal_dspin_h_p2m_inc[x][y]);
     713          clusters[x + 1][y]->p_p2m_in[WEST]   (signal_dspin_h_p2m_inc[x][y]);
     714          clusters[x][y]->p_p2m_in[EAST]       (signal_dspin_h_p2m_dec[x][y]);
     715          clusters[x + 1][y]->p_p2m_out[WEST]  (signal_dspin_h_p2m_dec[x][y]);
     716
     717          clusters[x][y]->p_cla_out[EAST]      (signal_dspin_h_cla_inc[x][y]);
     718          clusters[x + 1][y]->p_cla_in[WEST]   (signal_dspin_h_cla_inc[x][y]);
     719          clusters[x][y]->p_cla_in[EAST]       (signal_dspin_h_cla_dec[x][y]);
     720          clusters[x + 1][y]->p_cla_out[WEST]  (signal_dspin_h_cla_dec[x][y]);
     721       }
     722    }
     723    std::cout << std::endl << "Horizontal connections done" << std::endl;
     724
     725    // Inter Clusters vertical connections
     726    for (int y = 0; y < Y_SIZE - 1; y++) {
     727       for (int x = 0; x < X_SIZE; x++) {
     728          clusters[x][y]->p_cmd_out[NORTH]     (signal_dspin_v_cmd_inc[x][y]);
     729          clusters[x][y + 1]->p_cmd_in[SOUTH]  (signal_dspin_v_cmd_inc[x][y]);
     730          clusters[x][y]->p_cmd_in[NORTH]      (signal_dspin_v_cmd_dec[x][y]);
     731          clusters[x][y + 1]->p_cmd_out[SOUTH] (signal_dspin_v_cmd_dec[x][y]);
     732
     733          clusters[x][y]->p_rsp_out[NORTH]     (signal_dspin_v_rsp_inc[x][y]);
     734          clusters[x][y + 1]->p_rsp_in[SOUTH]  (signal_dspin_v_rsp_inc[x][y]);
     735          clusters[x][y]->p_rsp_in[NORTH]      (signal_dspin_v_rsp_dec[x][y]);
     736          clusters[x][y + 1]->p_rsp_out[SOUTH] (signal_dspin_v_rsp_dec[x][y]);
     737
     738          clusters[x][y]->p_m2p_out[NORTH]     (signal_dspin_v_m2p_inc[x][y]);
     739          clusters[x][y + 1]->p_m2p_in[SOUTH]  (signal_dspin_v_m2p_inc[x][y]);
     740          clusters[x][y]->p_m2p_in[NORTH]      (signal_dspin_v_m2p_dec[x][y]);
     741          clusters[x][y + 1]->p_m2p_out[SOUTH] (signal_dspin_v_m2p_dec[x][y]);
     742
     743          clusters[x][y]->p_p2m_out[NORTH]     (signal_dspin_v_p2m_inc[x][y]);
     744          clusters[x][y + 1]->p_p2m_in[SOUTH]  (signal_dspin_v_p2m_inc[x][y]);
     745          clusters[x][y]->p_p2m_in[NORTH]      (signal_dspin_v_p2m_dec[x][y]);
     746          clusters[x][y + 1]->p_p2m_out[SOUTH] (signal_dspin_v_p2m_dec[x][y]);
     747
     748          clusters[x][y]->p_cla_out[NORTH]     (signal_dspin_v_cla_inc[x][y]);
     749          clusters[x][y + 1]->p_cla_in[SOUTH]  (signal_dspin_v_cla_inc[x][y]);
     750          clusters[x][y]->p_cla_in[NORTH]      (signal_dspin_v_cla_dec[x][y]);
     751          clusters[x][y + 1]->p_cla_out[SOUTH] (signal_dspin_v_cla_dec[x][y]);
     752       }
     753    }
     754    std::cout << std::endl << "Vertical connections done" << std::endl;
     755
     756    // East & West boundary cluster connections
     757    for (size_t y = 0; y < Y_SIZE; y++) {
     758        clusters[0][y]->p_cmd_in[WEST]           (signal_dspin_bound_cmd_in[0][y][WEST]);
     759        clusters[0][y]->p_cmd_out[WEST]          (signal_dspin_bound_cmd_out[0][y][WEST]);
     760        clusters[X_SIZE - 1][y]->p_cmd_in[EAST]  (signal_dspin_bound_cmd_in[X_SIZE - 1][y][EAST]);
     761        clusters[X_SIZE - 1][y]->p_cmd_out[EAST] (signal_dspin_bound_cmd_out[X_SIZE - 1][y][EAST]);
     762
     763        clusters[0][y]->p_rsp_in[WEST]           (signal_dspin_bound_rsp_in[0][y][WEST]);
     764        clusters[0][y]->p_rsp_out[WEST]          (signal_dspin_bound_rsp_out[0][y][WEST]);
     765        clusters[X_SIZE - 1][y]->p_rsp_in[EAST]  (signal_dspin_bound_rsp_in[X_SIZE - 1][y][EAST]);
     766        clusters[X_SIZE - 1][y]->p_rsp_out[EAST] (signal_dspin_bound_rsp_out[X_SIZE - 1][y][EAST]);
     767
     768        clusters[0][y]->p_m2p_in[WEST]           (signal_dspin_bound_m2p_in[0][y][WEST]);
     769        clusters[0][y]->p_m2p_out[WEST]          (signal_dspin_bound_m2p_out[0][y][WEST]);
     770        clusters[X_SIZE - 1][y]->p_m2p_in[EAST]  (signal_dspin_bound_m2p_in[X_SIZE - 1][y][EAST]);
     771        clusters[X_SIZE - 1][y]->p_m2p_out[EAST] (signal_dspin_bound_m2p_out[X_SIZE - 1][y][EAST]);
     772
     773        clusters[0][y]->p_p2m_in[WEST]           (signal_dspin_bound_p2m_in[0][y][WEST]);
     774        clusters[0][y]->p_p2m_out[WEST]          (signal_dspin_bound_p2m_out[0][y][WEST]);
     775        clusters[X_SIZE - 1][y]->p_p2m_in[EAST]  (signal_dspin_bound_p2m_in[X_SIZE - 1][y][EAST]);
     776        clusters[X_SIZE - 1][y]->p_p2m_out[EAST] (signal_dspin_bound_p2m_out[X_SIZE - 1][y][EAST]);
     777
     778        clusters[0][y]->p_cla_in[WEST]           (signal_dspin_bound_cla_in[0][y][WEST]);
     779        clusters[0][y]->p_cla_out[WEST]          (signal_dspin_bound_cla_out[0][y][WEST]);
     780        clusters[X_SIZE - 1][y]->p_cla_in[EAST]  (signal_dspin_bound_cla_in[X_SIZE - 1][y][EAST]);
     781        clusters[X_SIZE - 1][y]->p_cla_out[EAST] (signal_dspin_bound_cla_out[X_SIZE - 1][y][EAST]);
     782    }
     783
     784    std::cout << std::endl << "West & East boundaries connections done" << std::endl;
     785
     786    // North & South boundary clusters connections
     787    for (size_t x = 0; x < X_SIZE; x++) {
     788        clusters[x][0]->p_cmd_in[SOUTH]          (signal_dspin_bound_cmd_in[x][0][SOUTH]);
     789        clusters[x][0]->p_cmd_out[SOUTH]         (signal_dspin_bound_cmd_out[x][0][SOUTH]);
     790        clusters[x][Y_SIZE - 1]->p_cmd_in[NORTH] (signal_dspin_bound_cmd_in[x][Y_SIZE - 1][NORTH]);
     791        clusters[x][Y_SIZE - 1]->p_cmd_out[NORTH](signal_dspin_bound_cmd_out[x][Y_SIZE - 1][NORTH]);
     792
     793        clusters[x][0]->p_rsp_in[SOUTH]          (signal_dspin_bound_rsp_in[x][0][SOUTH]);
     794        clusters[x][0]->p_rsp_out[SOUTH]         (signal_dspin_bound_rsp_out[x][0][SOUTH]);
     795        clusters[x][Y_SIZE - 1]->p_rsp_in[NORTH] (signal_dspin_bound_rsp_in[x][Y_SIZE - 1][NORTH]);
     796        clusters[x][Y_SIZE - 1]->p_rsp_out[NORTH](signal_dspin_bound_rsp_out[x][Y_SIZE - 1][NORTH]);
     797
     798        clusters[x][0]->p_m2p_in[SOUTH]          (signal_dspin_bound_m2p_in[x][0][SOUTH]);
     799        clusters[x][0]->p_m2p_out[SOUTH]         (signal_dspin_bound_m2p_out[x][0][SOUTH]);
     800        clusters[x][Y_SIZE - 1]->p_m2p_in[NORTH] (signal_dspin_bound_m2p_in[x][Y_SIZE - 1][NORTH]);
     801        clusters[x][Y_SIZE - 1]->p_m2p_out[NORTH](signal_dspin_bound_m2p_out[x][Y_SIZE - 1][NORTH]);
     802
     803        clusters[x][0]->p_p2m_in[SOUTH]          (signal_dspin_bound_p2m_in[x][0][SOUTH]);
     804        clusters[x][0]->p_p2m_out[SOUTH]         (signal_dspin_bound_p2m_out[x][0][SOUTH]);
     805        clusters[x][Y_SIZE - 1]->p_p2m_in[NORTH] (signal_dspin_bound_p2m_in[x][Y_SIZE - 1][NORTH]);
     806        clusters[x][Y_SIZE - 1]->p_p2m_out[NORTH](signal_dspin_bound_p2m_out[x][Y_SIZE - 1][NORTH]);
     807
     808        clusters[x][0]->p_cla_in[SOUTH]          (signal_dspin_bound_cla_in[x][0][SOUTH]);
     809        clusters[x][0]->p_cla_out[SOUTH]         (signal_dspin_bound_cla_out[x][0][SOUTH]);
     810        clusters[x][Y_SIZE - 1]->p_cla_in[NORTH] (signal_dspin_bound_cla_in[x][Y_SIZE - 1][NORTH]);
     811        clusters[x][Y_SIZE - 1]->p_cla_out[NORTH](signal_dspin_bound_cla_out[x][Y_SIZE - 1][NORTH]);
     812    }
     813
     814    std::cout << std::endl << "North & South boundaries connections done" << std::endl;
     815    std::cout << std::endl;
    859816
    860817
     
    865822        GdbServer<Mips32ElIss> > * > l1_caches;
    866823
    867    for (int x = 0; x < X_SIZE; x++) {
    868       for (int y = 0; y < Y_SIZE; y++) {
    869          for (int proc = 0; proc < NB_PROCS_MAX; proc++) {
    870             l1_caches.push_back(clusters[x][y]->proc[proc]);
    871          }
    872       }
    873    }
    874 
    875    for (int x = 0; x < X_SIZE; x++) {
    876       for (int y = 0; y < Y_SIZE; y++) {
    877          clusters[x][y]->memc->set_vcache_list(l1_caches);
    878       }
    879    }
     824    for (int x = 0; x < X_SIZE; x++) {
     825        for (int y = 0; y < Y_SIZE; y++) {
     826            for (int proc = 0; proc < NB_PROCS_MAX; proc++) {
     827                l1_caches.push_back(clusters[x][y]->proc[proc]);
     828            }
     829        }
     830    }
     831
     832    for (int x = 0; x < X_SIZE; x++) {
     833        for (int y = 0; y < Y_SIZE; y++) {
     834            clusters[x][y]->memc->set_vcache_list(l1_caches);
     835        }
     836    }
    880837#endif
    881838
     
    883840//#define SC_TRACE
    884841#ifdef SC_TRACE
    885    sc_trace_file * tf = sc_create_vcd_trace_file("my_trace_file");
    886 
    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++) {
    917          std::ostringstream signame;
    918          signame << "cluster" << x << "_" << y;
    919          clusters[x][y]->trace(tf, signame.str());
    920       }
    921    }
    922 #endif
    923 
    924 
    925    ////////////////////////////////////////////////////////
    926    //   Simulation
    927    ///////////////////////////////////////////////////////
    928 
    929    sc_start(sc_core::sc_time(0, SC_NS));
    930    signal_resetn = false;
    931 
    932    // set network boundaries signals default values
    933    // for all boundary clusters
    934    for (size_t x = 0; x < X_SIZE ; x++) {
    935        for (size_t y = 0; y < Y_SIZE ; y++) {
    936            for (size_t face = 0; face < 4; face++) {
    937                signal_dspin_bound_cmd_in [x][y][face].write = false;
    938                signal_dspin_bound_cmd_in [x][y][face].read  = true;
    939                signal_dspin_bound_cmd_out[x][y][face].write = false;
    940                signal_dspin_bound_cmd_out[x][y][face].read  = true;
    941 
    942                signal_dspin_bound_rsp_in [x][y][face].write = false;
    943                signal_dspin_bound_rsp_in [x][y][face].read  = true;
    944                signal_dspin_bound_rsp_out[x][y][face].write = false;
    945                signal_dspin_bound_rsp_out[x][y][face].read  = true;
    946 
    947                signal_dspin_bound_m2p_in [x][y][face].write = false;
    948                signal_dspin_bound_m2p_in [x][y][face].read  = true;
    949                signal_dspin_bound_m2p_out[x][y][face].write = false;
    950                signal_dspin_bound_m2p_out[x][y][face].read  = true;
    951 
    952                signal_dspin_bound_p2m_in [x][y][face].write = false;
    953                signal_dspin_bound_p2m_in [x][y][face].read  = true;
    954                signal_dspin_bound_p2m_out[x][y][face].write = false;
    955                signal_dspin_bound_p2m_out[x][y][face].read  = true;
    956 
    957                signal_dspin_bound_cla_in [x][y][face].write = false;
    958                signal_dspin_bound_cla_in [x][y][face].read  = true;
    959                signal_dspin_bound_cla_out[x][y][face].write = false;
    960                signal_dspin_bound_cla_out[x][y][face].read  = true;
    961            }
    962        }
    963    }
    964    // @M debug fu**
    965    clusters[0][0]->signal_dspin_m2p_proc[2].read = true;
    966 
    967    sc_start(sc_core::sc_time(1, SC_NS));
    968    signal_resetn = true;
    969 
    970    if (debug_ok) {
    971       #if USE_OPENMP
    972          assert(false && "OPEN MP should not be used with debug because of its traces");
    973       #endif
    974 
    975       if (gettimeofday(&t1, NULL) != 0) {
    976          perror("gettimeofday");
    977          return EXIT_FAILURE;
    978       }
    979 
    980       for (int64_t n = 1; n < ncycles && !stop_called; n++) {
    981          if ((n % max_cycles) == 0) {
     842    sc_trace_file * tf = sc_create_vcd_trace_file("my_trace_file");
     843
     844    for (int x = 0; x < X_SIZE - 1; x++) {
     845        for (int y = 0; y < Y_SIZE; y++) {
     846            for (int k = 0; k < 3; k++) {
     847                signal_dspin_h_cmd_inc[x][y][k].trace(tf, "dspin_h_cmd_inc");
     848                signal_dspin_h_cmd_dec[x][y][k].trace(tf, "dspin_h_cmd_dec");
     849            }
     850
     851            for (int k = 0; k < 2; k++) {
     852                signal_dspin_h_rsp_inc[x][y][k].trace(tf, "dspin_h_rsp_inc");
     853                signal_dspin_h_rsp_dec[x][y][k].trace(tf, "dspin_h_rsp_dec");
     854            }
     855        }
     856    }
     857
     858    for (int y = 0; y < Y_SIZE - 1; y++) {
     859        for (int x = 0; x < X_SIZE; x++) {
     860            for (int k = 0; k < 3; k++) {
     861                signal_dspin_v_cmd_inc[x][y][k].trace(tf, "dspin_v_cmd_inc");
     862                signal_dspin_v_cmd_dec[x][y][k].trace(tf, "dspin_v_cmd_dec");
     863            }
     864
     865            for (int k = 0; k < 2; k++) {
     866                signal_dspin_v_rsp_inc[x][y][k].trace(tf, "dspin_v_rsp_inc");
     867                signal_dspin_v_rsp_dec[x][y][k].trace(tf, "dspin_v_rsp_dec");
     868            }
     869        }
     870    }
     871
     872    for (int x = 0; x < (X_SIZE); x++) {
     873        for (int y = 0; y < Y_SIZE; y++) {
     874            std::ostringstream signame;
     875            signame << "cluster" << x << "_" << y;
     876            clusters[x][y]->trace(tf, signame.str());
     877        }
     878    }
     879#endif
     880
     881
     882    ////////////////////////////////////////////////////////
     883    //   Simulation
     884    ///////////////////////////////////////////////////////
     885
     886    sc_start(sc_core::sc_time(0, SC_NS));
     887    signal_resetn = false;
     888
     889    // set network boundaries signals default values
     890    // for all boundary clusters
     891    for (size_t x = 0; x < X_SIZE ; x++) {
     892        for (size_t y = 0; y < Y_SIZE ; y++) {
     893            for (size_t face = 0; face < 4; face++) {
     894                signal_dspin_bound_cmd_in [x][y][face].write = false;
     895                signal_dspin_bound_cmd_in [x][y][face].read  = true;
     896                signal_dspin_bound_cmd_out[x][y][face].write = false;
     897                signal_dspin_bound_cmd_out[x][y][face].read  = true;
     898
     899                signal_dspin_bound_rsp_in [x][y][face].write = false;
     900                signal_dspin_bound_rsp_in [x][y][face].read  = true;
     901                signal_dspin_bound_rsp_out[x][y][face].write = false;
     902                signal_dspin_bound_rsp_out[x][y][face].read  = true;
     903
     904                signal_dspin_bound_m2p_in [x][y][face].write = false;
     905                signal_dspin_bound_m2p_in [x][y][face].read  = true;
     906                signal_dspin_bound_m2p_out[x][y][face].write = false;
     907                signal_dspin_bound_m2p_out[x][y][face].read  = true;
     908
     909                signal_dspin_bound_p2m_in [x][y][face].write = false;
     910                signal_dspin_bound_p2m_in [x][y][face].read  = true;
     911                signal_dspin_bound_p2m_out[x][y][face].write = false;
     912                signal_dspin_bound_p2m_out[x][y][face].read  = true;
     913
     914                signal_dspin_bound_cla_in [x][y][face].write = false;
     915                signal_dspin_bound_cla_in [x][y][face].read  = true;
     916                signal_dspin_bound_cla_out[x][y][face].write = false;
     917                signal_dspin_bound_cla_out[x][y][face].read  = true;
     918            }
     919        }
     920    }
     921    // @QM : what is the following line?
     922    //clusters[0][0]->signal_dspin_m2p_proc[2].read = true;
     923
     924    sc_start(sc_core::sc_time(1, SC_NS));
     925    signal_resetn = true;
     926
     927    if (debug_ok) {
     928#ifdef USE_OPENMP
     929        assert(false && "OPEN MP should not be used with debug because of its traces");
     930#endif
     931
     932        if (gettimeofday(&t1, NULL) != 0) {
     933            perror("gettimeofday");
     934            return EXIT_FAILURE;
     935        }
     936
     937        for (int64_t n = 1; n < ncycles && !stop_called; n++) {
     938            if ((n % max_cycles) == 0) {
     939
     940                if (gettimeofday(&t2, NULL) != 0) {
     941                    perror("gettimeofday");
     942                    return EXIT_FAILURE;
     943                }
     944
     945                ms1 = (uint64_t) t1.tv_sec * 1000ULL + (uint64_t) t1.tv_usec / 1000;
     946                ms2 = (uint64_t) t2.tv_sec * 1000ULL + (uint64_t) t2.tv_usec / 1000;
     947                std::cerr << "platform clock frequency " << (double) 5000000 / (double) (ms2 - ms1) << "Khz" << std::endl;
     948
     949                if (gettimeofday(&t1, NULL) != 0) {
     950                    perror("gettimeofday");
     951                    return EXIT_FAILURE;
     952                }
     953            }
     954
     955
     956            if (n == reset_counters) {
     957                for (size_t x = 0; x < (X_SIZE); x++) {
     958                    for (size_t y = 0; y < Y_SIZE; y++) {
     959                        clusters[x][y]->memc->reset_counters();
     960                    }
     961                }
     962            }
     963
     964            if (n == dump_counters) {
     965                for (size_t x = 0; x < (X_SIZE); x++) {
     966                    for (size_t y = 0; y < Y_SIZE; y++) {
     967                        clusters[x][y]->memc->print_stats(true, false);
     968                    }
     969                }
     970            }
     971
     972            if ((n > debug_from) and (n % debug_period == 0)) {
     973                std::cout << "****************** cycle " << std::dec << n ;
     974                std::cout << "************************************************" << std::endl;
     975
     976                for (size_t x = 0; x < X_SIZE ; x++) {
     977                    for (size_t y = 0; y < Y_SIZE ; y++) {
     978                        for (int proc = 0; proc < NB_PROCS_MAX; proc++) {
     979                            clusters[x][y]->proc[proc]->print_trace();
     980                            std::ostringstream proc_signame;
     981                            proc_signame << "[SIG]PROC_" << x << "_" << y << "_" << proc ;
     982                            std::ostringstream p2m_signame;
     983                            p2m_signame << "[SIG]PROC_" << x << "_" << y << "_" << proc << " P2M";
     984                            std::ostringstream m2p_signame;
     985                            m2p_signame << "[SIG]PROC_" << x << "_" << y << "_" << proc << " M2P";
     986
     987                            clusters[x][y]->signal_vci_ini_proc[proc].print_trace(proc_signame.str());
     988                            clusters[x][y]->signal_dspin_p2m_proc[proc].print_trace(p2m_signame.str());
     989                            clusters[x][y]->signal_dspin_m2p_proc[proc].print_trace(m2p_signame.str());
     990                        }
     991
     992                        clusters[x][y]->memc->print_trace();
     993
     994                        std::ostringstream smemc;
     995                        smemc << "[SIG]MEMC_" << x << "_" << y;
     996                        std::ostringstream sxram;
     997                        sxram << "[SIG]XRAM_" << x << "_" << y;
     998                        std::ostringstream sm2p;
     999                        sm2p << "[SIG]MEMC_" << x << "_" << y << " M2P";
     1000                        std::ostringstream sp2m;
     1001                        sp2m << "[SIG]MEMC_" << x << "_" << y << " P2M";
     1002
     1003                        clusters[x][y]->signal_vci_tgt_memc.print_trace(smemc.str());
     1004                        clusters[x][y]->signal_vci_xram.print_trace(sxram.str());
     1005                        clusters[x][y]->signal_dspin_p2m_memc.print_trace(sp2m.str());
     1006                        clusters[x][y]->signal_dspin_m2p_memc.print_trace(sm2p.str());
     1007                    }
     1008                }
     1009            }
     1010
     1011            sc_start(sc_core::sc_time(1, SC_NS));
     1012        }
     1013    }
     1014    else {
     1015        int64_t n = 0;
     1016        while (!stop_called && n != ncycles) {
     1017            if (gettimeofday(&t1, NULL) != 0) {
     1018                perror("gettimeofday");
     1019                return EXIT_FAILURE;
     1020            }
     1021            int64_t nb_cycles = min(max_cycles, ncycles - n);
     1022            if (do_reset_counters) {
     1023                nb_cycles = min(nb_cycles, reset_counters - n);
     1024            }
     1025            if (do_dump_counters) {
     1026                nb_cycles = min(nb_cycles, dump_counters - n);
     1027            }
     1028
     1029            sc_start(sc_core::sc_time(nb_cycles, SC_NS));
     1030            n += nb_cycles;
     1031
     1032            if (do_reset_counters && n == reset_counters) {
     1033                // Reseting counters
     1034                for (size_t x = 0; x < (X_SIZE); x++) {
     1035                    for (size_t y = 0; y < Y_SIZE; y++) {
     1036                        clusters[x][y]->memc->reset_counters();
     1037                    }
     1038                }
     1039                do_reset_counters = false;
     1040            }
     1041
     1042            if (do_dump_counters && n == dump_counters) {
     1043                // Dumping counters
     1044                for (size_t x = 0; x < (X_SIZE); x++) {
     1045                    for (size_t y = 0; y < Y_SIZE; y++) {
     1046                        clusters[x][y]->memc->print_stats(true, false);
     1047                    }
     1048                }
     1049                do_dump_counters = false;
     1050            }
     1051
    9821052
    9831053            if (gettimeofday(&t2, NULL) != 0) {
    984                perror("gettimeofday");
    985                return EXIT_FAILURE;
    986             }
    987 
     1054                perror("gettimeofday");
     1055                return EXIT_FAILURE;
     1056            }
    9881057            ms1 = (uint64_t) t1.tv_sec * 1000ULL + (uint64_t) t1.tv_usec / 1000;
    9891058            ms2 = (uint64_t) t2.tv_sec * 1000ULL + (uint64_t) t2.tv_usec / 1000;
    990             std::cerr << "platform clock frequency " << (double) 5000000 / (double) (ms2 - ms1) << "Khz" << std::endl;
    991 
    992             if (gettimeofday(&t1, NULL) != 0)
    993             {
    994                perror("gettimeofday");
    995                return EXIT_FAILURE;
    996             }
    997          }
    998 
    999 
    1000          if (n == reset_counters) {
    1001             for (size_t x = 0; x < (X_SIZE); x++) {
    1002                for (size_t y = 0; y < Y_SIZE; y++) {
    1003                   clusters[x][y]->memc->reset_counters();
    1004                }
    1005             }
    1006          }
    1007 
    1008          if (n == dump_counters) {
    1009             for (size_t x = 0; x < (X_SIZE); x++) {
    1010                for (size_t y = 0; y < Y_SIZE; y++) {
    1011                   clusters[x][y]->memc->print_stats(true, false);
    1012                }
    1013             }
    1014          }
    1015 
    1016          if ((n > debug_from) and (n % debug_period == 0)) {
    1017             std::cout << "****************** cycle " << std::dec << n ;
    1018             std::cout << "************************************************" << std::endl;
    1019 
    1020             for (size_t x = 0; x < X_SIZE ; x++) {
    1021                for (size_t y = 0; y < Y_SIZE ; y++) {
    1022                   for (int proc = 0; proc < NB_PROCS_MAX; proc++) {
    1023                      if (x == 0 && y == 0 && proc == 2) {
    1024                         continue;
    1025                      }
    1026                      clusters[x][y]->proc[proc]->print_trace();
    1027                      std::ostringstream proc_signame;
    1028                      proc_signame << "[SIG]PROC_" << x << "_" << y << "_" << proc ;
    1029                      std::ostringstream p2m_signame;
    1030                      p2m_signame << "[SIG]PROC_" << x << "_" << y << "_" << proc << " P2M";
    1031                      std::ostringstream m2p_signame;
    1032                      m2p_signame << "[SIG]PROC_" << x << "_" << y << "_" << proc << " M2P";
    1033 
    1034                      clusters[x][y]->signal_vci_ini_proc[proc].print_trace(proc_signame.str());
    1035                      clusters[x][y]->signal_dspin_p2m_proc[proc].print_trace(p2m_signame.str());
    1036                      clusters[x][y]->signal_dspin_m2p_proc[proc].print_trace(m2p_signame.str());
    1037                   }
    1038 
    1039                   clusters[x][y]->memc->print_trace();
    1040 
    1041                   std::ostringstream smemc;
    1042                   smemc << "[SIG]MEMC_" << x << "_" << y;
    1043                   std::ostringstream sxram;
    1044                   sxram << "[SIG]XRAM_" << x << "_" << y;
    1045                   std::ostringstream sm2p;
    1046                   sm2p << "[SIG]MEMC_" << x << "_" << y << " M2P";
    1047                   std::ostringstream sp2m;
    1048                   sp2m << "[SIG]MEMC_" << x << "_" << y << " P2M";
    1049 
    1050                   clusters[x][y]->signal_vci_tgt_memc.print_trace(smemc.str());
    1051                   clusters[x][y]->signal_vci_xram.print_trace(sxram.str());
    1052                   clusters[x][y]->signal_dspin_p2m_memc.print_trace(sp2m.str());
    1053                   clusters[x][y]->signal_dspin_m2p_memc.print_trace(sm2p.str());
    1054                }
    1055             }
    1056          }
    1057 
    1058          sc_start(sc_core::sc_time(1, SC_NS));
    1059       }
    1060    }
    1061    else {
    1062       int64_t n = 0;
    1063       while (!stop_called && n != ncycles) {
    1064          if (gettimeofday(&t1, NULL) != 0) {
    1065             perror("gettimeofday");
    1066             return EXIT_FAILURE;
    1067          }
    1068          int64_t nb_cycles = min(max_cycles, ncycles - n);
    1069          if (do_reset_counters) {
    1070             nb_cycles = min(nb_cycles, reset_counters - n);
    1071          }
    1072          if (do_dump_counters) {
    1073             nb_cycles = min(nb_cycles, dump_counters - n);
    1074          }
    1075 
    1076          sc_start(sc_core::sc_time(nb_cycles, SC_NS));
    1077          n += nb_cycles;
    1078 
    1079          if (do_reset_counters && n == reset_counters) {
    1080             // Reseting counters
    1081             for (size_t x = 0; x < (X_SIZE); x++) {
    1082                for (size_t y = 0; y < Y_SIZE; y++) {
    1083                   clusters[x][y]->memc->reset_counters();
    1084                }
    1085             }
    1086             do_reset_counters = false;
    1087          }
    1088 
    1089          if (do_dump_counters && n == dump_counters) {
    1090             // Dumping counters
    1091             for (size_t x = 0; x < (X_SIZE); x++) {
    1092                for (size_t y = 0; y < Y_SIZE; y++) {
    1093                   clusters[x][y]->memc->print_stats(true, false);
    1094                }
    1095             }
    1096             do_dump_counters = false;
    1097          }
    1098 
    1099 
    1100          if (gettimeofday(&t2, NULL) != 0) {
    1101             perror("gettimeofday");
    1102             return EXIT_FAILURE;
    1103          }
    1104          ms1 = (uint64_t) t1.tv_sec * 1000ULL + (uint64_t) t1.tv_usec / 1000;
    1105          ms2 = (uint64_t) t2.tv_sec * 1000ULL + (uint64_t) t2.tv_usec / 1000;
    1106          std::cerr << std::dec << "cycle " << n << " platform clock frequency " << (double) nb_cycles / (double) (ms2 - ms1) << "Khz" << std::endl;
    1107       }
    1108    }
    1109 
    1110 
    1111    // Free memory
    1112    for (size_t i = 0; i  < (X_SIZE * Y_SIZE); i++) {
    1113       size_t x = i / Y_SIZE;
    1114       size_t y = i % Y_SIZE;
    1115       delete clusters[x][y];
    1116    }
    1117 
    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);
    1147 
    1148    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_cmd_in, X_SIZE, Y_SIZE, 4);
    1149    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_cmd_out, X_SIZE, Y_SIZE, 4);
    1150 
    1151    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_bound_rsp_in, X_SIZE, Y_SIZE, 4);
    1152    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_bound_rsp_out, X_SIZE, Y_SIZE, 4);
    1153 
    1154    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_m2p_in, X_SIZE, Y_SIZE, 4);
    1155    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_m2p_out, X_SIZE, Y_SIZE, 4);
    1156 
    1157    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_bound_p2m_in, X_SIZE, Y_SIZE, 4);
    1158    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_bound_p2m_out, X_SIZE, Y_SIZE, 4);
    1159 
    1160    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_cla_in, X_SIZE, Y_SIZE, 4);
    1161    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_cla_out, X_SIZE, Y_SIZE, 4);
    1162 
    1163    return EXIT_SUCCESS;
     1059            std::cerr << std::dec << "cycle " << n << " platform clock frequency " << (double) nb_cycles / (double) (ms2 - ms1) << "Khz" << std::endl;
     1060        }
     1061    }
     1062
     1063
     1064    // Free memory
     1065    for (size_t i = 0; i  < (X_SIZE * Y_SIZE); i++) {
     1066        size_t x = i / Y_SIZE;
     1067        size_t y = i % Y_SIZE;
     1068        delete clusters[x][y];
     1069    }
     1070
     1071    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cmd_inc, X_SIZE - 1, Y_SIZE);
     1072    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cmd_dec, X_SIZE - 1, Y_SIZE);
     1073
     1074    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_rsp_inc, X_SIZE - 1, Y_SIZE);
     1075    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_rsp_dec, X_SIZE - 1, Y_SIZE);
     1076
     1077    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_m2p_inc, X_SIZE - 1, Y_SIZE);
     1078    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_m2p_dec, X_SIZE - 1, Y_SIZE);
     1079
     1080    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_p2m_inc, X_SIZE - 1, Y_SIZE);
     1081    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_p2m_dec, X_SIZE - 1, Y_SIZE);
     1082
     1083    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cla_inc, X_SIZE - 1, Y_SIZE);
     1084    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cla_dec, X_SIZE - 1, Y_SIZE);
     1085
     1086    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cmd_inc, X_SIZE, Y_SIZE - 1);
     1087    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cmd_dec, X_SIZE, Y_SIZE - 1);
     1088
     1089    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_rsp_inc, X_SIZE, Y_SIZE - 1);
     1090    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_rsp_dec, X_SIZE, Y_SIZE - 1);
     1091
     1092    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_m2p_inc, X_SIZE, Y_SIZE - 1);
     1093    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_m2p_dec, X_SIZE, Y_SIZE - 1);
     1094
     1095    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_p2m_inc, X_SIZE, Y_SIZE - 1);
     1096    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_p2m_dec, X_SIZE, Y_SIZE - 1);
     1097
     1098    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cla_inc, X_SIZE, Y_SIZE - 1);
     1099    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cla_dec, X_SIZE, Y_SIZE - 1);
     1100
     1101    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_cmd_in, X_SIZE, Y_SIZE, 4);
     1102    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_cmd_out, X_SIZE, Y_SIZE, 4);
     1103
     1104    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_bound_rsp_in, X_SIZE, Y_SIZE, 4);
     1105    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_bound_rsp_out, X_SIZE, Y_SIZE, 4);
     1106
     1107    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_m2p_in, X_SIZE, Y_SIZE, 4);
     1108    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_m2p_out, X_SIZE, Y_SIZE, 4);
     1109
     1110    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_bound_p2m_in, X_SIZE, Y_SIZE, 4);
     1111    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_bound_p2m_out, X_SIZE, Y_SIZE, 4);
     1112
     1113    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_cla_in, X_SIZE, Y_SIZE, 4);
     1114    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_cla_out, X_SIZE, Y_SIZE, 4);
     1115
     1116    return EXIT_SUCCESS;
    11641117}
    11651118
    11661119
    11671120void handler(int dummy = 0) {
    1168    stop_called = true;
    1169    sc_stop();
     1121    stop_called = true;
     1122    sc_stop();
    11701123}
    11711124
     
    11731126
    11741127int sc_main (int argc, char *argv[]) {
    1175    signal(SIGINT, handler);
    1176    signal(SIGPIPE, voidhandler);
    1177 
    1178    try {
    1179       return _main(argc, argv);
    1180    } catch (std::exception &e) {
    1181       std::cout << e.what() << std::endl;
    1182    }
    1183    catch (...) {
    1184       std::cout << "Unknown exception occured" << std::endl;
    1185       throw;
    1186    }
    1187    return 1;
     1128    signal(SIGINT, handler);
     1129    signal(SIGPIPE, voidhandler);
     1130
     1131    try {
     1132        int ret =_main(argc, argv);
     1133        if (!stop_called) {
     1134            sc_stop();
     1135            sc_start(sc_core::sc_time(0, SC_NS));
     1136        }
     1137        return ret;
     1138    } catch (std::exception &e) {
     1139        std::cout << e.what() << std::endl;
     1140    }
     1141    catch (...) {
     1142        std::cout << "Unknown exception occured" << std::endl;
     1143        throw;
     1144    }
     1145    return 1;
    11881146}
    11891147
    11901148
    11911149// Local Variables:
    1192 // tab-width: 3
    1193 // c-basic-offset: 3
     1150// tab-width: 4
     1151// c-basic-offset: 4
    11941152// c-file-offsets:((innamespace . 0)(inline-open . 0))
    11951153// indent-tabs-mode: nil
    11961154// End:
    11971155
    1198 // vim: filetype=cpp:expandtab:shiftwidth=3:tabstop=3:softtabstop=3
     1156// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
  • trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/metadata/tsar_xbar_cluster.sd

    r885 r1048  
    3535                memc_dspin_out_width = parameter.Reference('dspin_cmd_width')),
    3636
     37        Uses('caba:vci_simple_ram',
     38                cell_size       = parameter.Reference('vci_data_width_ext')),
     39
    3740        Uses('caba:vci_simple_rom',
    3841                cell_size       = parameter.Reference('vci_data_width_int')),
    39 
    40         Uses('caba:vci_simple_ram',
    41                 cell_size       = parameter.Reference('vci_data_width_ext')),
    4242
    4343        Uses('caba:vci_simple_ram',
  • trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/src/tsar_xbar_cluster.cpp

    r1023 r1048  
    156156                     y_width,                            // Number of y bits in platform
    157157                     memc_ways, memc_sets, 16,           // CACHE SIZE
    158                      3,                                  // MAX NUMBER OF COPIES
     158                     4,                                  // MAX NUMBER OF COPIES
    159159                     4096,                               // HEAP SIZE
    160160                     8,                                  // TRANSACTION TABLE DEPTH
     
    343343                     64);            // burst size
    344344
    345         int mac = 0xBEEF0000;
    346345        mnic = new VciMultiNic<vci_param_int>(
    347346                     "mnic",
     
    349348                     mtd,
    350349                     nic_channels,
    351                      mac,             // mac_4 address
    352                      0xBABE,          // mac_2 address
    353                      nic_rx_name,
    354                      nic_tx_name);
     350                     0,             // mac_4 address
     351                     0,             // mac_2 address
     352                     1,             // NIC_MODE_SYNTHESIS
     353                     12);           // INTER_FRAME_GAP
    355354
    356355
     
    709708    delete router_cmd;
    710709    delete router_rsp;
     710    delete router_m2p;
     711    delete router_p2m;
     712    delete router_cla;
    711713    if (brom != NULL) {
    712714        delete brom;
Note: See TracChangeset for help on using the changeset viewer.