Index: trunk/platforms/tsar_generic_xbar/scripts/counter_defs.py
===================================================================
--- trunk/platforms/tsar_generic_xbar/scripts/counter_defs.py	(revision 1047)
+++ trunk/platforms/tsar_generic_xbar/scripts/counter_defs.py	(revision 1048)
@@ -11,9 +11,17 @@
 m_prot_name['hmesi'] = "HMESI"
 m_prot_name['wtidl'] = "WT IDEAL"
+m_prot_name['th0'] = "TH. 0"
 
 m_app_name = {}
-m_app_name['mandel'] = "Mandelbrot"
+m_app_name['barnes'] = "Barnes"
+m_app_name['blackscholes'] = "Blackscholes"
+m_app_name['cholesky'] = "Cholesky"
+m_app_name['fal_sh_1'] = "False Sharing 1"
+m_app_name['fal_sh_2'] = "False Sharing 2"
+m_app_name['fft'] = "FFT"
+m_app_name['fft_ga'] = "FFT"
 m_app_name['filter'] = "Convol"
 m_app_name['filt_ga'] = "Convol"
+m_app_name['fmm'] = "FMM"
 m_app_name['histogram'] = "Histogram"
 m_app_name['histogram-pad'] = "Histogram"
@@ -22,21 +30,19 @@
 m_app_name['kmeans'] = "Kmeans"
 m_app_name['kmeans-opt'] = "Kmeans"
+m_app_name['linear_regression'] = "Linear Reg."
+m_app_name['lu'] = "LU"
+m_app_name['mandel'] = "Mandelbrot"
+m_app_name['mat_mult'] = "Matrix Mult."
+m_app_name['mat_mult-opt'] = "Matrix Mult."
 m_app_name['pca'] = "PCA"
 m_app_name['pca-opt'] = "PCA"
-m_app_name['mat_mult'] = "Matrix Mult."
-m_app_name['mat_mult-opt'] = "Matrix Mult."
-m_app_name['barnes'] = "Barnes"
-m_app_name['fmm'] = "FMM"
 m_app_name['ocean'] = "Ocean"
+m_app_name['radix'] = "Radix"
+m_app_name['radix_ga'] = "Radix"
 m_app_name['raytrace'] = "Raytrace"
 m_app_name['radiosity'] = "Radiosity"
+m_app_name['string_match'] = "String Match"
 m_app_name['waters'] = "Water Sp."
 m_app_name['watern'] = "Water Nsq."
-m_app_name['cholesky'] = "Cholesky"
-m_app_name['lu'] = "LU"
-m_app_name['fft'] = "FFT"
-m_app_name['radix'] = "Radix"
-m_app_name['fft_ga'] = "FFT"
-m_app_name['radix_ga'] = "Radix"
 
 m_metric_id = {}
@@ -237,5 +243,5 @@
 
 #colors = [ "\"#008000\"", "\"#000080\"", "\"#BADC98\"", "\"#BA98DC\"", "\"#98DCBA\"", "\"#98BADC\"", "\"#BA9876\"", "\"#BA7698\"", "\"#98BA76\"", "\"#9876BA\"", "\"#76BA98\"", "\"#7698BA\"" ]
-colors = [ "\"#008000\"", "\"#FEDCBA\"", "\"#BADC98\"", "\"#000080\"", "\"#98DCBA\"", "\"#98BADC\"", "\"#BA9876\"", "\"#BA7698\"", "\"#98BA76\"", "\"#9876BA\"", "\"#76BA98\"", "\"#7698BA\"" ]
-
-
+colors = [ "\"#008000\"", "\"#FEDCBA\"", "\"#9876BA\"", "\"#000080\"", "\"#98DCBA\"", "\"#98BADC\"", "\"#BA9876\"", "\"#BA7698\"", "\"#98BA76\"", "\"#BADC98\"", "\"#76BA98\"", "\"#7698BA\"" ]
+
+
Index: trunk/platforms/tsar_generic_xbar/scripts/create_graphs.py
===================================================================
--- trunk/platforms/tsar_generic_xbar/scripts/create_graphs.py	(revision 1047)
+++ trunk/platforms/tsar_generic_xbar/scripts/create_graphs.py	(revision 1048)
@@ -7,12 +7,13 @@
 
 
+apps = [ 'blackscholes', 'filt_ga', 'fft_ga', 'histo-opt', 'kmeans-opt', 'linear_regression', 'lu', 'mandel', 'pca-opt', 'radix_ga', 'string_match' ]
+#apps = [ 'blackscholes', 'fft_ga', 'filt_ga', 'histo-opt', 'kmeans-opt', 'linear_regression', 'lu', 'mandel', 'pca-opt', 'radix_ga' ]
 #apps = [ 'histo-opt', 'mandel', 'filt_ga', 'radix_ga', 'fft_ga', 'pca-opt', 'fft', 'radix', 'filter', 'kmeans-opt' ]
-apps = [ 'fft_ga', 'filt_ga', 'lu', 'radix_ga', 'histo-opt', 'mandel', 'pca-opt', 'kmeans-opt' ]
 #apps = [ 'histogram', 'mandel', 'filter', 'fft', 'fft_ga', 'filt_ga', 'pca', 'lu' ]  # radix radix_ga kmeans
-#apps = [ 'histo-opt', 'histogram2', 'histo-opt2' ]
-#nb_procs = [ 1, 4, 8, 16, 32, 64, 128, 256 ]
+#apps = [ 'fal_sh_2' ]
 nb_procs = [ 1, 4, 8, 16, 32, 64, 128, 256 ]
-single_protocols = ['dhccp', 'hmesi']
-joint_protocols = ['dhccp', 'hmesi']
+#nb_procs = [ 256 ]
+single_protocols = ['dhccp', 'th0', 'hmesi', 'wtidl']
+joint_protocols = ['dhccp', 'th0', 'hmesi', 'wtidl' ]
 #joint_protocols = []
 
@@ -31,8 +32,9 @@
 log_term_name = '_term_'
 
-coherence_tmpl = os.path.join(scripts_path, template_dir, 'coherence_template.gp') # 1 graph per appli
-speedup_tmpl   = os.path.join(scripts_path, template_dir, 'speedup_template.gp')
-metric_tmpl    = os.path.join(scripts_path, template_dir, 'metric_template.gp') # 1 graph per metric
-stacked_tmpl   = os.path.join(scripts_path, template_dir, 'stacked_template.gp')
+coherence_tmpl     = os.path.join(scripts_path, template_dir, 'coherence_template.gp') # 1 graph per appli
+speedup_tmpl       = os.path.join(scripts_path, template_dir, 'speedup_template.gp')
+metric_tmpl        = os.path.join(scripts_path, template_dir, 'metric_template.gp') # 1 graph per metric
+stacked_tmpl       = os.path.join(scripts_path, template_dir, 'stacked_template.gp')
+cst_exec_time_tmpl = os.path.join(scripts_path, template_dir, 'cst_exec_time_template.gp')
 
 
@@ -140,5 +142,6 @@
          metrics_val[prot][app][i]['direct_cost']     = metrics_val[prot][app][i]['read_cost']       + metrics_val[prot][app][i]['write_cost']
          metrics_val[prot][app][i]['broadcast_cost']  = metrics_val[prot][app][i]['broadcast'] * 2 * (x * y - 1)
