Changeset 1012


Ignore:
Timestamp:
Sep 11, 2015, 3:44:14 PM (9 years ago)
Author:
meunier
Message:
  • Update of simulation scripts for tsar_generic_xbar
Location:
trunk/platforms/tsar_generic_xbar
Files:
31 added
3 deleted
8 edited

Legend:

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

    r836 r1012  
    1010m_prot_name['rwt'] = "RWT"
    1111m_prot_name['hmesi'] = "HMESI"
     12m_prot_name['wtidl'] = "WT IDEAL"
    1213
    1314m_app_name = {}
    1415m_app_name['mandel'] = "Mandelbrot"
    15 m_app_name['filter'] = "Filter"
    16 m_app_name['filt_ga'] = "Filter (opt.)"
     16m_app_name['filter'] = "Convol"
     17m_app_name['filt_ga'] = "Convol"
    1718m_app_name['histogram'] = "Histogram"
     19m_app_name['histogram-pad'] = "Histogram"
     20m_app_name['histo-opt'] = "Histogram"
     21m_app_name['histo-opt-nopad'] = "Histogram"
    1822m_app_name['kmeans'] = "Kmeans"
     23m_app_name['kmeans-opt'] = "Kmeans"
    1924m_app_name['pca'] = "PCA"
     25m_app_name['pca-opt'] = "PCA"
    2026m_app_name['mat_mult'] = "Matrix Mult."
     27m_app_name['mat_mult-opt'] = "Matrix Mult."
    2128m_app_name['barnes'] = "Barnes"
    2229m_app_name['fmm'] = "FMM"
     
    3037m_app_name['fft'] = "FFT"
    3138m_app_name['radix'] = "Radix"
    32 m_app_name['fft_ga'] = "FFT (opt.)"
    33 m_app_name['radix_ga'] = "Radix (opt.)"
     39m_app_name['fft_ga'] = "FFT"
     40m_app_name['radix_ga'] = "Radix"
    3441
    3542m_metric_id = {}
     
    192199m_metric_name['total_ncc_to_cc']     = "Total Number of NCC to CC Changes"
    193200m_metric_name['broadcast_cost']      = "Broadcast Cost"
     201m_metric_name['coherence_cost']      = "Coherence Cost"
    194202m_metric_name['direct_cost']         = "Direct Requests Cost"
    195203m_metric_name['total_stacked']       = "??" # Normalization factor, does not have a name (unused)
     
    228236
    229237
    230 colors = [ "\"#008000\"", "\"#000080\"", "\"#BADC98\"", "\"#BA98DC\"", "\"#98DCBA\"", "\"#98BADC\"", "\"#BA9876\"", "\"#BA7698\"", "\"#98BA76\"", "\"#9876BA\"", "\"#76BA98\"", "\"#7698BA\"" ]
    231 
    232 
     238#colors = [ "\"#008000\"", "\"#000080\"", "\"#BADC98\"", "\"#BA98DC\"", "\"#98DCBA\"", "\"#98BADC\"", "\"#BA9876\"", "\"#BA7698\"", "\"#98BA76\"", "\"#9876BA\"", "\"#76BA98\"", "\"#7698BA\"" ]
     239colors = [ "\"#008000\"", "\"#FEDCBA\"", "\"#BADC98\"", "\"#000080\"", "\"#98DCBA\"", "\"#98BADC\"", "\"#BA9876\"", "\"#BA7698\"", "\"#98BA76\"", "\"#9876BA\"", "\"#76BA98\"", "\"#7698BA\"" ]
     240
     241
  • trunk/platforms/tsar_generic_xbar/scripts/create_graphs.py

    r836 r1012  
    77
    88
    9 apps = [ 'filter', 'lu', 'fft_ga' ]
     9#apps = [ 'histo-opt', 'mandel', 'filt_ga', 'radix_ga', 'fft_ga', 'pca-opt', 'fft', 'radix', 'filter', 'kmeans-opt' ]
     10apps = [ 'fft_ga', 'filt_ga', 'lu', 'radix_ga', 'histo-opt', 'mandel', 'pca-opt', 'kmeans-opt' ]
    1011#apps = [ 'histogram', 'mandel', 'filter', 'fft', 'fft_ga', 'filt_ga', 'pca', 'lu' ]  # radix radix_ga kmeans
    11 #apps = [ 'filt_ga' ]
    12 nb_procs = [ 1, 4, 8, 16, 32, 64 ]
    13 single_protocols = ['dhccp', 'rwt' ]
    14 joint_protocols = ['dhccp', 'rwt' ]
     12#apps = [ 'histo-opt', 'histogram2', 'histo-opt2' ]
     13#nb_procs = [ 1, 4, 8, 16, 32, 64, 128, 256 ]
     14nb_procs = [ 1, 4, 8, 16, 32, 64, 128, 256 ]
     15single_protocols = ['dhccp', 'hmesi']
     16joint_protocols = ['dhccp', 'hmesi']
    1517#joint_protocols = []
    1618
     
    7577exec_time = {}
    7678metrics_val = {}
    77 for prot in single_protocols:
     79for prot in joint_protocols:
    7880   metrics_val[prot] = {}
    7981   exec_time[prot] = {}
     
    111113   
    112114# Completing unset metrics (i.e. they are not present in the data file) with 0
    113 for prot in single_protocols:
     115for prot in joint_protocols:
    114116   for app in apps:
    115117      for i in nb_procs:
     
    119121
    120122# We make a 2nd pass to fill the derived fields, e.g. nb_total_updates
    121 for prot in single_protocols:
     123for prot in joint_protocols:
    122124   for app in apps:
    123125      for i in nb_procs:
     
    137139         metrics_val[prot][app][i]['total_ncc_to_cc'] = metrics_val[prot][app][i]['ncc_to_cc_read']  + metrics_val[prot][app][i]['ncc_to_cc_write']
    138140         metrics_val[prot][app][i]['direct_cost']     = metrics_val[prot][app][i]['read_cost']       + metrics_val[prot][app][i]['write_cost']
    139          metrics_val[prot][app][i]['broadcast_cost']  = metrics_val[prot][app][i]['broadcast'] * (x * y - 1)
     141         metrics_val[prot][app][i]['broadcast_cost']  = metrics_val[prot][app][i]['broadcast'] * 2 * (x * y - 1)
     142         metrics_val[prot][app][i]['coherence_cost']  = metrics_val[prot][app][i]['broadcast_cost']  + metrics_val[prot][app][i]['m_inv_cost'] + metrics_val[prot][app][i]['update_cost']
    140143         if metrics_val[prot][app][i]['broadcast'] < metrics_val[prot][app][i]['write_broadcast']:
    141144            # test to patch a bug in mem_cache
     
    414417   app_labels = ""
    415418   for num_appli in range(0, len(apps)):
    416       for i in nb_procs:
     419      for i in nb_procs[1:len(nb_procs)]: # skipping values for 1 proc
    417420         if not first:
    418421            xtics_str += ", "
    419422         first = False
    420          if i == nb_procs[0]:
     423         if i == nb_procs[1]:
    421424            xpos_first = xpos
    422425         xtics_str += "\"%d\" %d -1" % (i, xpos)
     
    451454            content += "%-15f" % 0.0
    452455         content += "\n"
    453       for i in nb_procs:
     456      for i in nb_procs[1:len(nb_procs)]:
    454457         for stacked_metric in stacked_metrics:
    455             content += "%-15f" % (float(metrics_val[prot][app][i][stacked_metric]) / metrics_val[prot][app][norm_factor_value]['total_stacked'])
     458            metric_val = metrics_val[prot][app][norm_factor_value]['total_stacked'] # Normalisation
     459            if metric_val != 0:
     460               content += "%-15f" % (float(metrics_val[prot][app][i][stacked_metric]) / metric_val)
     461            else:
     462               content += "%-15f" % 0
    456463         content += "\n"
    457464   
     
    476483   
    477484   direct_cost_metrics = [ 'read_cost', 'write_cost' ]
    478    coherence_cost_metrics = ['update_cost', 'm_inv_cost', 'broadcast_cost' ]
     485   #coherence_cost_metrics = ['update_cost', 'm_inv_cost', 'broadcast_cost' ]
     486   coherence_cost_metrics = ['coherence_cost']
    479487   
    480488   # Creating the gp file
     
    533541         if i > 4:
    534542            for cost_metric in direct_cost_metrics:
    535                content += "%-15f" % (float(metrics_val[prot][app][i][cost_metric]) / metrics_val[prot][app][i]['direct_cost'])
     543               if metrics_val[prot][app][i]['direct_cost'] == 0:
     544                  print "Error: prot : ", prot, " - app : ", app, " - i : ", i
     545                  content += "%-15f" % 0
     546               else:
     547                  content += "%-15f" % (float(metrics_val[prot][app][i][cost_metric]) / metrics_val[prot][app][i]['direct_cost'])
    536548            for cost_metric in coherence_cost_metrics:
    537549               content += "%-15f" % 0.0
     
    540552               content += "%-15f" % 0.0
    541553            for cost_metric in coherence_cost_metrics:
    542                content += "%-15f" % (float(metrics_val[prot][app][i][cost_metric]) / metrics_val[prot][app][i]['direct_cost'])
     554               if metrics_val[prot][app][i]['direct_cost'] == 0:
     555                  print "Error: prot : ", prot, " - app : ", app, " - i : ", i
     556                  content += "%-15f" % 0
     557               else:
     558                  content += "%-15f" % (float(metrics_val[prot][app][i][cost_metric]) / metrics_val[prot][app][i]['direct_cost'])
    543559            content += "\n"
    544560            if i != nb_procs[-1]:
     
    680696      if i > 4:
    681697         for prot in joint_protocols:
     698            if metrics_val[joint_protocols[0]][app][i]['direct_cost'] == 0:
     699               continue
    682700            for cost_metric in direct_cost_metrics:
    683701               content += "%-15f" % (float(metrics_val[prot][app][i][cost_metric]) / metrics_val[joint_protocols[0]][app][i]['direct_cost'])
  • trunk/platforms/tsar_generic_xbar/scripts/run_simus.py

    r836 r1012  
    66import shutil
    77
     8from gen_hdd import *
     9from gen_hard_config import *
     10from gen_arch_info import *
     11
    812#TODO (?): recopier les fichiers d'entrees dans le script en fonction de l'appli selectionnee
    913# Par exemple, tk14.O pour LU, img.raw pour ep_filter, etc.
     
    1115
    1216# User parameters
    13 nb_procs = [ 4 ]
    14 #nb_procs = [ 1, 4, 8, 16, 32, 64, 128, 256 ]
    15 rerun_stats = False
    16 use_omp = False
    17 protocol = 'wtidl'
    18 
     17bscpu = 0
     18#nb_procs = [ 4 ]
     19nb_procs = [ 1, 4, 8, 16, 32, 64, 128, 256 ]
     20rerun_stats = True
     21use_omp = True
     22protocol = 'rwt'
     23cpu_per_cluster = 4
     24# mode must be one of 'test' and 'simu'
     25mode = 'simu'
     26
     27#apps = [ 'cholesky', 'fft', 'fft_ga', 'filter', 'filt_ga', 'histogram', 'kmeans', 'lu', 'mandel', 'mat_mult', 'pca', 'radix_ga' ]
    1928#apps = [ 'histogram', 'mandel', 'filter', 'radix_ga', 'fft_ga', 'kmeans' ]
    20 #apps = [ 'histogram', 'mandel', 'filter', 'radix_ga', 'fft_ga' ]
    21 apps = [ 'radix' ]
     29apps = [ 'blackscholes', 'linear_regression', 'string_match', 'swaptions', 'fluidanimate' ]
    2230
    2331
    2432# Variables which could be changed but ought not to because they are reflected in the create_graphs.py script
    25 data_dir = 'data'
     33if mode == 'test':
     34    data_dir = 'data_test'
     35else:
     36    data_dir = 'data'
    2637log_init_name = protocol + '_stdo_'
    2738log_term_name = protocol + '_term_'
     
    2940# Global Variables
    3041
    31 all_apps = [ 'cholesky', 'fft', 'fft_ga', 'filter', 'filt_ga', 'histogram', 'kmeans', 'lu', 'mandel', 'mat_mult', 'pca', 'radix', 'radix_ga', 'showimg', ]
     42all_apps = [ 'blackscholes', 'boot_only', 'cholesky', 'fft', 'fft_ga', 'filter', 'filt_ga', 'fluidanimate', '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', ]
    3243# to come: 'barnes', 'fmm', 'ocean', 'raytrace', 'radiosity', 'waters', 'watern'
    3344
    34 all_protocols = [ 'dhccp', 'rwt', 'hmesi', 'wtidl' ]
     45all_protocols = [ 'dhccp', 'rwt', 'hmesi', 'wtidl', 'snoop' ]
    3546
    3647top_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..")
    3748config_name = os.path.join(os.path.dirname(os.path.realpath(__file__)), "config.py")
    3849
    39 scripts_path       = os.path.join(top_path, 'scripts')
    40 almos_path         = os.path.join(top_path, 'almos')
    41 soclib_conf_name   = os.path.join(top_path, "soclib.conf")
    42 topcell_name       = os.path.join(top_path, "top.cpp")
    43 arch_info_name     = os.path.join(almos_path, "arch-info-gen.info")
    44 arch_info_bib_name = os.path.join(almos_path, 'arch-info.bib')
    45 hdd_img_file_name  = os.path.join(almos_path, "hdd-img.bin")
    46 shrc_file_name     = os.path.join(almos_path, "shrc")
    47 hard_config_name   = os.path.join(almos_path, "hard_config.h")
     50scripts_path         = os.path.join(top_path, 'scripts')
     51almos_path           = os.path.join(top_path, 'almos')
     52soclib_conf_name     = os.path.join(top_path, "soclib.conf")
     53topcell_name         = os.path.join(top_path, "top.cpp")
     54partition_root_path  = os.path.join(top_path, "hdd_root")
     55arch_info_name       = os.path.join(almos_path, "arch-info-gen.info")
     56arch_info_bib_name   = os.path.join(almos_path, 'arch-info.bib')
     57hdd_img_file_name    = os.path.join(almos_path, "hdd-img.bin")
     58shrc_file_name       = os.path.join(almos_path, "shrc")
     59hard_config_name     = os.path.join(almos_path, "hard_config.h")
     60bootloader_link_name = os.path.join(almos_path, "bootloader-tsar-mipsel.bin")
    4861
    4962
    5063# Checks
     64if mode != 'test' and mode != 'simu':
     65    help_str = '''
     66*** Error: variable mode must be one either 'test' (testing purpose, small data sets) or 'simu' (performance evaluation, large data sets)
     67'''
     68    print help_str
     69    sys.exit()
     70
    5171if protocol not in all_protocols:
    5272    help_str = '''
     
    6484    help_str = '''
    6585You should create a file named config.py in this directory with the following definitions:
    66  - apps_dir:      path to almos-tsar-mipsel/apps directory
    67  - almos_src_dir: path to almos source directory (for kernel and bootloader binaries)
    68  - hdd_img_name:  path to the hdd image to use (will be copied but not modified)
    69  - tsar_dir:      path to tsar repository
     86 - apps_dir:          path to almos-tsar-mipsel/apps directory
     87 - almos_src_dir:     path to almos source directory (for kernel and bootloader binaries)
     88 - preloader_src_dir: path to the preloader main directory (where to run make)
     89 - hdd_img_name:      path to the hdd image to use (will be copied but not modified)
     90 - tsar_dir:          path to tsar repository
    7091Optional definitions (necessary if you want to use alternative protocols):
    71  - rwt_dir:       path to the RWT repository
    72  - hmesi_dir:     path to HMESI directory
    73  - wtidl_dir:     path to the ideal write-through protocol directory
     92 - rwt_dir:           path to the RWT repository
     93 - hmesi_dir:         path to HMESI directory
     94 - wtidl_dir:         path to the ideal write-through protocol directory
    7495*** Stopping execution
    7596'''
     
    127148
    128149
    129 def get_x_y(nb_procs):
     150def print_and_call(cmd):
     151    print subprocess.list2cmdline(cmd)
     152    retval = subprocess.call(cmd)
     153    return retval
     154
     155def print_and_popen(cmd, outfile):
     156    print subprocess.list2cmdline(cmd),
     157    print " >", outfile
     158    output = subprocess.Popen(cmd, stdout = subprocess.PIPE).communicate()[0]
     159    return output
     160
     161
     162def get_x_y(nb_procs, cpu_per_cluster):
    130163    x = 1
    131164    y = 1
    132165    to_x = True
    133     while (x * y * 4 < nb_procs):
     166    while (x * y * cpu_per_cluster < nb_procs):
    134167        if to_x:
    135168            x = x * 2
     
    140173
    141174
     175def get_nb_bits(size):
     176    i = 0
     177    while 2**i < size:
     178        i += 1
     179    return i
     180
     181
     182
    142183def gen_soclib_conf():
    143 
    144184    if os.path.isfile(soclib_conf_name):
    145185        print "Updating file %s" % (soclib_conf_name)
     
    204244
    205245
    206 def gen_hard_config(x, y, hard_config):
    207    header = '''
    208 /* Generated from run_simus.py */
    209 
    210 #ifndef _HD_CONFIG_H
    211 #define _HD_CONFIG_H
    212 
    213 #define X_SIZE              %(x)d
    214 #define Y_SIZE              %(y)d
    215 #define NB_CLUSTERS         %(nb_clus)d
    216 #define NB_PROCS_MAX        4
    217 #define NB_TASKS_MAX        8
    218 
    219 #define NB_TIM_CHANNELS     32
    220 #define NB_DMA_CHANNELS     1
    221 
    222 #define NB_TTY_CHANNELS     4
    223 #define NB_IOC_CHANNELS     1
    224 #define NB_NIC_CHANNELS     0
    225 #define NB_CMA_CHANNELS     0
    226 
    227 #define USE_XICU            1
    228 #define IOMMU_ACTIVE        0
    229 
    230 #define IRQ_PER_PROCESSOR   1
    231 ''' % dict(x = x, y = y, nb_clus = x * y)
    232 
    233    if protocol == 'wtidl':
    234        header += '#define WT_IDL\n'
    235 
    236    header += '#endif //_HD_CONFIG_H\n'
    237 
    238    file = open(hard_config, 'w')
    239    file.write(header)
    240    file.close()
    241 
    242 
    243 
    244 def gen_arch_info(x, y, arch_info, arch_info_bib):
    245    old_path = os.getcwd()
    246    print "cd", scripts_path
    247    os.chdir(scripts_path)
    248    print "./gen_arch_info_large.sh", str(x), str(y), ">", arch_info
    249    output = subprocess.Popen([ './gen_arch_info_large.sh', str(x), str(y) ], stdout = subprocess.PIPE).communicate()[0]
    250    os.chdir(almos_path)
    251    file = open(arch_info, 'w')
    252    file.write(output)
    253    file.close()
    254    print "./info2bib -i", arch_info, "-o", arch_info_bib
    255    subprocess.call([ './info2bib', '-i', arch_info, '-o', arch_info_bib ])
    256    print "cd", old_path
    257    os.chdir(old_path)
     246
     247def gen_arch_info_bib(x, y, arch_info, arch_info_bib):
     248    old_path = os.getcwd()
     249
     250    print "cd", scripts_path
     251    os.chdir(scripts_path)
     252    gen_arch_info(x, y, x_width, y_width, bscpu, arch_info)
     253    os.chdir(almos_path)
    258254   
     255    cmd = ['./info2bib', '-i', arch_info, '-o', arch_info_bib]
     256    print_and_call(cmd)
     257
     258    print "cd", old_path
     259    os.chdir(old_path)
     260   
    259261
    260262def gen_sym_links():
    261    old_path = os.getcwd()
    262    print "cd", almos_path
    263    os.chdir(almos_path)
    264 
    265    target = os.path.join(almos_src_dir, 'tools/soclib-bootloader/bootloader-tsar-mipsel.bin')
    266    link_name = 'bootloader-tsar-mipsel.bin'
    267    if not os.path.isfile(link_name):
    268       print "ln -s", target, link_name
    269       os.symlink(target, link_name)
    270 
    271    target = os.path.join(almos_src_dir, 'kernel/obj.tsar/almix-tsar-mipsel.bin')
    272    link_name = 'kernel-soclib.bin'
    273    if not os.path.isfile(link_name):
    274       print "ln -s", target, link_name
    275       os.symlink(target, link_name)
    276 
    277    copied_hdd = 'hdd-img.bin'
    278    print "cp", hdd_img_name, copied_hdd
    279    shutil.copy(hdd_img_name, copied_hdd)
    280 
    281    os.chdir(old_path)
    282 
    283 
    284 
    285 def compile_app(app_name, nprocs):
    286 
    287    #if app_name in splash2:
    288    #   app_dir_name = os.path.join(splash2_dir, splash_app_dir[app_name])
    289    #elif app_name in splash2_ga:
    290    #   app_dir_name = os.path.join(splash2_ga_dir, splash_ga_app_dir[app_name])
    291    #else:
    292    #   app_dir_name = os.path.join(apps_dir, app_name)
     263    target = os.path.join(almos_src_dir, 'tools/soclib-bootloader/bootloader-tsar-mipsel.bin')
     264    if not os.path.isfile(bootloader_link_name):
     265        print "ln -s", target, bootloader_link_name
     266        os.symlink(target, bootloader_link_name)
     267
     268    #target = os.path.join(almos_src_dir, 'kernel/obj.tsar/almix-tsar-mipsel.bin')
     269    #link_name = 'kernel-soclib.bin'
     270    #if not os.path.isfile(link_name):
     271    #    print "ln -s", target, link_name
     272    #    os.symlink(target, link_name)
     273
     274
     275def compile_almos():
     276    old_path = os.getcwd()
     277
     278    print "cd", almos_src_dir
     279    os.chdir(almos_src_dir)
     280    cmd = ['make']
     281    print_and_call(cmd)
     282    bootloader_dir = os.path.join(almos_src_dir, 'tools/soclib-bootloader')
     283    print "cd", bootloader_dir
     284    os.chdir(bootloader_dir)
     285    print_and_call(cmd)
     286
     287    print "cd", old_path
     288    os.chdir(old_path)
     289 
     290
     291def compile_preloader():
     292    old_path = os.getcwd()
     293    hard_conf_path_set = "HARD_CONFIG_PATH=" + almos_path
     294    bscpu_set = "BS_PROC=%d" % bscpu
     295
     296    print "cd", preloader_src_dir
     297    os.chdir(preloader_src_dir)
     298    cmd = ['make', hard_conf_path_set, bscpu_set, 'USE_DT=0']
     299    print_and_call(cmd)
     300
     301    print "cd", old_path
     302    os.chdir(old_path)
     303
     304
     305
     306
     307def compile_app(app_name):
     308
     309    #if app_name in splash2:
     310    #   app_dir_name = os.path.join(splash2_dir, splash_app_dir[app_name])
     311    #elif app_name in splash2_ga:
     312    #   app_dir_name = os.path.join(splash2_ga_dir, splash_ga_app_dir[app_name])
     313    #else:
     314    #   app_dir_name = os.path.join(apps_dir, app_name)
    293315
    294316     
    295    app_dir_name = os.path.join(apps_dir, app_name)
    296 
    297    old_path = os.getcwd()
    298    print "cd", app_dir_name
    299    os.chdir(app_dir_name)
    300 
    301    # Compilation process is different in splash and other apps
    302    #if app_name in splash2:
    303    #   print "make clean"
    304    #   subprocess.call([ 'make', 'clean' ])
    305 
    306    #   print "rm Makefile"
    307    #   subprocess.call([ 'rm', 'Makefile' ])
    308 
    309    #   print "ln -s Makefile.soclib Makefile"
    310    #   subprocess.call([ 'ln', '-s', 'Makefile.soclib', 'Makefile' ])
    311 
    312    #   print "make"
    313    #   subprocess.call([ 'make' ])
    314 
    315    #else:
    316    #   print "make clean"
    317    #   subprocess.call([ 'make', 'clean' ])
    318  
    319    #   print "make TARGET=tsar"
    320    #   subprocess.call([ 'make', 'TARGET=tsar' ])
    321 
    322    print "make clean"
    323    subprocess.call([ 'make', 'clean' ])
    324  
    325    print "make TARGET=tsar"
    326    retval = subprocess.call([ 'make', 'TARGET=tsar' ])
    327    if retval != 0:
    328        sys.exit()
    329    
    330    # Creation/Modification du shrc de almos
    331    if (app_name == "boot_only"):
    332       shrc = "exec -p 0 /bin/boot_onl\n"
    333    elif (app_name == "mandel"):
    334       shrc = "exec -p 0 /bin/mandel -n%(nproc)d\n" % dict(nproc = nprocs)
    335    elif (app_name == "filter"):
    336       shrc = "exec -p 0 /bin/filter -l1024 -c1024 -n%(nproc)d /etc/img.raw\n" % dict(nproc = nprocs)
    337    elif (app_name == "filt_ga"):
    338       shrc = "exec -p 0 /bin/filt_ga -n%(nproc)d -i /etc/img.raw\n" % dict(nproc = nprocs)
    339    elif (app_name == "histogram"):
    340       shrc = "exec -p 0 /bin/histogra -n%(nproc)d /etc/histo.bmp\n" % dict(nproc = nprocs)
    341    elif (app_name == "kmeans"):
    342       shrc = "exec -p 0 /bin/kmeans -n %(nproc)d -p %(npoints)d\n" % dict(nproc = nprocs, npoints = 10000) # default npoints = 100000
    343    elif (app_name == "pca"):
    344       shrc = "exec -p 0 /bin/pca -n%(nproc)d\n" % dict(nproc = nprocs)
    345    elif (app_name == "mat_mult"):
    346       shrc = "exec -p 0 /bin/mat_mult -n%(nproc)d\n" % dict(nproc = nprocs)
    347    elif (app_name == "showimg"):
    348       shrc = "exec -p 0 /bin/showimg -i /etc/lena.sgi\n"
    349    elif (app_name == "barnes"):
    350       shrc = "exec -p 0 /bin/barnes -n%(nproc)d -b%(nbody)d\n" % dict(nproc = nprocs, nbody = 1024)
    351    elif (app_name == "fmm"):
    352       shrc = "exec -p 0 /bin/fmm -n%(nproc)d -p%(nparticles)d\n" % dict(nproc = nprocs, nparticles = 1024)
    353    elif (app_name == "ocean"):
    354       shrc = "exec -p 0 /bin/ocean -n%(nproc)d -m%(gridsize)d\n" % dict(nproc = nprocs, gridsize = 66)
    355    elif (app_name == "radiosity"):
    356       shrc = "exec -p 0 /bin/radiosit -n %(nproc)d -batch\n" % dict(nproc = nprocs)
    357    elif (app_name == "raytrace"):
    358       shrc = "exec -p 0 /bin/raytrace -n%(nproc)d /etc/tea.env\n" % dict(nproc = nprocs)
    359    elif (app_name == "watern"):
    360       shrc = "exec -p 0 /bin/watern -n%(nproc)d -m512\n" % dict(nproc = nprocs)
    361    elif (app_name == "waters"):
    362       shrc = "exec -p 0 /bin/waters -n%(nproc)d -m512\n" % dict(nproc = nprocs)
    363    elif (app_name == "cholesky"):
    364       shrc = "exec -p 0 /bin/cholesky -n%(nproc)d /etc/tk14.O\n" % dict(nproc = nprocs)
    365    elif (app_name == "fft"):
    366       shrc = "exec -p 0 /bin/fft -n%(nproc)d -m18\n" % dict(nproc = nprocs)
    367    elif (app_name == "lu"):
    368       shrc = "exec -p 0 /bin/lu -n%(nproc)d -m512\n" % dict(nproc = nprocs)
    369    elif (app_name == "radix"):
    370       shrc = "exec -p 0 /bin/radix -n%(nproc)d -k1024\n" % dict(nproc = nprocs) # test : 1024 ; simu : 2097152
    371    elif (app_name == "radix_ga"):
    372       shrc = "exec -p 0 /bin/radix_ga -n%(nproc)d -k2097152\n" % dict(nproc = nprocs) # p = proc, n = num_keys
    373    elif (app_name == "fft_ga"):
    374       shrc = "exec -p 0 /bin/fft_ga -n%(nproc)d -m18\n" % dict(nproc = nprocs)
    375    else:
    376       assert(False)
    377    
    378    file = open(shrc_file_name, 'w')
    379    file.write(shrc)
    380    file.close()
    381 
    382    # Copie du binaire et du shrc dans l'image disque
    383    print "mcopy -o -i", hdd_img_file_name, shrc_file_name, "::/etc/"
    384    subprocess.call([ 'mcopy', '-o', '-i', hdd_img_file_name, shrc_file_name, '::/etc/' ])
    385    print "mcopy -o -i", hdd_img_file_name, app_name, "::/bin/"
    386    subprocess.call([ 'mcopy', '-o', '-i', hdd_img_file_name, app_name, '::/bin/' ])
    387 
    388    print "cd", old_path
    389    os.chdir(old_path)
     317    app_dir_name = os.path.join(apps_dir, app_name)
     318
     319    old_path = os.getcwd()
     320    print "cd", app_dir_name
     321    os.chdir(app_dir_name)
     322
     323    # Compilation process is different in splash and other apps
     324    #if app_name in splash2:
     325    #   print "make clean"
     326    #   subprocess.call([ 'make', 'clean' ])
     327
     328    #   print "rm Makefile"
     329    #   subprocess.call([ 'rm', 'Makefile' ])
     330
     331    #   print "ln -s Makefile.soclib Makefile"
     332    #   subprocess.call([ 'ln', '-s', 'Makefile.soclib', 'Makefile' ])
     333
     334    #   print "make"
     335    #   subprocess.call([ 'make' ])
     336
     337    #else:
     338    #   print "make clean"
     339    #   subprocess.call([ 'make', 'clean' ])
     340 
     341    #   print "make TARGET=tsar"
     342    #   subprocess.call([ 'make', 'TARGET=tsar' ])
     343
     344    cmd = ['make', 'clean']
     345    print_and_call(cmd)
     346 
     347    cmd = ['make', 'TARGET=tsar']
     348    retval = print_and_call(cmd)
     349    if retval != 0:
     350        sys.exit()
     351
     352    print "cd", old_path
     353    os.chdir(old_path)
    390354# end of compile_app
    391355
    392356
    393 print "mkdir -p", os.path.join(scripts_path, data_dir)
    394 subprocess.call([ 'mkdir', '-p', os.path.join(scripts_path, data_dir) ])
     357
     358
     359def gen_shrc(app_name, nprocs):
     360    # Creation/Modification du shrc de almos
     361    if mode == 'test':
     362        if (app_name == "blackscholes"):
     363            shrc = "exec -p 0 /bin/blacksch -n%(nproc)d /etc/black_16.txt\n" % dict(nproc = nprocs)
     364        elif (app_name == "boot_only"):
     365            shrc = "exec -p 0 /bin/boot_onl\n"
     366        elif (app_name == "filter"):
     367            shrc = "exec -p 0 /bin/filter -l 128 -c 128 -n %(nproc)d -i /etc/img128.raw\n" % dict(nproc = nprocs)
     368        elif (app_name == "filt_ga"):
     369            shrc = "exec -p 0 /bin/filt_ga -l 128 -c 128 -n %(nproc)d -i /etc/img128.raw\n" % dict(nproc = nprocs)
     370        elif (app_name == "fft"):
     371            shrc = "exec -p 0 /bin/fft -n%(nproc)d -m4\n" % dict(nproc = nprocs)
     372        elif (app_name == "fft_ga"):
     373            shrc = "exec -p 0 /bin/fft_ga -n%(nproc)d -m4\n" % dict(nproc = nprocs) # m = vector size
     374        elif (app_name == "fluidanimate"):
     375            shrc = "exec -p 0 /bin/fluidani -n%(nproc)d -i /etc/flui_15K.flu\n" % dict(nproc = nprocs)
     376        elif (app_name == "histogram"):
     377            shrc = "exec -p 0 /bin/histogra -n%(nproc)d /etc/histo_s.bmp\n" % dict(nproc = nprocs)
     378        elif (app_name == "histo-opt"):
     379            shrc = "exec -p 0 /bin/histo-op -n%(nproc)d /etc/histo_s.bmp\n" % dict(nproc = nprocs)
     380        elif (app_name == "kmeans"):
     381            shrc = "exec -p 0 /bin/kmeans -n %(nproc)d -p %(npoints)d\n" % dict(nproc = nprocs, npoints = 1000)
     382        elif (app_name == "kmeans-opt"):
     383            shrc = "exec -p 0 /bin/kmeans-o -n %(nproc)d -p %(npoints)d\n" % dict(nproc = nprocs, npoints = 1000)
     384        elif (app_name == "linear_regression"):
     385            shrc = "exec -p 0 /bin/linear_r -n%(nproc)d /etc/key_1MB.txt\n" % dict(nproc = nprocs)
     386        elif (app_name == "lu"):
     387            shrc = "exec -p 0 /bin/lu -n%(nproc)d -m16\n" % dict(nproc = nprocs)
     388        elif (app_name == "mandel"):
     389            shrc = "exec -p 0 /bin/mandel -n%(nproc)d -x 30 -y 20\n" % dict(nproc = nprocs)
     390        elif (app_name == "mat_mult"):
     391            shrc = "exec -p 0 /bin/mat_mult -n%(nproc)d -s 10\n" % dict(nproc = nprocs) # s = matrix size
     392        elif (app_name == "mat_mult-opt"):
     393            shrc = "exec -p 0 /bin/mat_mult -n%(nproc)d -s 10\n" % dict(nproc = nprocs)
     394        elif (app_name == "pca"):
     395            shrc = "exec -p 0 /bin/pca -n%(nproc)d -r 16 -c 8\n" % dict(nproc = nprocs) # r = num rows, c = num cols
     396        elif (app_name == "pca-opt"):
     397            shrc = "exec -p 0 /bin/pca-opt -n%(nproc)d -r 16 -c 8\n" % dict(nproc = nprocs)
     398        elif (app_name == "radix"):
     399            shrc = "exec -p 0 /bin/radix -n%(nproc)d -k1024\n" % dict(nproc = nprocs)
     400        elif (app_name == "radix_ga"):
     401            shrc = "exec -p 0 /bin/radix_ga -n%(nproc)d -k1024\n" % dict(nproc = nprocs) # n = num_keys
     402        elif (app_name == "string_match"):
     403            shrc = "exec -p 0 /bin/string_m -n%(nproc)d /etc/key_1MB.txt\n" % dict(nproc = nprocs)
     404        elif (app_name == "swaptions"):
     405            shrc = "exec -p 0 /bin/swaption -n%(nproc)d -s 16 -t 1000\n" % dict(nproc = nprocs) # s = num swaptions (default 16), t = num simus (default 10000)
     406        else:
     407            print "*** Error: The application %s is not available in test mode", app_name
     408            sys.exit()
     409    else:
     410        if (app_name == "barnes"):
     411            shrc = "exec -p 0 /bin/barnes -n%(nproc)d -b%(nbody)d\n" % dict(nproc = nprocs, nbody = 1024)
     412        elif (app_name == "blackscholes"):
     413            shrc = "exec -p 0 /bin/blacksch -n %(nproc)d /etc/black_4K.txt\n" % dict(nproc = nprocs)
     414        elif (app_name == "boot_only"):
     415            shrc = "exec -p 0 /bin/boot_onl\n"
     416        elif (app_name == "cholesky"):
     417            shrc = "exec -p 0 /bin/cholesky -n%(nproc)d /etc/tk14.O\n" % dict(nproc = nprocs)
     418        elif (app_name == "fft"):
     419            shrc = "exec -p 0 /bin/fft -n%(nproc)d -m18\n" % dict(nproc = nprocs)
     420        elif (app_name == "fft_ga"):
     421            shrc = "exec -p 0 /bin/fft_ga -n%(nproc)d -m18\n" % dict(nproc = nprocs)
     422        elif (app_name == "fluidanimate"):
     423            shrc = "exec -p 0 /bin/fluidani -n%(nproc)d -i /etc/flui_35K.flu\n" % dict(nproc = nprocs)
     424        elif (app_name == "filter"):
     425            shrc = "exec -p 0 /bin/filter -l 1024 -c 1024 -n %(nproc)d -i /etc/img1024.raw\n" % dict(nproc = nprocs)
     426        elif (app_name == "filt_ga"):
     427            shrc = "exec -p 0 /bin/filt_ga -l 1024 -c 1024 -n %(nproc)d -i /etc/img1024.raw\n" % dict(nproc = nprocs)
     428        elif (app_name == "histogram"):
     429            shrc = "exec -p 0 /bin/histogra -n%(nproc)d /etc/histo.bmp\n" % dict(nproc = nprocs)
     430        elif (app_name == "histo-opt"):
     431            shrc = "exec -p 0 /bin/histo-op -n%(nproc)d /etc/histo.bmp\n" % dict(nproc = nprocs)
     432        elif (app_name == "kmeans"):
     433            shrc = "exec -p 0 /bin/kmeans -n %(nproc)d -p %(npoints)d\n" % dict(nproc = nprocs, npoints = 10000) # default npoints = 100000
     434        elif (app_name == "kmeans-opt"):
     435            shrc = "exec -p 0 /bin/kmeans-o -n %(nproc)d -p %(npoints)d\n" % dict(nproc = nprocs, npoints = 10000) # default npoints = 100000
     436        elif (app_name == "linear_regression"):
     437            shrc = "exec -p 0 /bin/linear_r -n%(nproc)d /etc/key_50MB.txt\n" % dict(nproc = nprocs)
     438        elif (app_name == "lu"):
     439            shrc = "exec -p 0 /bin/lu -n%(nproc)d -m512\n" % dict(nproc = nprocs)
     440        elif (app_name == "mandel"):
     441            shrc = "exec -p 0 /bin/mandel -n%(nproc)d\n" % dict(nproc = nprocs)
     442        elif (app_name == "mat_mult"):
     443            shrc = "exec -p 0 /bin/mat_mult -n%(nproc)d\n" % dict(nproc = nprocs)
     444        elif (app_name == "mat_mult-opt"):
     445            shrc = "exec -p 0 /bin/mat_mult -n%(nproc)d\n" % dict(nproc = nprocs)
     446        elif (app_name == "pca"):
     447            shrc = "exec -p 0 /bin/pca -n%(nproc)d\n" % dict(nproc = nprocs)
     448        elif (app_name == "pca-opt"):
     449            shrc = "exec -p 0 /bin/pca-opt -n%(nproc)d\n" % dict(nproc = nprocs)
     450        elif (app_name == "fmm"):
     451            shrc = "exec -p 0 /bin/fmm -n%(nproc)d -p%(nparticles)d\n" % dict(nproc = nprocs, nparticles = 1024)
     452        elif (app_name == "ocean"):
     453            shrc = "exec -p 0 /bin/ocean -n%(nproc)d -m%(gridsize)d\n" % dict(nproc = nprocs, gridsize = 66)
     454        elif (app_name == "radiosity"):
     455            shrc = "exec -p 0 /bin/radiosit -n %(nproc)d -batch\n" % dict(nproc = nprocs)
     456        elif (app_name == "radix"):
     457            shrc = "exec -p 0 /bin/radix -n%(nproc)d -k2097152\n" % dict(nproc = nprocs)
     458        elif (app_name == "radix_ga"):
     459            shrc = "exec -p 0 /bin/radix_ga -n%(nproc)d -k2097152\n" % dict(nproc = nprocs) # k = num_keys
     460        elif (app_name == "string_match"):
     461            shrc = "exec -p 0 /bin/string_m -n%(nproc)d /etc/key_50MB.txt\n" % dict(nproc = nprocs)
     462        elif (app_name == "raytrace"):
     463            shrc = "exec -p 0 /bin/raytrace -n%(nproc)d /etc/tea.env\n" % dict(nproc = nprocs)
     464        elif (app_name == "showimg"):
     465            shrc = "exec -p 0 /bin/showimg -i /etc/lena.sgi\n"
     466        elif (app_name == "swaptions"):
     467            shrc = "exec -p 0 /bin/swaption -n%(nproc)d -s 256 -t 1000\n" % dict(nproc = nprocs) # s = num swaptions (default 16), t = num simus (default 10000)
     468        elif (app_name == "watern"):
     469            shrc = "exec -p 0 /bin/watern -n%(nproc)d -m512\n" % dict(nproc = nprocs)
     470        elif (app_name == "waters"):
     471            shrc = "exec -p 0 /bin/waters -n%(nproc)d -m512\n" % dict(nproc = nprocs)
     472        else:
     473            assert(False)
     474   
     475    file = open(shrc_file_name, 'w')
     476    file.write(shrc)
     477    file.close()
     478
     479    # Copie du shrc dans la future image disque
     480    cmd = ['cp', shrc_file_name, os.path.join(partition_root_path, "etc", "shrc")]
     481    print_and_call(cmd)
     482# end of gen_shrc
     483
     484
     485
     486cmd = ['mkdir', '-p', os.path.join(scripts_path, data_dir)]
     487print_and_call(cmd)
    395488
    396489gen_sym_links()
    397490gen_soclib_conf()
     491compile_preloader()
     492compile_almos()
     493# Compile application once at the beginning not to intererfere with
     494# other simulations
     495for app in apps:
     496    compile_app(app)
     497    full_app_name = os.path.join(apps_dir, app, app)
     498    cmd = ['cp', full_app_name, os.path.join(partition_root_path, "bin", app)]
     499    print_and_call(cmd)
     500
     501 
     502print "cd", top_path
     503os.chdir(top_path)
    398504
    399505for i in nb_procs:
    400    x, y = get_x_y(i)
    401    nthreads = min(4, x * y)
    402    gen_hard_config(x, y, hard_config_name)
    403    gen_arch_info(x, y, arch_info_name, arch_info_bib_name)
    404 
    405    print "cd", top_path
    406    os.chdir(top_path)
    407    print "touch", topcell_name
    408    subprocess.call([ 'touch', topcell_name ])
    409    print "make"
    410    retval = subprocess.call([ 'make' ])
    411    if retval != 0:
    412        sys.exit()
    413 
    414    for app in apps:
    415       print "cd", top_path
    416       os.chdir(top_path)
    417 
    418       compile_app(app, i)
    419 
    420       # Launch simulation
    421       if use_omp:
    422          print "./simul.x -THREADS", nthreads, ">", os.path.join(scripts_path, data_dir, app + '_' + log_init_name + str(i))
    423          output = subprocess.Popen([ './simul.x', '-THREADS', str(nthreads) ], stdout = subprocess.PIPE).communicate()[0]
    424       else:
    425          print "./simul.x >", os.path.join(scripts_path, data_dir, app + '_' + log_init_name + str(i))
    426          output = subprocess.Popen([ './simul.x' ], stdout = subprocess.PIPE).communicate()[0]
    427 
    428 
    429       # Write simulation results to data directory
    430       print "cd", scripts_path
    431       os.chdir(scripts_path)
    432       filename = os.path.join(data_dir, app + '_' + log_init_name + str(i))
    433       file = open(filename, 'w')
    434       file.write(output)
    435       file.close()
    436 
    437       filename = os.path.join(scripts_path, data_dir, app + '_' + log_term_name + str(i))
    438       print "mv", os.path.join(top_path, 'term1'), filename
    439       subprocess.call([ 'mv', os.path.join(top_path, 'term1'), filename ])
    440 
    441       if rerun_stats:
    442          start2_found = False
    443          end_found = False
    444          for line in open(filename):
    445             if "[THREAD_COMPUTE_START]" in line:
    446                start2 = line.split()[-1]
    447                start2_found = True
    448             if "[THREAD_COMPUTE_END]" in line:
    449                end = line.split()[-1]
    450                end_found = True
    451          assert(start2_found and end_found)
    452          
    453          print "cd", top_path
    454          os.chdir(top_path)
    455 
    456          # Relauching simulation with reset and dump of counters
    457          if use_omp:
    458             print "./simul.x -THREADS", nthreads, "--reset-counters %s --dump-counters %s >" % (start2, end), os.path.join(scripts_path, data_dir, app + '_' + log_init_name + str(i))
    459             output = subprocess.Popen([ './simul.x', '-THREADS', str(nthreads), '--reset-counters', start2, '--dump-counters', end ], stdout = subprocess.PIPE).communicate()[0]
    460          else:
    461             print "./simul.x --reset-counters %s --dump-counters %s >" % (start2, end), os.path.join(scripts_path, data_dir, app + '_' + log_init_name + str(i))
    462             output = subprocess.Popen([ './simul.x', '--reset-counters', start2, '--dump-counters', end ], stdout = subprocess.PIPE).communicate()[0]
    463          
    464          # Write simulation results (counters) to data directory
    465          print "cd", scripts_path
    466          os.chdir(scripts_path)
    467          filename = os.path.join(data_dir, app + '_' + log_init_name + str(i))
    468          file = open(filename, 'w')
    469          file.write(output)
    470          file.close()
     506    x, y = get_x_y(i, cpu_per_cluster)
     507    x_width = get_nb_bits(x)
     508    y_width = get_nb_bits(y)
     509    nthreads = min(4, x * y)
     510    hard_config(x, y, x_width, y_width, cpu_per_cluster, hard_config_name, protocol)
     511    gen_arch_info_bib(x, y, arch_info_name, arch_info_bib_name)
     512
     513    cmd = ['touch', topcell_name]
     514    print_and_call(cmd)
     515
     516    cmd = ['make']
     517    retval = print_and_call(cmd)
     518    if retval != 0:
     519        sys.exit()
     520 
     521    for app in apps:
     522        # Generate shrc
     523        gen_shrc(app, i)
     524
     525        # Remove current disk image
     526        print "rm", hdd_img_file_name
     527        os.remove(hdd_img_file_name)
     528
     529        # Regenerate disk image
     530        hdd_img(partition_root_path, hdd_img_file_name, "fat32", bootloader_link_name)
     531
     532        # Launch simulation
     533        if use_omp:
     534            cmd = ['./simul.x', '-THREADS', str(nthreads)]
     535        else:
     536            cmd = ['./simul.x']
     537        filename = os.path.join(scripts_path, data_dir, app + '_' + log_init_name + str(i))
     538        output = print_and_popen(cmd, filename)
     539 
     540        # Write simulation results to data directory
     541        file = open(filename, 'w')
     542        file.write(output)
     543        file.close()
     544 
     545        filename = os.path.join(scripts_path, data_dir, app + '_' + log_term_name + str(i))
     546       
     547        cmd = ['mv', os.path.join(top_path, 'term1'), filename]
     548        print_and_call(cmd)
     549 
     550        if rerun_stats:
     551            start2_found = False
     552            end_found = False
     553            for line in open(filename):
     554                if "[THREAD_COMPUTE_START]" in line:
     555                    start2 = line.split()[-1]
     556                    start2_found = True
     557                if "[THREAD_COMPUTE_END]" in line:
     558                    end = line.split()[-1]
     559                    end_found = True
     560            assert(start2_found and end_found)
     561         
     562            # Regenerate shrc and hdd to ensure having the same hdd image
     563            gen_shrc(app, i)
     564 
     565            # Relauching simulation with reset and dump of counters
     566            if use_omp:
     567                cmd = ['./simul.x', '-THREADS', str(nthreads), '--reset-counters', start2, '--dump-counters', end]
     568            else:
     569                cmd = ['./simul.x', '--reset-counters', start2, '--dump-counters', end]
     570            filename = os.path.join(scripts_path, data_dir, app + '_' + log_init_name + str(i))
     571            output = print_and_popen(cmd, filename)
     572           
     573            # Checking that the two terms obtained are identical
     574            import filecmp
     575            term_orig_file = os.path.join(scripts_path, data_dir, app + '_' + log_term_name + str(i))
     576            term_new_file = os.path.join(top_path, 'term1')
     577            assert(filecmp.cmp(term_orig_file, term_new_file))
     578 
     579            # Write simulation results (counters) to data directory
     580            file = open(filename, 'w')
     581            file.write(output)
     582            file.close()
    471583 
    472584
  • trunk/platforms/tsar_generic_xbar/scripts/templates/coherence_template.gp

    r706 r1012  
    1515#set logscale y 2
    1616set xrange [8:256]
    17 #set yrange [0:30]
     17set yrange [0:300]
    1818
    1919set key inside left top Left reverse
  • trunk/platforms/tsar_generic_xbar/scripts/templates/metric_template.gp

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

    r749 r1012  
    11
    2 set terminal svg size 1000 800 fixed
     2set terminal svg size 500 400 fixed
    33set output "%(svg_name)s.svg"
    44
  • trunk/platforms/tsar_generic_xbar/soclib.conf

    r836 r1012  
    11
    22# DescPath modified by a script
    3 
    43
    54
     
    1514config.addDescPath("/users/cao/meunier/src/tsar/modules/vci_spi")
    1615config.addDescPath("/users/cao/meunier/src/tsar/platforms/tsar_generic_xbar/tsar_xbar_cluster")
    17 config.addDescPath("/users/cao/meunier/src/wt_ideal/communication")
    18 config.addDescPath("/users/cao/meunier/src/wt_ideal/lib/generic_cache_tsar")
    19 config.addDescPath("/users/cao/meunier/src/wt_ideal/modules/vci_cc_vcache_wrapper")
    20 config.addDescPath("/users/cao/meunier/src/wt_ideal/modules/vci_mem_cache")
     16config.addDescPath("/users/cao/meunier/src/tsar/communication")
     17config.addDescPath("/users/cao/meunier/src/tsar/lib/generic_cache_tsar")
     18config.addDescPath("/users/cao/meunier/src/tsar/modules/vci_cc_vcache_wrapper")
     19config.addDescPath("/users/cao/meunier/src/tsar/modules/vci_mem_cache")
  • trunk/platforms/tsar_generic_xbar/top.cpp

    r885 r1012  
    126126#endif
    127127
    128 //  cluster index (computed from x,y coordinates)
     128//  nluster index (computed from x,y coordinates)
    129129#ifdef USE_ALMOS
    130130   #define cluster(x,y)   (y + x * Y_SIZE)
     
    213213
    214214#ifdef USE_ALMOS
    215 #define soft_name       PREFIX_OS"bootloader-tsar-mipsel.bin",\
    216                         PREFIX_OS"kernel-soclib.bin@0xbfc10000:D",\
    217                         PREFIX_OS"arch-info.bib@0xBFC08000:D"
     215#define soft_name       PREFIX_OS"preloader.elf"
    218216#endif
    219217#ifdef USE_GIET
     
    232230// For all components:  global TGTID = global SRCID = cluster_index
    233231////////////////////////////////////////////////////////////////////
    234 
    235 #define MEMC_TGTID      0
    236 #define XICU_TGTID      1
    237 #define MDMA_TGTID      2
    238 #define MTTY_TGTID      3
    239 #define BDEV_TGTID      4
    240 #define MNIC_TGTID      5
    241 #define BROM_TGTID      6
    242 #define CDMA_TGTID      7
    243 #define SIMH_TGTID      8
    244 #define FBUF_TGTID      9
    245232
    246233
     
    254241
    255242#ifdef USE_GIET
    256    // specific segments in "IO" cluster : absolute physical address
    257    #define BROM_BASE    0x00BFC00000
    258    #define BROM_SIZE    0x0000100000   // 1 Mbytes
    259 
    260    #define FBUF_BASE    0x00B2000000
    261    #define FBUF_SIZE    (FBUF_X_SIZE * FBUF_Y_SIZE * 2)
    262 
    263    #define BDEV_BASE    0x00B3000000
    264    #define BDEV_SIZE    0x0000001000   // 4 Kbytes
    265 
    266    #define MTTY_BASE    0x00B4000000
    267    #define MTTY_SIZE    0x0000001000   // 4 Kbytes
    268 
    269    #define MNIC_BASE    0x00B5000000
    270    #define MNIC_SIZE    0x0000080000   // 512 Kbytes (for 8 channels)
    271 
    272    #define CDMA_BASE    0x00B6000000
    273    #define CDMA_SIZE    0x0000004000 * NB_CMA_CHANNELS
    274 
    275    // replicated segments : address is incremented by a cluster offset
    276    //     offset  = cluster(x,y) << (address_width-x_width-y_width);
    277 
    278    #define MEMC_BASE    0x0000000000
    279    #define MEMC_SIZE    0x0010000000   // 256 Mbytes per cluster
    280 
    281    #define XICU_BASE    0x00B0000000
    282    #define XICU_SIZE    0x0000001000   // 4 Kbytes
    283 
    284    #define MDMA_BASE    0x00B1000000
    285    #define MDMA_SIZE    0x0000001000 * NB_DMA_CHANNELS  // 4 Kbytes per channel
    286 
    287    #define SIMH_BASE    0x00B7000000
    288    #define SIMH_SIZE    0x0000001000
     243   #error "This platform is no more supported for the GIET"
    289244#endif
    290245
     
    293248   // 1 bit for Memcache or Peripheral, 4 for local peripheral id)
    294249   // (Almos supports 32 bits physical addresses)
    295 
    296    #define CLUSTER_INC (0x80000000ULL / (X_SIZE * Y_SIZE) * 2)
    297 
    298    #define CLUSTER_IO_INC (cluster_io_id * CLUSTER_INC)
    299    #define MEMC_MAX_SIZE (0x40000000 / (X_SIZE * Y_SIZE)) // 0x40000000 : valeur totale souhaitée (ici : 1Go)
    300 
    301    #define BROM_BASE    0x00BFC00000
    302    #define BROM_SIZE    0x0000100000 // 1 Mbytes
    303 
    304    #define MEMC_BASE    0x0000000000
    305    #define MEMC_SIZE    min(0x04000000, MEMC_MAX_SIZE)
    306 
    307    #define XICU_BASE    (CLUSTER_INC >> 1) + (XICU_TGTID << 19)
    308    #define XICU_SIZE    0x0000001000 // 4 Kbytes
    309    
    310    #define MDMA_BASE    (CLUSTER_INC >> 1) + (MDMA_TGTID << 19)
    311    #define MDMA_SIZE    (0x0000001000 * NB_DMA_CHANNELS) // 4 Kbytes per channel 
    312 
    313    #define BDEV_BASE    (CLUSTER_INC >> 1) + (BDEV_TGTID << 19) + (CLUSTER_IO_INC)
    314    #define BDEV_SIZE    0x0000001000 // 4 Kbytes
    315 
    316    #define MTTY_BASE    (CLUSTER_INC >> 1) + (MTTY_TGTID << 19) + (CLUSTER_IO_INC)
    317    #define MTTY_SIZE    0x0000001000 // 4 Kbytes
    318 
    319    #define FBUF_BASE    (CLUSTER_INC >> 1) + (FBUF_TGTID << 19) + (CLUSTER_IO_INC)
    320    #define FBUF_SIZE    (FBUF_X_SIZE * FBUF_Y_SIZE * 2) // Should be 0x80000
    321 
    322    #define MNIC_BASE    (CLUSTER_INC >> 1) + (MNIC_TGTID << 19) + (CLUSTER_IO_INC)
    323    #define MNIC_SIZE    0x0000080000
    324 
    325    #define CDMA_BASE    (CLUSTER_INC >> 1) + (CDMA_TGTID << 19) + (CLUSTER_IO_INC)
    326    #define CDMA_SIZE    (0x0000004000 * NB_CMA_CHANNELS)
    327 
    328    #define SIMH_BASE    (CLUSTER_INC >> 1) + (SIMH_TGTID << 19) + (CLUSTER_IO_INC)
    329    #define SIMH_SIZE    0x0000001000
    330250#endif
    331251
     
    339259   using namespace soclib::common;
    340260
    341 #ifdef USE_GIET
    342    char     soft_name[256]    = soft_pathname;      // pathname to binary code
    343 #endif
    344261   const int64_t max_cycles   = 5000000;             // Maximum number of cycles simulated in one sc_start call
    345262   int64_t ncycles            = 0x7FFFFFFFFFFFFFFF;  // simulated cycles
     
    556473   size_t y_width = Y_WIDTH;
    557474
    558    assert( (X_WIDTH <= 4) and (Y_WIDTH <= 4) and
     475   assert((X_WIDTH <= 4) and (Y_WIDTH <= 4) and
    559476           "Up to 256 clusters");
    560477
    561    assert( (X_SIZE <= (1 << X_WIDTH)) and (Y_SIZE <= (1 << Y_WIDTH)) and
     478   assert((X_SIZE <= (1 << X_WIDTH)) and (Y_SIZE <= (1 << Y_WIDTH)) and
    562479           "The X_WIDTH and Y_WIDTH parameter are insufficient");
    563480
     
    583500      {
    584501         sc_uint<vci_address_width> offset;
    585          offset = (sc_uint<vci_address_width>)cluster(x,y)
    586                    << (vci_address_width-x_width-y_width);
     502         offset = (sc_uint<vci_address_width>) cluster(x,y)
     503                   << (vci_address_width - x_width - y_width);
    587504
    588505         std::ostringstream    si;
    589506         si << "seg_xicu_" << x << "_" << y;
    590          maptabd.add(Segment(si.str(), XICU_BASE + offset, XICU_SIZE,
    591                   IntTab(cluster(x,y),XICU_TGTID), false));
     507         maptabd.add(Segment(si.str(), SEG_XCU_BASE + offset, SEG_XCU_SIZE,
     508                  IntTab(cluster(x,y), XCU_TGTID), false));
    592509
    593510         std::ostringstream    sd;
    594511         sd << "seg_mdma_" << x << "_" << y;
    595          maptabd.add(Segment(sd.str(), MDMA_BASE + offset, MDMA_SIZE,
    596                   IntTab(cluster(x,y),MDMA_TGTID), false));
     512         maptabd.add(Segment(sd.str(), SEG_DMA_BASE + offset, SEG_DMA_SIZE,
     513                  IntTab(cluster(x,y), DMA_TGTID), false));
    597514
    598515         std::ostringstream    sh;
    599516         sh << "seg_memc_" << x << "_" << y;
    600          maptabd.add(Segment(sh.str(), MEMC_BASE + offset, MEMC_SIZE,
    601                   IntTab(cluster(x,y),MEMC_TGTID), true));
     517         maptabd.add(Segment(sh.str(), SEG_RAM_BASE + offset, SEG_RAM_SIZE,
     518                  IntTab(cluster(x,y), RAM_TGTID), true));
    602519
    603520         if ( cluster(x,y) == cluster_io_id )
    604521         {
    605             maptabd.add(Segment("seg_mtty", MTTY_BASE, MTTY_SIZE,
    606                         IntTab(cluster(x,y),MTTY_TGTID), false));
    607             maptabd.add(Segment("seg_fbuf", FBUF_BASE, FBUF_SIZE,
    608                         IntTab(cluster(x,y),FBUF_TGTID), false));
    609             maptabd.add(Segment("seg_bdev", BDEV_BASE, BDEV_SIZE,
    610                         IntTab(cluster(x,y),BDEV_TGTID), false));
    611             maptabd.add(Segment("seg_brom", BROM_BASE, BROM_SIZE,
    612                         IntTab(cluster(x,y),BROM_TGTID), true));
    613             maptabd.add(Segment("seg_mnic", MNIC_BASE, MNIC_SIZE,
    614                         IntTab(cluster(x,y),MNIC_TGTID), false));
    615             maptabd.add(Segment("seg_cdma", CDMA_BASE, CDMA_SIZE,
    616                         IntTab(cluster(x,y),CDMA_TGTID), false));
    617             maptabd.add(Segment("seg_simh", SIMH_BASE, SIMH_SIZE,
    618                         IntTab(cluster(x,y),SIMH_TGTID), false));
     522            maptabd.add(Segment("seg_mtty", SEG_TTY_BASE, SEG_TTY_SIZE,
     523                        IntTab(cluster(x,y),TTY_TGTID), false));
     524            maptabd.add(Segment("seg_fbuf", SEG_FBF_BASE, SEG_FBF_SIZE,
     525                        IntTab(cluster(x,y),FBF_TGTID), false));
     526            maptabd.add(Segment("seg_bdev", SEG_IOC_BASE, SEG_IOC_SIZE,
     527                        IntTab(cluster(x,y),IOC_TGTID), false));
     528            maptabd.add(Segment("seg_brom", SEG_ROM_BASE, SEG_ROM_SIZE,
     529                        IntTab(cluster(x,y),ROM_TGTID), true));
     530            maptabd.add(Segment("seg_mnic", SEG_NIC_BASE, SEG_NIC_SIZE,
     531                        IntTab(cluster(x,y),NIC_TGTID), false));
     532            maptabd.add(Segment("seg_cdma", SEG_CMA_BASE, SEG_CMA_SIZE,
     533                        IntTab(cluster(x,y),CMA_TGTID), false));
     534            maptabd.add(Segment("seg_simh", SEG_SIM_BASE, SEG_SIM_SIZE,
     535                        IntTab(cluster(x,y),SIM_TGTID), false));
    619536         }
    620537      }
     
    624541   // external network
    625542   MappingTable maptabx(vci_address_width,
    626                         IntTab(x_width+y_width),
    627                         IntTab(x_width+y_width),
     543                        IntTab(x_width + y_width),
     544                        IntTab(x_width + y_width),
    628545                        0xFFFF000000ULL);
    629546
     
    634551
    635552         sc_uint<vci_address_width> offset;
    636          offset = (sc_uint<vci_address_width>)cluster(x,y)
     553         offset = (sc_uint<vci_address_width>) cluster(x,y)
    637554                   << (vci_address_width - x_width - y_width);
    638555
     
    640557         sh << "x_seg_memc_" << x << "_" << y;
    641558
    642          maptabx.add(Segment(sh.str(), MEMC_BASE + offset,
    643                      MEMC_SIZE, IntTab(cluster(x,y)), false));
     559         maptabx.add(Segment(sh.str(), SEG_RAM_BASE + offset,
     560                     SEG_RAM_SIZE, IntTab(cluster(x,y)), false));
    644561      }
    645562   }
     
    655572   // Horizontal inter-clusters DSPIN signals
    656573   DspinSignals<dspin_cmd_width>** signal_dspin_h_cmd_inc =
    657       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_inc", X_SIZE-1, Y_SIZE);
     574      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_inc", X_SIZE - 1, Y_SIZE);
    658575   DspinSignals<dspin_cmd_width>** signal_dspin_h_cmd_dec =
    659       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_dec", X_SIZE-1, Y_SIZE);
     576      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_dec", X_SIZE - 1, Y_SIZE);
    660577
    661578   DspinSignals<dspin_rsp_width>** signal_dspin_h_rsp_inc =
    662       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_rsp_inc", X_SIZE-1, Y_SIZE);
     579      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_rsp_inc", X_SIZE - 1, Y_SIZE);
    663580   DspinSignals<dspin_rsp_width>** signal_dspin_h_rsp_dec =
    664       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_rsp_dec", X_SIZE-1, Y_SIZE);
     581      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_rsp_dec", X_SIZE - 1, Y_SIZE);
    665582
    666583   DspinSignals<dspin_cmd_width>** signal_dspin_h_m2p_inc =
    667       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_m2p_inc", X_SIZE-1, Y_SIZE);
     584      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_m2p_inc", X_SIZE- 1 , Y_SIZE);
    668585   DspinSignals<dspin_cmd_width>** signal_dspin_h_m2p_dec =
    669       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_m2p_dec", X_SIZE-1, Y_SIZE);
     586      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_m2p_dec", X_SIZE - 1, Y_SIZE);
    670587
    671588   DspinSignals<dspin_rsp_width>** signal_dspin_h_p2m_inc =
    672       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_p2m_inc", X_SIZE-1, Y_SIZE);
     589      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_p2m_inc", X_SIZE - 1, Y_SIZE);
    673590   DspinSignals<dspin_rsp_width>** signal_dspin_h_p2m_dec =
    674       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_p2m_dec", X_SIZE-1, Y_SIZE);
     591      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_p2m_dec", X_SIZE - 1, Y_SIZE);
    675592
    676593   DspinSignals<dspin_cmd_width>** signal_dspin_h_cla_inc =
    677       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cla_inc", X_SIZE-1, Y_SIZE);
     594      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cla_inc", X_SIZE - 1, Y_SIZE);
    678595   DspinSignals<dspin_cmd_width>** signal_dspin_h_cla_dec =
    679       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cla_dec", X_SIZE-1, Y_SIZE);
     596      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cla_dec", X_SIZE - 1, Y_SIZE);
    680597
    681598   // Vertical inter-clusters DSPIN signals
    682599   DspinSignals<dspin_cmd_width>** signal_dspin_v_cmd_inc =
    683       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_inc", X_SIZE, Y_SIZE-1);
     600      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_inc", X_SIZE, Y_SIZE - 1);
    684601   DspinSignals<dspin_cmd_width>** signal_dspin_v_cmd_dec =
    685       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_dec", X_SIZE, Y_SIZE-1);
     602      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_dec", X_SIZE, Y_SIZE - 1);
    686603
    687604   DspinSignals<dspin_rsp_width>** signal_dspin_v_rsp_inc =
    688       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_rsp_inc", X_SIZE, Y_SIZE-1);
     605      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_rsp_inc", X_SIZE, Y_SIZE - 1);
    689606   DspinSignals<dspin_rsp_width>** signal_dspin_v_rsp_dec =
    690       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_rsp_dec", X_SIZE, Y_SIZE-1);
     607      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_rsp_dec", X_SIZE, Y_SIZE - 1);
    691608
    692609   DspinSignals<dspin_cmd_width>** signal_dspin_v_m2p_inc =
    693       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_m2p_inc", X_SIZE, Y_SIZE-1);
     610      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_m2p_inc", X_SIZE, Y_SIZE - 1);
    694611   DspinSignals<dspin_cmd_width>** signal_dspin_v_m2p_dec =
    695       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_m2p_dec", X_SIZE, Y_SIZE-1);
     612      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_m2p_dec", X_SIZE, Y_SIZE - 1);
    696613
    697614   DspinSignals<dspin_rsp_width>** signal_dspin_v_p2m_inc =
    698       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_p2m_inc", X_SIZE, Y_SIZE-1);
     615      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_p2m_inc", X_SIZE, Y_SIZE - 1);
    699616   DspinSignals<dspin_rsp_width>** signal_dspin_v_p2m_dec =
    700       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_p2m_dec", X_SIZE, Y_SIZE-1);
     617      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_p2m_dec", X_SIZE, Y_SIZE - 1);
    701618
    702619   DspinSignals<dspin_cmd_width>** signal_dspin_v_cla_inc =
    703       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cla_inc", X_SIZE, Y_SIZE-1);
     620      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cla_inc", X_SIZE, Y_SIZE - 1);
    704621   DspinSignals<dspin_cmd_width>** signal_dspin_v_cla_dec =
    705       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cla_dec", X_SIZE, Y_SIZE-1);
     622      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cla_dec", X_SIZE, Y_SIZE - 1);
    706623
    707624   // Mesh boundaries DSPIN signals (Most of those signals are not used...)
     
    787704                y_width,
    788705                vci_srcid_width - x_width - y_width,   // l_id width,
    789                 MEMC_TGTID,
    790                 XICU_TGTID,
    791                 MDMA_TGTID,
    792                 FBUF_TGTID,
    793                 MTTY_TGTID,
    794                 BROM_TGTID,
    795                 MNIC_TGTID,
    796                 CDMA_TGTID,
    797                 BDEV_TGTID,
    798                 SIMH_TGTID,
     706                RAM_TGTID,
     707                XCU_TGTID,
     708                DMA_TGTID,
     709                FBF_TGTID,
     710                TTY_TGTID,
     711                ROM_TGTID,
     712                NIC_TGTID,
     713                CMA_TGTID,
     714                IOC_TGTID,
     715                SIM_TGTID,
    799716                MEMC_WAYS,
    800717                MEMC_SETS,
     
    806723                XRAM_LATENCY,
    807724                (cluster(x,y) == cluster_io_id),
    808                 FBUF_X_SIZE,
    809                 FBUF_Y_SIZE,
     725                FBF_X_SIZE,
     726                FBF_Y_SIZE,
    810727                disk_name,
    811728                BDEV_SECTOR_SIZE,
     
    11381055               for (size_t y = 0; y < Y_SIZE ; y++){
    11391056                  for (int proc = 0; proc < NB_PROCS_MAX; proc++) {
    1140 
    11411057                     clusters[x][y]->proc[proc]->print_trace();
    11421058                     std::ostringstream proc_signame;
Note: See TracChangeset for help on using the changeset viewer.