Ignore:
Timestamp:
Oct 15, 2014, 11:41:49 AM (10 years ago)
Author:
meunier
Message:

Trunk:

  • Cosmetic in mem_cache_directory.h and xram_transaction.h
  • Renamed mem_cache param dspin_in_width and dspin_out_width to memc_dspin_in_width and memc_dspin_out_width (because of a bug in soclib-cc ?). Should have updated these names in the .sd or .py files of all platforms
  • Updated the scripts for tsar_generic_xbar to take into account the ideal write-through + added a graph in create_graphs.py
File:
1 edited

Legend:

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

    r790 r836  
    77
    88
    9 #apps = [ 'histogram', 'mandel', 'filter', 'radix', 'fft_ga' ]
    10 #apps = [ 'histogram', 'mandel', 'filter', 'radix', 'radix_ga', 'fft', 'fft_ga', 'filt_ga', 'kmeans', 'pca', 'lu' ]
    11 apps = [ 'fft', 'fft_ga' ]
    12 nb_procs = [ 1, 4, 8, 16, 32, 64, 128, 256 ]
    13 single_protocols = ['dhccp', 'rwt']
    14 joint_protocols = ['dhccp', 'rwt']
     9apps = [ 'filter', 'lu', 'fft_ga' ]
     10#apps = [ 'histogram', 'mandel', 'filter', 'fft', 'fft_ga', 'filt_ga', 'pca', 'lu' ]  # radix radix_ga kmeans
     11#apps = [ 'filt_ga' ]
     12nb_procs = [ 1, 4, 8, 16, 32, 64 ]
     13single_protocols = ['dhccp', 'rwt' ]
     14joint_protocols = ['dhccp', 'rwt' ]
    1515#joint_protocols = []
    1616
     
    403403   gp_stacked_name   = os.path.join(scripts_path, gen_dir, prot + '_stacked.gp')
    404404   
    405    norm_factor_value = 256
     405   norm_factor_value = nb_procs[-1]
    406406   
    407407   # Creating the gp file
     
    616616gp_cost_filename   = os.path.join(scripts_path, gen_dir, 'joint_relative_cost.gp')
    617617   
    618 direct_cost_metrics = [ 'read_cost', 'write_cost' ]
    619 coherence_cost_metrics = ['update_cost', 'm_inv_cost', 'broadcast_cost' ]
    620   
     618direct_cost_metrics = [ 'read_cost', 'write_cost', 'getm_cost' ]
     619coherence_cost_metrics = ['update_cost', 'm_inv_cost', 'broadcast_cost', 'inval_ro_cost', 'cleanup_cost', 'cleanup_d_cost' ]
     620 
    621621# Creating the gp file
    622622template_file = open(stacked_tmpl, 'r')
     
    702702
    703703
    704 
    705 
     704#################################################################################
     705### Graph 9 :         ###
     706#################################################################################
     707
     708
     709data_metric_filename = os.path.join(scripts_path, gen_dir, 'single_metric.dat')
     710gp_metric_filename   = os.path.join(scripts_path, gen_dir, 'single_metric.gp')
     711   
     712metric = 'total_write'
     713 
     714# Creating the gp file
     715template_file = open(stacked_tmpl, 'r')
     716template = template_file.read()
     717   
     718xtics_str = "("
     719first = True
     720xpos = 0 # successive x position of the center of the first bar in a application
     721app_labels = ""
     722prot_labels = ""
     723for num_appli in range(0, len(apps)):
     724   first_proc = True
     725   for i in nb_procs:
     726      x = 0 # local var for computing position of protocol names
     727      #for prot in joint_protocols:
     728         #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?)
     729         #x += 1
     730
     731      if not first:
     732         xtics_str += ", "
     733      first = False
     734      if first_proc:
     735         first_proc = False
     736         xpos_first = xpos
     737      xtics_str += "\"%d\" %f -1" % (i, float(xpos - 0.5 + len(joint_protocols)))
     738      xpos_last = xpos
     739      xpos += 1 + len(joint_protocols)
     740   app_name_xpos = float((xpos_first + xpos_last)) / 2
     741   app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos)
     742   xpos += 1
     743xtics_str += ")"
     744
     745n = 1
     746plot_str = "newhistogram \"\""
     747for prot in joint_protocols:
     748   plot_str += ", \\\n    " + "'" + data_metric_filename + "'" + " using " + str(n) + " lc rgb " + colors[n] + " title \"" + m_metric_name[metric] + " for " + m_prot_name[prot] + "\""
     749   n += 1
     750
     751ylabel_str = "%(m)s" % dict(m = m_metric_name[metric])
     752content = template % dict(svg_name = os.path.join(graph_dir, 'single_metric'), xtics_str = xtics_str, plot_str = plot_str, ylabel_str = ylabel_str, app_labels = app_labels, prot_labels = prot_labels)
     753
     754create_file(gp_metric_filename, content)
     755
     756# Creating the data file
     757content = "#" + metric
     758content += "\n"
     759for app in apps:
     760   if app != apps[0]:
     761      for prot in joint_protocols:
     762         for p in joint_protocols:
     763            content += "%-15f " % 0.0
     764         content += "\n"
     765   for i in nb_procs:
     766      for prot in joint_protocols:
     767         for p in joint_protocols:
     768            if p != prot:
     769               content += "%-15f " % 0
     770            else:
     771               content += "%-15f " % (float(metrics_val[prot][app][i][metric]))
     772         content += "\n"
     773      if i != nb_procs[-1]:
     774         for p in joint_protocols:
     775            content += "%-15f " % 0.0
     776         content += "\n"
     777
     778create_file(data_metric_filename, content)
     779# Calling gnuplot
     780print "gnuplot", gp_metric_filename
     781subprocess.call([ 'gnuplot', gp_metric_filename ])
     782
     783
     784
     785
Note: See TracChangeset for help on using the changeset viewer.