-         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]['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]['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']
          if metrics_val[prot][app][i]['broadcast'] < metrics_val[prot][app][i]['write_broadcast']:
             # test to patch a bug in mem_cache
@@ -159,312 +162,315 @@
 subprocess.call([ 'mkdir', '-p', os.path.join(scripts_path, graph_dir) ])
 
-############################################################
-### Graph 1 : Coherence traffic Cost per application     ###
-############################################################
-
-for prot in single_protocols:
-   for app in apps:
-      data_coherence_name = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_coherence.dat')
-      gp_coherence_name   = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_coherence.gp')
-   
-      # Creating the data file
-      width = 15
-      content = ""
-      
-      for metric in [ '#nb_procs' ] + grouped_metrics:
-         content += metric + " "
-         nb_spaces = width - len(metric)
-         content += nb_spaces * ' '
-      content += "\n"
-   
-      for i in nb_procs:
-         content += "%-15d " % i
-         for metric in grouped_metrics:
-            val = float(metrics_val[prot][app][i][metric]) / exec_time[prot][app][i] * 1000
-            content += "%-15f " % val
-         content += "\n"
-      
-      create_file(data_coherence_name, content)
-   
-      # Creating the gp file
-      template_file = open(coherence_tmpl, 'r')
-      template = template_file.read()
-      
-      plot_str = ""
-      col = 2
-      for metric in grouped_metrics:
-         if metric != grouped_metrics[0]:
-            plot_str += ", \\\n    "
-         plot_str += "\"" + data_coherence_name + "\" using ($1):($" + str(col) + ") lc rgb " + colors[col - 2] + " title \"" + m_metric_name[metric] + "\" with linespoint"
-         col += 1
-      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'))
-      
-      create_file(gp_coherence_name, gp_commands)
-      
-      # Calling gnuplot
-      print "gnuplot", gp_coherence_name
-      subprocess.call([ 'gnuplot', gp_coherence_name ])
-
-
-############################################################
-### Graph 2 : Speedup per Application                    ###
-############################################################
-
-for prot in single_protocols:
-   for app in apps:
-   
-      data_speedup_name = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_speedup.dat')
-      gp_speedup_name   = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_speedup.gp')
-      
-      # Creating data file
-      width = 15
-      content = "#nb_procs"
-      nb_spaces = width - len(content)
-      content += nb_spaces * ' '
-      content += "speedup\n"
-   
-      for i in nb_procs:
-         content += "%-15d " % i
-         val = exec_time[prot][app][i]
-         content += "%-15f\n" % (exec_time[prot][app][1] / float(val))
-   
-      plot_str = "\"" + data_speedup_name + "\" using ($1):($2) lc rgb \"#654387\" title \"Speedup\" with linespoint"
-      
-      create_file(data_speedup_name, content)
-      
-      # Creating the gp file
-      template_file = open(speedup_tmpl, 'r')
-      template = template_file.read()
-      
-      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'))
-      
-      create_file(gp_speedup_name, gp_commands)
-      
-      # Calling gnuplot
-      print "gnuplot", gp_speedup_name
-      subprocess.call([ 'gnuplot', gp_speedup_name ])
-
-
-############################################################
-### Graph 3 : All speedups on the same Graph             ###
-############################################################
-
-for prot in single_protocols:
-   # This graph uses the same template as the graph 2
-   data_speedup_name = os.path.join(scripts_path, gen_dir, prot + '_all_speedup.dat')
-   gp_speedup_name   = os.path.join(scripts_path, gen_dir, prot + '_all_speedup.gp')
-   
-   # Creating data file
-   width = 15
-   content = "#nb_procs"
-   nb_spaces = width - len(content)
-   content += (nb_spaces + 1) * ' '
-   for app in apps:
-      content += app + " "
-      content += (width - len(app)) * " "
-   content += "\n"
-   
-   for i in nb_procs:
-      content += "%-15d " % i
-      for app in apps:
-         val = exec_time[prot][app][i]
-         content += "%-15f " % (exec_time[prot][app][1] / float(val))
-      content += "\n"
-   
-   create_file(data_speedup_name, content)
-   
-   # Creating gp file
-   template_file = open(speedup_tmpl, 'r')
-   template = template_file.read()
-   
-   plot_str = ""
-   col = 2
-   for app in apps:
-      if app != apps[0]:
-         plot_str += ", \\\n     "
-      plot_str += "\"" + data_speedup_name + "\" using ($1):($" + str(col) + ") lc rgb %s title \"" % (colors[col - 2])  + m_app_name[app] + "\" with linespoint"
-      col += 1
-   
-   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'))
-      
-   create_file(gp_speedup_name, gp_commands)
-      
-   # Calling gnuplot
-   print "gnuplot", gp_speedup_name
-   subprocess.call([ 'gnuplot', gp_speedup_name ])
-
-
-############################################################
-### Graph 4 : Graph per metric                           ###
-############################################################
-
-# The following section creates the graphs grouped by measure (e.g. #broadcasts)
-# The template file cannot be easily created otherwise it would not be generic
-# in many ways. This is why it is mainly created here.
-# Graphs are created for metric in the "individual_metrics" list
-
-for prot in single_protocols:
-   for metric in individual_metrics:
-      data_metric_name = os.path.join(scripts_path, gen_dir, prot + '_' + metric + '.dat')
-      gp_metric_name   = os.path.join(scripts_path, gen_dir, prot + '_' + metric + '.gp')
-   
-      # Creating the gp file
-      # Setting xtics, i.e. number of procs for each application
-      xtics_str = "("
-      first = True
-      xpos = 1
-      app_labels = ""
-      for num_appli in range(0, len(apps)):
-         for i in nb_procs:
-            if not first:
-               xtics_str += ", "
-            first = False
-            if i == nb_procs[0]:
-               xpos_first = xpos
-            xtics_str += "\"%d\" %.1f" % (i, xpos)
-            xpos_last = xpos
-            xpos += 1.5
-         xpos += 0.5
-         app_name_xpos = float((xpos_first + xpos_last)) / 2
-         app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos)
-      xtics_str += ")"
-   
-      xmax_val = float(xpos - 1)
-   
-      # Writing the lines of "plot"
-      plot_str = ""
-      xpos = 0
-      first = True
-      column = 2
-      for i in range(0, len(nb_procs)):
-         if not first:
-            plot_str += ", \\\n    "
-         first = False
-         plot_str += "\"%s\" using ($1+%.1f):($%d) lc rgb %s notitle with boxes" % (data_metric_name, xpos, column, colors[i])
-         column += 1
-         xpos += 1.5
-   
-      template_file = open(metric_tmpl, 'r')
-      template = template_file.read()
-   
-      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))
-   
-      create_file(gp_metric_name, gp_commands)
-      
-      # Creating the data file
-      width = 15
-      content = "#x_pos"
-      nb_spaces = width - len(content)
-      content += nb_spaces * ' '
-      for i in nb_procs:
-         content += "%-15d" % i
-      content += "\n"
-   
-      x_pos = 1
-      for app in apps:
-         # Computation of x_pos
-         content += "%-15f" % x_pos
-         x_pos += len(nb_procs) * 1.5 + 0.5
-         for i in nb_procs:
-            if m_metric_norm[metric] == "N":
-               content += "%-15d" % (metrics_val[prot][app][i][metric])
-            elif m_metric_norm[metric] == "P":
-               content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / i)
-            elif m_metric_norm[metric] == "C":
-               content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / exec_time[prot][app][i] * 1000)
-            elif m_metric_norm[metric] == "W":
-               content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][i]['total_write'])) # Number of writes
-            elif m_metric_norm[metric] == "R":
-               content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][i]['total_read'])) # Number of reads
-            elif m_metric_norm[metric] == "D":
-               content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][i]['total_direct'])) # Number of req.
-            elif is_numeric(m_metric_norm[metric]):
-               content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][int(m_metric_norm[metric])][metric]))
-            else:
-               assert(False)
-   
-         app_name = m_app_name[app]
-         content += "#" + app_name + "\n"
-      
-      create_file(data_metric_name, content)
-   
-      # Calling gnuplot
-      print "gnuplot", gp_metric_name
-      subprocess.call([ 'gnuplot', gp_metric_name ])
-
-
-############################################################
-### Graph 5 : Stacked histogram with counters            ###
-############################################################
-
-# The following section creates a stacked histogram containing
-# the metrics in the "stacked_metric" list
-# It is normalized per application w.r.t the values on 256 procs
-
-for prot in single_protocols:
-   data_stacked_name = os.path.join(scripts_path, gen_dir, prot + '_stacked.dat')
-   gp_stacked_name   = os.path.join(scripts_path, gen_dir, prot + '_stacked.gp')
-   
-   norm_factor_value = nb_procs[-1]
-   
-   # Creating the gp file
-   template_file = open(stacked_tmpl, 'r')
-   template = template_file.read()
-   
-   xtics_str = "("
-   first = True
-   xpos = 1
-   app_labels = ""
-   for num_appli in range(0, len(apps)):
-      for i in nb_procs[1:len(nb_procs)]: # skipping values for 1 proc
-         if not first:
-            xtics_str += ", "
-         first = False
-         if i == nb_procs[1]:
-            xpos_first = xpos
-         xtics_str += "\"%d\" %d -1" % (i, xpos)
-         xpos_last = xpos
-         xpos += 1
-      xpos += 1
-      app_name_xpos = float((xpos_first + xpos_last)) / 2
-      app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos)
-   xtics_str += ")"
-   
-   plot_str = "newhistogram \"\""
-   n = 1
-   for stacked_metric in stacked_metrics:
-      plot_str += ", \\\n    " + "'" + data_stacked_name + "'" + " using " + str(n) + " lc rgb " + colors[n] + " title \"" + m_metric_name[stacked_metric] + "\""
-      n += 1
-   
-   ylabel_str = "Breakdown of Coherence Traffic Normalized w.r.t. \\nthe Values on %d Processors" % norm_factor_value
-   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 = "")
-   
-   create_file(gp_stacked_name, content)
-   
-   # Creating the data file
-   # Values are normalized by application, w.r.t. the number of requests for a given number of procs
-   content = "#"
-   for stacked_metric in stacked_metrics:
-      content += stacked_metric
-      content += ' ' + ' ' * (15 - len(stacked_metric))
-   content += "\n"
-   for app in apps:
-      if app != apps[0]:
-         for i in range(0, len(stacked_metrics)):
-            content += "%-15f" % 0.0
-         content += "\n"
-      for i in nb_procs[1:len(nb_procs)]:
-         for stacked_metric in stacked_metrics:
-            metric_val = metrics_val[prot][app][norm_factor_value]['total_stacked'] # Normalisation
-            if metric_val != 0:
-               content += "%-15f" % (float(metrics_val[prot][app][i][stacked_metric]) / metric_val)
-            else:
-               content += "%-15f" % 0
-         content += "\n"
-   
-   create_file(data_stacked_name, content)
-   # Calling gnuplot
-   print "gnuplot", gp_stacked_name
-   subprocess.call([ 'gnuplot', gp_stacked_name ])
+#############################################################
+#### Graph 1 : Coherence traffic Cost per application     ###
+#############################################################
+#
+#for prot in single_protocols:
+#   for app in apps:
+#      data_coherence_name = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_coherence.dat')
+#      gp_coherence_name   = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_coherence.gp')
+#   
+#      # Creating the data file
+#      width = 15
+#      content = ""
+#      
+#      for metric in [ '#nb_procs' ] + grouped_metrics:
+#         content += metric + " "
+#         nb_spaces = width - len(metric)
+#         content += nb_spaces * ' '
+#      content += "\n"
+#   
+#      for i in nb_procs:
+#         content += "%-15d " % i
+#         for metric in grouped_metrics:
+#            #print "app : %s - prot : %s - i : %d" % (app, prot, i)
+#            val = float(metrics_val[prot][app][i][metric]) / exec_time[prot][app][i] * 1000
+#            content += "%-15f " % val
+#         content += "\n"
+#      
+#      create_file(data_coherence_name, content)
+#   
+#      # Creating the gp file
+#      template_file = open(coherence_tmpl, 'r')
+#      template = template_file.read()
+#      
+#      plot_str = ""
+#      col = 2
+#      for metric in grouped_metrics:
+#         if metric != grouped_metrics[0]:
+#            plot_str += ", \\\n    "
+#         plot_str += "\"" + data_coherence_name + "\" using ($1):($" + str(col) + ") lc rgb " + colors[col - 2] + " title \"" + m_metric_name[metric] + "\" with linespoint"
+#         col += 1
+#      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'))
+#      
+#      create_file(gp_coherence_name, gp_commands)
+#      
+#      # Calling gnuplot
+#      print "gnuplot", gp_coherence_name
+#      subprocess.call([ 'gnuplot', gp_coherence_name ])
+#
+#
+#############################################################
+#### Graph 2 : Speedup per Application                    ###
+#############################################################
+#
+#if 1 in nb_procs:
+#   for prot in single_protocols:
+#      for app in apps:
+#   
+#         data_speedup_name = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_speedup.dat')
+#         gp_speedup_name   = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_speedup.gp')
+#         
+#         # Creating data file
+#         width = 15
+#         content = "#nb_procs"
+#         nb_spaces = width - len(content)
+#         content += nb_spaces * ' '
+#         content += "speedup\n"
+#   
+#         for i in nb_procs:
+#            content += "%-15d " % i
+#            val = exec_time[prot][app][i]
+#            content += "%-15f\n" % (exec_time[prot][app][1] / float(val))
+#   
+#         plot_str = "\"" + data_speedup_name + "\" using ($1):($2) lc rgb \"#654387\" title \"Speedup\" with linespoint"
+#         
+#         create_file(data_speedup_name, content)
+#         
+#         # Creating the gp file
+#         template_file = open(speedup_tmpl, 'r')
+#         template = template_file.read()
+#         
+#         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'))
+#         
+#         create_file(gp_speedup_name, gp_commands)
+#         
+#         # Calling gnuplot
+#         print "gnuplot", gp_speedup_name
+#         subprocess.call([ 'gnuplot', gp_speedup_name ])
+#
+#
+#############################################################
+#### Graph 3 : All speedups on the same Graph             ###
+#############################################################
+#
+#if 1 in nb_procs:
+#   for prot in single_protocols:
+#      # This graph uses the same template as the graph 2
+#      data_speedup_name = os.path.join(scripts_path, gen_dir, prot + '_all_speedup.dat')
+#      gp_speedup_name   = os.path.join(scripts_path, gen_dir, prot + '_all_speedup.gp')
+#      
+#      # Creating data file
+#      width = 15
+#      content = "#nb_procs"
+#      nb_spaces = width - len(content)
+#      content += (nb_spaces + 1) * ' '
+#      for app in apps:
+#         content += app + " "
+#         content += (width - len(app)) * " "
+#      content += "\n"
+#      
+#      for i in nb_procs:
+#         content += "%-15d " % i
+#         for app in apps:
+#            val = exec_time[prot][app][i]
+#            content += "%-15f " % (exec_time[prot][app][1] / float(val))
+#         content += "\n"
+#      
+#      create_file(data_speedup_name, content)
+#      
+#      # Creating gp file
+#      template_file = open(speedup_tmpl, 'r')
+#      template = template_file.read()
+#      
+#      plot_str = ""
+#      col = 2
+#      for app in apps:
+#         if app != apps[0]:
+#            plot_str += ", \\\n     "
+#         plot_str += "\"" + data_speedup_name + "\" using ($1):($" + str(col) + ") lc rgb %s title \"" % (colors[col - 2])  + m_app_name[app] + "\" with linespoint"
+#         col += 1
+#      
+#      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'))
+#         
+#      create_file(gp_speedup_name, gp_commands)
+#         
+#      # Calling gnuplot
+#      print "gnuplot", gp_speedup_name
+#      subprocess.call([ 'gnuplot', gp_speedup_name ])
+#
+#
+#############################################################
+#### Graph 4 : Graph per metric                           ###
+#############################################################
+#
+## The following section creates the graphs grouped by measure (e.g. #broadcasts)
+## The template file cannot be easily created otherwise it would not be generic
+## in many ways. This is why it is mainly created here.
+## Graphs are created for metric in the "individual_metrics" list
+#
+#for prot in single_protocols:
+#   for metric in individual_metrics:
+#      data_metric_name = os.path.join(scripts_path, gen_dir, prot + '_' + metric + '.dat')
+#      gp_metric_name   = os.path.join(scripts_path, gen_dir, prot + '_' + metric + '.gp')
+#   
+#      # Creating the gp file
+#      # Setting xtics, i.e. number of procs for each application
+#      xtics_str = "("
+#      first = True
+#      xpos = 1
+#      app_labels = ""
+#      for num_appli in range(0, len(apps)):
+#         for i in nb_procs:
+#            if not first:
+#               xtics_str += ", "
+#            first = False
+#            if i == nb_procs[0]:
+#               xpos_first = xpos
+#            xtics_str += "\"%d\" %.1f" % (i, xpos)
+#            xpos_last = xpos
+#            xpos += 1.5
+#         xpos += 0.5
+#         app_name_xpos = float((xpos_first + xpos_last)) / 2
+#         app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos)
+#      xtics_str += ")"
+#   
+#      xmax_val = float(xpos - 1)
+#   
+#      # Writing the lines of "plot"
+#      plot_str = ""
+#      xpos = 0
+#      first = True
+#      column = 2
+#      for i in range(0, len(nb_procs)):
+#         if not first:
+#            plot_str += ", \\\n    "
+#         first = False
+#         plot_str += "\"%s\" using ($1+%.1f):($%d) lc rgb %s notitle with boxes" % (data_metric_name, xpos, column, colors[i])
+#         column += 1
+#         xpos += 1.5
+#   
+#      template_file = open(metric_tmpl, 'r')
+#      template = template_file.read()
+#   
+#      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))
+#   
+#      create_file(gp_metric_name, gp_commands)
+#      
+#      # Creating the data file
+#      width = 15
+#      content = "#x_pos"
+#      nb_spaces = width - len(content)
+#      content += nb_spaces * ' '
+#      for i in nb_procs:
+#         content += "%-15d" % i
+#      content += "\n"
+#   
+#      x_pos = 1
+#      for app in apps:
+#         # Computation of x_pos
+#         content += "%-15f" % x_pos
+#         x_pos += len(nb_procs) * 1.5 + 0.5
+#         for i in nb_procs:
+#            if m_metric_norm[metric] == "N":
+#               content += "%-15d" % (metrics_val[prot][app][i][metric])
+#            elif m_metric_norm[metric] == "P":
+#               content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / i)
+#            elif m_metric_norm[metric] == "C":
+#               content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / exec_time[prot][app][i] * 1000)
+#            elif m_metric_norm[metric] == "W":
+#               content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][i]['total_write'])) # Number of writes
+#            elif m_metric_norm[metric] == "R":
+#               content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][i]['total_read'])) # Number of reads
+#            elif m_metric_norm[metric] == "D":
+#               content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][i]['total_direct'])) # Number of req.
+#            elif is_numeric(m_metric_norm[metric]):
+#               content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][int(m_metric_norm[metric])][metric]))
+#            else:
+#               assert(False)
+#   
+#         app_name = m_app_name[app]
+#         content += "#" + app_name + "\n"
+#      
+#      create_file(data_metric_name, content)
+#   
+#      # Calling gnuplot
+#      print "gnuplot", gp_metric_name
+#      subprocess.call([ 'gnuplot', gp_metric_name ])
+#
+#
+#############################################################
+#### Graph 5 : Stacked histogram with counters            ###
+#############################################################
+#
+## The following section creates a stacked histogram containing
+## the metrics in the "stacked_metric" list
+## It is normalized per application w.r.t the values on 256 procs
+#
+#for prot in single_protocols:
+#   data_stacked_name = os.path.join(scripts_path, gen_dir, prot + '_stacked.dat')
+#   gp_stacked_name   = os.path.join(scripts_path, gen_dir, prot + '_stacked.gp')
+#   
+#   norm_factor_value = nb_procs[-1]
+#   
+#   # Creating the gp file
+#   template_file = open(stacked_tmpl, 'r')
+#   template = template_file.read()
+#   
+#   xtics_str = "("
+#   first = True
+#   xpos = 1
+#   app_labels = ""
+#   for num_appli in range(0, len(apps)):
+#      for i in nb_procs[1:len(nb_procs)]: # skipping values for 1 proc
+#         if not first:
+#            xtics_str += ", "
+#         first = False
+#         if i == nb_procs[1]:
+#            xpos_first = xpos
+#         xtics_str += "\"%d\" %d -1" % (i, xpos)
+#         xpos_last = xpos
+#         xpos += 1
+#      xpos += 1
+#      app_name_xpos = float((xpos_first + xpos_last)) / 2
+#      app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos)
+#   xtics_str += ")"
+#   
+#   plot_str = "newhistogram \"\""
+#   n = 1
+#   for stacked_metric in stacked_metrics:
+#      plot_str += ", \\\n    " + "'" + data_stacked_name + "'" + " using " + str(n) + " lc rgb " + colors[n] + " title \"" + m_metric_name[stacked_metric] + "\""
+#      n += 1
+#   
+#   ylabel_str = "Breakdown of Coherence Traffic Normalized w.r.t. \\nthe Values on %d Processors" % norm_factor_value
+#   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 = "")
+#   
+#   create_file(gp_stacked_name, content)
+#   
+#   # Creating the data file
+#   # Values are normalized by application, w.r.t. the number of requests for a given number of procs
+#   content = "#"
+#   for stacked_metric in stacked_metrics:
+#      content += stacked_metric
+#      content += ' ' + ' ' * (15 - len(stacked_metric))
+#   content += "\n"
+#   for app in apps:
+#      if app != apps[0]:
+#         for i in range(0, len(stacked_metrics)):
+#            content += "%-15f" % 0.0
+#         content += "\n"
+#      for i in nb_procs[1:len(nb_procs)]:
+#         for stacked_metric in stacked_metrics:
+#            metric_val = metrics_val[prot][app][norm_factor_value]['total_stacked'] # Normalisation
+#            if metric_val != 0:
+#               content += "%-15f" % (float(metrics_val[prot][app][i][stacked_metric]) / metric_val)
+#            else:
+#               content += "%-15f" % 0
+#         content += "\n"
+#   
+#   create_file(data_stacked_name, content)
+#   # Calling gnuplot
+#   print "gnuplot", gp_stacked_name
+#   subprocess.call([ 'gnuplot', gp_stacked_name ])
 
 
@@ -508,5 +514,5 @@
             xpos += 3
       app_name_xpos = float((xpos_first + xpos_last)) / 2
-      app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos)
+      app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,28\"\n" % (m_app_name[apps[num_appli]], app_name_xpos)
       #xpos += 1
    xtics_str += ")"
@@ -518,5 +524,5 @@
       n += 1
    
-   ylabel_str = "Coherence Cost Compared to Direct Requests Cost,\\nNormalized per Application for each Number of Processors"
+   ylabel_str = "Coherence Cost Vs. Direct Requests Cost,\\nNormalized w.r.t. Direct Requests Cost"
    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 = "")
    
@@ -581,44 +587,45 @@
 
 
-for app in apps:
-
-   data_speedup_name = os.path.join(scripts_path, gen_dir, 'joint_' + app + '_speedup.dat')
-   gp_speedup_name   = os.path.join(scripts_path, gen_dir, 'joint_' + app + '_speedup.gp')
-   
-   # Creating data file
-   width = 15
-   content = "#nb_procs"
-   nb_spaces = width - len(content)
-   content += nb_spaces * ' '
-   content += "speedup\n"
-
-   for i in nb_procs:
-      content += "%-15d " % i
-      for prot in joint_protocols:
-         val = exec_time[prot][app][i]
-         content += "%-15f " % (exec_time[joint_protocols[0]][app][1] / float(val))
-      content += "\n"
-
-   create_file(data_speedup_name, content)
-   
-   # Creating the gp file
-   template_file = open(speedup_tmpl, 'r')
-   template = template_file.read()
-  
-   plot_str = ""
-   col = 2
-   for prot in joint_protocols:
-      if prot != joint_protocols[0]:
-         plot_str += ", \\\n     "
-      plot_str += "\"" + data_speedup_name + "\" using ($1):($" + str(col) + ") lc rgb %s title \"" % (colors[col - 2])  + m_prot_name[prot] + "\" with linespoint"
-      col += 1
-  
-   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'))
-   
-   create_file(gp_speedup_name, gp_commands)
-   
-   # Calling gnuplot
-   print "gnuplot", gp_speedup_name
-   subprocess.call([ 'gnuplot', gp_speedup_name ])
+#if 1 in nb_procs:
+#   for app in apps:
+#   
+#      data_speedup_name = os.path.join(scripts_path, gen_dir, 'joint_' + app + '_speedup.dat')
+#      gp_speedup_name   = os.path.join(scripts_path, gen_dir, 'joint_' + app + '_speedup.gp')
+#      
+#      # Creating data file
+#      width = 15
+#      content = "#nb_procs"
+#      nb_spaces = width - len(content)
+#      content += nb_spaces * ' '
+#      content += "speedup\n"
+#   
+#      for i in nb_procs:
+#         content += "%-15d " % i
+#         for prot in joint_protocols:
+#            val = exec_time[prot][app][i]
+#            content += "%-15f " % (exec_time[joint_protocols[0]][app][1] / float(val))
+#         content += "\n"
+#   
+#      create_file(data_speedup_name, content)
+#      
+#      # Creating the gp file
+#      template_file = open(speedup_tmpl, 'r')
+#      template = template_file.read()
+#     
+#      plot_str = ""
+#      col = 2
+#      for prot in joint_protocols:
+#         if prot != joint_protocols[0]:
+#            plot_str += ", \\\n     "
+#         plot_str += "\"" + data_speedup_name + "\" using ($1):($" + str(col) + ") lc rgb %s title \"" % (colors[col - 2])  + m_prot_name[prot] + "\" with linespoint"
+#         col += 1
+#     
+#      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'))
+#      
+#      create_file(gp_speedup_name, gp_commands)
+#      
+#      # Calling gnuplot
+#      print "gnuplot", gp_speedup_name
+#      subprocess.call([ 'gnuplot', gp_speedup_name ])
 
 
@@ -638,8 +645,9 @@
 template_file = open(stacked_tmpl, 'r')
 template = template_file.read()
-   
+ 
 xtics_str = "("
 first = True
-xpos = 1 # successive x position of the center of the first bar in a application
+barwidth = 1
+xpos = 1 # successive x position of the center of the first bar in an application
 app_labels = ""
 prot_labels = ""
@@ -650,5 +658,5 @@
          x = 0 # local var for computing position of protocol names
          for prot in joint_protocols:
-            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?)
+            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?)
             x += 2
 
@@ -660,9 +668,10 @@
             xpos_first = xpos
          xtics_str += "\"%d\" %f -1" % (i, float(xpos - 0.5 + len(joint_protocols)))
+         #xtics_str += "\"\" %f -1" % (float(xpos - 0.5 + len(joint_protocols))) # not to have proc number displayed
          xpos_last = xpos
-         xpos += 1 + len(joint_protocols) * 2
-   app_name_xpos = float((xpos_first + xpos_last)) / 2
+         xpos += 1 + len(joint_protocols) * 2 * barwidth
+   app_name_xpos = float((xpos_first + xpos_last)) / 2 + 2
    app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos)
-   xpos += 1
+   #xpos += 1
 xtics_str += ")"
 
@@ -673,5 +682,5 @@
    n += 1
 
-ylabel_str = "Coherence Cost and Direct Requests Cost,\\nNormalized per Application for each Number of Processors"
+ylabel_str = "Coherence Cost vs. Direct Requests Cost,\\nNormalized per Application for each Number of Processors"
 content = 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)
 
