Changeset 779 for trunk/platforms
- Timestamp:
- Aug 28, 2014, 6:04:44 PM (10 years ago)
- Location:
- trunk/platforms/tsar_generic_xbar
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/tsar_generic_xbar/scripts/counter_defs.py
r749 r779 5 5 6 6 stacked_metrics = [ 'nonwrite_broadcast', 'write_broadcast', 'local_m_inv', 'remote_m_inv', 'local_update', 'remote_update' ] 7 8 m_prot_name = {} 9 m_prot_name['dhccp'] = "DHCCP" 10 m_prot_name['rwt'] = "RWT" 11 m_prot_name['mesi'] = "HMESI" 7 12 8 13 m_app_name = {} … … 32 37 m_metric_tag['counter_reset'] = "[000]" 33 38 m_metric_tag['ncycles'] = "[001]" 34 m_metric_tag['local_read'] = "[002]" 35 m_metric_tag['remote_read'] = "[003]" 36 m_metric_tag['read_cost'] = "[004]" 37 m_metric_tag['local_write'] = "[005]" 38 m_metric_tag['remote_write'] = "[006]" 39 m_metric_tag['write_flits_local'] = "[007]" 40 m_metric_tag['write_flits_remote'] = "[008]" 41 m_metric_tag['write_cost'] = "[009]" 42 m_metric_tag['local_ll'] = "[010]" 43 m_metric_tag['remote_ll'] = "[011]" 44 m_metric_tag['ll_cost'] = "[012]" 45 m_metric_tag['local_sc'] = "[013]" 46 m_metric_tag['remote_sc'] = "[014]" 47 m_metric_tag['sc_cost'] = "[015]" 48 m_metric_tag['local_cas'] = "[016]" 49 m_metric_tag['remote_cas'] = "[017]" 50 m_metric_tag['cas_cost'] = "[018]" 51 m_metric_tag['req_trig_update'] = "[019]" 52 m_metric_tag['local_update'] = "[020]" 53 m_metric_tag['remote_update'] = "[021]" 54 m_metric_tag['update_cost'] = "[022]" 55 m_metric_tag['req_trig_m_inv'] = "[023]" 56 m_metric_tag['local_m_inv'] = "[024]" 57 m_metric_tag['remote_m_inv'] = "[025]" 58 m_metric_tag['m_inv_cost'] = "[026]" 59 m_metric_tag['broadcast'] = "[027]" 60 m_metric_tag['local_cleanup'] = "[028]" 61 m_metric_tag['remote_cleanup'] = "[029]" 62 m_metric_tag['cleanup_cost'] = "[030]" 63 m_metric_tag['nb_read_miss'] = "[031]" 64 m_metric_tag['write_miss'] = "[032]" 65 m_metric_tag['write_dirty'] = "[033]" 66 m_metric_tag['read_hit_trt'] = "[034]" # Reads blocked by a hit in the TRT 67 m_metric_tag['trans_full_trt'] = "[035]" # Transactions blocked because the TRT is full 68 m_metric_tag['put'] = "[036]" 69 m_metric_tag['get'] = "[037]" 70 m_metric_tag['write_broadcast'] = "[038]" 71 72 m_metric_tag['total_read'] = "[040]" 73 m_metric_tag['total_write'] = "[041]" 74 m_metric_tag['total_ll'] = "[042]" 75 m_metric_tag['total_sc'] = "[043]" 76 m_metric_tag['total_cas'] = "[044]" 77 m_metric_tag['total_update'] = "[045]" 78 m_metric_tag['total_m_inv'] = "[046]" 79 m_metric_tag['total_cleanup'] = "[047]" 80 m_metric_tag['total_direct'] = "[048]" 81 82 m_metric_tag['nonwrite_broadcast'] = "[050]" 83 m_metric_tag['broadcast_cost'] = "[051]" 84 m_metric_tag['direct_cost'] = "[052]" 85 m_metric_tag['total_stacked'] = "|060]" 39 40 m_metric_tag['local_read'] = "[010]" 41 m_metric_tag['remote_read'] = "[011]" 42 m_metric_tag['read_cost'] = "[012]" 43 44 m_metric_tag['local_write'] = "[020]" 45 m_metric_tag['remote_write'] = "[021]" 46 m_metric_tag['write_flits_local'] = "[022]" 47 m_metric_tag['write_flits_remote'] = "[023]" 48 m_metric_tag['write_cost'] = "[024]" 49 m_metric_tag['write_l1_miss_ncc'] = "[025]" 50 51 m_metric_tag['local_ll'] = "[030]" 52 m_metric_tag['remote_ll'] = "[031]" 53 m_metric_tag['ll_cost'] = "[032]" 54 55 m_metric_tag['local_sc'] = "[040]" 56 m_metric_tag['remote_sc'] = "[041]" 57 m_metric_tag['sc_cost'] = "[042]" 58 59 m_metric_tag['local_cas'] = "[050]" 60 m_metric_tag['remote_cas'] = "[051]" 61 m_metric_tag['cas_cost'] = "[052]" 62 63 m_metric_tag['req_trig_update'] = "[060]" 64 m_metric_tag['local_update'] = "[061]" 65 m_metric_tag['remote_update'] = "[062]" 66 m_metric_tag['update_cost'] = "[063]" 67 68 m_metric_tag['req_trig_m_inv'] = "[070]" 69 m_metric_tag['local_m_inv'] = "[071]" 70 m_metric_tag['remote_m_inv'] = "[072]" 71 m_metric_tag['m_inv_cost'] = "[073]" 72 73 m_metric_tag['broadcast'] = "[080]" 74 m_metric_tag['write_broadcast'] = "[081]" 75 76 m_metric_tag['local_cleanup'] = "[090]" 77 m_metric_tag['remote_cleanup'] = "[091]" 78 m_metric_tag['cleanup_cost'] = "[092]" 79 m_metric_tag['cleanup_data_flits'] = "[093]" 80 81 m_metric_tag['read_miss'] = "[100]" 82 m_metric_tag['write_miss'] = "[101]" 83 m_metric_tag['write_dirty'] = "[102]" 84 m_metric_tag['read_hit_trt'] = "[110]" # Reads blocked by a hit in the TRT 85 m_metric_tag['trans_full_trt'] = "[111]" # Transactions blocked because the TRT is full 86 m_metric_tag['put'] = "[120]" 87 m_metric_tag['get'] = "[121]" 88 m_metric_tag['min_heap_slots_av'] = "[130]" 89 90 m_metric_tag['ncc_to_cc_read'] = "[140]" 91 m_metric_tag['ncc_to_cc_write'] = "[141]" 92 93 m_metric_tag['total_read'] = "[500]" 94 m_metric_tag['total_write'] = "[501]" 95 m_metric_tag['total_ll'] = "[502]" 96 m_metric_tag['total_sc'] = "[503]" 97 m_metric_tag['total_cas'] = "[504]" 98 m_metric_tag['total_update'] = "[505]" 99 m_metric_tag['total_m_inv'] = "[506]" 100 m_metric_tag['total_cleanup'] = "[507]" 101 m_metric_tag['total_direct'] = "[508]" 102 m_metric_tag['total_ncc_to_cc'] = "[509]" 103 104 m_metric_tag['nonwrite_broadcast'] = "[600]" 105 m_metric_tag['broadcast_cost'] = "[601]" 106 m_metric_tag['direct_cost'] = "[602]" 86 107 87 108 all_metrics = m_metric_tag.keys() … … 91 112 m_metric_name['counter_reset'] = "Counters reset at cycle" 92 113 m_metric_name['ncycles'] = "Number of Cycles" 114 93 115 m_metric_name['local_read'] = "Number of Local Reads (Miss in L1)" 94 116 m_metric_name['remote_read'] = "Number of Remote Reads (Miss in L1)" 95 117 m_metric_name['read_cost'] = "Read Cost" 118 96 119 m_metric_name['local_write'] = "Number of Local Writes" 97 120 m_metric_name['remote_write'] = "Number of Remote Writes" … … 99 122 m_metric_name['write_flits_remote'] = "Number of Remote Write Flits" 100 123 m_metric_name['write_cost'] = "Write Cost" 124 101 125 m_metric_name['local_ll'] = "Number of Local LL" 102 126 m_metric_name['remote_ll'] = "Number of Remote LL" 103 127 m_metric_name['ll_cost'] = "LL Cost" 128 104 129 m_metric_name['local_sc'] = "Number of Local SC" 105 130 m_metric_name['remote_sc'] = "Number of Remote SC" 106 131 m_metric_name['sc_cost'] = "SC Cost" 132 107 133 m_metric_name['local_cas'] = "Number of Local CAS" 108 134 m_metric_name['remote_cas'] = "Number of Remote CAS" 109 135 m_metric_name['cas_cost'] = "CAS Cost" 136 110 137 m_metric_name['req_trig_update'] = "Number of Requests Triggering an Update" 111 138 m_metric_name['local_update'] = "Number of Local Updates" 112 139 m_metric_name['remote_update'] = "Number of Remote Updates" 113 140 m_metric_name['update_cost'] = "Update Cost" 141 114 142 m_metric_name['req_trig_m_inv'] = "Number of Requests Triggering a M.inv" 115 143 m_metric_name['local_m_inv'] = "Number of Local Multi Inval" 116 144 m_metric_name['remote_m_inv'] = "Number of Remote Multi Inval" 117 145 m_metric_name['m_inv_cost'] = "Multi Inval Cost" 118 m_metric_name['broadcast'] = "Number of Broadcasts" 146 119 147 m_metric_name['broadcast'] = "Total Number of Broadcasts" 148 m_metric_name['write_broadcast'] = "Number of Broadcasts Trig. by Writes" 149 m_metric_name['nonwrite_broadcast'] = "Number of Broadcasts not Trig. by Writes" 150 120 151 m_metric_name['local_cleanup'] = "Number of Local Cleanups" 121 152 m_metric_name['remote_cleanup'] = "Number of Remote Cleanups" 122 153 m_metric_name['cleanup_cost'] = "Cleanup Cost" 123 m_metric_name['nb_read_miss'] = "Number of Read Miss (in L2)" 154 155 m_metric_name['read_miss'] = "Number of Read Miss (in L2)" 124 156 m_metric_name['write_miss'] = "Number of Write Miss (in L2)" 125 157 m_metric_name['write_dirty'] = "Number of Write Dirty (from L2 to Memory)" … … 128 160 m_metric_name['put'] = "Number of PUT to Memory" 129 161 m_metric_name['get'] = "Number of GET from Memory" 130 m_metric_name['write_broadcast'] = "Number of Broadcasts Trig. by Writes" 162 m_metric_name['min_heap_slots_av'] = "Minimum Number of Heap Slots available" 163 164 m_metric_name['ncc_to_cc_read'] = "Number or Reads trig. NCC to CC" 165 m_metric_name['ncc_to_cc_write'] = "Number of Writes trig. NCC to CC" 131 166 132 167 m_metric_name['total_read'] = "Total Number of Reads" … … 139 174 m_metric_name['total_cleanup'] = "Total Number of Cleanups" 140 175 m_metric_name['total_direct'] = "Total Number of Direct Requests" 141 m_metric_name[' nonwrite_broadcast'] = "Number of Broadcasts not Trig. by Writes"176 m_metric_name['total_ncc_to_cc'] = "Total Number of NCC to CC Changes" 142 177 m_metric_name['broadcast_cost'] = "Broadcast Cost" 143 178 m_metric_name['direct_cost'] = "Direct Requests Cost" 144 m_metric_name['total_stacked'] = "??" # Normalization factor 179 m_metric_name['total_stacked'] = "??" # Normalization factor, does not have a name (unused) 145 180 146 181 -
trunk/platforms/tsar_generic_xbar/scripts/create_graphs.py
r749 r779 4 4 import os 5 5 import re 6 7 8 6 import sys 7 8 9 #apps = [ 'histogram', 'mandel', 'filter', 'radix', 'fft_ga' ] 9 10 apps = [ 'histogram', 'mandel', 'filter', 'radix', 'radix_ga', 'fft', 'fft_ga', 'filt_ga', 'kmeans', 'pca', 'lu' ] 11 #apps = [ 'fft' ] 10 12 nb_procs = [ 1, 4, 8, 16, 32, 64, 128, 256 ] 13 single_protocols = ['dhccp'] 14 #joint_protocols = ['dhccp', 'rwt'] 15 joint_protocols = [] 11 16 12 17 top_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..") … … 21 26 data_dir = 'data' 22 27 23 log_ init_name = 'log_init_'24 log_term_name = ' log_term_'28 log_stdo_name = '_stdo_' 29 log_term_name = '_term_' 25 30 26 31 coherence_tmpl = os.path.join(scripts_path, template_dir, 'coherence_template.gp') # 1 graph per appli … … 70 75 exec_time = {} 71 76 metrics_val = {} 72 for app in apps: 73 exec_time[app] = {} 74 metrics_val[app] = {} 75 for i in nb_procs: 76 metrics_val[app][i] = {} 77 log_init_file = os.path.join(scripts_path, data_dir, app + '_' + log_init_name + str(i)) 78 log_term_file = os.path.join(scripts_path, data_dir, app + '_' + log_term_name + str(i)) 79 80 # Term 81 lines = open(log_term_file, 'r') 82 for line in lines: 83 tokens = line[:-1].split() 84 if len(tokens) > 0 and tokens[0] == "[PARALLEL_COMPUTE]": 85 exec_time[app][i] = int(tokens[len(tokens) - 1]) 86 87 # Init files 88 lines = open(log_init_file, 'r') 89 for line in lines: 90 tokens = line[:-1].split() 91 if len(tokens) == 0: 92 continue 93 tag = tokens[0] 94 value = tokens[len(tokens) - 1] 95 pattern = re.compile('\[0[0-9][0-9]\]') 96 if pattern.match(tag): 97 metric = m_metric_id[tag] 98 if (not metrics_val[app][i].has_key(metric) or tag == "[000]" or tag == "[001]"): 99 # We don't add cycles of all Memcaches (they must be the same for all) 100 metrics_val[app][i][metric] = int(value) 101 else: 102 metrics_val[app][i][metric] += int(value) 103 77 for prot in single_protocols: 78 metrics_val[prot] = {} 79 exec_time[prot] = {} 80 for app in apps: 81 exec_time[prot][app] = {} 82 metrics_val[prot][app] = {} 83 for i in nb_procs: 84 metrics_val[prot][app][i] = {} 85 log_stdo_file = os.path.join(scripts_path, data_dir, app + '_' + prot + log_stdo_name + str(i)) 86 log_term_file = os.path.join(scripts_path, data_dir, app + '_' + prot + log_term_name + str(i)) 87 88 # Term 89 lines = open(log_term_file, 'r') 90 for line in lines: 91 tokens = line[:-1].split() 92 if len(tokens) > 0 and tokens[0] == "[PARALLEL_COMPUTE]": 93 exec_time[prot][app][i] = int(tokens[len(tokens) - 1]) 94 95 # Init files 96 lines = open(log_stdo_file, 'r') 97 for line in lines: 98 tokens = line[:-1].split() 99 if len(tokens) == 0: 100 continue 101 tag = tokens[0] 102 value = tokens[len(tokens) - 1] 103 pattern = re.compile('\[0[0-9][0-9]\]') 104 if pattern.match(tag): 105 metric = m_metric_id[tag] 106 if (not metrics_val[prot][app][i].has_key(metric) or tag == "[000]" or tag == "[001]"): 107 # We don't add cycles of all Memcaches (they must be the same for all) 108 metrics_val[prot][app][i][metric] = int(value) 109 else: 110 metrics_val[prot][app][i][metric] += int(value) 111 112 # Completing unset metrics (i.e. they are not present in the data file) with 0 113 for prot in single_protocols: 114 for app in apps: 115 for i in nb_procs: 116 for metric in all_metrics: 117 if metric not in metrics_val[prot][app][i]: 118 metrics_val[prot][app][i][metric] = 0 119 104 120 # We make a 2nd pass to fill the derived fields, e.g. nb_total_updates 105 for app in apps: 106 for i in nb_procs: 107 x, y = get_x_y(i) 108 metrics_val[app][i]['total_read'] = metrics_val[app][i]['local_read'] + metrics_val[app][i]['remote_read'] 109 metrics_val[app][i]['total_write'] = metrics_val[app][i]['local_write'] + metrics_val[app][i]['remote_write'] 110 metrics_val[app][i]['total_ll'] = metrics_val[app][i]['local_ll'] + metrics_val[app][i]['remote_ll'] 111 metrics_val[app][i]['total_sc'] = metrics_val[app][i]['local_sc'] + metrics_val[app][i]['remote_sc'] 112 metrics_val[app][i]['total_cas'] = metrics_val[app][i]['local_cas'] + metrics_val[app][i]['remote_cas'] 113 metrics_val[app][i]['total_update'] = metrics_val[app][i]['local_update'] + metrics_val[app][i]['remote_update'] 114 metrics_val[app][i]['total_m_inv'] = metrics_val[app][i]['local_m_inv'] + metrics_val[app][i]['remote_m_inv'] 115 metrics_val[app][i]['total_cleanup'] = metrics_val[app][i]['local_cleanup'] + metrics_val[app][i]['remote_cleanup'] 116 metrics_val[app][i]['total_direct'] = metrics_val[app][i]['total_read'] + metrics_val[app][i]['total_write'] 117 metrics_val[app][i]['direct_cost'] = metrics_val[app][i]['read_cost'] + metrics_val[app][i]['write_cost'] 118 metrics_val[app][i]['broadcast_cost'] = metrics_val[app][i]['broadcast'] * (x * y - 1) 119 if metrics_val[app][i]['broadcast'] < metrics_val[app][i]['write_broadcast']: 120 # test to patch a bug in mem_cache 121 metrics_val[app][i]['nonwrite_broadcast'] = 0 122 else: 123 metrics_val[app][i]['nonwrite_broadcast'] = metrics_val[app][i]['broadcast'] - metrics_val[app][i]['write_broadcast'] 124 125 metrics_val[app][i]['total_stacked'] = 0 126 for stacked_metric in stacked_metrics: 127 metrics_val[app][i]['total_stacked'] += metrics_val[app][i][stacked_metric] 121 for prot in single_protocols: 122 for app in apps: 123 for i in nb_procs: 124 x, y = get_x_y(i) 125 metrics_val[prot][app][i]['total_read'] = metrics_val[prot][app][i]['local_read'] + metrics_val[prot][app][i]['remote_read'] 126 metrics_val[prot][app][i]['total_write'] = metrics_val[prot][app][i]['local_write'] + metrics_val[prot][app][i]['remote_write'] 127 metrics_val[prot][app][i]['total_ll'] = metrics_val[prot][app][i]['local_ll'] + metrics_val[prot][app][i]['remote_ll'] 128 metrics_val[prot][app][i]['total_sc'] = metrics_val[prot][app][i]['local_sc'] + metrics_val[prot][app][i]['remote_sc'] 129 metrics_val[prot][app][i]['total_cas'] = metrics_val[prot][app][i]['local_cas'] + metrics_val[prot][app][i]['remote_cas'] 130 metrics_val[prot][app][i]['total_update'] = metrics_val[prot][app][i]['local_update'] + metrics_val[prot][app][i]['remote_update'] 131 metrics_val[prot][app][i]['total_m_inv'] = metrics_val[prot][app][i]['local_m_inv'] + metrics_val[prot][app][i]['remote_m_inv'] 132 metrics_val[prot][app][i]['total_cleanup'] = metrics_val[prot][app][i]['local_cleanup'] + metrics_val[prot][app][i]['remote_cleanup'] 133 metrics_val[prot][app][i]['total_direct'] = metrics_val[prot][app][i]['total_read'] + metrics_val[prot][app][i]['total_write'] 134 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'] 135 metrics_val[prot][app][i]['direct_cost'] = metrics_val[prot][app][i]['read_cost'] + metrics_val[prot][app][i]['write_cost'] 136 metrics_val[prot][app][i]['broadcast_cost'] = metrics_val[prot][app][i]['broadcast'] * (x * y - 1) 137 if metrics_val[prot][app][i]['broadcast'] < metrics_val[prot][app][i]['write_broadcast']: 138 # test to patch a bug in mem_cache 139 metrics_val[prot][app][i]['nonwrite_broadcast'] = 0 140 else: 141 metrics_val[prot][app][i]['nonwrite_broadcast'] = metrics_val[prot][app][i]['broadcast'] - metrics_val[prot][app][i]['write_broadcast'] 142 143 metrics_val[prot][app][i]['total_stacked'] = 0 144 for stacked_metric in stacked_metrics: 145 metrics_val[prot][app][i]['total_stacked'] += metrics_val[prot][app][i][stacked_metric] 128 146 129 147 … … 138 156 ############################################################ 139 157 140 for app in apps: 141 data_coherence_name = os.path.join(scripts_path, gen_dir, app + '_coherence.dat') 142 gp_coherence_name = os.path.join(scripts_path, gen_dir, app + '_coherence.gp') 143 144 # Creating the data file 158 for prot in single_protocols: 159 for app in apps: 160 data_coherence_name = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_coherence.dat') 161 gp_coherence_name = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_coherence.gp') 162 163 # Creating the data file 164 width = 15 165 content = "" 166 167 for metric in [ '#nb_procs' ] + grouped_metrics: 168 content += metric + " " 169 nb_spaces = width - len(metric) 170 content += nb_spaces * ' ' 171 content += "\n" 172 173 for i in nb_procs: 174 content += "%-15d " % i 175 for metric in grouped_metrics: 176 val = float(metrics_val[prot][app][i][metric]) / exec_time[prot][app][i] * 1000 177 content += "%-15f " % val 178 content += "\n" 179 180 create_file(data_coherence_name, content) 181 182 # Creating the gp file 183 template_file = open(coherence_tmpl, 'r') 184 template = template_file.read() 185 186 plot_str = "" 187 col = 2 188 for metric in grouped_metrics: 189 if metric != grouped_metrics[0]: 190 plot_str += ", \\\n " 191 plot_str += "\"" + data_coherence_name + "\" using ($1):($" + str(col) + ") lc rgb " + colors[col - 2] + " title \"" + m_metric_name[metric] + "\" with linespoint" 192 col += 1 193 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')) 194 195 create_file(gp_coherence_name, gp_commands) 196 197 # Calling gnuplot 198 print "gnuplot", gp_coherence_name 199 subprocess.call([ 'gnuplot', gp_coherence_name ]) 200 201 202 ############################################################ 203 ### Graph 2 : Speedup per Application ### 204 ############################################################ 205 206 for prot in single_protocols: 207 for app in apps: 208 209 data_speedup_name = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_speedup.dat') 210 gp_speedup_name = os.path.join(scripts_path, gen_dir, prot + '_' + app + '_speedup.gp') 211 212 # Creating data file 213 width = 15 214 content = "#nb_procs" 215 nb_spaces = width - len(content) 216 content += nb_spaces * ' ' 217 content += "speedup\n" 218 219 for i in nb_procs: 220 content += "%-15d " % i 221 val = exec_time[prot][app][i] 222 content += "%-15f\n" % (exec_time[prot][app][1] / float(val)) 223 224 plot_str = "\"" + data_speedup_name + "\" using ($1):($2) lc rgb \"#654387\" title \"Speedup\" with linespoint" 225 226 create_file(data_speedup_name, content) 227 228 # Creating the gp file 229 template_file = open(speedup_tmpl, 'r') 230 template = template_file.read() 231 232 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')) 233 234 create_file(gp_speedup_name, gp_commands) 235 236 # Calling gnuplot 237 print "gnuplot", gp_speedup_name 238 subprocess.call([ 'gnuplot', gp_speedup_name ]) 239 240 241 ############################################################ 242 ### Graph 3 : All speedups on the same Graph ### 243 ############################################################ 244 245 for prot in single_protocols: 246 # This graph uses the same template as the graph 2 247 data_speedup_name = os.path.join(scripts_path, gen_dir, prot + '_all_speedup.dat') 248 gp_speedup_name = os.path.join(scripts_path, gen_dir, prot + '_all_speedup.gp') 249 250 # Creating data file 145 251 width = 15 146 content = " "147 148 for metric in [ '#nb_procs' ] + grouped_metrics:149 content += metric + " "150 nb_spaces = width - len(metric)151 content += nb_spaces * ' '252 content = "#nb_procs" 253 nb_spaces = width - len(content) 254 content += (nb_spaces + 1) * ' ' 255 for app in apps: 256 content += app + " " 257 content += (width - len(app)) * " " 152 258 content += "\n" 153 259 154 260 for i in nb_procs: 155 261 content += "%-15d " % i 156 for metric in grouped_metrics:157 val = float(metrics_val[app][i][metric]) / exec_time[app][i] * 1000158 content += "%-15f " % val262 for app in apps: 263 val = exec_time[prot][app][i] 264 content += "%-15f " % (exec_time[prot][app][1] / float(val)) 159 265 content += "\n" 160 266 161 create_file(data_ coherence_name, content)162 163 # Creating thegp file164 template_file = open( coherence_tmpl, 'r')267 create_file(data_speedup_name, content) 268 269 # Creating gp file 270 template_file = open(speedup_tmpl, 'r') 165 271 template = template_file.read() 166 272 167 273 plot_str = "" 168 274 col = 2 169 for metric in grouped_metrics:170 if metric != grouped_metrics[0]:171 plot_str += ", \\\n "172 plot_str += "\"" + data_ coherence_name + "\" using ($1):($" + str(col) + ") lc rgb " + colors[col - 2] + " title \"" + m_metric_name[metric] + "\" with linespoint"275 for app in apps: 276 if app != apps[0]: 277 plot_str += ", \\\n " 278 plot_str += "\"" + data_speedup_name + "\" using ($1):($" + str(col) + ") lc rgb %s title \"" % (colors[col - 2]) + m_app_name[app] + "\" with linespoint" 173 279 col += 1 174 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, app + '_coherence')) 175 176 create_file(gp_coherence_name, gp_commands) 177 280 281 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')) 282 283 create_file(gp_speedup_name, gp_commands) 284 178 285 # Calling gnuplot 179 print "gnuplot", gp_coherence_name 180 subprocess.call([ 'gnuplot', gp_coherence_name ]) 181 182 183 ############################################################ 184 ### Graph 2 : Speedup per Application ### 185 ############################################################ 286 print "gnuplot", gp_speedup_name 287 subprocess.call([ 'gnuplot', gp_speedup_name ]) 288 289 290 ############################################################ 291 ### Graph 4 : Graph per metric ### 292 ############################################################ 293 294 # The following section creates the graphs grouped by measure (e.g. #broadcasts) 295 # The template file cannot be easily created otherwise it would not be generic 296 # in many ways. This is why it is mainly created here. 297 # Graphs are created for metric in the "individual_metrics" list 298 299 for prot in single_protocols: 300 for metric in individual_metrics: 301 data_metric_name = os.path.join(scripts_path, gen_dir, prot + '_' + metric + '.dat') 302 gp_metric_name = os.path.join(scripts_path, gen_dir, prot + '_' + metric + '.gp') 303 304 # Creating the gp file 305 # Setting xtics, i.e. number of procs for each application 306 xtics_str = "(" 307 first = True 308 xpos = 1 309 app_labels = "" 310 for num_appli in range(0, len(apps)): 311 for i in nb_procs: 312 if not first: 313 xtics_str += ", " 314 first = False 315 if i == nb_procs[0]: 316 xpos_first = xpos 317 xtics_str += "\"%d\" %.1f" % (i, xpos) 318 xpos_last = xpos 319 xpos += 1.5 320 xpos += 0.5 321 app_name_xpos = float((xpos_first + xpos_last)) / 2 322 app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos) 323 xtics_str += ")" 324 325 xmax_val = float(xpos - 1) 326 327 # Writing the lines of "plot" 328 plot_str = "" 329 xpos = 0 330 first = True 331 column = 2 332 for i in range(0, len(nb_procs)): 333 if not first: 334 plot_str += ", \\\n " 335 first = False 336 plot_str += "\"%s\" using ($1+%.1f):($%d) lc rgb %s notitle with boxes" % (data_metric_name, xpos, column, colors[i]) 337 column += 1 338 xpos += 1.5 339 340 template_file = open(metric_tmpl, 'r') 341 template = template_file.read() 342 343 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)) 344 345 create_file(gp_metric_name, gp_commands) 346 347 # Creating the data file 348 width = 15 349 content = "#x_pos" 350 nb_spaces = width - len(content) 351 content += nb_spaces * ' ' 352 for i in nb_procs: 353 content += "%-15d" % i 354 content += "\n" 355 356 x_pos = 1 357 for app in apps: 358 # Computation of x_pos 359 content += "%-15f" % x_pos 360 x_pos += len(nb_procs) * 1.5 + 0.5 361 for i in nb_procs: 362 if m_metric_norm[metric] == "N": 363 content += "%-15d" % (metrics_val[prot][app][i][metric]) 364 elif m_metric_norm[metric] == "P": 365 content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / i) 366 elif m_metric_norm[metric] == "C": 367 content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / exec_time[prot][app][i] * 1000) 368 elif m_metric_norm[metric] == "W": 369 content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][i]['total_write'])) # Number of writes 370 elif m_metric_norm[metric] == "R": 371 content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][i]['total_read'])) # Number of reads 372 elif m_metric_norm[metric] == "D": 373 content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][i]['total_direct'])) # Number of req. 374 elif is_numeric(m_metric_norm[metric]): 375 content += "%-15f" % (float(metrics_val[prot][app][i][metric]) / float(metrics_val[prot][app][int(m_metric_norm[metric])][metric])) 376 else: 377 assert(False) 378 379 app_name = m_app_name[app] 380 content += "#" + app_name + "\n" 381 382 create_file(data_metric_name, content) 383 384 # Calling gnuplot 385 print "gnuplot", gp_metric_name 386 subprocess.call([ 'gnuplot', gp_metric_name ]) 387 388 389 ############################################################ 390 ### Graph 5 : Stacked histogram with counters ### 391 ############################################################ 392 393 # The following section creates a stacked histogram containing 394 # the metrics in the "stacked_metric" list 395 # It is normalized per application w.r.t the values on 256 procs 396 397 for prot in single_protocols: 398 data_stacked_name = os.path.join(scripts_path, gen_dir, prot + '_stacked.dat') 399 gp_stacked_name = os.path.join(scripts_path, gen_dir, prot + '_stacked.gp') 400 401 norm_factor_value = 256 402 403 # Creating the gp file 404 template_file = open(stacked_tmpl, 'r') 405 template = template_file.read() 406 407 xtics_str = "(" 408 first = True 409 xpos = 1 410 app_labels = "" 411 for num_appli in range(0, len(apps)): 412 for i in nb_procs: 413 if not first: 414 xtics_str += ", " 415 first = False 416 if i == nb_procs[0]: 417 xpos_first = xpos 418 xtics_str += "\"%d\" %d -1" % (i, xpos) 419 xpos_last = xpos 420 xpos += 1 421 xpos += 1 422 app_name_xpos = float((xpos_first + xpos_last)) / 2 423 app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos) 424 xtics_str += ")" 425 426 plot_str = "newhistogram \"\"" 427 n = 1 428 for stacked_metric in stacked_metrics: 429 plot_str += ", \\\n " + "'" + data_stacked_name + "'" + " using " + str(n) + " lc rgb " + colors[n] + " title \"" + m_metric_name[stacked_metric] + "\"" 430 n += 1 431 432 ylabel_str = "Breakdown of Coherence Traffic Normalized w.r.t. \\nthe Values on %d Processors" % norm_factor_value 433 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 = "") 434 435 create_file(gp_stacked_name, content) 436 437 # Creating the data file 438 # Values are normalized by application, w.r.t. the number of requests for a given number of procs 439 content = "#" 440 for stacked_metric in stacked_metrics: 441 content += stacked_metric 442 content += ' ' + ' ' * (15 - len(stacked_metric)) 443 content += "\n" 444 for app in apps: 445 if app != apps[0]: 446 for i in range(0, len(stacked_metrics)): 447 content += "%-15f" % 0.0 448 content += "\n" 449 for i in nb_procs: 450 for stacked_metric in stacked_metrics: 451 content += "%-15f" % (float(metrics_val[prot][app][i][stacked_metric]) / metrics_val[prot][app][norm_factor_value]['total_stacked']) 452 content += "\n" 453 454 create_file(data_stacked_name, content) 455 # Calling gnuplot 456 print "gnuplot", gp_stacked_name 457 subprocess.call([ 'gnuplot', gp_stacked_name ]) 458 459 460 461 ################################################################################# 462 ### Graph 6 : Stacked histogram with coherence cost compared to r/w cost ### 463 ################################################################################# 464 465 # The following section creates pairs of stacked histograms, normalized w.r.t. the first one. 466 # The first one contains the cost of reads and writes, the second contains the cost 467 # of m_inv, m_up and broadcasts (extrapolated) 468 469 for prot in single_protocols: 470 data_cost_filename = os.path.join(scripts_path, gen_dir, prot + '_relative_cost.dat') 471 gp_cost_filename = os.path.join(scripts_path, gen_dir, prot + '_relative_cost.gp') 472 473 direct_cost_metrics = [ 'read_cost', 'write_cost' ] 474 coherence_cost_metrics = ['update_cost', 'm_inv_cost', 'broadcast_cost' ] 475 476 # Creating the gp file 477 template_file = open(stacked_tmpl, 'r') 478 template = template_file.read() 479 480 xtics_str = "(" 481 first = True 482 xpos = 1 483 app_labels = "" 484 for num_appli in range(0, len(apps)): 485 first_proc = True 486 for i in nb_procs: 487 if i > 4: 488 if not first: 489 xtics_str += ", " 490 first = False 491 if first_proc: 492 first_proc = False 493 xpos_first = xpos 494 xtics_str += "\"%d\" %f -1" % (i, float(xpos + 0.5)) 495 xpos_last = xpos 496 xpos += 3 497 app_name_xpos = float((xpos_first + xpos_last)) / 2 498 app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos) 499 #xpos += 1 500 xtics_str += ")" 501 502 plot_str = "newhistogram \"\"" 503 n = 1 504 for cost_metric in direct_cost_metrics + coherence_cost_metrics: 505 plot_str += ", \\\n " + "'" + data_cost_filename + "'" + " using " + str(n) + " lc rgb " + colors[n] + " title \"" + m_metric_name[cost_metric] + "\"" 506 n += 1 507 508 ylabel_str = "Coherence Cost Compared to Direct Requests Cost,\\nNormalized per Application for each Number of Processors" 509 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 = "") 510 511 create_file(gp_cost_filename, content) 512 513 # Creating the data file 514 # Values are normalized by application, w.r.t. the number of requests for a given number of procs 515 content = "#" 516 for cost_metric in direct_cost_metrics: 517 content += cost_metric 518 content += ' ' + ' ' * (15 - len(cost_metric)) 519 for cost_metric in coherence_cost_metrics: 520 content += cost_metric 521 content += ' ' + ' ' * (15 - len(cost_metric)) 522 content += "\n" 523 for app in apps: 524 if app != apps[0]: 525 for i in range(0, len(direct_cost_metrics) + len(coherence_cost_metrics)): 526 content += "%-15f" % 0.0 527 content += "\n" 528 for i in nb_procs: 529 if i > 4: 530 for cost_metric in direct_cost_metrics: 531 content += "%-15f" % (float(metrics_val[prot][app][i][cost_metric]) / metrics_val[prot][app][i]['direct_cost']) 532 for cost_metric in coherence_cost_metrics: 533 content += "%-15f" % 0.0 534 content += "\n" 535 for cost_metric in direct_cost_metrics: 536 content += "%-15f" % 0.0 537 for cost_metric in coherence_cost_metrics: 538 content += "%-15f" % (float(metrics_val[prot][app][i][cost_metric]) / metrics_val[prot][app][i]['direct_cost']) 539 content += "\n" 540 if i != nb_procs[-1]: 541 for j in range(0, len(direct_cost_metrics) + len(coherence_cost_metrics)): 542 content += "%-15f" % 0.0 543 content += "\n" 544 545 create_file(data_cost_filename, content) 546 # Calling gnuplot 547 print "gnuplot", gp_cost_filename 548 subprocess.call([ 'gnuplot', gp_cost_filename ]) 549 550 551 ################################################################################# 552 ### Joint Graphs to several architectures ### 553 ################################################################################# 554 555 if len(joint_protocols) == 0: 556 sys.exit() 557 558 ################################################################################# 559 ### Graph 7: Comparison of Speedups (normalized w.r.t. 1 proc on first arch) ### 560 ################################################################################# 561 186 562 187 563 for app in apps: 188 564 189 data_speedup_name = os.path.join(scripts_path, gen_dir,app + '_speedup.dat')190 gp_speedup_name = os.path.join(scripts_path, gen_dir,app + '_speedup.gp')565 data_speedup_name = os.path.join(scripts_path, gen_dir, 'joint_' + app + '_speedup.dat') 566 gp_speedup_name = os.path.join(scripts_path, gen_dir, 'joint_' + app + '_speedup.gp') 191 567 192 568 # Creating data file … … 199 575 for i in nb_procs: 200 576 content += "%-15d " % i 201 val = exec_time[app][i]202 content += "%-15f\n" % (exec_time[app][1] / float(val))203 204 plot_str = "\"" + data_speedup_name + "\" using ($1):($2) lc rgb \"#654387\" title \"Speedup\" with linespoint"205 577 for prot in joint_protocols: 578 val = exec_time[prot][app][i] 579 content += "%-15f " % (exec_time[joint_protocols[0]][app][1] / float(val)) 580 content += "\n" 581 206 582 create_file(data_speedup_name, content) 207 583 … … 209 585 template_file = open(speedup_tmpl, 'r') 210 586 template = template_file.read() 211 212 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, app + '_speedup')) 587 588 plot_str = "" 589 col = 2 590 for prot in joint_protocols: 591 if prot != joint_protocols[0]: 592 plot_str += ", \\\n " 593 plot_str += "\"" + data_speedup_name + "\" using ($1):($" + str(col) + ") lc rgb %s title \"" % (colors[col - 2]) + m_prot_name[prot] + "\" with linespoint" 594 col += 1 595 596 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')) 213 597 214 598 create_file(gp_speedup_name, gp_commands) … … 219 603 220 604 221 ############################################################ 222 ### Graph 3 : All speedups on the same Graph ### 223 ############################################################ 224 225 # This graph uses the same template as the graph 2 226 227 data_speedup_name = os.path.join(scripts_path, gen_dir, 'all_speedup.dat') 228 gp_speedup_name = os.path.join(scripts_path, gen_dir, 'all_speedup.gp') 229 230 # Creating data file 231 width = 15 232 content = "#nb_procs" 233 nb_spaces = width - len(content) 234 content += (nb_spaces + 1) * ' ' 235 for app in apps: 236 content += app + " " 237 content += (width - len(app)) * " " 238 content += "\n" 239 240 for i in nb_procs: 241 content += "%-15d " % i 242 for app in apps: 243 val = exec_time[app][i] 244 content += "%-15f " % (exec_time[app][1] / float(val)) 245 content += "\n" 246 247 create_file(data_speedup_name, content) 248 249 # Creating gp file 250 template_file = open(speedup_tmpl, 'r') 251 template = template_file.read() 252 253 plot_str = "" 254 col = 2 255 for app in apps: 256 if app != apps[0]: 257 plot_str += ", \\\n " 258 plot_str += "\"" + data_speedup_name + "\" using ($1):($" + str(col) + ") lc rgb %s title \"" % (colors[col - 2]) + m_app_name[app] + "\" with linespoint" 259 col += 1 260 261 gp_commands = template % dict(appli = "All Applications", nb_procs = nb_procs[-1] + 1, plot_str = plot_str, svg_name = os.path.join(graph_dir, 'all_speedup')) 262 263 create_file(gp_speedup_name, gp_commands) 264 265 # Calling gnuplot 266 print "gnuplot", gp_speedup_name 267 subprocess.call([ 'gnuplot', gp_speedup_name ]) 268 269 270 ############################################################ 271 ### Graph 4 : Graph per metric ### 272 ############################################################ 273 274 # The following section creates the graphs grouped by measure (e.g. #broadcasts) 275 # The template file cannot be easily created otherwise it would not be generic 276 # in many ways. This is why it is mainly created here. 277 # Graphs are created for metric in the "individual_metrics" list 278 279 for metric in individual_metrics: 280 data_metric_name = os.path.join(scripts_path, gen_dir, metric + '.dat') 281 gp_metric_name = os.path.join(scripts_path, gen_dir, metric + '.gp') 282 283 # Creating the gp file 284 # Setting xtics, i.e. number of procs for each application 285 xtics_str = "(" 286 first = True 287 xpos = 1 288 app_labels = "" 289 for num_appli in range(0, len(apps)): 290 for i in nb_procs: 291 if not first: 292 xtics_str += ", " 293 first = False 294 if i == nb_procs[0]: 295 xpos_first = xpos 296 xtics_str += "\"%d\" %.1f" % (i, xpos) 297 xpos_last = xpos 298 xpos += 1.5 299 xpos += 0.5 300 app_name_xpos = float((xpos_first + xpos_last)) / 2 301 app_labels += "set label \"%s\" at first %f,character 1 center font\"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos) 302 xtics_str += ")" 303 304 xmax_val = xpos + 0.5 305 306 # Writing the lines of "plot" 307 plot_str = "" 308 xpos = 0 309 first = True 310 column = 2 311 for i in range(0, len(nb_procs)): 312 if not first: 313 plot_str += ", \\\n " 314 first = False 315 plot_str += "\"%s\" using ($1+%.1f):($%d) lc rgb %s notitle with boxes" % (data_metric_name, xpos, column, colors[i]) 316 column += 1 317 xpos += 1.5 318 319 template_file = open(metric_tmpl, 'r') 320 template = template_file.read() 321 322 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, metric)) 323 324 create_file(gp_metric_name, gp_commands) 325 326 # Creating the data file 327 width = 15 328 content = "#x_pos" 329 nb_spaces = width - len(content) 330 content += nb_spaces * ' ' 331 for i in nb_procs: 332 content += "%-15d" % i 333 content += "\n" 334 335 x_pos = 1 336 for app in apps: 337 # Computation of x_pos 338 content += "%-15f" % x_pos 339 x_pos += len(nb_procs) * 1.5 + 0.5 340 for i in nb_procs: 341 if m_metric_norm[metric] == "N": 342 content += "%-15d" % (metrics_val[app][i][metric]) 343 elif m_metric_norm[metric] == "P": 344 content += "%-15f" % (float(metrics_val[app][i][metric]) / i) 345 elif m_metric_norm[metric] == "C": 346 content += "%-15f" % (float(metrics_val[app][i][metric]) / exec_time[app][i] * 1000) 347 elif m_metric_norm[metric] == "W": 348 content += "%-15f" % (float(metrics_val[app][i][metric]) / float(metrics_val[app][i]['total_write'])) # Number of writes 349 elif m_metric_norm[metric] == "R": 350 content += "%-15f" % (float(metrics_val[app][i][metric]) / float(metrics_val[app][i]['total_read'])) # Number of reads 351 elif m_metric_norm[metric] == "D": 352 content += "%-15f" % (float(metrics_val[app][i][metric]) / float(metrics_val[app][i]['total_direct'])) # Number of req. 353 elif is_numeric(m_metric_norm[metric]): 354 content += "%-15f" % (float(metrics_val[app][i][metric]) / float(metrics_val[app][int(m_metric_norm[metric])][metric])) 355 else: 356 assert(False) 357 358 app_name = m_app_name[app] 359 content += "#" + app_name + "\n" 360 361 create_file(data_metric_name, content) 362 363 # Calling gnuplot 364 print "gnuplot", gp_metric_name 365 subprocess.call([ 'gnuplot', gp_metric_name ]) 366 367 368 ############################################################ 369 ### Graph 5 : Stacked histogram with counters ### 370 ############################################################ 371 372 # The following section creates a stacked histogram containing 373 # the metrics in the "stacked_metric" list 374 # It is normalized per application w.r.t the values on 256 procs 375 376 data_stacked_name = os.path.join(scripts_path, gen_dir, 'stacked.dat') 377 gp_stacked_name = os.path.join(scripts_path, gen_dir, 'stacked.gp') 378 379 norm_factor_value = 256 380 605 ################################################################################# 606 ### Graph 8 : Joint Stacked histogram with coherence cost and r/w cost ### 607 ################################################################################# 608 609 # The following section creates pairs of stacked histograms for each arch for each number of proc for each app, normalized by (app x number of procs) (with first arch, R/W cost, first of the 2*num_arch histo). It is close to Graph 6 610 611 data_cost_filename = os.path.join(scripts_path, gen_dir, 'joint_relative_cost.dat') 612 gp_cost_filename = os.path.join(scripts_path, gen_dir, 'joint_relative_cost.gp') 613 614 direct_cost_metrics = [ 'read_cost', 'write_cost' ] 615 coherence_cost_metrics = ['update_cost', 'm_inv_cost', 'broadcast_cost' ] 616 381 617 # Creating the gp file 382 618 template_file = open(stacked_tmpl, 'r') 383 619 template = template_file.read() 384 620 385 621 xtics_str = "(" 386 622 first = True 387 xpos = 1 623 xpos = 1 # successive x position of the center of the first bar in a application 388 624 app_labels = "" 389 for num_appli in range(0, len(apps)): 390 for i in nb_procs: 391 if not first: 392 xtics_str += ", " 393 first = False 394 if i == nb_procs[0]: 395 xpos_first = xpos 396 xtics_str += "\"%d\" %d -1" % (i, xpos) 397 xpos_last = xpos 398 xpos += 1 399 xpos += 1 400 app_name_xpos = float((xpos_first + xpos_last)) / 2 401 app_labels += "set label \"%s\" at first %f,character 1 center font\"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos) 402 xtics_str += ")" 403 404 plot_str = "newhistogram \"\"" 405 n = 1 406 for stacked_metric in stacked_metrics: 407 plot_str += ", \\\n " + "'" + data_stacked_name + "'" + " using " + str(n) + " lc rgb " + colors[n] + " title \"" + m_metric_name[stacked_metric] + "\"" 408 n += 1 409 410 ylabel_str = "Breakdown of Coherence Traffic Normalized w.r.t. \\nthe Values on %d Processors" % norm_factor_value 411 content = template % dict(svg_name = os.path.join(graph_dir, 'stacked'), xtics_str = xtics_str, plot_str = plot_str, ylabel_str = ylabel_str, app_labels = app_labels) 412 413 create_file(gp_stacked_name, content) 414 415 # Creating the data file 416 # Values are normalized by application, w.r.t. the number of requests for a given number of procs 417 content = "#" 418 for stacked_metric in stacked_metrics: 419 content += stacked_metric 420 content += ' ' + ' ' * (15 - len(stacked_metric)) 421 content += "\n" 422 for app in apps: 423 if app != apps[0]: 424 for i in range(0, len(stacked_metrics)): 425 content += "%-15f" % 0.0 426 content += "\n" 427 for i in nb_procs: 428 for stacked_metric in stacked_metrics: 429 content += "%-15f" % (float(metrics_val[app][i][stacked_metric]) / metrics_val[app][norm_factor_value]['total_stacked']) 430 content += "\n" 431 432 create_file(data_stacked_name, content) 433 # Calling gnuplot 434 print "gnuplot", gp_stacked_name 435 subprocess.call([ 'gnuplot', gp_stacked_name ]) 436 437 438 439 ################################################################################# 440 ### Graph 6 : Stacked histogram with coherence cost compared to r/w cost ### 441 ################################################################################# 442 443 # The following section creates pairs of stacked histograms, normalized w.r.t. the first one. 444 # The first one contains the cost of reads and writes, the second contains the cost 445 # of m_inv, m_up and broadcasts (extrapolated) 446 447 data_cost_filename = os.path.join(scripts_path, gen_dir, 'relative_cost.dat') 448 gp_cost_filename = os.path.join(scripts_path, gen_dir, 'relative_cost.gp') 449 450 direct_cost_metrics = [ 'read_cost', 'write_cost' ] 451 coherence_cost_metrics = ['update_cost', 'm_inv_cost', 'broadcast_cost' ] 452 453 # Creating the gp file 454 template_file = open(stacked_tmpl, 'r') 455 template = template_file.read() 456 457 xtics_str = "(" 458 first = True 459 xpos = 1.5 460 app_labels = "" 625 prot_labels = "" 461 626 for num_appli in range(0, len(apps)): 462 627 first_proc = True 463 628 for i in nb_procs: 464 629 if i > 4: 630 x = 0 # local var for computing position of protocol names 631 for prot in joint_protocols: 632 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?) 633 x += 2 634 465 635 if not first: 466 636 xtics_str += ", " … … 469 639 first_proc = False 470 640 xpos_first = xpos 471 xtics_str += "\"%d\" %f -1" % (i, xpos)641 xtics_str += "\"%d\" %f -1" % (i, float(xpos - 0.5 + len(joint_protocols))) 472 642 xpos_last = xpos 473 xpos += 3643 xpos += 1 + len(joint_protocols) * 2 474 644 app_name_xpos = float((xpos_first + xpos_last)) / 2 475 app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos)645 app_labels += "set label \"%s\" at first %f,character 1 center font \"Times,12\"\n" % (m_app_name[apps[num_appli]], app_name_xpos) 476 646 xpos += 1 477 647 xtics_str += ")" … … 483 653 n += 1 484 654 485 ylabel_str = "Coherence Cost Compared toDirect Requests Cost,\\nNormalized per Application for each Number of Processors"486 content = template % dict(svg_name = os.path.join(graph_dir, ' rel_cost'), xtics_str = xtics_str, plot_str = plot_str, ylabel_str = ylabel_str, app_labels = app_labels)655 ylabel_str = "Coherence Cost and Direct Requests Cost,\\nNormalized per Application for each Number of Processors" 656 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) 487 657 488 658 create_file(gp_cost_filename, content) … … 500 670 for app in apps: 501 671 if app != apps[0]: 502 for iin range(0, len(direct_cost_metrics) + len(coherence_cost_metrics)):672 for j in range(0, len(direct_cost_metrics) + len(coherence_cost_metrics)): 503 673 content += "%-15f" % 0.0 504 674 content += "\n" 505 675 for i in nb_procs: 506 676 if i > 4: 507 for cost_metric in direct_cost_metrics: 508 content += "%-15f" % (float(metrics_val[app][i][cost_metric]) / metrics_val[app][i]['direct_cost']) 509 for cost_metric in coherence_cost_metrics: 510 content += "%-15f" % 0.0 511 content += "\n" 512 for cost_metric in direct_cost_metrics: 513 content += "%-15f" % 0.0 514 for cost_metric in coherence_cost_metrics: 515 content += "%-15f" % (float(metrics_val[app][i][cost_metric]) / metrics_val[app][i]['direct_cost']) 516 content += "\n" 517 for i in range(0, len(direct_cost_metrics) + len(coherence_cost_metrics)): 518 content += "%-15f" % 0.0 519 content += "\n" 677 for prot in joint_protocols: 678 for cost_metric in direct_cost_metrics: 679 content += "%-15f" % (float(metrics_val[prot][app][i][cost_metric]) / metrics_val[joint_protocols[0]][app][i]['direct_cost']) 680 for cost_metric in coherence_cost_metrics: 681 content += "%-15f" % 0.0 682 content += "\n" 683 for cost_metric in direct_cost_metrics: 684 content += "%-15f" % 0.0 685 for cost_metric in coherence_cost_metrics: 686 content += "%-15f" % (float(metrics_val[prot][app][i][cost_metric]) / metrics_val[joint_protocols[0]][app][i]['direct_cost']) 687 content += "\n" 688 if i != nb_procs[-1]: 689 for j in range(0, len(direct_cost_metrics) + len(coherence_cost_metrics)): 690 content += "%-15f" % 0.0 691 content += "\n" 520 692 521 693 create_file(data_cost_filename, content) … … 525 697 526 698 699 700 701 -
trunk/platforms/tsar_generic_xbar/scripts/run_simus.py
r752 r779 6 6 import shutil 7 7 8 #TODO : recopier les fichiers d'entrees dans le script en fonction de l'appli selectionnee8 #TODO (?): recopier les fichiers d'entrees dans le script en fonction de l'appli selectionnee 9 9 # Par exemple, tk14.O pour LU, img.raw pour ep_filter, etc. 10 10 11 data_dir = 'data' 12 log_init_name = 'log_init_' 13 log_term_name = 'log_term_' 14 15 11 12 # User parameters 16 13 nb_procs = [ 4 ] 17 14 #nb_procs = [ 16, 32, 64, 128, 256 ] 18 rerun_stats = True15 rerun_stats = False 19 16 use_omp = False 17 protocol = 'rwt' 20 18 21 19 #apps = [ 'histogram', 'mandel', 'filter', 'radix_ga', 'fft_ga', 'kmeans' ] 22 20 #apps = [ 'histogram', 'mandel', 'filter', 'radix_ga', 'fft_ga' ] 23 21 apps = [ 'radix' ] 22 23 24 # Variables which could be changed but ought not to because they are reflected in the create_graphs.py script 25 data_dir = 'data' 26 log_init_name = protocol + '_stdo_' 27 log_term_name = protocol + '_term_' 28 29 # Global Variables 24 30 25 31 all_apps = [ 'cholesky', 'fft', 'fft_ga', 'filter', 'filt_ga', 'histogram', 'kmeans', 'lu', 'mandel', 'mat_mult', 'pca', 'radix', 'radix_ga', 'showimg', ] 26 32 # to come: 'barnes', 'fmm', 'ocean', 'raytrace', 'radiosity', 'waters', 'watern' 27 33 28 a pps = [ 'cholesky' ]29 30 34 all_protocols = [ 'dhccp', 'rwt', 'mesi' ] 35 36 top_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..") 31 37 config_name = os.path.join(os.path.dirname(os.path.realpath(__file__)), "config.py") 38 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") 48 49 50 # Checks 51 if protocol not in all_protocols: 52 help_str = ''' 53 *** Error: variable protocol has an unsupported value 54 ''' 55 print help_str 56 sys.exit() 57 58 for the_app in apps: 59 if the_app not in all_apps: 60 print "*** Error: application %s is not defined" % (the_app) 61 sys.exit() 62 32 63 if not os.path.isfile(config_name): 33 help_str = '''64 help_str = ''' 34 65 You should create a file named config.py in this directory with the following definitions: 35 66 - apps_dir: path to almos-tsar-mipsel/apps directory … … 38 69 *** Stopping execution 39 70 ''' 40 print help_str 41 sys.exit() 42 71 print help_str 72 sys.exit() 73 74 # Loading config 43 75 exec(file(config_name)) 44 76 45 top_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..") 46 47 scripts_path = os.path.join(top_path, 'scripts') 48 almos_path = os.path.join(top_path, 'almos') 49 arch_info_name = os.path.join(almos_path, "arch-info-gen.info") 50 arch_info_bib_name = os.path.join(almos_path, 'arch-info.bib') 51 hdd_img_file_name = os.path.join(almos_path, "hdd-img.bin") 52 shrc_file_name = os.path.join(almos_path, "shrc") 53 hard_config_name = os.path.join(almos_path, "hard_config.h") 54 55 topcell_name = "top.cpp" 77 # Check that variables and paths exist 78 for var in [ 'apps_dir', 'almos_src_dir', 'hdd_img_name', 'tsar_dir' ]: 79 if eval(var) == "": 80 print "*** Error: variable %s not defined in config file" % (var) 81 sys.exit() 82 if not os.path.exists(eval(var)): 83 print "*** Error: variable %s does not define a valid path" % (var) 84 sys.exit() 85 86 if protocol == "rwt": 87 if rwt_dir == "": 88 print "*** Error: variable rwt_dir not defined in config file" 89 sys.exit() 90 if not os.path.exists(rwt_dir): 91 print "*** Error: variable rwt_dir does not define a valid path" 92 sys.exit() 93 94 if protocol == "mesi": 95 if mesi_dir == "": 96 print "*** Error: variable mesi_dir not defined in config file" 97 sys.exit() 98 if not os.path.exists(mesi_dir): 99 print "*** Error: variable mesi_dir does not define a valid path" 100 sys.exit() 101 102 56 103 57 104 … … 65 112 #splash_app_dir['watern'] = 'apps/water-nsquared' 66 113 #splash_app_dir['waters'] = 'apps/water-spatial' 67 #68 #splash_app_dir['cholesky'] = 'kernels/cholesky'69 #splash_app_dir['fft'] = 'kernels/fft'70 #splash_app_dir['lu'] = 'kernels/lu/contiguous_blocks'71 #splash_app_dir['radix'] = 'kernels/radix'72 #73 #splash_ga_app_dir = {}74 #splash_ga_app_dir['radix_ga'] = 'apps/radix'75 #splash_ga_app_dir['fft_ga'] = 'apps/fft'76 114 77 115 78 116 def get_x_y(nb_procs): 79 x = 1 80 y = 1 81 to_x = True 82 while (x * y * 4 < nb_procs): 83 if to_x: 84 x = x * 2 85 else: 86 y = y * 2 87 to_x = not to_x 88 return x, y 89 117 x = 1 118 y = 1 119 to_x = True 120 while (x * y * 4 < nb_procs): 121 if to_x: 122 x = x * 2 123 else: 124 y = y * 2 125 to_x = not to_x 126 return x, y 127 128 129 def gen_soclib_conf(): 130 131 if os.path.isfile(soclib_conf_name): 132 print "Updating file %s" % (soclib_conf_name) 133 # First, remove lines containing "addDescPath" 134 f = open(soclib_conf_name, "r") 135 lines = f.readlines() 136 f.close() 137 138 f = open(soclib_conf_name, "w") 139 140 for line in lines: 141 if not ("addDescPath" in line): 142 f.write(line) 143 f.close() 144 else: 145 print "Creating file %s" % (soclib_conf_name) 146 f = open(soclib_conf_name, "w") 147 f.close() 148 149 # Defining common and specific modules 150 common_modules = [ 151 'lib/generic_llsc_global_table', 152 'modules/dspin_router_tsar', 153 'modules/sdmmc', 154 'modules/vci_block_device_tsar', 155 'modules/vci_ethernet_tsar', 156 'modules/vci_io_bridge', 157 'modules/vci_iox_network', 158 'modules/vci_spi' 159 'platforms/tsar_generic_xbar/tsar_xbar_cluster' 160 ] 161 162 specific_modules = [ 163 'communication', 164 'lib/generic_cache_tsar', 165 'modules/vci_cc_vcache_wrapper', 166 'modules/vci_mem_cache' 167 ] 168 169 f = open(soclib_conf_name, "a") 170 # Adding common modules 171 for common_module in common_modules: 172 f.write("config.addDescPath(\"%s/%s\")\n" % (tsar_dir, common_module)) 173 #f.write("\n") 174 175 if protocol == "dhccp": 176 arch_dir = tsar_dir 177 elif protocol == "rwt": 178 arch_dir = rwt_dir 179 elif protocol == "mesi": 180 archi_dir = mesi_dir 181 else: 182 assert(False) 183 184 for specific_module in specific_modules: 185 f.write("config.addDescPath(\"%s/%s\")\n" % (arch_dir, specific_module)) 186 187 #f.write("\n") 188 f.close() 90 189 91 190 … … 97 196 #define _HD_CONFIG_H 98 197 99 #define 100 #define 101 #define 102 #define 103 #define 104 105 #define 106 #define 107 108 #define 109 #define 110 #define 111 #define 112 113 #define 114 #define 198 #define X_SIZE %(x)d 199 #define Y_SIZE %(y)d 200 #define NB_CLUSTERS %(nb_clus)d 201 #define NB_PROCS_MAX 4 202 #define NB_TASKS_MAX 8 203 204 #define NB_TIM_CHANNELS 32 205 #define NB_DMA_CHANNELS 1 206 207 #define NB_TTY_CHANNELS 4 208 #define NB_IOC_CHANNELS 1 209 #define NB_NIC_CHANNELS 0 210 #define NB_CMA_CHANNELS 0 211 212 #define USE_XICU 1 213 #define IOMMU_ACTIVE 0 115 214 116 215 #define IRQ_PER_PROCESSOR 1 … … 194 293 # subprocess.call([ 'make' ]) 195 294 196 #elif app_name in splash2_ga:197 # print "make clean"198 # subprocess.call([ 'make', 'clean' ])199 200 # print "make"201 # subprocess.call([ 'make' ])202 203 295 #else: 204 296 # print "make clean" … … 212 304 213 305 print "make TARGET=tsar" 214 subprocess.call([ 'make', 'TARGET=tsar' ]) 306 retval = subprocess.call([ 'make', 'TARGET=tsar' ]) 307 if retval != 0: 308 sys.exit() 215 309 216 310 # Creation/Modification du shrc de almos … … 281 375 282 376 gen_sym_links() 377 gen_soclib_conf() 283 378 284 379 for i in nb_procs: … … 293 388 subprocess.call([ 'touch', topcell_name ]) 294 389 print "make" 295 subprocess.call([ 'make' ]) 296 390 retval = subprocess.call([ 'make' ]) 391 if retval != 0: 392 sys.exit() 393 297 394 for app in apps: 298 395 print "cd", top_path -
trunk/platforms/tsar_generic_xbar/scripts/templates/metric_template.gp
r706 r779 14 14 %(app_labels)s 15 15 16 set xrange [0:%(xmax_val) d]16 set xrange [0:%(xmax_val)f] 17 17 18 18 #set mytics 0.1 -
trunk/platforms/tsar_generic_xbar/scripts/templates/stacked_template.gp
r706 r779 33 33 34 34 %(app_labels)s 35 %(prot_labels)s 35 36 36 37 plot %(plot_str)s -
trunk/platforms/tsar_generic_xbar/soclib.conf
r504 r779 1 1 2 # DescPath modified by a script 3 4 config.addDescPath("/users/cao/meunier/src/tsar/lib/generic_llsc_global_table") 5 config.addDescPath("/users/cao/meunier/src/tsar/modules/dspin_router_tsar") 6 config.addDescPath("/users/cao/meunier/src/tsar/modules/sdmmc") 7 config.addDescPath("/users/cao/meunier/src/tsar/modules/vci_block_device_tsar") 8 config.addDescPath("/users/cao/meunier/src/tsar/modules/vci_ethernet_tsar") 9 config.addDescPath("/users/cao/meunier/src/tsar/modules/vci_io_bridge") 10 config.addDescPath("/users/cao/meunier/src/tsar/modules/vci_iox_network") 11 config.addDescPath("/users/cao/meunier/src/tsar/modules/vci_spiplatforms/tsar_generic_xbar/tsar_xbar_cluster") 12 config.addDescPath("/users/cao/meunier/src/rwt/communication") 13 config.addDescPath("/users/cao/meunier/src/rwt/lib/generic_cache_tsar") 14 config.addDescPath("/users/cao/meunier/src/rwt/modules/vci_cc_vcache_wrapper") 15 config.addDescPath("/users/cao/meunier/src/rwt/modules/vci_mem_cache") 16 -
trunk/platforms/tsar_generic_xbar/top.cpp
r752 r779 121 121 /////////////////////////////////////////////////// 122 122 123 #define USE_OPENMP 0124 123 125 124 #if USE_OPENMP … … 881 880 882 881 882 //#define SC_TRACE 883 #ifdef SC_TRACE 884 sc_trace_file * tf = sc_create_vcd_trace_file("my_trace_file"); 885 886 if (X_SIZE > 1){ 887 for (size_t x = 0; x < (X_SIZE-1); x++){ 888 for (size_t y = 0; y < Y_SIZE; y++){ 889 for (size_t k = 0; k < 3; k++){ 890 signal_dspin_h_cmd_inc[x][y][k].trace(tf, "dspin_h_cmd_inc"); 891 signal_dspin_h_cmd_dec[x][y][k].trace(tf, "dspin_h_cmd_dec"); 892 } 893 894 for (size_t k = 0; k < 2; k++){ 895 signal_dspin_h_rsp_inc[x][y][k].trace(tf, "dspin_h_rsp_inc"); 896 signal_dspin_h_rsp_dec[x][y][k].trace(tf, "dspin_h_rsp_dec"); 897 } 898 } 899 } 900 } 901 902 if (Y_SIZE > 1) { 903 for (size_t y = 0; y < (Y_SIZE-1); y++){ 904 for (size_t x = 0; x < X_SIZE; x++){ 905 for (size_t k = 0; k < 3; k++){ 906 signal_dspin_v_cmd_inc[x][y][k].trace(tf, "dspin_v_cmd_inc"); 907 signal_dspin_v_cmd_dec[x][y][k].trace(tf, "dspin_v_cmd_dec"); 908 } 909 910 for (size_t k = 0; k < 2; k++){ 911 signal_dspin_v_rsp_inc[x][y][k].trace(tf, "dspin_v_rsp_inc"); 912 signal_dspin_v_rsp_dec[x][y][k].trace(tf, "dspin_v_rsp_dec"); 913 } 914 } 915 } 916 } 917 918 for (size_t x = 0; x < (X_SIZE); x++){ 919 for (size_t y = 0; y < Y_SIZE; y++){ 920 std::ostringstream signame; 921 signame << "cluster" << x << "_" << y; 922 clusters[x][y]->trace(tf, signame.str()); 923 } 924 } 925 #endif 926 927 883 928 //////////////////////////////////////////////////////// 884 929 // Simulation … … 898 943 signal_dspin_false_cmd_out[x][y][a][k].read = true; 899 944 } 900 for (size_t k = 0; k < 2; k++){901 signal_dspin_false_rsp_in [x][y][a][k].write = false;902 signal_dspin_false_rsp_in [x][y][a][k].read = true;903 signal_dspin_false_rsp_out[x][y][a][k].write = false;904 signal_dspin_false_rsp_out[x][y][a][k].read = true;905 }945 for (size_t k = 0; k < 2; k++){ 946 signal_dspin_false_rsp_in [x][y][a][k].write = false; 947 signal_dspin_false_rsp_in [x][y][a][k].read = true; 948 signal_dspin_false_rsp_out[x][y][a][k].write = false; 949 signal_dspin_false_rsp_out[x][y][a][k].read = true; 950 } 906 951 } 907 952 } … … 910 955 sc_start(sc_core::sc_time(1, SC_NS)); 911 956 signal_resetn = true; 912 913 #define SC_TRACE914 #ifdef SC_TRACE915 sc_trace_file * tf = sc_create_vcd_trace_file("my_trace_file");916 917 if (X_SIZE > 1){918 for (size_t x = 0; x < (X_SIZE-1); x++){919 for (size_t y = 0; y < Y_SIZE; y++){920 for (size_t k = 0; k < 3; k++){921 signal_dspin_h_cmd_inc[x][y][k].trace(tf, "dspin_h_cmd_inc");922 signal_dspin_h_cmd_dec[x][y][k].trace(tf, "dspin_h_cmd_dec");923 }924 925 for (size_t k = 0; k < 2; k++){926 signal_dspin_h_rsp_inc[x][y][k].trace(tf, "dspin_h_rsp_inc");927 signal_dspin_h_rsp_dec[x][y][k].trace(tf, "dspin_h_rsp_dec");928 }929 }930 }931 }932 933 if (Y_SIZE > 1) {934 for (size_t y = 0; y < (Y_SIZE-1); y++){935 for (size_t x = 0; x < X_SIZE; x++){936 for (size_t k = 0; k < 3; k++){937 signal_dspin_v_cmd_inc[x][y][k].trace(tf, "dspin_v_cmd_inc");938 signal_dspin_v_cmd_dec[x][y][k].trace(tf, "dspin_v_cmd_dec");939 }940 941 for (size_t k = 0; k < 2; k++){942 signal_dspin_v_rsp_inc[x][y][k].trace(tf, "dspin_v_rsp_inc");943 signal_dspin_v_rsp_dec[x][y][k].trace(tf, "dspin_v_rsp_dec");944 }945 }946 }947 }948 949 for (size_t x = 0; x < (X_SIZE); x++){950 for (size_t y = 0; y < Y_SIZE; y++){951 std::ostringstream signame;952 signame << "cluster" << x << "_" << y;953 clusters[x][y]->trace(tf, signame.str());954 }955 }956 #endif957 957 958 958 if (debug_ok) { -
trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/metadata/tsar_xbar_cluster.sd
r706 r779 3 3 4 4 Module('caba:tsar_xbar_cluster', 5 classname = 'soclib::caba::TsarXbarCluster',6 tmpl_parameters = [7 parameter.Int('dspin_cmd_width'),8 parameter.Int('dspin_rsp_width'),5 classname = 'soclib::caba::TsarXbarCluster', 6 tmpl_parameters = [ 7 parameter.Int('dspin_cmd_width'), 8 parameter.Int('dspin_rsp_width'), 9 9 parameter.Module('vci_param_int', default = 'caba:vci_param', 10 10 cell_size = parameter.Reference('vci_data_width_int')), 11 11 parameter.Module('vci_param_ext', default = 'caba:vci_param', 12 12 cell_size = parameter.Reference('vci_data_width_ext')), 13 13 ], 14 14 15 header_files = [ '../source/include/tsar_xbar_cluster.h', 15 header_files = [ '../source/include/tsar_xbar_cluster.h', ], 16 17 implementation_files = [ '../source/src/tsar_xbar_cluster.cpp', ], 18 19 uses = [ 20 Uses('caba:base_module'), 21 Uses('common:mapping_table'), 22 Uses('common:iss2'), 23 24 Uses('caba:vci_cc_vcache_wrapper', 25 cell_size = parameter.Reference('vci_data_width_int'), 26 dspin_in_width = parameter.Reference('dspin_cmd_width'), 27 dspin_out_width = parameter.Reference('dspin_rsp_width'), 28 iss_t = 'common:gdb_iss', 29 gdb_iss_t = 'common:mips32el'), 30 31 Uses('caba:vci_mem_cache', 32 memc_cell_size_int = parameter.Reference('vci_data_width_int'), 33 memc_cell_size_ext = parameter.Reference('vci_data_width_ext'), 34 dspin_in_width = parameter.Reference('dspin_rsp_width'), 35 dspin_out_width = parameter.Reference('dspin_cmd_width')), 36 37 Uses('caba:vci_simple_rom', 38 cell_size = parameter.Reference('vci_data_width_int')), 39 40 Uses('caba:vci_simple_ram', 41 cell_size = parameter.Reference('vci_data_width_ext')), 42 43 Uses('caba:vci_simple_ram', 44 cell_size = parameter.Reference('vci_data_width_int')), 45 46 Uses('caba:vci_xicu', 47 cell_size = parameter.Reference('vci_data_width_int')), 48 49 Uses('caba:vci_local_crossbar', 50 cell_size = parameter.Reference('vci_data_width_int')), 51 52 Uses('caba:dspin_local_crossbar', 53 flit_width = parameter.Reference('dspin_cmd_width')), 54 55 Uses('caba:dspin_local_crossbar', 56 flit_width = parameter.Reference('dspin_rsp_width')), 57 58 Uses('caba:virtual_dspin_router', 59 flit_width = parameter.Reference('dspin_cmd_width')), 60 61 Uses('caba:virtual_dspin_router', 62 flit_width = parameter.Reference('dspin_rsp_width')), 63 64 Uses('caba:vci_multi_tty', 65 cell_size = parameter.Reference('vci_data_width_int')), 66 67 Uses('caba:vci_framebuffer', 68 cell_size = parameter.Reference('vci_data_width_int')), 69 70 Uses('caba:vci_multi_nic', 71 cell_size = parameter.Reference('vci_data_width_int')), 72 73 Uses('caba:vci_chbuf_dma', 74 cell_size = parameter.Reference('vci_data_width_int')), 75 76 Uses('caba:vci_block_device_tsar', 77 cell_size = parameter.Reference('vci_data_width_int')), 78 79 Uses('caba:vci_multi_dma', 80 cell_size = parameter.Reference('vci_data_width_int')), 81 82 Uses('caba:vci_dspin_target_wrapper', 83 cell_size = parameter.Reference('vci_data_width_int')), 84 85 Uses('caba:vci_dspin_initiator_wrapper', 86 cell_size = parameter.Reference('vci_data_width_int')), 87 88 Uses('caba:vci_simhelper', 89 cell_size = parameter.Reference('vci_data_width_int')), 90 91 Uses('common:elf_file_loader'), 16 92 ], 17 93 18 implementation_files = [ '../source/src/tsar_xbar_cluster.cpp', 94 ports = [ 95 Port('caba:bit_in', 'p_resetn', auto = 'resetn'), 96 Port('caba:clock_in', 'p_clk', auto = 'clock'), 97 Port('caba:dspin_output', 'p_cmd_out', [4, 3], 98 dspin_data_size = parameter.Reference('dspin_cmd_width')), 99 Port('caba:dspin_input', 'p_cmd_in', [4, 3], 100 dspin_data_size = parameter.Reference('dspin_cmd_width')), 101 Port('caba:dspin_output', 'p_rsp_out', [4, 2], 102 dspin_data_size = parameter.Reference('dspin_rsp_width')), 103 Port('caba:dspin_input', 'p_rsp_in', [4, 2], 104 dspin_data_size = parameter.Reference('dspin_rsp_width')), 19 105 ], 20 21 uses = [ 22 Uses('caba:base_module'), 23 Uses('common:mapping_table'), 24 Uses('common:iss2'), 25 26 Uses('caba:vci_cc_vcache_wrapper', 27 cell_size = parameter.Reference('vci_data_width_int'), 28 dspin_in_width = parameter.Reference('dspin_cmd_width'), 29 dspin_out_width = parameter.Reference('dspin_rsp_width'), 30 iss_t = 'common:gdb_iss', 31 gdb_iss_t = 'common:mips32el'), 32 33 Uses('caba:vci_mem_cache', 34 memc_cell_size_int = parameter.Reference('vci_data_width_int'), 35 memc_cell_size_ext = parameter.Reference('vci_data_width_ext'), 36 dspin_in_width = parameter.Reference('dspin_rsp_width'), 37 dspin_out_width = parameter.Reference('dspin_cmd_width')), 38 39 Uses('caba:vci_simple_rom', 40 cell_size = parameter.Reference('vci_data_width_int')), 41 42 Uses('caba:vci_simple_ram', 43 cell_size = parameter.Reference('vci_data_width_ext')), 44 45 Uses('caba:vci_simple_ram', 46 cell_size = parameter.Reference('vci_data_width_int')), 47 48 Uses('caba:vci_xicu', 49 cell_size = parameter.Reference('vci_data_width_int')), 50 51 Uses('caba:vci_local_crossbar', 52 cell_size = parameter.Reference('vci_data_width_int')), 53 54 Uses('caba:dspin_local_crossbar', 55 flit_width = parameter.Reference('dspin_cmd_width')), 56 57 Uses('caba:dspin_local_crossbar', 58 flit_width = parameter.Reference('dspin_rsp_width')), 59 60 Uses('caba:virtual_dspin_router', 61 flit_width = parameter.Reference('dspin_cmd_width')), 62 63 Uses('caba:virtual_dspin_router', 64 flit_width = parameter.Reference('dspin_rsp_width')), 65 66 Uses('caba:vci_multi_tty', 67 cell_size = parameter.Reference('vci_data_width_int')), 68 69 Uses('caba:vci_framebuffer', 70 cell_size = parameter.Reference('vci_data_width_int')), 71 72 Uses('caba:vci_multi_nic', 73 cell_size = parameter.Reference('vci_data_width_int')), 74 75 Uses('caba:vci_chbuf_dma', 76 cell_size = parameter.Reference('vci_data_width_int')), 77 78 Uses('caba:vci_block_device_tsar', 79 cell_size = parameter.Reference('vci_data_width_int')), 80 81 Uses('caba:vci_multi_dma', 82 cell_size = parameter.Reference('vci_data_width_int')), 83 84 Uses('caba:vci_dspin_target_wrapper', 85 cell_size = parameter.Reference('vci_data_width_int')), 86 87 Uses('caba:vci_dspin_initiator_wrapper', 88 cell_size = parameter.Reference('vci_data_width_int')), 89 90 Uses('caba:vci_simhelper', 91 cell_size = parameter.Reference('vci_data_width_int')), 92 93 Uses('common:elf_file_loader'), 94 ], 95 96 ports = [ 97 Port('caba:bit_in', 'p_resetn', auto = 'resetn'), 98 Port('caba:clock_in', 'p_clk', auto = 'clock'), 99 Port('caba:dspin_output', 'p_cmd_out', [4, 3], 100 dspin_data_size = parameter.Reference('dspin_cmd_width')), 101 Port('caba:dspin_input', 'p_cmd_in', [4, 3], 102 dspin_data_size = parameter.Reference('dspin_cmd_width')), 103 Port('caba:dspin_output', 'p_rsp_out', [4, 2], 104 dspin_data_size = parameter.Reference('dspin_rsp_width')), 105 Port('caba:dspin_input', 'p_rsp_in', [4, 2], 106 dspin_data_size = parameter.Reference('dspin_rsp_width')), 107 ], 108 ) 106 ) 109 107 110 108
Note: See TracChangeset
for help on using the changeset viewer.