@@ -800,4 +809,51 @@
 
 
-
-
+#########################################################################################################
+### Graph 10: Normalized exec times with no log scale: when scalability is achieved by constant time  ###
+#########################################################################################################
+
+
+if 1 in nb_procs:
+   for app in apps:
+   
+      data_speedup_name = os.path.join(scripts_path, gen_dir, 'joint_' + app + '_cst_exec_time.dat')
+      gp_speedup_name   = os.path.join(scripts_path, gen_dir, 'joint_' + app + '_cst_exec_time.gp')
+      
+      # Creating data file
+      width = 15
+      content = "#nb_procs"
+      nb_spaces = width - len(content)
+      content += nb_spaces * ' '
+      content += "norm_exec_time\n"
+   
+      for i in nb_procs:
+         content += "%-15d " % i
+         for prot in joint_protocols:
+            val = exec_time[prot][app][i]
+            content += "%-15f " % (float(val) / exec_time[joint_protocols[0]][app][1])
+         content += "\n"
+   
+      create_file(data_speedup_name, content)
+      
+      # Creating the gp file
+      template_file = open(cst_exec_time_tmpl, 'r')
+      template = template_file.read()
+     
+      plot_str = ""
+      col = 2
+      for prot in joint_protocols:
+         if prot != joint_protocols[0]:
+            plot_str += ", \\\n     "
+         plot_str += "\"" + data_speedup_name + "\" using ($1):($" + str(col) + ") lc rgb %s title \"" % (colors[col - 2])  + m_prot_name[prot] + "\" with linespoint"
+         col += 1
+     
+      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'))
+      
+      create_file(gp_speedup_name, gp_commands)
+      
+      # Calling gnuplot
+      print "gnuplot", gp_speedup_name
+      subprocess.call([ 'gnuplot', gp_speedup_name ])
+
+
+
Index: trunk/platforms/tsar_generic_xbar/scripts/gen_arch_info.py
===================================================================
--- trunk/platforms/tsar_generic_xbar/scripts/gen_arch_info.py	(revision 1047)
+++ trunk/platforms/tsar_generic_xbar/scripts/gen_arch_info.py	(revision 1048)
@@ -29,4 +29,5 @@
     print "        BSTTY=0x%x" % bstty
     print "        BSDMA=0x%x" % bsdma
+    print "        BSHCRYPT=0" # Not supported
     print " "
     print " "
Index: trunk/platforms/tsar_generic_xbar/scripts/run_simus.py
===================================================================
--- trunk/platforms/tsar_generic_xbar/scripts/run_simus.py	(revision 1047)
+++ trunk/platforms/tsar_generic_xbar/scripts/run_simus.py	(revision 1048)
@@ -17,8 +17,8 @@
 bscpu = 0 # bootstrap CPU
 nb_procs = [ 4 ]
-#nb_procs = [ 1, 4, 8, 16, 32, 64, 128, 256 ]
+#nb_procs = [ 1, 2, 4, 8, 16, 32, 64, 128, 256 ]
 rerun_stats = False
-use_omp = False
-protocol = 'rwt'
+use_omp = True
+protocol = 'dhccp'
 cpu_per_cluster = 4
 # mode must be one of 'test' and 'simu'
@@ -27,19 +27,24 @@
 #apps = [ 'cholesky', 'fft', 'fft_ga', 'filter', 'filt_ga', 'histogram', 'kmeans', 'lu', 'mandel', 'mat_mult', 'pca', 'radix_ga' ]
 #apps = [ 'histogram', 'mandel', 'filter', 'radix_ga', 'fft_ga', 'kmeans' ]
-#apps = [ 'blackscholes', 'linear_regression', 'string_match', 'swaptions', 'fluidanimate' ]
-apps = [ 'hello', 'taquin', '2048' ]
-
-
-# Variables which could be changed but ought not to because they are reflected in the create_graphs.py script
+apps = [ 'fal_sh_2' ]
+
+#apps = [ 'pca-opt', 'blackscholes', 'fft_ga', 'filt_ga', 'histo-opt', 'kmeans-opt', 'linear_regression', 'lu', 'mandel', 'radix_ga', 'string_match' ]
+#apps = [ 'pca-opt', 'blackscholes', 'fft_ga', 'filt_ga', 'histo-opt', 'kmeans-opt', 'linear_regression', 'lu', 'mandel', 'mat_mult-opt', 'radix_ga', 'string_match' ]
+
 if mode == 'test':
     data_dir = 'data_test'
 else:
     data_dir = 'data'
-log_init_name = protocol + '_stdo_'
+
+# Variables which could be changed but ought not to because they are reflected in the create_graphs.py script
+
+log_stdo_name = protocol + '_stdo_'
 log_term_name = protocol + '_term_'
 
+
 # Global Variables
 
-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']
+all_modes = ['simu', 'test']
+all_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', ]
 # to come: 'barnes', 'fmm', 'ocean', 'raytrace', 'radiosity', 'waters', 'watern'
 
@@ -60,5 +65,5 @@
 hard_config_name      = os.path.join(almos_path, "hard_config.h")
 bootloader_file_name  = os.path.join(almos_path, "bootloader-tsar-mipsel.bin")
-preloader_file_name   = os.path.join(almos_path, "preloader.elf")
+#preloader_file_name   = os.path.join(almos_path, "preloader.elf")
 preloader_build_path  = os.path.join(almos_path, "build_preloader")
 bootloader_build_path = os.path.join(almos_path, "build_bootloader")
@@ -227,5 +232,4 @@
     for common_module in common_modules:
         f.write("config.addDescPath(\"%s/%s\")\n" % (tsar_dir, common_module))
-    #f.write("\n")
 
     if protocol == "dhccp":
@@ -243,5 +247,4 @@
         f.write("config.addDescPath(\"%s/%s\")\n" % (arch_dir, specific_module))
 
-    #f.write("\n")
     f.close()
 
@@ -330,5 +333,5 @@
     print "cd", preloader_src_dir
     os.chdir(preloader_src_dir)
-    cmd = ['make', hard_conf_path_set, bscpu_set, 'USE_DT=0', 'BUILD_DIR=%s' % (preloader_build_path)]
+    cmd = ['make', hard_conf_path_set, bscpu_set, 'BLOCK_SIZE=4096', 'USE_32BIT=1', 'USE_DT=0', 'BUILD_DIR=%s' % (preloader_build_path)]
     retval = print_and_call(cmd)
     if retval != 0:
@@ -406,4 +409,8 @@
         elif (app_name == "boot_only"):
             shrc = "exec -p 0 /bin/boot_onl\n"
+        elif (app_name == "fal_sh_1"):
+            shrc = "exec -p 0 /bin/fal_sh_1 -n %(nproc)d -p %(niter)d\n" % dict(nproc = nprocs, niter = 100)
+        elif (app_name == "fal_sh_2"):
+            shrc = "exec -p 0 /bin/fal_sh_2 -n %(nproc)d -p %(niter)d\n" % dict(nproc = nprocs, niter = 100)
         elif (app_name == "filter"):
             shrc = "exec -p 0 /bin/filter -l 128 -c 128 -n %(nproc)d -i /etc/img128.raw\n" % dict(nproc = nprocs)
@@ -460,4 +467,8 @@
         elif (app_name == "cholesky"):
             shrc = "exec -p 0 /bin/cholesky -n%(nproc)d /etc/tk14.O\n" % dict(nproc = nprocs)
+        elif (app_name == "fal_sh_1"):
+            shrc = "exec -p 0 /bin/fal_sh_1 -n %(nproc)d -p %(niter)d\n" % dict(nproc = nprocs, niter = 10000)
+        elif (app_name == "fal_sh_2"):
+            shrc = "exec -p 0 /bin/fal_sh_2 -n %(nproc)d -p %(niter)d\n" % dict(nproc = nprocs, niter = 10000)
         elif (app_name == "fft"):
             shrc = "exec -p 0 /bin/fft -n%(nproc)d -m18\n" % dict(nproc = nprocs)
@@ -533,5 +544,4 @@
 print_and_call(cmd)
 
-#gen_sym_links()
 gen_soclib_conf()
 compile_almos()
@@ -580,5 +590,5 @@
         else:
             cmd = ['./simul.x']
-        filename = os.path.join(scripts_path, data_dir, app + '_' + log_init_name + str(i))
+        filename = os.path.join(scripts_path, data_dir, app + '_' + log_stdo_name + str(i))
         output = print_and_popen(cmd, filename)
  
@@ -613,5 +623,5 @@
             else:
                 cmd = ['./simul.x', '--reset-counters', start2, '--dump-counters', end]
-            filename = os.path.join(scripts_path, data_dir, app + '_' + log_init_name + str(i))
+            filename = os.path.join(scripts_path, data_dir, app + '_' + log_stdo_name + str(i))
             output = print_and_popen(cmd, filename)
            
Index: trunk/platforms/tsar_generic_xbar/scripts/templates/metric_template.gp
===================================================================
--- trunk/platforms/tsar_generic_xbar/scripts/templates/metric_template.gp	(revision 1047)
+++ trunk/platforms/tsar_generic_xbar/scripts/templates/metric_template.gp	(revision 1048)
@@ -1,4 +1,4 @@
 
-set terminal svg size 1000 300 fixed
+set terminal svg size 1200 300 fixed
 set output "%(svg_name)s.svg"
 
Index: trunk/platforms/tsar_generic_xbar/scripts/templates/speedup_template.gp
===================================================================
--- trunk/platforms/tsar_generic_xbar/scripts/templates/speedup_template.gp	(revision 1047)
+++ trunk/platforms/tsar_generic_xbar/scripts/templates/speedup_template.gp	(revision 1048)
@@ -3,6 +3,6 @@
 set output "%(svg_name)s.svg"
 
-set ylabel "Speedup for %(appli)s" font "Times,12"
-set xlabel "Number of Cores" font "Times,12"
+#set ylabel "Speedup for %(appli)s" font "Times,12"
+#set xlabel "Number of Cores" font "Times,12"
 
 set xrange [1:%(nb_procs)d]
@@ -15,4 +15,7 @@
 set grid mytics
 
+set ytics font "Times,16"
+set xtics font "Times,16"
+
 set logscale x 2
 set logscale y 2
Index: trunk/platforms/tsar_generic_xbar/scripts/templates/stacked_template.gp
===================================================================
--- trunk/platforms/tsar_generic_xbar/scripts/templates/stacked_template.gp	(revision 1047)
+++ trunk/platforms/tsar_generic_xbar/scripts/templates/stacked_template.gp	(revision 1048)
@@ -1,4 +1,4 @@
 
-set terminal svg size 1500 500 fixed
+set terminal svg size 2500 500 fixed
 set output "%(svg_name)s.svg"
 
@@ -24,5 +24,5 @@
 
 # border : ne croise pas l'axe ; in : a l'interieur ; scale : taille (major,minor) ; offset : offset du texte
-set xtics border in scale 0.0,0.0 nomirror rotate by 0 offset character 0,0 font "Times,10"
+set xtics border in scale 0.0,0.0 nomirror rotate by 0 offset character 0,0 font "Times,19"
 set ytics border out scale 1,0.5 nomirror norotate offset character 0,0
 
@@ -30,5 +30,5 @@
 
 set xlabel " "
-set ylabel "%(ylabel_str)s" font "Times,14" 
+set ylabel "%(ylabel_str)s" font "Times,24" 
 
 %(app_labels)s
Index: trunk/platforms/tsar_generic_xbar/soclib.conf
===================================================================
--- trunk/platforms/tsar_generic_xbar/soclib.conf	(revision 1047)
+++ 	(revision )
@@ -1,19 +1,0 @@
-
-# DescPath modified by a script
-
-
-config.default = config.mysystemcass
-
-config.addDescPath("/users/cao/meunier/src/tsar/lib/generic_llsc_global_table")
-config.addDescPath("/users/cao/meunier/src/tsar/modules/dspin_router_tsar")
-config.addDescPath("/users/cao/meunier/src/tsar/modules/sdmmc")
-config.addDescPath("/users/cao/meunier/src/tsar/modules/vci_block_device_tsar")
-config.addDescPath("/users/cao/meunier/src/tsar/modules/vci_ethernet_tsar")
-config.addDescPath("/users/cao/meunier/src/tsar/modules/vci_io_bridge")
-config.addDescPath("/users/cao/meunier/src/tsar/modules/vci_iox_network")
-config.addDescPath("/users/cao/meunier/src/tsar/modules/vci_spi")
-config.addDescPath("/users/cao/meunier/src/tsar/platforms/tsar_generic_xbar/tsar_xbar_cluster")
-config.addDescPath("/users/cao/meunier/src/tsar/communication")
-config.addDescPath("/users/cao/meunier/src/tsar/lib/generic_cache_tsar")
-config.addDescPath("/users/cao/meunier/src/tsar/modules/vci_cc_vcache_wrapper")
-config.addDescPath("/users/cao/meunier/src/tsar/modules/vci_mem_cache")
Index: trunk/platforms/tsar_generic_xbar/top.cpp
===================================================================
--- trunk/platforms/tsar_generic_xbar/top.cpp	(revision 1047)
+++ trunk/platforms/tsar_generic_xbar/top.cpp	(revision 1048)
@@ -95,17 +95,5 @@
 
 #define USE_ALMOS 1
-//#define USE_GIET 
-
-#ifdef USE_ALMOS
-#ifdef USE_GIET
-#error "Can't use Two different OS"
-#endif
-#endif
-
-#ifndef USE_ALMOS
-#ifndef USE_GIET
-#error "You need to specify one OS"
-#endif
-#endif
+
 
 #ifdef USE_ALMOS
@@ -113,7 +101,4 @@
    #include "almos/hard_config.h"
 #endif
-#ifdef USE_GIET
-   #define PREFIX_OS "giet_vm/"
-#endif
 
 ///////////////////////////////////////////////////
@@ -122,6 +107,6 @@
 
 
-#if USE_OPENMP
-#include <omp.h>
+#ifdef USE_OPENMP
+    #include <omp.h>
 #endif
 
@@ -152,7 +137,4 @@
 #ifdef USE_ALMOS
 #define vci_address_width     32
-#endif
-#ifdef USE_GIET
-#define vci_address_width     40
 #endif
 #define vci_plen_width        8
@@ -185,13 +167,5 @@
 #define FBUF_Y_SIZE           1024
 #endif
-#ifdef USE_GIET
-#define FBUF_X_SIZE           128
-#define FBUF_Y_SIZE           128
-#endif
-
-#ifdef USE_GIET
-#define BDEV_SECTOR_SIZE      512
-#define BDEV_IMAGE_NAME       PREFIX_OS"display/images.raw"
-#endif
+
 #ifdef USE_ALMOS
 #define BDEV_SECTOR_SIZE      4096
@@ -214,7 +188,4 @@
 #ifdef USE_ALMOS
 #define soft_name       PREFIX_OS"preloader.elf"
-#endif
-#ifdef USE_GIET
-#define soft_pathname   PREFIX_OS"soft.elf"
 #endif
 
@@ -244,121 +215,113 @@
 #endif
 
-#ifdef USE_ALMOS
-   // 2^19 is the offset for the local id (8 bits for global ID :
-   // 1 bit for Memcache or Peripheral, 4 for local peripheral id)
-   // (Almos supports 32 bits physical addresses)
-#endif
-
 bool stop_called = false;
+
+using namespace sc_core;
+using namespace soclib::caba;
+using namespace soclib::common;
 
 /////////////////////////////////
 int _main(int argc, char *argv[])
 {
-   using namespace sc_core;
-   using namespace soclib::caba;
-   using namespace soclib::common;
-
-   const int64_t max_cycles   = 5000000;             // Maximum number of cycles simulated in one sc_start call
-   int64_t ncycles            = 0x7FFFFFFFFFFFFFFF;  // simulated cycles
-   char     disk_name[256]    = BDEV_IMAGE_NAME;    // pathname to the disk image
-   char     nic_rx_name[256]  = NIC_RX_NAME;        // pathname to the rx packets file
-   char     nic_tx_name[256]  = NIC_TX_NAME;        // pathname to the tx packets file
-   ssize_t  threads_nr        = 1;                  // simulator's threads number
-   bool     debug_ok          = false;              // trace activated
-   size_t   debug_period      = 1;                  // trace period
-   size_t   debug_memc_id     = 0;                  // index of memc to be traced 
-   size_t   debug_proc_id     = 0;                  // index of proc to be traced
-   int64_t  debug_from        = 0;                  // trace start cycle
-   int64_t  frozen_cycles     = MAX_FROZEN_CYCLES;  // monitoring frozen processor
-   int64_t  reset_counters    = -1;
-   int64_t  dump_counters     = -1;
-   bool     do_reset_counters = false;
-   bool     do_dump_counters  = false;
-   struct   timeval t1, t2;
-   uint64_t ms1, ms2;
-
-   ////////////// command line arguments //////////////////////
-   if (argc > 1) {
-      for (int n = 1; n < argc; n = n + 2) {
-         if ((strcmp(argv[n], "-NCYCLES") == 0) && (n + 1 < argc)) {
-            ncycles = (int64_t) strtol(argv[n + 1], NULL, 0);
-         }
-         else if ((strcmp(argv[n], "-SOFT") == 0) && (n + 1 < argc)) {
+
+    const int64_t max_cycles   = 5000000;            // Maximum number of cycles simulated in one sc_start call
+    int64_t  ncycles           = 0x7FFFFFFFFFFFFFFF; // simulated cycles
+    char     disk_name[256]    = BDEV_IMAGE_NAME;    // pathname to the disk image
+    char     nic_rx_name[256]  = NIC_RX_NAME;        // pathname to the rx packets file
+    char     nic_tx_name[256]  = NIC_TX_NAME;        // pathname to the tx packets file
+    ssize_t  threads_nr        = 1;                  // simulator's threads number
+    bool     debug_ok          = false;              // trace activated
+    size_t   debug_period      = 1;                  // trace period
+    size_t   debug_memc_id     = 0;                  // index of memc to be traced 
+    size_t   debug_proc_id     = 0;                  // index of proc to be traced
+    int64_t  debug_from        = 0;                  // trace start cycle
+    int64_t  frozen_cycles     = MAX_FROZEN_CYCLES;  // monitoring frozen processor
+    int64_t  reset_counters    = -1;
+    int64_t  dump_counters     = -1;
+    bool     do_reset_counters = false;
+    bool     do_dump_counters  = false;
+    struct   timeval t1, t2;
+    uint64_t ms1, ms2;
+
+    ////////////// command line arguments //////////////////////
+    if (argc > 1) {
+        for (int n = 1; n < argc; n = n + 2) {
+            if ((strcmp(argv[n], "-NCYCLES") == 0) && (n + 1 < argc)) {
+                ncycles = (int64_t) strtol(argv[n + 1], NULL, 0);
+            }
+            else if ((strcmp(argv[n], "-SOFT") == 0) && (n + 1 < argc)) {
 #ifdef USE_ALMOS
-            assert( 0 && "Can't define almos soft name" );
-#endif
-#ifdef USE_GIET
-            strcpy(soft_name, argv[n + 1]);
-#endif
-         }
-         else if ((strcmp(argv[n],"-DISK") == 0) && (n + 1 < argc)) {
-            strcpy(disk_name, argv[n + 1]);
-         }
-         else if ((strcmp(argv[n],"-DEBUG") == 0) && (n + 1 < argc)) {
-            debug_ok = true;
-            debug_from = (int64_t) strtol(argv[n + 1], NULL, 0);
-         }
-         else if ((strcmp(argv[n], "-MEMCID") == 0) && (n + 1 < argc)) {
-            debug_memc_id = (size_t) strtol(argv[n + 1], NULL, 0);
+                assert( 0 && "Can't define almos soft name" );
+#endif
+            }
+            else if ((strcmp(argv[n],"-DISK") == 0) && (n + 1 < argc)) {
+                strcpy(disk_name, argv[n + 1]);
+            }
+            else if ((strcmp(argv[n],"-DEBUG") == 0) && (n + 1 < argc)) {
+                debug_ok = true;
+                debug_from = (int64_t) strtol(argv[n + 1], NULL, 0);
+            }
+            else if ((strcmp(argv[n], "-MEMCID") == 0) && (n + 1 < argc)) {
+                debug_memc_id = (size_t) strtol(argv[n + 1], NULL, 0);
 #ifdef USE_ALMOS
-            assert((debug_memc_id < (X_SIZE * Y_SIZE)) &&
-                   "debug_memc_id larger than X_SIZE * Y_SIZE" );
+                assert((debug_memc_id < (X_SIZE * Y_SIZE)) &&
+                        "debug_memc_id larger than X_SIZE * Y_SIZE" );
 #else
-            size_t x = debug_memc_id >> Y_WIDTH;
-            size_t y = debug_memc_id & ((1 << Y_WIDTH) - 1);
-
-            assert( (x <= X_SIZE) and (y <= Y_SIZE) &&
-                  "MEMCID parameter refers a not valid memory cache");
-#endif
-         }
-         else if ((strcmp(argv[n], "-PROCID") == 0) && (n + 1 < argc)) {
-            debug_proc_id = (size_t) strtol(argv[n + 1], NULL, 0);
+                size_t x = debug_memc_id >> Y_WIDTH;
+                size_t y = debug_memc_id & ((1 << Y_WIDTH) - 1);
+
+                assert( (x <= X_SIZE) and (y <= Y_SIZE) &&
+                        "MEMCID parameter refers a not valid memory cache");
+#endif
+            }
+            else if ((strcmp(argv[n], "-PROCID") == 0) && (n + 1 < argc)) {
+                debug_proc_id = (size_t) strtol(argv[n + 1], NULL, 0);
 #ifdef USE_ALMOS
-            assert((debug_proc_id < (X_SIZE * Y_SIZE * NB_PROCS_MAX)) && 
-                   "debug_proc_id larger than X_SIZE * Y_SIZE * NB_PROCS");
+                assert((debug_proc_id < (X_SIZE * Y_SIZE * NB_PROCS_MAX)) && 
+                        "debug_proc_id larger than X_SIZE * Y_SIZE * NB_PROCS");
 #else
-            size_t cluster_xy = debug_proc_id / NB_PROCS_MAX ;
-            size_t x = cluster_xy >> Y_WIDTH;
-            size_t y = cluster_xy & ((1 << Y_WIDTH) - 1);
-
-            assert( (x <= X_SIZE) and (y <= Y_SIZE) &&
-                  "PROCID parameter refers a not valid processor");
-#endif
-         }
-         else if ((strcmp(argv[n], "-THREADS") == 0) && ((n + 1) < argc)) {
-            threads_nr = (ssize_t) strtol(argv[n + 1], NULL, 0);
-            threads_nr = (threads_nr < 1) ? 1 : threads_nr;
-         }
-         else if ((strcmp(argv[n], "-FROZEN") == 0) && (n + 1 < argc)) {
-            frozen_cycles = (int64_t) strtol(argv[n + 1], NULL, 0);
-         }
-         else if ((strcmp(argv[n], "-PERIOD") == 0) && (n + 1 < argc)) {
-            debug_period = (size_t) strtol(argv[n + 1], NULL, 0);
-         }
-         else if ((strcmp(argv[n], "--reset-counters") == 0) && (n + 1 < argc)) {
-            reset_counters = (int64_t) strtol(argv[n + 1], NULL, 0);
-            do_reset_counters = true;
-         }
-         else if ((strcmp(argv[n], "--dump-counters") == 0) && (n + 1 < argc)) {
-            dump_counters = (int64_t) strtol(argv[n + 1], NULL, 0);
-            do_dump_counters = true;
-         }
-         else {
-            std::cout << "   Arguments are (key,value) couples." << std::endl;
-            std::cout << "   The order is not important." << std::endl;
-            std::cout << "   Accepted arguments are :" << std::endl << std::endl;
-            std::cout << "     -SOFT pathname_for_embedded_soft" << std::endl;
-            std::cout << "     -DISK pathname_for_disk_image" << std::endl;
-            std::cout << "     -NCYCLES number_of_simulated_cycles" << std::endl;
-            std::cout << "     -DEBUG debug_start_cycle" << std::endl;
-            std::cout << "     -THREADS simulator's threads number" << std::endl;
-            std::cout << "     -FROZEN max_number_of_lines" << std::endl;
-            std::cout << "     -PERIOD number_of_cycles between trace" << std::endl;
-            std::cout << "     -MEMCID index_memc_to_be_traced" << std::endl;
-            std::cout << "     -PROCID index_proc_to_be_traced" << std::endl;
-            exit(0);
-         }
-      }
-   }
+                size_t cluster_xy = debug_proc_id / NB_PROCS_MAX ;
+                size_t x = cluster_xy >> Y_WIDTH;
+                size_t y = cluster_xy & ((1 << Y_WIDTH) - 1);
+
+                assert( (x <= X_SIZE) and (y <= Y_SIZE) &&
+                        "PROCID parameter refers a not valid processor");
+#endif
+            }
+            else if ((strcmp(argv[n], "-THREADS") == 0) && ((n + 1) < argc)) {
+                threads_nr = (ssize_t) strtol(argv[n + 1], NULL, 0);
+                threads_nr = (threads_nr < 1) ? 1 : threads_nr;
+            }
+            else if ((strcmp(argv[n], "-FROZEN") == 0) && (n + 1 < argc)) {
+                frozen_cycles = (int64_t) strtol(argv[n + 1], NULL, 0);
+            }
+            else if ((strcmp(argv[n], "-PERIOD") == 0) && (n + 1 < argc)) {
+                debug_period = (size_t) strtol(argv[n + 1], NULL, 0);
+            }
+            else if ((strcmp(argv[n], "--reset-counters") == 0) && (n + 1 < argc)) {
+                reset_counters = (int64_t) strtol(argv[n + 1], NULL, 0);
+                do_reset_counters = true;
+            }
+            else if ((strcmp(argv[n], "--dump-counters") == 0) && (n + 1 < argc)) {
+                dump_counters = (int64_t) strtol(argv[n + 1], NULL, 0);
+                do_dump_counters = true;
+            }
+            else {
+                std::cout << "   Arguments are (key,value) couples." << std::endl;
+                std::cout << "   The order is not important." << std::endl;
+                std::cout << "   Accepted arguments are :" << std::endl << std::endl;
+                std::cout << "     -SOFT pathname_for_embedded_soft" << std::endl;
+                std::cout << "     -DISK pathname_for_disk_image" << std::endl;
+                std::cout << "     -NCYCLES number_of_simulated_cycles" << std::endl;
+                std::cout << "     -DEBUG debug_start_cycle" << std::endl;
+                std::cout << "     -THREADS simulator's threads number" << std::endl;
+                std::cout << "     -FROZEN max_number_of_lines" << std::endl;
+                std::cout << "     -PERIOD number_of_cycles between trace" << std::endl;
+                std::cout << "     -MEMCID index_memc_to_be_traced" << std::endl;
+                std::cout << "     -PROCID index_proc_to_be_traced" << std::endl;
+                exit(0);
+            }
+        }
+    }
 
     // checking hardware parameters
@@ -383,9 +346,4 @@
     assert( (NB_NIC_CHANNELS < 9) and
             "The NB_NIC_CHANNELS parameter must be smaller than 9" );
-
-#ifdef USE_GIET
-    assert( (vci_address_width == 40) and
-            "VCI address width with the GIET must be 40 bits" );
-#endif
 
 #ifdef USE_ALMOS
@@ -431,229 +389,232 @@
                                     vci_wrplen_width> vci_param_ext;
 
-#if USE_OPENMP
-   omp_set_dynamic(false);
-   omp_set_num_threads(threads_nr);
-   std::cerr << "Built with openmp version " << _OPENMP << std::endl;
-#endif
-
-   // Define parameters depending on mesh size
-   size_t   x_width;
-   size_t   y_width;
+#ifdef USE_OPENMP
+    omp_set_dynamic(false);
+    omp_set_num_threads(threads_nr);
+    std::cerr << "Built with openmp version " << _OPENMP << std::endl;
+    std::cerr << "Run with " << threads_nr << " threads" << std::endl;
+#endif
+
+    // Define parameters depending on mesh size
+    size_t   x_width;
+    size_t   y_width;
 
 #ifdef USE_ALMOS
-   if      (X_SIZE == 1) x_width = 0;
-   else if (X_SIZE == 2) x_width = 1;
-   else if (X_SIZE <= 4) x_width = 2;
-   else if (X_SIZE <= 8) x_width = 3;
-   else                  x_width = 4;
-
-   if      (Y_SIZE == 1) y_width = 0;
-   else if (Y_SIZE == 2) y_width = 1;
-   else if (Y_SIZE <= 4) y_width = 2;
-   else if (Y_SIZE <= 8) y_width = 3;
-   else                  y_width = 4;
+    if      (X_SIZE == 1) x_width = 0;
+    else if (X_SIZE == 2) x_width = 1;
+    else if (X_SIZE <= 4) x_width = 2;
+    else if (X_SIZE <= 8) x_width = 3;
+    else                  x_width = 4;
+
+    if      (Y_SIZE == 1) y_width = 0;
+    else if (Y_SIZE == 2) y_width = 1;
+    else if (Y_SIZE <= 4) y_width = 2;
+    else if (Y_SIZE <= 8) y_width = 3;
+    else                  y_width = 4;
 
 #else
-   size_t x_width = X_WIDTH;
-   size_t y_width = Y_WIDTH;
-
-   assert((X_WIDTH <= 4) and (Y_WIDTH <= 4) and
-           "Up to 256 clusters");
-
-   assert((X_SIZE <= (1 << X_WIDTH)) and (Y_SIZE <= (1 << Y_WIDTH)) and
-           "The X_WIDTH and Y_WIDTH parameter are insufficient");
-
-#endif
-
-   /////////////////////
-   //  Mapping Tables
-   /////////////////////
-
-   // internal network
-   MappingTable maptabd(vci_address_width, 
-                        IntTab(x_width + y_width, 16 - x_width - y_width), 
-                        IntTab(x_width + y_width, vci_srcid_width - x_width - y_width), 
-                        0x00FF800000);
-
-   for (size_t x = 0; x < X_SIZE; x++) {
-      for (size_t y = 0; y < Y_SIZE; y++) {
-         sc_uint<vci_address_width> offset;
-         offset = (sc_uint<vci_address_width>) cluster(x,y) 
-                   << (vci_address_width - x_width - y_width);
-
-         std::ostringstream    si;
-         si << "seg_xicu_" << x << "_" << y;
-         maptabd.add(Segment(si.str(), SEG_XCU_BASE + offset, SEG_XCU_SIZE, 
-                  IntTab(cluster(x,y), XCU_TGTID), false));
-
-         std::ostringstream    sd;
-         sd << "seg_mdma_" << x << "_" << y;
-         maptabd.add(Segment(sd.str(), SEG_DMA_BASE + offset, SEG_DMA_SIZE, 
-                  IntTab(cluster(x,y), DMA_TGTID), false));
-
-         std::ostringstream    sh;
-         sh << "seg_memc_" << x << "_" << y;
-         maptabd.add(Segment(sh.str(), SEG_RAM_BASE + offset, SEG_RAM_SIZE, 
-                  IntTab(cluster(x,y), RAM_TGTID), true));
-
-         if (x == X_IO && y == Y_IO) {
-            maptabd.add(Segment("seg_mtty", SEG_TTY_BASE, SEG_TTY_SIZE, 
-                        IntTab(cluster(x,y),TTY_TGTID), false));
-            maptabd.add(Segment("seg_fbuf", SEG_FBF_BASE, SEG_FBF_SIZE, 
-                        IntTab(cluster(x,y),FBF_TGTID), false));
-            maptabd.add(Segment("seg_bdev", SEG_IOC_BASE, SEG_IOC_SIZE, 
-                        IntTab(cluster(x,y),IOC_TGTID), false));
-            maptabd.add(Segment("seg_brom", SEG_ROM_BASE, SEG_ROM_SIZE, 
-                        IntTab(cluster(x,y),ROM_TGTID), true));
-            maptabd.add(Segment("seg_mnic", SEG_NIC_BASE, SEG_NIC_SIZE, 
-                        IntTab(cluster(x,y),NIC_TGTID), false));
-            maptabd.add(Segment("seg_cdma", SEG_CMA_BASE, SEG_CMA_SIZE, 
-                        IntTab(cluster(x,y),CMA_TGTID), false));
-            maptabd.add(Segment("seg_simh", SEG_SIM_BASE, SEG_SIM_SIZE, 
-                        IntTab(cluster(x,y),SIM_TGTID), false));
-         }
-      }
-   }
-   std::cout << maptabd << std::endl;
-
-   // external network
-   MappingTable maptabx(vci_address_width, 
-                        IntTab(x_width + y_width), 
-                        IntTab(x_width + y_width), 
-                        0xFFFF000000ULL);
-
-   for (size_t x = 0; x < X_SIZE; x++) {
-      for (size_t y = 0; y < Y_SIZE ; y++) {
-
-         sc_uint<vci_address_width> offset;
-         offset = (sc_uint<vci_address_width>) cluster(x,y) 
-                   << (vci_address_width - x_width - y_width);
-
-         std::ostringstream sh;
-         sh << "x_seg_memc_" << x << "_" << y;
-
-         maptabx.add(Segment(sh.str(), SEG_RAM_BASE + offset, 
-                     SEG_RAM_SIZE, IntTab(cluster(x,y)), false));
-      }
-   }
-   std::cout << maptabx << std::endl;
-
-   ////////////////////
-   // Signals
-   ///////////////////
-
-   sc_clock           signal_clk("clk");
-   sc_signal<bool>    signal_resetn("resetn");
-
-   // Horizontal inter-clusters DSPIN signals
-   DspinSignals<dspin_cmd_width>** signal_dspin_h_cmd_inc =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_inc", X_SIZE - 1, Y_SIZE);
-   DspinSignals<dspin_cmd_width>** signal_dspin_h_cmd_dec =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_dec", X_SIZE - 1, Y_SIZE);
-
-   DspinSignals<dspin_rsp_width>** signal_dspin_h_rsp_inc =
-      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_rsp_inc", X_SIZE - 1, Y_SIZE);
-   DspinSignals<dspin_rsp_width>** signal_dspin_h_rsp_dec =
-      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_rsp_dec", X_SIZE - 1, Y_SIZE);
-
-   DspinSignals<dspin_cmd_width>** signal_dspin_h_m2p_inc =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_m2p_inc", X_SIZE- 1 , Y_SIZE);
-   DspinSignals<dspin_cmd_width>** signal_dspin_h_m2p_dec =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_m2p_dec", X_SIZE - 1, Y_SIZE);
-
-   DspinSignals<dspin_rsp_width>** signal_dspin_h_p2m_inc =
-      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_p2m_inc", X_SIZE - 1, Y_SIZE);
-   DspinSignals<dspin_rsp_width>** signal_dspin_h_p2m_dec =
-      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_p2m_dec", X_SIZE - 1, Y_SIZE);
-
-   DspinSignals<dspin_cmd_width>** signal_dspin_h_cla_inc =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cla_inc", X_SIZE - 1, Y_SIZE);
-   DspinSignals<dspin_cmd_width>** signal_dspin_h_cla_dec =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cla_dec", X_SIZE - 1, Y_SIZE);
-
-   // Vertical inter-clusters DSPIN signals
-   DspinSignals<dspin_cmd_width>** signal_dspin_v_cmd_inc =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_inc", X_SIZE, Y_SIZE - 1);
-   DspinSignals<dspin_cmd_width>** signal_dspin_v_cmd_dec =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_dec", X_SIZE, Y_SIZE - 1);
-
-   DspinSignals<dspin_rsp_width>** signal_dspin_v_rsp_inc =
-      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_rsp_inc", X_SIZE, Y_SIZE - 1);
-   DspinSignals<dspin_rsp_width>** signal_dspin_v_rsp_dec =
-      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_rsp_dec", X_SIZE, Y_SIZE - 1);
-
-   DspinSignals<dspin_cmd_width>** signal_dspin_v_m2p_inc =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_m2p_inc", X_SIZE, Y_SIZE - 1);
-   DspinSignals<dspin_cmd_width>** signal_dspin_v_m2p_dec =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_m2p_dec", X_SIZE, Y_SIZE - 1);
-
-   DspinSignals<dspin_rsp_width>** signal_dspin_v_p2m_inc =
-      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_p2m_inc", X_SIZE, Y_SIZE - 1);
-   DspinSignals<dspin_rsp_width>** signal_dspin_v_p2m_dec =
-      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_p2m_dec", X_SIZE, Y_SIZE - 1);
-
-   DspinSignals<dspin_cmd_width>** signal_dspin_v_cla_inc =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cla_inc", X_SIZE, Y_SIZE - 1);
-   DspinSignals<dspin_cmd_width>** signal_dspin_v_cla_dec =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cla_dec", X_SIZE, Y_SIZE - 1);
-
-   // Mesh boundaries DSPIN signals (Most of those signals are not used...)
-   DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cmd_in =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cmd_in" , X_SIZE, Y_SIZE, 4);
-   DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cmd_out =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cmd_out", X_SIZE, Y_SIZE, 4);
-
-   DspinSignals<dspin_rsp_width>*** signal_dspin_bound_rsp_in =
-      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_rsp_in" , X_SIZE, Y_SIZE, 4);
-   DspinSignals<dspin_rsp_width>*** signal_dspin_bound_rsp_out =
-      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_rsp_out", X_SIZE, Y_SIZE, 4);
-
-   DspinSignals<dspin_cmd_width>*** signal_dspin_bound_m2p_in =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_m2p_in" , X_SIZE, Y_SIZE, 4);
-   DspinSignals<dspin_cmd_width>*** signal_dspin_bound_m2p_out =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_m2p_out", X_SIZE, Y_SIZE, 4);
-
-   DspinSignals<dspin_rsp_width>*** signal_dspin_bound_p2m_in =
-      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_p2m_in" , X_SIZE, Y_SIZE, 4);
-   DspinSignals<dspin_rsp_width>*** signal_dspin_bound_p2m_out =
-      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_p2m_out", X_SIZE, Y_SIZE, 4);
-
-   DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cla_in =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cla_in" , X_SIZE, Y_SIZE, 4);
-   DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cla_out =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cla_out", X_SIZE, Y_SIZE, 4);
-
-
-   ////////////////////////////
-   //      Loader    
-   ////////////////////////////
-
-   soclib::common::Loader loader(soft_name);
-
-   typedef soclib::common::GdbServer<soclib::common::Mips32ElIss> proc_iss;
-   proc_iss::set_loader(loader);
-
-   ////////////////////////////
-   // Clusters construction
-   ////////////////////////////
-
-   TsarXbarCluster<dspin_cmd_width,
-                   dspin_rsp_width,
-                   vci_param_int,
-                   vci_param_ext> * clusters[X_SIZE][Y_SIZE];
-
-#if USE_OPENMP
+    size_t x_width = X_WIDTH;
+    size_t y_width = Y_WIDTH;
+
+    assert((X_WIDTH <= 4) and (Y_WIDTH <= 4) and
+            "Up to 256 clusters");
+
+    assert((X_SIZE <= (1 << X_WIDTH)) and (Y_SIZE <= (1 << Y_WIDTH)) and
+            "The X_WIDTH and Y_WIDTH parameter are insufficient");
+
+#endif
+
+    /////////////////////
+    //  Mapping Tables
+    /////////////////////
+
+    // internal network
+    MappingTable maptabd(vci_address_width, 
+                         IntTab(x_width + y_width, 16 - x_width - y_width), 
+                         IntTab(x_width + y_width, vci_srcid_width - x_width - y_width), 
+                         0x00FF800000);
+
+    for (size_t x = 0; x < X_SIZE; x++) {
+       for (size_t y = 0; y < Y_SIZE; y++) {
+          sc_uint<vci_address_width> offset;
+          offset = (sc_uint<vci_address_width>) cluster(x,y) 
+                    << (vci_address_width - x_width - y_width);
+
+          std::ostringstream    si;
+          si << "seg_xicu_" << x << "_" << y;
+          maptabd.add(Segment(si.str(), SEG_XCU_BASE + offset, SEG_XCU_SIZE, 
+                   IntTab(cluster(x,y), XCU_TGTID), false));
+
+          std::ostringstream    sd;
+          sd << "seg_mdma_" << x << "_" << y;
+          maptabd.add(Segment(sd.str(), SEG_DMA_BASE + offset, SEG_DMA_SIZE, 
+                   IntTab(cluster(x,y), DMA_TGTID), false));
+
+          std::ostringstream    sh;
+          sh << "seg_memc_" << x << "_" << y;
+          maptabd.add(Segment(sh.str(), SEG_RAM_BASE + offset, SEG_RAM_SIZE, 
+                   IntTab(cluster(x,y), RAM_TGTID), true));
+
+          if (x == X_IO && y == Y_IO) {
+             maptabd.add(Segment("seg_mtty", SEG_TTY_BASE, SEG_TTY_SIZE, 
+                         IntTab(cluster(x,y),TTY_TGTID), false));
+             maptabd.add(Segment("seg_fbuf", SEG_FBF_BASE, SEG_FBF_SIZE, 
+                         IntTab(cluster(x,y),FBF_TGTID), false));
+             maptabd.add(Segment("seg_bdev", SEG_IOC_BASE, SEG_IOC_SIZE, 
+                         IntTab(cluster(x,y),IOC_TGTID), false));
+             maptabd.add(Segment("seg_brom", SEG_ROM_BASE, SEG_ROM_SIZE, 
+                         IntTab(cluster(x,y),ROM_TGTID), true));
+             maptabd.add(Segment("seg_mnic", SEG_NIC_BASE, SEG_NIC_SIZE, 
+                         IntTab(cluster(x,y),NIC_TGTID), false));
+             maptabd.add(Segment("seg_cdma", SEG_CMA_BASE, SEG_CMA_SIZE, 
+                         IntTab(cluster(x,y),CMA_TGTID), false));
+             maptabd.add(Segment("seg_simh", SEG_SIM_BASE, SEG_SIM_SIZE, 
+                         IntTab(cluster(x,y),SIM_TGTID), false));
+          }
+       }
+    }
+    std::cout << maptabd << std::endl;
+
+    // external network
+    MappingTable maptabx(vci_address_width, 
+                         IntTab(x_width + y_width), 
+                         IntTab(x_width + y_width), 
+                         0xFFFF000000ULL);
+
+    for (size_t x = 0; x < X_SIZE; x++) {
+       for (size_t y = 0; y < Y_SIZE ; y++) {
+
+          sc_uint<vci_address_width> offset;
+          offset = (sc_uint<vci_address_width>) cluster(x,y) 
+                    << (vci_address_width - x_width - y_width);
+
+          std::ostringstream sh;
+          sh << "x_seg_memc_" << x << "_" << y;
+
+          maptabx.add(Segment(sh.str(), SEG_RAM_BASE + offset, 
+                      SEG_RAM_SIZE, IntTab(cluster(x,y)), false));
+       }
+    }
+    std::cout << maptabx << std::endl;
+
+    ////////////////////
+    // Signals
+    ///////////////////
+
+    sc_clock           signal_clk("clk");
+    sc_signal<bool>    signal_resetn("resetn");
+
+    // Horizontal inter-clusters DSPIN signals
+    DspinSignals<dspin_cmd_width>** signal_dspin_h_cmd_inc =
+       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_inc", X_SIZE - 1, Y_SIZE);
+    DspinSignals<dspin_cmd_width>** signal_dspin_h_cmd_dec =
+       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_dec", X_SIZE - 1, Y_SIZE);
+
+    DspinSignals<dspin_rsp_width>** signal_dspin_h_rsp_inc =
+       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_rsp_inc", X_SIZE - 1, Y_SIZE);
+    DspinSignals<dspin_rsp_width>** signal_dspin_h_rsp_dec =
+       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_rsp_dec", X_SIZE - 1, Y_SIZE);
+
+    DspinSignals<dspin_cmd_width>** signal_dspin_h_m2p_inc =
+       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_m2p_inc", X_SIZE- 1 , Y_SIZE);
+    DspinSignals<dspin_cmd_width>** signal_dspin_h_m2p_dec =
+       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_m2p_dec", X_SIZE - 1, Y_SIZE);
+
+    DspinSignals<dspin_rsp_width>** signal_dspin_h_p2m_inc =
+       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_p2m_inc", X_SIZE - 1, Y_SIZE);
+    DspinSignals<dspin_rsp_width>** signal_dspin_h_p2m_dec =
+       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_p2m_dec", X_SIZE - 1, Y_SIZE);
+
+    DspinSignals<dspin_cmd_width>** signal_dspin_h_cla_inc =
+       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cla_inc", X_SIZE - 1, Y_SIZE);
+    DspinSignals<dspin_cmd_width>** signal_dspin_h_cla_dec =
+       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cla_dec", X_SIZE - 1, Y_SIZE);
+
+    // Vertical inter-clusters DSPIN signals
+    DspinSignals<dspin_cmd_width>** signal_dspin_v_cmd_inc =
+       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_inc", X_SIZE, Y_SIZE - 1);
+    DspinSignals<dspin_cmd_width>** signal_dspin_v_cmd_dec =
+       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_dec", X_SIZE, Y_SIZE - 1);
+
+    DspinSignals<dspin_rsp_width>** signal_dspin_v_rsp_inc =
+       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_rsp_inc", X_SIZE, Y_SIZE - 1);
+    DspinSignals<dspin_rsp_width>** signal_dspin_v_rsp_dec =
+       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_rsp_dec", X_SIZE, Y_SIZE - 1);
+
+    DspinSignals<dspin_cmd_width>** signal_dspin_v_m2p_inc =
+       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_m2p_inc", X_SIZE, Y_SIZE - 1);
+    DspinSignals<dspin_cmd_width>** signal_dspin_v_m2p_dec =
+       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_m2p_dec", X_SIZE, Y_SIZE - 1);
+
+    DspinSignals<dspin_rsp_width>** signal_dspin_v_p2m_inc =
+       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_p2m_inc", X_SIZE, Y_SIZE - 1);
+    DspinSignals<dspin_rsp_width>** signal_dspin_v_p2m_dec =
+       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_p2m_dec", X_SIZE, Y_SIZE - 1);
+
+    DspinSignals<dspin_cmd_width>** signal_dspin_v_cla_inc =
+       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cla_inc", X_SIZE, Y_SIZE - 1);
+    DspinSignals<dspin_cmd_width>** signal_dspin_v_cla_dec =
+       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cla_dec", X_SIZE, Y_SIZE - 1);
+
+    // Mesh boundaries DSPIN signals (Most of those signals are not used...)
+    DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cmd_in =
+       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cmd_in" , X_SIZE, Y_SIZE, 4);
+    DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cmd_out =
+       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cmd_out", X_SIZE, Y_SIZE, 4);
+
+    DspinSignals<dspin_rsp_width>*** signal_dspin_bound_rsp_in =
+       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_rsp_in" , X_SIZE, Y_SIZE, 4);
+    DspinSignals<dspin_rsp_width>*** signal_dspin_bound_rsp_out =
+       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_rsp_out", X_SIZE, Y_SIZE, 4);
+
+    DspinSignals<dspin_cmd_width>*** signal_dspin_bound_m2p_in =
+       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_m2p_in" , X_SIZE, Y_SIZE, 4);
+    DspinSignals<dspin_cmd_width>*** signal_dspin_bound_m2p_out =
+       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_m2p_out", X_SIZE, Y_SIZE, 4);
+
+    DspinSignals<dspin_rsp_width>*** signal_dspin_bound_p2m_in =
+       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_p2m_in" , X_SIZE, Y_SIZE, 4);
+    DspinSignals<dspin_rsp_width>*** signal_dspin_bound_p2m_out =
+       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_p2m_out", X_SIZE, Y_SIZE, 4);
+
+    DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cla_in =
+       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cla_in" , X_SIZE, Y_SIZE, 4);
+    DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cla_out =
+       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cla_out", X_SIZE, Y_SIZE, 4);
+
+
+    ////////////////////////////
+    //      Loader    
+    ////////////////////////////
+
+    soclib::common::Loader loader(soft_name);
+
+    typedef soclib::common::GdbServer<soclib::common::Mips32ElIss> proc_iss;
+    proc_iss::set_loader(loader);
+
+    ////////////////////////////
+    // Clusters construction
+    ////////////////////////////
+
+    TsarXbarCluster<dspin_cmd_width,
+                    dspin_rsp_width,
+                    vci_param_int,
+                    vci_param_ext> * clusters[X_SIZE][Y_SIZE];
+
+#ifdef USE_OPENMP
 #pragma omp parallel
+#endif
     {
+#ifdef USE_OPENMP
 #pragma omp for
 #endif
-        for (size_t i = 0; i  < (X_SIZE * Y_SIZE); i++) {
-            size_t x = i / Y_SIZE;
-            size_t y = i % Y_SIZE;
-
-#if USE_OPENMP
+    for (size_t i = 0; i  < (X_SIZE * Y_SIZE); i++) {
+        size_t x = i / Y_SIZE;
+        size_t y = i % Y_SIZE;
+
+#ifdef USE_OPENMP
 #pragma omp critical
-            {
-#endif
+#endif
+        {
             std::cout << std::endl;
             std::cout << "Cluster_" << x << "_" << y << std::endl;
@@ -663,198 +624,194 @@
             sc << "cluster_" << x << "_" << y;
             clusters[x][y] = new TsarXbarCluster<dspin_cmd_width,
-                                                 dspin_rsp_width,
-                                                 vci_param_int,
-                                                 vci_param_ext>
-            (
-                sc.str().c_str(),
-                NB_PROCS_MAX,
-                NB_TTY_CHANNELS,
-                NB_DMA_CHANNELS,
-                x,
-                y,
-                cluster(x,y),
-                maptabd,
-                maptabx,
-                x_width,
-                y_width,
-                vci_srcid_width - x_width - y_width,   // l_id width,
-                P_WIDTH,
-                RAM_TGTID,
-                XCU_TGTID,
-                DMA_TGTID,
-                FBF_TGTID,
-                TTY_TGTID,
-                ROM_TGTID,
-                NIC_TGTID,
-                CMA_TGTID,
-                IOC_TGTID,
-                SIM_TGTID,
-                MEMC_WAYS,
-                MEMC_SETS,
-                L1_IWAYS,
-                L1_ISETS,
-                L1_DWAYS,
-                L1_DSETS,
-                IRQ_PER_PROCESSOR,
-                XRAM_LATENCY,
-                x == X_IO && y == Y_IO,
-                FBF_X_SIZE,
-                FBF_Y_SIZE,
-                disk_name,
-                BDEV_SECTOR_SIZE,
-                NB_NIC_CHANNELS,
-                nic_rx_name,
-                nic_tx_name,
-                NIC_TIMEOUT,
-                NB_CMA_CHANNELS,
-                loader,
-                frozen_cycles,
-                debug_from,
-                debug_ok,
-                debug_ok
-            );
-
-#if USE_OPENMP
-            } // end critical
-#endif
-        } // end for
-#if USE_OPENMP
-    }
-#endif
-
-   ///////////////////////////////////////////////////////////////
-   //     Net-list 
-   ///////////////////////////////////////////////////////////////
-
-   // Clock & RESET
-   for (int x = 0; x < X_SIZE; x++) {
-      for (int y = 0; y < Y_SIZE; y++) {
-         clusters[x][y]->p_clk                      (signal_clk);
-         clusters[x][y]->p_resetn                   (signal_resetn);
-      }
-   }
-
-   // Inter Clusters horizontal connections
-   for (int x = 0; x < X_SIZE - 1; x++) {
-      for (int y = 0; y < Y_SIZE; y++) {
-         clusters[x][y]->p_cmd_out[EAST]      (signal_dspin_h_cmd_inc[x][y]);
-         clusters[x + 1][y]->p_cmd_in[WEST]   (signal_dspin_h_cmd_inc[x][y]);
-         clusters[x][y]->p_cmd_in[EAST]       (signal_dspin_h_cmd_dec[x][y]);
-         clusters[x + 1][y]->p_cmd_out[WEST]  (signal_dspin_h_cmd_dec[x][y]);
-
-         clusters[x][y]->p_rsp_out[EAST]      (signal_dspin_h_rsp_inc[x][y]);
-         clusters[x + 1][y]->p_rsp_in[WEST]   (signal_dspin_h_rsp_inc[x][y]);
-         clusters[x][y]->p_rsp_in[EAST]       (signal_dspin_h_rsp_dec[x][y]);
-         clusters[x + 1][y]->p_rsp_out[WEST]  (signal_dspin_h_rsp_dec[x][y]);
-
-         clusters[x][y]->p_m2p_out[EAST]      (signal_dspin_h_m2p_inc[x][y]);
-         clusters[x + 1][y]->p_m2p_in[WEST]   (signal_dspin_h_m2p_inc[x][y]);
-         clusters[x][y]->p_m2p_in[EAST]       (signal_dspin_h_m2p_dec[x][y]);
-         clusters[x + 1][y]->p_m2p_out[WEST]  (signal_dspin_h_m2p_dec[x][y]);
-
-         clusters[x][y]->p_p2m_out[EAST]      (signal_dspin_h_p2m_inc[x][y]);
-         clusters[x + 1][y]->p_p2m_in[WEST]   (signal_dspin_h_p2m_inc[x][y]);
-         clusters[x][y]->p_p2m_in[EAST]       (signal_dspin_h_p2m_dec[x][y]);
-         clusters[x + 1][y]->p_p2m_out[WEST]  (signal_dspin_h_p2m_dec[x][y]);
-
-         clusters[x][y]->p_cla_out[EAST]      (signal_dspin_h_cla_inc[x][y]);
-         clusters[x + 1][y]->p_cla_in[WEST]   (signal_dspin_h_cla_inc[x][y]);
-         clusters[x][y]->p_cla_in[EAST]       (signal_dspin_h_cla_dec[x][y]);
-         clusters[x + 1][y]->p_cla_out[WEST]  (signal_dspin_h_cla_dec[x][y]);
-      }
-   }
-   std::cout << std::endl << "Horizontal connections done" << std::endl;
-
-   // Inter Clusters vertical connections
-   for (int y = 0; y < Y_SIZE - 1; y++) {
-      for (int x = 0; x < X_SIZE; x++) {
-         clusters[x][y]->p_cmd_out[NORTH]     (signal_dspin_v_cmd_inc[x][y]);
-         clusters[x][y + 1]->p_cmd_in[SOUTH]  (signal_dspin_v_cmd_inc[x][y]);
-         clusters[x][y]->p_cmd_in[NORTH]      (signal_dspin_v_cmd_dec[x][y]);
-         clusters[x][y + 1]->p_cmd_out[SOUTH] (signal_dspin_v_cmd_dec[x][y]);
-
-         clusters[x][y]->p_rsp_out[NORTH]     (signal_dspin_v_rsp_inc[x][y]);
-         clusters[x][y + 1]->p_rsp_in[SOUTH]  (signal_dspin_v_rsp_inc[x][y]);
-         clusters[x][y]->p_rsp_in[NORTH]      (signal_dspin_v_rsp_dec[x][y]);
-         clusters[x][y + 1]->p_rsp_out[SOUTH] (signal_dspin_v_rsp_dec[x][y]);
-
-         clusters[x][y]->p_m2p_out[NORTH]     (signal_dspin_v_m2p_inc[x][y]);
-         clusters[x][y + 1]->p_m2p_in[SOUTH]  (signal_dspin_v_m2p_inc[x][y]);
-         clusters[x][y]->p_m2p_in[NORTH]      (signal_dspin_v_m2p_dec[x][y]);
-         clusters[x][y + 1]->p_m2p_out[SOUTH] (signal_dspin_v_m2p_dec[x][y]);
-
-         clusters[x][y]->p_p2m_out[NORTH]     (signal_dspin_v_p2m_inc[x][y]);
-         clusters[x][y + 1]->p_p2m_in[SOUTH]  (signal_dspin_v_p2m_inc[x][y]);
-         clusters[x][y]->p_p2m_in[NORTH]      (signal_dspin_v_p2m_dec[x][y]);
-         clusters[x][y + 1]->p_p2m_out[SOUTH] (signal_dspin_v_p2m_dec[x][y]);
-
-         clusters[x][y]->p_cla_out[NORTH]     (signal_dspin_v_cla_inc[x][y]);
-         clusters[x][y + 1]->p_cla_in[SOUTH]  (signal_dspin_v_cla_inc[x][y]);
-         clusters[x][y]->p_cla_in[NORTH]      (signal_dspin_v_cla_dec[x][y]);
-         clusters[x][y + 1]->p_cla_out[SOUTH] (signal_dspin_v_cla_dec[x][y]);
-      }
-   }
-   std::cout << std::endl << "Vertical connections done" << std::endl;
-
-   // East & West boundary cluster connections
-   for (size_t y = 0; y < Y_SIZE; y++) {
-       clusters[0][y]->p_cmd_in[WEST]           (signal_dspin_bound_cmd_in[0][y][WEST]);
-       clusters[0][y]->p_cmd_out[WEST]          (signal_dspin_bound_cmd_out[0][y][WEST]);
-       clusters[X_SIZE - 1][y]->p_cmd_in[EAST]  (signal_dspin_bound_cmd_in[X_SIZE - 1][y][EAST]);
-       clusters[X_SIZE - 1][y]->p_cmd_out[EAST] (signal_dspin_bound_cmd_out[X_SIZE - 1][y][EAST]);
-
-       clusters[0][y]->p_rsp_in[WEST]           (signal_dspin_bound_rsp_in[0][y][WEST]);
-       clusters[0][y]->p_rsp_out[WEST]          (signal_dspin_bound_rsp_out[0][y][WEST]);
-       clusters[X_SIZE - 1][y]->p_rsp_in[EAST]  (signal_dspin_bound_rsp_in[X_SIZE - 1][y][EAST]);
-       clusters[X_SIZE - 1][y]->p_rsp_out[EAST] (signal_dspin_bound_rsp_out[X_SIZE - 1][y][EAST]);
-
-       clusters[0][y]->p_m2p_in[WEST]           (signal_dspin_bound_m2p_in[0][y][WEST]);
-       clusters[0][y]->p_m2p_out[WEST]          (signal_dspin_bound_m2p_out[0][y][WEST]);
-       clusters[X_SIZE - 1][y]->p_m2p_in[EAST]  (signal_dspin_bound_m2p_in[X_SIZE - 1][y][EAST]);
-       clusters[X_SIZE - 1][y]->p_m2p_out[EAST] (signal_dspin_bound_m2p_out[X_SIZE - 1][y][EAST]);
-
-       clusters[0][y]->p_p2m_in[WEST]           (signal_dspin_bound_p2m_in[0][y][WEST]);
-       clusters[0][y]->p_p2m_out[WEST]          (signal_dspin_bound_p2m_out[0][y][WEST]);
-       clusters[X_SIZE - 1][y]->p_p2m_in[EAST]  (signal_dspin_bound_p2m_in[X_SIZE - 1][y][EAST]);
-       clusters[X_SIZE - 1][y]->p_p2m_out[EAST] (signal_dspin_bound_p2m_out[X_SIZE - 1][y][EAST]);
-
-       clusters[0][y]->p_cla_in[WEST]           (signal_dspin_bound_cla_in[0][y][WEST]);
-       clusters[0][y]->p_cla_out[WEST]          (signal_dspin_bound_cla_out[0][y][WEST]);
-       clusters[X_SIZE - 1][y]->p_cla_in[EAST]  (signal_dspin_bound_cla_in[X_SIZE - 1][y][EAST]);
-       clusters[X_SIZE - 1][y]->p_cla_out[EAST] (signal_dspin_bound_cla_out[X_SIZE - 1][y][EAST]);
-   }
-
-   std::cout << std::endl << "West & East boundaries connections done" << std::endl;
-
-   // North & South boundary clusters connections
-   for (size_t x = 0; x < X_SIZE; x++) {
-       clusters[x][0]->p_cmd_in[SOUTH]          (signal_dspin_bound_cmd_in[x][0][SOUTH]);
-       clusters[x][0]->p_cmd_out[SOUTH]         (signal_dspin_bound_cmd_out[x][0][SOUTH]);
-       clusters[x][Y_SIZE - 1]->p_cmd_in[NORTH] (signal_dspin_bound_cmd_in[x][Y_SIZE - 1][NORTH]);
-       clusters[x][Y_SIZE - 1]->p_cmd_out[NORTH](signal_dspin_bound_cmd_out[x][Y_SIZE - 1][NORTH]);
-
-       clusters[x][0]->p_rsp_in[SOUTH]          (signal_dspin_bound_rsp_in[x][0][SOUTH]);
-       clusters[x][0]->p_rsp_out[SOUTH]         (signal_dspin_bound_rsp_out[x][0][SOUTH]);
-       clusters[x][Y_SIZE - 1]->p_rsp_in[NORTH] (signal_dspin_bound_rsp_in[x][Y_SIZE - 1][NORTH]);
-       clusters[x][Y_SIZE - 1]->p_rsp_out[NORTH](signal_dspin_bound_rsp_out[x][Y_SIZE - 1][NORTH]);
-
-       clusters[x][0]->p_m2p_in[SOUTH]          (signal_dspin_bound_m2p_in[x][0][SOUTH]);
-       clusters[x][0]->p_m2p_out[SOUTH]         (signal_dspin_bound_m2p_out[x][0][SOUTH]);
-       clusters[x][Y_SIZE - 1]->p_m2p_in[NORTH] (signal_dspin_bound_m2p_in[x][Y_SIZE - 1][NORTH]);
-       clusters[x][Y_SIZE - 1]->p_m2p_out[NORTH](signal_dspin_bound_m2p_out[x][Y_SIZE - 1][NORTH]);
-
-       clusters[x][0]->p_p2m_in[SOUTH]          (signal_dspin_bound_p2m_in[x][0][SOUTH]);
-       clusters[x][0]->p_p2m_out[SOUTH]         (signal_dspin_bound_p2m_out[x][0][SOUTH]);
-       clusters[x][Y_SIZE - 1]->p_p2m_in[NORTH] (signal_dspin_bound_p2m_in[x][Y_SIZE - 1][NORTH]);
-       clusters[x][Y_SIZE - 1]->p_p2m_out[NORTH](signal_dspin_bound_p2m_out[x][Y_SIZE - 1][NORTH]);
-
-       clusters[x][0]->p_cla_in[SOUTH]          (signal_dspin_bound_cla_in[x][0][SOUTH]);
-       clusters[x][0]->p_cla_out[SOUTH]         (signal_dspin_bound_cla_out[x][0][SOUTH]);
-       clusters[x][Y_SIZE - 1]->p_cla_in[NORTH] (signal_dspin_bound_cla_in[x][Y_SIZE - 1][NORTH]);
-       clusters[x][Y_SIZE - 1]->p_cla_out[NORTH](signal_dspin_bound_cla_out[x][Y_SIZE - 1][NORTH]);
-   }
-
-   std::cout << std::endl << "North & South boundaries connections done" << std::endl;
-   std::cout << std::endl;
+                dspin_rsp_width,
+                vci_param_int,
+                vci_param_ext>
+                    (
+                     sc.str().c_str(),
+                     NB_PROCS_MAX,
+                     NB_TTY_CHANNELS,
+                     NB_DMA_CHANNELS,
+                     x,
+                     y,
+                     cluster(x,y),
+                     maptabd,
+                     maptabx,
+                     x_width,
+                     y_width,
+                     vci_srcid_width - x_width - y_width,   // l_id width,
+                     P_WIDTH,
+                     RAM_TGTID,
+                     XCU_TGTID,
+                     DMA_TGTID,
+                     FBF_TGTID,
+                     TTY_TGTID,
+                     ROM_TGTID,
+                     NIC_TGTID,
+                     CMA_TGTID,
+                     IOC_TGTID,
+                     SIM_TGTID,
+                     MEMC_WAYS,
+                     MEMC_SETS,
+                     L1_IWAYS,
+                     L1_ISETS,
+                     L1_DWAYS,
+                     L1_DSETS,
+                     IRQ_PER_PROCESSOR,
+                     XRAM_LATENCY,
+                     x == X_IO && y == Y_IO,
+                     FBF_X_SIZE,
+                     FBF_Y_SIZE,
+                     disk_name,
+                     BDEV_SECTOR_SIZE,
+                     NB_NIC_CHANNELS,
+                     nic_rx_name,
+                     nic_tx_name,
+                     NIC_TIMEOUT,
+                     NB_CMA_CHANNELS,
+                     loader,
+                     frozen_cycles,
+                     debug_from,
+                     debug_ok,
+                     debug_ok
+                         );
+
+        }
+    }
+    }
+
+    ///////////////////////////////////////////////////////////////
+    //     Net-list 
+    ///////////////////////////////////////////////////////////////
+
+    // Clock & RESET
+    for (int x = 0; x < X_SIZE; x++) {
+       for (int y = 0; y < Y_SIZE; y++) {
+          clusters[x][y]->p_clk                      (signal_clk);
+          clusters[x][y]->p_resetn                   (signal_resetn);
+       }
+    }
+
+    // Inter Clusters horizontal connections
+    for (int x = 0; x < X_SIZE - 1; x++) {
+       for (int y = 0; y < Y_SIZE; y++) {
+          clusters[x][y]->p_cmd_out[EAST]      (signal_dspin_h_cmd_inc[x][y]);
+          clusters[x + 1][y]->p_cmd_in[WEST]   (signal_dspin_h_cmd_inc[x][y]);
+          clusters[x][y]->p_cmd_in[EAST]       (signal_dspin_h_cmd_dec[x][y]);
+          clusters[x + 1][y]->p_cmd_out[WEST]  (signal_dspin_h_cmd_dec[x][y]);
+
+          clusters[x][y]->p_rsp_out[EAST]      (signal_dspin_h_rsp_inc[x][y]);
+          clusters[x + 1][y]->p_rsp_in[WEST]   (signal_dspin_h_rsp_inc[x][y]);
+          clusters[x][y]->p_rsp_in[EAST]       (signal_dspin_h_rsp_dec[x][y]);
+          clusters[x + 1][y]->p_rsp_out[WEST]  (signal_dspin_h_rsp_dec[x][y]);
+
+          clusters[x][y]->p_m2p_out[EAST]      (signal_dspin_h_m2p_inc[x][y]);
+          clusters[x + 1][y]->p_m2p_in[WEST]   (signal_dspin_h_m2p_inc[x][y]);
+          clusters[x][y]->p_m2p_in[EAST]       (signal_dspin_h_m2p_dec[x][y]);
+          clusters[x + 1][y]->p_m2p_out[WEST]  (signal_dspin_h_m2p_dec[x][y]);
+
+          clusters[x][y]->p_p2m_out[EAST]      (signal_dspin_h_p2m_inc[x][y]);
+          clusters[x + 1][y]->p_p2m_in[WEST]   (signal_dspin_h_p2m_inc[x][y]);
+          clusters[x][y]->p_p2m_in[EAST]       (signal_dspin_h_p2m_dec[x][y]);
+          clusters[x + 1][y]->p_p2m_out[WEST]  (signal_dspin_h_p2m_dec[x][y]);
+
+          clusters[x][y]->p_cla_out[EAST]      (signal_dspin_h_cla_inc[x][y]);
+          clusters[x + 1][y]->p_cla_in[WEST]   (signal_dspin_h_cla_inc[x][y]);
+          clusters[x][y]->p_cla_in[EAST]       (signal_dspin_h_cla_dec[x][y]);
+          clusters[x + 1][y]->p_cla_out[WEST]  (signal_dspin_h_cla_dec[x][y]);
+       }
+    }
+    std::cout << std::endl << "Horizontal connections done" << std::endl;
+
+    // Inter Clusters vertical connections
+    for (int y = 0; y < Y_SIZE - 1; y++) {
+       for (int x = 0; x < X_SIZE; x++) {
+          clusters[x][y]->p_cmd_out[NORTH]     (signal_dspin_v_cmd_inc[x][y]);
+          clusters[x][y + 1]->p_cmd_in[SOUTH]  (signal_dspin_v_cmd_inc[x][y]);
+          clusters[x][y]->p_cmd_in[NORTH]      (signal_dspin_v_cmd_dec[x][y]);
+          clusters[x][y + 1]->p_cmd_out[SOUTH] (signal_dspin_v_cmd_dec[x][y]);
+
+          clusters[x][y]->p_rsp_out[NORTH]     (signal_dspin_v_rsp_inc[x][y]);
+          clusters[x][y + 1]->p_rsp_in[SOUTH]  (signal_dspin_v_rsp_inc[x][y]);
+          clusters[x][y]->p_rsp_in[NORTH]      (signal_dspin_v_rsp_dec[x][y]);
+          clusters[x][y + 1]->p_rsp_out[SOUTH] (signal_dspin_v_rsp_dec[x][y]);
+
+          clusters[x][y]->p_m2p_out[NORTH]     (signal_dspin_v_m2p_inc[x][y]);
+          clusters[x][y + 1]->p_m2p_in[SOUTH]  (signal_dspin_v_m2p_inc[x][y]);
+          clusters[x][y]->p_m2p_in[NORTH]      (signal_dspin_v_m2p_dec[x][y]);
+          clusters[x][y + 1]->p_m2p_out[SOUTH] (signal_dspin_v_m2p_dec[x][y]);
+
+          clusters[x][y]->p_p2m_out[NORTH]     (signal_dspin_v_p2m_inc[x][y]);
+          clusters[x][y + 1]->p_p2m_in[SOUTH]  (signal_dspin_v_p2m_inc[x][y]);
+          clusters[x][y]->p_p2m_in[NORTH]      (signal_dspin_v_p2m_dec[x][y]);
+          clusters[x][y + 1]->p_p2m_out[SOUTH] (signal_dspin_v_p2m_dec[x][y]);
+
+          clusters[x][y]->p_cla_out[NORTH]     (signal_dspin_v_cla_inc[x][y]);
+          clusters[x][y + 1]->p_cla_in[SOUTH]  (signal_dspin_v_cla_inc[x][y]);
+          clusters[x][y]->p_cla_in[NORTH]      (signal_dspin_v_cla_dec[x][y]);
+          clusters[x][y + 1]->p_cla_out[SOUTH] (signal_dspin_v_cla_dec[x][y]);
+       }
+    }
+    std::cout << std::endl << "Vertical connections done" << std::endl;
+
+    // East & West boundary cluster connections
+    for (size_t y = 0; y < Y_SIZE; y++) {
+        clusters[0][y]->p_cmd_in[WEST]           (signal_dspin_bound_cmd_in[0][y][WEST]);
+        clusters[0][y]->p_cmd_out[WEST]          (signal_dspin_bound_cmd_out[0][y][WEST]);
+        clusters[X_SIZE - 1][y]->p_cmd_in[EAST]  (signal_dspin_bound_cmd_in[X_SIZE - 1][y][EAST]);
+        clusters[X_SIZE - 1][y]->p_cmd_out[EAST] (signal_dspin_bound_cmd_out[X_SIZE - 1][y][EAST]);
+
+        clusters[0][y]->p_rsp_in[WEST]           (signal_dspin_bound_rsp_in[0][y][WEST]);
+        clusters[0][y]->p_rsp_out[WEST]          (signal_dspin_bound_rsp_out[0][y][WEST]);
+        clusters[X_SIZE - 1][y]->p_rsp_in[EAST]  (signal_dspin_bound_rsp_in[X_SIZE - 1][y][EAST]);
+        clusters[X_SIZE - 1][y]->p_rsp_out[EAST] (signal_dspin_bound_rsp_out[X_SIZE - 1][y][EAST]);
+
+        clusters[0][y]->p_m2p_in[WEST]           (signal_dspin_bound_m2p_in[0][y][WEST]);
+        clusters[0][y]->p_m2p_out[WEST]          (signal_dspin_bound_m2p_out[0][y][WEST]);
+        clusters[X_SIZE - 1][y]->p_m2p_in[EAST]  (signal_dspin_bound_m2p_in[X_SIZE - 1][y][EAST]);
+        clusters[X_SIZE - 1][y]->p_m2p_out[EAST] (signal_dspin_bound_m2p_out[X_SIZE - 1][y][EAST]);
+
+        clusters[0][y]->p_p2m_in[WEST]           (signal_dspin_bound_p2m_in[0][y][WEST]);
+        clusters[0][y]->p_p2m_out[WEST]          (signal_dspin_bound_p2m_out[0][y][WEST]);
+        clusters[X_SIZE - 1][y]->p_p2m_in[EAST]  (signal_dspin_bound_p2m_in[X_SIZE - 1][y][EAST]);
+        clusters[X_SIZE - 1][y]->p_p2m_out[EAST] (signal_dspin_bound_p2m_out[X_SIZE - 1][y][EAST]);
+
+        clusters[0][y]->p_cla_in[WEST]           (signal_dspin_bound_cla_in[0][y][WEST]);
+        clusters[0][y]->p_cla_out[WEST]          (signal_dspin_bound_cla_out[0][y][WEST]);
+        clusters[X_SIZE - 1][y]->p_cla_in[EAST]  (signal_dspin_bound_cla_in[X_SIZE - 1][y][EAST]);
+        clusters[X_SIZE - 1][y]->p_cla_out[EAST] (signal_dspin_bound_cla_out[X_SIZE - 1][y][EAST]);
+    }
+
+    std::cout << std::endl << "West & East boundaries connections done" << std::endl;
+
+    // North & South boundary clusters connections
+    for (size_t x = 0; x < X_SIZE; x++) {
+        clusters[x][0]->p_cmd_in[SOUTH]          (signal_dspin_bound_cmd_in[x][0][SOUTH]);
+        clusters[x][0]->p_cmd_out[SOUTH]         (signal_dspin_bound_cmd_out[x][0][SOUTH]);
+        clusters[x][Y_SIZE - 1]->p_cmd_in[NORTH] (signal_dspin_bound_cmd_in[x][Y_SIZE - 1][NORTH]);
+        clusters[x][Y_SIZE - 1]->p_cmd_out[NORTH](signal_dspin_bound_cmd_out[x][Y_SIZE - 1][NORTH]);
+
+        clusters[x][0]->p_rsp_in[SOUTH]          (signal_dspin_bound_rsp_in[x][0][SOUTH]);
+        clusters[x][0]->p_rsp_out[SOUTH]         (signal_dspin_bound_rsp_out[x][0][SOUTH]);
+        clusters[x][Y_SIZE - 1]->p_rsp_in[NORTH] (signal_dspin_bound_rsp_in[x][Y_SIZE - 1][NORTH]);
+        clusters[x][Y_SIZE - 1]->p_rsp_out[NORTH](signal_dspin_bound_rsp_out[x][Y_SIZE - 1][NORTH]);
+
+        clusters[x][0]->p_m2p_in[SOUTH]          (signal_dspin_bound_m2p_in[x][0][SOUTH]);
+        clusters[x][0]->p_m2p_out[SOUTH]         (signal_dspin_bound_m2p_out[x][0][SOUTH]);
+        clusters[x][Y_SIZE - 1]->p_m2p_in[NORTH] (signal_dspin_bound_m2p_in[x][Y_SIZE - 1][NORTH]);
+        clusters[x][Y_SIZE - 1]->p_m2p_out[NORTH](signal_dspin_bound_m2p_out[x][Y_SIZE - 1][NORTH]);
+
+        clusters[x][0]->p_p2m_in[SOUTH]          (signal_dspin_bound_p2m_in[x][0][SOUTH]);
+        clusters[x][0]->p_p2m_out[SOUTH]         (signal_dspin_bound_p2m_out[x][0][SOUTH]);
+        clusters[x][Y_SIZE - 1]->p_p2m_in[NORTH] (signal_dspin_bound_p2m_in[x][Y_SIZE - 1][NORTH]);
+        clusters[x][Y_SIZE - 1]->p_p2m_out[NORTH](signal_dspin_bound_p2m_out[x][Y_SIZE - 1][NORTH]);
+
+        clusters[x][0]->p_cla_in[SOUTH]          (signal_dspin_bound_cla_in[x][0][SOUTH]);
+        clusters[x][0]->p_cla_out[SOUTH]         (signal_dspin_bound_cla_out[x][0][SOUTH]);
+        clusters[x][Y_SIZE - 1]->p_cla_in[NORTH] (signal_dspin_bound_cla_in[x][Y_SIZE - 1][NORTH]);
+        clusters[x][Y_SIZE - 1]->p_cla_out[NORTH](signal_dspin_bound_cla_out[x][Y_SIZE - 1][NORTH]);
+    }
+
+    std::cout << std::endl << "North & South boundaries connections done" << std::endl;
+    std::cout << std::endl;
 
 
@@ -865,17 +822,17 @@
         GdbServer<Mips32ElIss> > * > l1_caches;
 
-   for (int x = 0; x < X_SIZE; x++) {
-      for (int y = 0; y < Y_SIZE; y++) {
-         for (int proc = 0; proc < NB_PROCS_MAX; proc++) {
-            l1_caches.push_back(clusters[x][y]->proc[proc]);
-         }
-      }
-   }
-
-   for (int x = 0; x < X_SIZE; x++) {
-      for (int y = 0; y < Y_SIZE; y++) {
-         clusters[x][y]->memc->set_vcache_list(l1_caches);
-      }
-   }
+    for (int x = 0; x < X_SIZE; x++) {
+        for (int y = 0; y < Y_SIZE; y++) {
+            for (int proc = 0; proc < NB_PROCS_MAX; proc++) {
+                l1_caches.push_back(clusters[x][y]->proc[proc]);
+            }
+        }
+    }
+
+    for (int x = 0; x < X_SIZE; x++) {
+        for (int y = 0; y < Y_SIZE; y++) {
+            clusters[x][y]->memc->set_vcache_list(l1_caches);
+        }
+    }
 #endif
 
@@ -883,289 +840,285 @@
 //#define SC_TRACE
 #ifdef SC_TRACE
-   sc_trace_file * tf = sc_create_vcd_trace_file("my_trace_file");
-
-   for (int x = 0; x < X_SIZE - 1; x++) {
-      for (int y = 0; y < Y_SIZE; y++) {
-         for (int k = 0; k < 3; k++) {
-            signal_dspin_h_cmd_inc[x][y][k].trace(tf, "dspin_h_cmd_inc");
-            signal_dspin_h_cmd_dec[x][y][k].trace(tf, "dspin_h_cmd_dec");
-         }
-
-         for (int k = 0; k < 2; k++) {
-            signal_dspin_h_rsp_inc[x][y][k].trace(tf, "dspin_h_rsp_inc");
-            signal_dspin_h_rsp_dec[x][y][k].trace(tf, "dspin_h_rsp_dec");
-         }
-      }
-   }
-
-   for (int y = 0; y < Y_SIZE - 1; y++) {
-      for (int x = 0; x < X_SIZE; x++) {
-         for (int k = 0; k < 3; k++) {
-            signal_dspin_v_cmd_inc[x][y][k].trace(tf, "dspin_v_cmd_inc");
-            signal_dspin_v_cmd_dec[x][y][k].trace(tf, "dspin_v_cmd_dec");
-         }
-
-         for (int k = 0; k < 2; k++) {
-            signal_dspin_v_rsp_inc[x][y][k].trace(tf, "dspin_v_rsp_inc");
-            signal_dspin_v_rsp_dec[x][y][k].trace(tf, "dspin_v_rsp_dec");
-         }
-      }
-   }
-
-   for (int x = 0; x < (X_SIZE); x++) {
-      for (int y = 0; y < Y_SIZE; y++) {
-         std::ostringstream signame;
-         signame << "cluster" << x << "_" << y;
-         clusters[x][y]->trace(tf, signame.str());
-      }
-   }
-#endif
-
-
-   ////////////////////////////////////////////////////////
-   //   Simulation
-   ///////////////////////////////////////////////////////
-
-   sc_start(sc_core::sc_time(0, SC_NS));
-   signal_resetn = false;
-
-   // set network boundaries signals default values
-   // for all boundary clusters
-   for (size_t x = 0; x < X_SIZE ; x++) {
-       for (size_t y = 0; y < Y_SIZE ; y++) {
-           for (size_t face = 0; face < 4; face++) {
-               signal_dspin_bound_cmd_in [x][y][face].write = false;
-               signal_dspin_bound_cmd_in [x][y][face].read  = true;
-               signal_dspin_bound_cmd_out[x][y][face].write = false;
-               signal_dspin_bound_cmd_out[x][y][face].read  = true;
-
-               signal_dspin_bound_rsp_in [x][y][face].write = false;
-               signal_dspin_bound_rsp_in [x][y][face].read  = true;
-               signal_dspin_bound_rsp_out[x][y][face].write = false;
-               signal_dspin_bound_rsp_out[x][y][face].read  = true;
-
-               signal_dspin_bound_m2p_in [x][y][face].write = false;
-               signal_dspin_bound_m2p_in [x][y][face].read  = true;
-               signal_dspin_bound_m2p_out[x][y][face].write = false;
-               signal_dspin_bound_m2p_out[x][y][face].read  = true;
-
-               signal_dspin_bound_p2m_in [x][y][face].write = false;
-               signal_dspin_bound_p2m_in [x][y][face].read  = true;
-               signal_dspin_bound_p2m_out[x][y][face].write = false;
-               signal_dspin_bound_p2m_out[x][y][face].read  = true;
-
-               signal_dspin_bound_cla_in [x][y][face].write = false;
-               signal_dspin_bound_cla_in [x][y][face].read  = true;
-               signal_dspin_bound_cla_out[x][y][face].write = false;
-               signal_dspin_bound_cla_out[x][y][face].read  = true;
-           }
-       }
-   }
-   // @M debug fu**
-   clusters[0][0]->signal_dspin_m2p_proc[2].read = true;
-
-   sc_start(sc_core::sc_time(1, SC_NS));
-   signal_resetn = true;
-
-   if (debug_ok) {
-      #if USE_OPENMP
-         assert(false && "OPEN MP should not be used with debug because of its traces");
-      #endif
-
-      if (gettimeofday(&t1, NULL) != 0) {
-         perror("gettimeofday");
-         return EXIT_FAILURE;
-      }
-
-      for (int64_t n = 1; n < ncycles && !stop_called; n++) {
-         if ((n % max_cycles) == 0) {
+    sc_trace_file * tf = sc_create_vcd_trace_file("my_trace_file");
+
+    for (int x = 0; x < X_SIZE - 1; x++) {
+        for (int y = 0; y < Y_SIZE; y++) {
+            for (int k = 0; k < 3; k++) {
+                signal_dspin_h_cmd_inc[x][y][k].trace(tf, "dspin_h_cmd_inc");
+                signal_dspin_h_cmd_dec[x][y][k].trace(tf, "dspin_h_cmd_dec");
+            }
+
+            for (int k = 0; k < 2; k++) {
+                signal_dspin_h_rsp_inc[x][y][k].trace(tf, "dspin_h_rsp_inc");
+                signal_dspin_h_rsp_dec[x][y][k].trace(tf, "dspin_h_rsp_dec");
+            }
+        }
+    }
+
+    for (int y = 0; y < Y_SIZE - 1; y++) {
+        for (int x = 0; x < X_SIZE; x++) {
+            for (int k = 0; k < 3; k++) {
+                signal_dspin_v_cmd_inc[x][y][k].trace(tf, "dspin_v_cmd_inc");
+                signal_dspin_v_cmd_dec[x][y][k].trace(tf, "dspin_v_cmd_dec");
+            }
+
+            for (int k = 0; k < 2; k++) {
+                signal_dspin_v_rsp_inc[x][y][k].trace(tf, "dspin_v_rsp_inc");
+                signal_dspin_v_rsp_dec[x][y][k].trace(tf, "dspin_v_rsp_dec");
+            }
+        }
+    }
+
+    for (int x = 0; x < (X_SIZE); x++) {
+        for (int y = 0; y < Y_SIZE; y++) {
+            std::ostringstream signame;
+            signame << "cluster" << x << "_" << y;
+            clusters[x][y]->trace(tf, signame.str());
+        }
+    }
+#endif
+
+
+    ////////////////////////////////////////////////////////
+    //   Simulation
+    ///////////////////////////////////////////////////////
+
+    sc_start(sc_core::sc_time(0, SC_NS));
+    signal_resetn = false;
+
+    // set network boundaries signals default values
+    // for all boundary clusters
+    for (size_t x = 0; x < X_SIZE ; x++) {
+        for (size_t y = 0; y < Y_SIZE ; y++) {
+            for (size_t face = 0; face < 4; face++) {
+                signal_dspin_bound_cmd_in [x][y][face].write = false;
+                signal_dspin_bound_cmd_in [x][y][face].read  = true;
+                signal_dspin_bound_cmd_out[x][y][face].write = false;
+                signal_dspin_bound_cmd_out[x][y][face].read  = true;
+
+                signal_dspin_bound_rsp_in [x][y][face].write = false;
+                signal_dspin_bound_rsp_in [x][y][face].read  = true;
+                signal_dspin_bound_rsp_out[x][y][face].write = false;
+                signal_dspin_bound_rsp_out[x][y][face].read  = true;
+
+                signal_dspin_bound_m2p_in [x][y][face].write = false;
+                signal_dspin_bound_m2p_in [x][y][face].read  = true;
+                signal_dspin_bound_m2p_out[x][y][face].write = false;
+                signal_dspin_bound_m2p_out[x][y][face].read  = true;
+
+                signal_dspin_bound_p2m_in [x][y][face].write = false;
+                signal_dspin_bound_p2m_in [x][y][face].read  = true;
+                signal_dspin_bound_p2m_out[x][y][face].write = false;
+                signal_dspin_bound_p2m_out[x][y][face].read  = true;
+
+                signal_dspin_bound_cla_in [x][y][face].write = false;
+                signal_dspin_bound_cla_in [x][y][face].read  = true;
+                signal_dspin_bound_cla_out[x][y][face].write = false;
+                signal_dspin_bound_cla_out[x][y][face].read  = true;
+            }
+        }
+    }
+    // @QM : what is the following line?
+    //clusters[0][0]->signal_dspin_m2p_proc[2].read = true;
+
+    sc_start(sc_core::sc_time(1, SC_NS));
+    signal_resetn = true;
+
+    if (debug_ok) {
+#ifdef USE_OPENMP
+        assert(false && "OPEN MP should not be used with debug because of its traces");
+#endif
+
+        if (gettimeofday(&t1, NULL) != 0) {
+            perror("gettimeofday");
+            return EXIT_FAILURE;
+        }
+
+        for (int64_t n = 1; n < ncycles && !stop_called; n++) {
+            if ((n % max_cycles) == 0) {
+
+                if (gettimeofday(&t2, NULL) != 0) {
+                    perror("gettimeofday");
+                    return EXIT_FAILURE;
+                }
+
+                ms1 = (uint64_t) t1.tv_sec * 1000ULL + (uint64_t) t1.tv_usec / 1000;
+                ms2 = (uint64_t) t2.tv_sec * 1000ULL + (uint64_t) t2.tv_usec / 1000;
+                std::cerr << "platform clock frequency " << (double) 5000000 / (double) (ms2 - ms1) << "Khz" << std::endl;
+
+                if (gettimeofday(&t1, NULL) != 0) {
+                    perror("gettimeofday");
+                    return EXIT_FAILURE;
+                }
+            }
+
+
+            if (n == reset_counters) {
+                for (size_t x = 0; x < (X_SIZE); x++) {
+                    for (size_t y = 0; y < Y_SIZE; y++) {
+                        clusters[x][y]->memc->reset_counters();
+                    }
+                }
+            }
+
+            if (n == dump_counters) {
+                for (size_t x = 0; x < (X_SIZE); x++) {
+                    for (size_t y = 0; y < Y_SIZE; y++) {
+                        clusters[x][y]->memc->print_stats(true, false);
+                    }
+                }
+            }
+
+            if ((n > debug_from) and (n % debug_period == 0)) {
+                std::cout << "****************** cycle " << std::dec << n ;
+                std::cout << "************************************************" << std::endl;
+
+                for (size_t x = 0; x < X_SIZE ; x++) {
+                    for (size_t y = 0; y < Y_SIZE ; y++) {
+                        for (int proc = 0; proc < NB_PROCS_MAX; proc++) {
+                            clusters[x][y]->proc[proc]->print_trace();
+                            std::ostringstream proc_signame;
+                            proc_signame << "[SIG]PROC_" << x << "_" << y << "_" << proc ;
+                            std::ostringstream p2m_signame;
+                            p2m_signame << "[SIG]PROC_" << x << "_" << y << "_" << proc << " P2M";
+                            std::ostringstream m2p_signame;
+                            m2p_signame << "[SIG]PROC_" << x << "_" << y << "_" << proc << " M2P";
+
+                            clusters[x][y]->signal_vci_ini_proc[proc].print_trace(proc_signame.str());
+                            clusters[x][y]->signal_dspin_p2m_proc[proc].print_trace(p2m_signame.str());
+                            clusters[x][y]->signal_dspin_m2p_proc[proc].print_trace(m2p_signame.str());
+                        }
+
+                        clusters[x][y]->memc->print_trace();
+
+                        std::ostringstream smemc;
+                        smemc << "[SIG]MEMC_" << x << "_" << y;
+                        std::ostringstream sxram;
+                        sxram << "[SIG]XRAM_" << x << "_" << y;
+                        std::ostringstream sm2p;
+                        sm2p << "[SIG]MEMC_" << x << "_" << y << " M2P";
+                        std::ostringstream sp2m;
+                        sp2m << "[SIG]MEMC_" << x << "_" << y << " P2M";
+
+                        clusters[x][y]->signal_vci_tgt_memc.print_trace(smemc.str());
+                        clusters[x][y]->signal_vci_xram.print_trace(sxram.str());
+                        clusters[x][y]->signal_dspin_p2m_memc.print_trace(sp2m.str());
+                        clusters[x][y]->signal_dspin_m2p_memc.print_trace(sm2p.str());
+                    }
+                }
+            }
+
+            sc_start(sc_core::sc_time(1, SC_NS));
+        }
+    }
+    else {
+        int64_t n = 0;
+        while (!stop_called && n != ncycles) {
+            if (gettimeofday(&t1, NULL) != 0) {
+                perror("gettimeofday");
+                return EXIT_FAILURE;
+            }
+            int64_t nb_cycles = min(max_cycles, ncycles - n);
+            if (do_reset_counters) {
+                nb_cycles = min(nb_cycles, reset_counters - n);
+            }
+            if (do_dump_counters) {
+                nb_cycles = min(nb_cycles, dump_counters - n);
+            }
+
+            sc_start(sc_core::sc_time(nb_cycles, SC_NS));
+            n += nb_cycles;
+
+            if (do_reset_counters && n == reset_counters) {
+                // Reseting counters
+                for (size_t x = 0; x < (X_SIZE); x++) {
+                    for (size_t y = 0; y < Y_SIZE; y++) {
+                        clusters[x][y]->memc->reset_counters();
+                    }
+                }
+                do_reset_counters = false;
+            }
+
+            if (do_dump_counters && n == dump_counters) {
+                // Dumping counters
+                for (size_t x = 0; x < (X_SIZE); x++) {
+                    for (size_t y = 0; y < Y_SIZE; y++) {
+                        clusters[x][y]->memc->print_stats(true, false);
+                    }
+                }
+                do_dump_counters = false;
+            }
+
 
             if (gettimeofday(&t2, NULL) != 0) {
-               perror("gettimeofday");
-               return EXIT_FAILURE;
-            }
-
+                perror("gettimeofday");
+                return EXIT_FAILURE;
+            }
             ms1 = (uint64_t) t1.tv_sec * 1000ULL + (uint64_t) t1.tv_usec / 1000;
             ms2 = (uint64_t) t2.tv_sec * 1000ULL + (uint64_t) t2.tv_usec / 1000;
-            std::cerr << "platform clock frequency " << (double) 5000000 / (double) (ms2 - ms1) << "Khz" << std::endl;
-
-            if (gettimeofday(&t1, NULL) != 0)
-            {
-               perror("gettimeofday");
-               return EXIT_FAILURE;
-            }
-         }
-
-
-         if (n == reset_counters) {
-            for (size_t x = 0; x < (X_SIZE); x++) {
-               for (size_t y = 0; y < Y_SIZE; y++) {
-                  clusters[x][y]->memc->reset_counters();
-               }
-            }
-         }
-
-         if (n == dump_counters) {
-            for (size_t x = 0; x < (X_SIZE); x++) {
-               for (size_t y = 0; y < Y_SIZE; y++) {
-                  clusters[x][y]->memc->print_stats(true, false);
-               }
-            }
-         }
-
-         if ((n > debug_from) and (n % debug_period == 0)) {
-            std::cout << "****************** cycle " << std::dec << n ;
-            std::cout << "************************************************" << std::endl;
-
-            for (size_t x = 0; x < X_SIZE ; x++) {
-               for (size_t y = 0; y < Y_SIZE ; y++) {
-                  for (int proc = 0; proc < NB_PROCS_MAX; proc++) {
-                     if (x == 0 && y == 0 && proc == 2) {
-                        continue;
-                     }
-                     clusters[x][y]->proc[proc]->print_trace();
-                     std::ostringstream proc_signame;
-                     proc_signame << "[SIG]PROC_" << x << "_" << y << "_" << proc ;
-                     std::ostringstream p2m_signame;
-                     p2m_signame << "[SIG]PROC_" << x << "_" << y << "_" << proc << " P2M";
-                     std::ostringstream m2p_signame;
-                     m2p_signame << "[SIG]PROC_" << x << "_" << y << "_" << proc << " M2P";
-
-                     clusters[x][y]->signal_vci_ini_proc[proc].print_trace(proc_signame.str());
-                     clusters[x][y]->signal_dspin_p2m_proc[proc].print_trace(p2m_signame.str());
-                     clusters[x][y]->signal_dspin_m2p_proc[proc].print_trace(m2p_signame.str());
-                  }
-
-                  clusters[x][y]->memc->print_trace();
-
-                  std::ostringstream smemc;
-                  smemc << "[SIG]MEMC_" << x << "_" << y;
-                  std::ostringstream sxram;
-                  sxram << "[SIG]XRAM_" << x << "_" << y;
-                  std::ostringstream sm2p;
-                  sm2p << "[SIG]MEMC_" << x << "_" << y << " M2P";
-                  std::ostringstream sp2m;
-                  sp2m << "[SIG]MEMC_" << x << "_" << y << " P2M";
-
-                  clusters[x][y]->signal_vci_tgt_memc.print_trace(smemc.str());
-                  clusters[x][y]->signal_vci_xram.print_trace(sxram.str());
-                  clusters[x][y]->signal_dspin_p2m_memc.print_trace(sp2m.str());
-                  clusters[x][y]->signal_dspin_m2p_memc.print_trace(sm2p.str());
-               }
-            }
-         }
-
-         sc_start(sc_core::sc_time(1, SC_NS));
-      }
-   }
-   else {
-      int64_t n = 0;
-      while (!stop_called && n != ncycles) {
-         if (gettimeofday(&t1, NULL) != 0) {
-            perror("gettimeofday");
-            return EXIT_FAILURE;
-         }
-         int64_t nb_cycles = min(max_cycles, ncycles - n);
-         if (do_reset_counters) {
-            nb_cycles = min(nb_cycles, reset_counters - n);
-         }
-         if (do_dump_counters) {
-            nb_cycles = min(nb_cycles, dump_counters - n);
-         }
-
-         sc_start(sc_core::sc_time(nb_cycles, SC_NS));
-         n += nb_cycles;
-
-         if (do_reset_counters && n == reset_counters) {
-            // Reseting counters
-            for (size_t x = 0; x < (X_SIZE); x++) {
-               for (size_t y = 0; y < Y_SIZE; y++) {
-                  clusters[x][y]->memc->reset_counters();
-               }
-            }
-            do_reset_counters = false;
-         }
-
-         if (do_dump_counters && n == dump_counters) {
-            // Dumping counters
-            for (size_t x = 0; x < (X_SIZE); x++) {
-               for (size_t y = 0; y < Y_SIZE; y++) {
-                  clusters[x][y]->memc->print_stats(true, false);
-               }
-            }
-            do_dump_counters = false;
-         }
-
-
-         if (gettimeofday(&t2, NULL) != 0) {
-            perror("gettimeofday");
-            return EXIT_FAILURE;
-         }
-         ms1 = (uint64_t) t1.tv_sec * 1000ULL + (uint64_t) t1.tv_usec / 1000;
-         ms2 = (uint64_t) t2.tv_sec * 1000ULL + (uint64_t) t2.tv_usec / 1000;
-         std::cerr << std::dec << "cycle " << n << " platform clock frequency " << (double) nb_cycles / (double) (ms2 - ms1) << "Khz" << std::endl;
-      }
-   }
-
-
-   // Free memory
-   for (size_t i = 0; i  < (X_SIZE * Y_SIZE); i++) {
-      size_t x = i / Y_SIZE;
-      size_t y = i % Y_SIZE;
-      delete clusters[x][y];
-   }
-
-   dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cmd_inc, X_SIZE - 1, Y_SIZE);
-   dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cmd_dec, X_SIZE - 1, Y_SIZE);
-
-   dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_rsp_inc, X_SIZE - 1, Y_SIZE);
-   dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_rsp_dec, X_SIZE - 1, Y_SIZE);
-
-   dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_m2p_inc, X_SIZE - 1, Y_SIZE);
-   dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_m2p_dec, X_SIZE - 1, Y_SIZE);
-
-   dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_p2m_inc, X_SIZE - 1, Y_SIZE);
-   dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_p2m_dec, X_SIZE - 1, Y_SIZE);
-
-   dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cla_inc, X_SIZE - 1, Y_SIZE);
-   dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cla_dec, X_SIZE - 1, Y_SIZE);
-
-   dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cmd_inc, X_SIZE, Y_SIZE - 1);
-   dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cmd_dec, X_SIZE, Y_SIZE - 1);
-
-   dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_rsp_inc, X_SIZE, Y_SIZE - 1);
-   dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_rsp_dec, X_SIZE, Y_SIZE - 1);
-
-   dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_m2p_inc, X_SIZE, Y_SIZE - 1);
-   dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_m2p_dec, X_SIZE, Y_SIZE - 1);
-
-   dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_p2m_inc, X_SIZE, Y_SIZE - 1);
-   dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_p2m_dec, X_SIZE, Y_SIZE - 1);
-
-   dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cla_inc, X_SIZE, Y_SIZE - 1);
-   dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cla_dec, X_SIZE, Y_SIZE - 1);
-
-   dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_cmd_in, X_SIZE, Y_SIZE, 4);
-   dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_cmd_out, X_SIZE, Y_SIZE, 4);
-
-   dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_bound_rsp_in, X_SIZE, Y_SIZE, 4);
-   dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_bound_rsp_out, X_SIZE, Y_SIZE, 4);
-
-   dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_m2p_in, X_SIZE, Y_SIZE, 4);
-   dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_m2p_out, X_SIZE, Y_SIZE, 4);
-
-   dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_bound_p2m_in, X_SIZE, Y_SIZE, 4);
-   dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_bound_p2m_out, X_SIZE, Y_SIZE, 4);
-
-   dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_cla_in, X_SIZE, Y_SIZE, 4);
-   dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_cla_out, X_SIZE, Y_SIZE, 4);
-
-   return EXIT_SUCCESS;
+            std::cerr << std::dec << "cycle " << n << " platform clock frequency " << (double) nb_cycles / (double) (ms2 - ms1) << "Khz" << std::endl;
+        }
+    }
+
+
+    // Free memory
+    for (size_t i = 0; i  < (X_SIZE * Y_SIZE); i++) {
+        size_t x = i / Y_SIZE;
+        size_t y = i % Y_SIZE;
+        delete clusters[x][y];
+    }
+
+    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cmd_inc, X_SIZE - 1, Y_SIZE);
+    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cmd_dec, X_SIZE - 1, Y_SIZE);
+
+    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_rsp_inc, X_SIZE - 1, Y_SIZE);
+    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_rsp_dec, X_SIZE - 1, Y_SIZE);
+
+    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_m2p_inc, X_SIZE - 1, Y_SIZE);
+    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_m2p_dec, X_SIZE - 1, Y_SIZE);
+
+    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_p2m_inc, X_SIZE - 1, Y_SIZE);
+    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_p2m_dec, X_SIZE - 1, Y_SIZE);
+
+    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cla_inc, X_SIZE - 1, Y_SIZE);
+    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cla_dec, X_SIZE - 1, Y_SIZE);
+
+    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cmd_inc, X_SIZE, Y_SIZE - 1);
+    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cmd_dec, X_SIZE, Y_SIZE - 1);
+
+    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_rsp_inc, X_SIZE, Y_SIZE - 1);
+    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_rsp_dec, X_SIZE, Y_SIZE - 1);
+
+    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_m2p_inc, X_SIZE, Y_SIZE - 1);
+    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_m2p_dec, X_SIZE, Y_SIZE - 1);
+
+    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_p2m_inc, X_SIZE, Y_SIZE - 1);
+    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_p2m_dec, X_SIZE, Y_SIZE - 1);
+
+    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cla_inc, X_SIZE, Y_SIZE - 1);
+    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cla_dec, X_SIZE, Y_SIZE - 1);
+
+    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_cmd_in, X_SIZE, Y_SIZE, 4);
+    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_cmd_out, X_SIZE, Y_SIZE, 4);
+
+    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_bound_rsp_in, X_SIZE, Y_SIZE, 4);
+    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_bound_rsp_out, X_SIZE, Y_SIZE, 4);
+
+    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_m2p_in, X_SIZE, Y_SIZE, 4);
+    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_m2p_out, X_SIZE, Y_SIZE, 4);
+
+    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_bound_p2m_in, X_SIZE, Y_SIZE, 4);
+    dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_bound_p2m_out, X_SIZE, Y_SIZE, 4);
+
+    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_cla_in, X_SIZE, Y_SIZE, 4);
+    dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_bound_cla_out, X_SIZE, Y_SIZE, 4);
+
+    return EXIT_SUCCESS;
 }
 
 
 void handler(int dummy = 0) {
-   stop_called = true;
-   sc_stop();
+    stop_called = true;
+    sc_stop();
 }
 
@@ -1173,26 +1126,31 @@
 
 int sc_main (int argc, char *argv[]) {
-   signal(SIGINT, handler);
-   signal(SIGPIPE, voidhandler);
-
-   try {
-      return _main(argc, argv);
-   } catch (std::exception &e) {
-      std::cout << e.what() << std::endl;
-   }
-   catch (...) {
-      std::cout << "Unknown exception occured" << std::endl;
-      throw;
-   }
-   return 1;
+    signal(SIGINT, handler);
+    signal(SIGPIPE, voidhandler);
+
+    try {
+        int ret =_main(argc, argv);
+        if (!stop_called) {
+            sc_stop();
+            sc_start(sc_core::sc_time(0, SC_NS));
+        }
+        return ret;
+    } catch (std::exception &e) {
+        std::cout << e.what() << std::endl;
+    }
+    catch (...) {
+        std::cout << "Unknown exception occured" << std::endl;
+        throw;
+    }
+    return 1;
 }
 
 
 // Local Variables:
-// tab-width: 3
-// c-basic-offset: 3
+// tab-width: 4
+// c-basic-offset: 4
 // c-file-offsets:((innamespace . 0)(inline-open . 0))
 // indent-tabs-mode: nil
 // End:
 
-// vim: filetype=cpp:expandtab:shiftwidth=3:tabstop=3:softtabstop=3
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
Index: trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/metadata/tsar_xbar_cluster.sd
===================================================================
--- trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/metadata/tsar_xbar_cluster.sd	(revision 1047)
+++ trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/metadata/tsar_xbar_cluster.sd	(revision 1048)
@@ -35,9 +35,9 @@
                 memc_dspin_out_width = parameter.Reference('dspin_cmd_width')),
 
+        Uses('caba:vci_simple_ram',
+                cell_size       = parameter.Reference('vci_data_width_ext')),
+
         Uses('caba:vci_simple_rom',
                 cell_size       = parameter.Reference('vci_data_width_int')),
-
-        Uses('caba:vci_simple_ram',
-                cell_size       = parameter.Reference('vci_data_width_ext')),
 
         Uses('caba:vci_simple_ram',
Index: trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/src/tsar_xbar_cluster.cpp
===================================================================
--- trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/src/tsar_xbar_cluster.cpp	(revision 1047)
+++ trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/src/tsar_xbar_cluster.cpp	(revision 1048)
@@ -156,5 +156,5 @@
                      y_width,                            // Number of y bits in platform
                      memc_ways, memc_sets, 16,           // CACHE SIZE
-                     3,                                  // MAX NUMBER OF COPIES
+                     4,                                  // MAX NUMBER OF COPIES
                      4096,                               // HEAP SIZE
                      8,                                  // TRANSACTION TABLE DEPTH
@@ -343,5 +343,4 @@
                      64);            // burst size
 
-        int mac = 0xBEEF0000;
         mnic = new VciMultiNic<vci_param_int>(
                      "mnic",
@@ -349,8 +348,8 @@
                      mtd,
                      nic_channels,
-                     mac,             // mac_4 address
-                     0xBABE,          // mac_2 address
-                     nic_rx_name,
-                     nic_tx_name);
+                     0,             // mac_4 address
+                     0,             // mac_2 address
+                     1,             // NIC_MODE_SYNTHESIS
+                     12);           // INTER_FRAME_GAP
 
 
@@ -709,4 +708,7 @@
     delete router_cmd;
     delete router_rsp;
+    delete router_m2p;
+    delete router_p2m;
+    delete router_cla;
     if (brom != NULL) {
         delete brom;
