def process(log): # Match patterns here lines = log.split('\n') print 'runtime', ln_start = 0 while True: ln1 = log_util.get_next_ln_starts_with(lines, ln_start, 'Co-efficient Ratio Summary:') if ln1 == ln_start: break t1 = log_util.get_elapse_time(lines, ln1, forward=True) ln2 = log_util.get_next_ln_starts_with(lines, ln1, 'END_CMD: route_opt_cmd') if ln2 == ln1: break t2 = log_util.get_elapse_time(lines, ln2, forward=True) print t1, t2, ln_start = ln2 break return
def process(log): # Match patterns here lines = log.split('\n') print 'runtime', ln_start = 0 while True: ln1 = log_util.get_next_ln_starts_with(lines, ln_start, 'START_CMD: clock_opt') if ln1 == ln_start: break t1 = log_util.get_elapse_time(lines, ln1, forward=True) ln2 = log_util.get_next_ln_starts_with(lines, ln1, 'END_CMD: clock_opt') if ln2 == ln1: break t2 = log_util.get_elapse_time(lines, ln2, forward=True) print t1, t2, ln_start = ln2 return
def process(log): # Match patterns here lines = log.split('\n') ln = log_util.get_next_ln_starts_with(lines, 0, ' WNS Optimization Summary') do_work(lines, ln, 'w') ln = log_util.get_next_ln_starts_with(lines, ln, ' TNS Optimization Summary') do_work(lines, ln, 't') return
def process(log): # Match patterns here lines = log.split('\n') # only for -debug t1 = 0 t2 = 0 t3 = 0 ln = log_util.get_next_ln_starts_with(lines, 0, ' POWER ') hb = lines[ln] for i in range(ln, 0, -1): if lines[i].startswith('END_FUNC: propagate_switching_activity'): match = re.search('ELAPSE:\s+(\d+) s', lines[i]) if match: t2 = int(match.group(1)) elif lines[i].startswith('START_FUNC: propagate_switching_activity'): match = re.search('ELAPSE:\s+(\d+) s', lines[i]) if match: t1 = int(match.group(1)) break qor = log_util.parse_heartbeat(hb) if qor['valid']: hh, mm, ss = qor['elapsed'].split(':') t3 = int(hh) * 3600 + int(mm) * 60 + int(ss) print "runtime", t1, t2, t3 else: print "runtime" return
def process(log): # Match patterns here lines = log.split('\n') ln = log_util.get_next_ln_starts_with(lines, 0, 'Final optimized QoR') wns = "--" tns = "--" whs = "--" ths = "--" match = re.search("\s+WNS\(setup\)=(\S+)\s+TNS\(setup\)=(\S+)\s.*", lines[ln + 1]) if match: wns = match.group(1) tns = match.group(2) match = re.search("\s+WNS\(hold\)=(\S+)\s+TNS\(hold\)=(\S+)\s.*", lines[ln + 2]) if match: whs = match.group(1) ths = match.group(2) print "wns", wns print "tns", tns print "whs", whs print "ths", ths return
def process(log): # Match patterns here lines = log.split('\n') ln_fo = log_util.get_next_ln_starts_with( lines, 0, 'Running final optimization step.') ln_lgl1 = log_util.get_next_ln_starts_with( lines, ln_fo, 'START_FUNC: legalize_placement') t1 = log_util.get_elapse_time(lines, ln_fo, forward=True) t2 = log_util.get_elapse_time(lines, ln_lgl1, forward=False) print t2 - t1 return
def process(log): # Match patterns here lines = log.split('\n') ln_init = log_util.get_next_ln_starts_with(lines, 0, ' * * ') hb1 = lines[ln_init] ln_delay = log_util.get_next_ln_starts_with(lines, ln_init, 'INFO: check if proc nro_prelude_delay-Wlb-Tlb exists') t_delay = log_util.get_elapse_time(lines, ln_delay, forward=False) ln_sbo = log_util.get_next_ln_starts_with(lines, ln_delay, ' SBO Optimization Summary') t_sbo = log_util.get_elapse_time(lines, ln_sbo, forward=True) ln_end = log_util.get_next_ln_starts_with(lines, ln_sbo, ' * * ') t_end = log_util.get_elapse_time(lines, ln_end, forward=False) hb2 = lines[ln_end] # print scenarios scenarios = [] for m in range(ln_end - 3, max(0, ln_end - 100), -1): match = re.search('^\s+\d+\s+\*\s+', lines[m]) if match: scenarios.append(lines[m]) if lines[m].startswith('Scene'): break for l in reversed(scenarios): print l qor1 = log_util.parse_heartbeat(hb1) qor2 = log_util.parse_heartbeat(hb2) if qor1['valid'] and qor2['valid']: print 'runtime', t_delay, t_sbo, t_end print "wns", qor1['wns'], qor2['wns'] print "tns", qor1['tns'], qor2['tns'] print "maxtran", qor1['maxtran'], qor2['maxtran'] print "area", qor1['area'], qor2['area'] print "buf", qor1['bufcnt'], qor2['bufcnt'] print "inv", qor1['invcnt'], qor2['invcnt'] return
def process(log): # Match patterns here lines = log.split('\n') ln_init = log_util.get_next_ln_starts_with(lines, 0, ' * * ') ln_delay = log_util.get_next_ln_starts_with( lines, ln_init, 'INFO: check if proc nro_prelude_delay-Wlb-Tb exists') t_delay = log_util.get_elapse_time(lines, ln_delay, forward=False) ln_prev_hb = log_util.get_next_ln_starts_with(lines, ln_delay, ' * * ', forward=False) if ln_prev_hb == None: hb1 = "" else: hb1 = lines[ln_prev_hb] print "SCN BEFORE:" print_scn_table(lines, ln_prev_hb) ln_sbo = log_util.get_next_ln_starts_with(lines, ln_delay, ' SBO Optimization Summary') t_sbo = log_util.get_elapse_time(lines, ln_sbo, forward=True) ln_pbo_w1 = log_util.get_next_ln_starts_with(lines, ln_sbo, 'PBO-WNS: Iteration 2') t_pbo_wns_1 = log_util.get_elapse_time(lines, ln_pbo_w1, forward=True) ln_pbo_w2 = log_util.get_next_ln_starts_with( lines, ln_pbo_w1, ' WNS Optimization Summary') t_pbo_wns_2 = log_util.get_elapse_time(lines, ln_pbo_w2, forward=True) ln_pbo_t1 = log_util.get_next_ln_starts_with(lines, ln_pbo_w2, 'PBO-TNS: Iteration 2') t_pbo_tns_1 = log_util.get_elapse_time(lines, ln_pbo_t1, forward=True) ln_end = log_util.get_next_ln_starts_with(lines, ln_pbo_t1, ' * * ') t_end = log_util.get_elapse_time(lines, ln_end, forward=False) if ln_end == None: hb2 = "" else: hb2 = lines[ln_end] print "SCN AFTER:" print_scn_table(lines, ln_end) qor1 = log_util.parse_heartbeat(hb1) qor2 = log_util.parse_heartbeat(hb2) if qor1['valid'] and qor2['valid']: print 'runtime', t_delay, t_sbo, t_pbo_wns_1, t_pbo_wns_2, t_pbo_tns_1, t_end print "wns", qor1['wns'], qor2['wns'] print "tns", qor1['tns'], qor2['tns'] print "maxtran", qor1['maxtran'], qor2['maxtran'] print "area", qor1['area'], qor2['area'] print "buf", qor1['bufcnt'], qor2['bufcnt'] print "inv", qor1['invcnt'], qor2['invcnt'] else: print 'runtime' print "wns" print "tns" print "maxtran" print "area" print "buf" print "inv" return
def process(log): # Match patterns here lines = log.split('\n') cnt_at = cnt_xac = cnt_xrj = cnt_drj = cnt_mat = cnt_mrj = -1 ln_sbo = log_util.get_next_ln_starts_with(lines, 0, ' SBO Optimization Summary') for i in range(ln_sbo + 3, ln_sbo + 18): line = lines[i] if 'Drivers Attempted' in line: cnt_at = line.split('=')[1].strip() elif 'Xform Acceptance Count' in line: cnt_xac = line.split('=')[1].strip() elif 'Xform Rejection Count' in line: cnt_xrj = line.split('=')[1].strip() elif 'Density Check Rejection Count' in line: cnt_drj = line.split('=')[1].strip() elif 'Main Graph Trial Count' in line: cnt_mat = line.split('=')[1].strip() elif 'Main Graph Rejection Count' in line: cnt_mrj = line.split('=')[1].strip() print "sum-sbo", cnt_at, cnt_xac, cnt_xrj, cnt_drj, cnt_mat, cnt_mrj cnt_at = cnt_xac = cnt_xrj = cnt_drj = cnt_mat = cnt_mrj = -1 ln_pbo_w = log_util.get_next_ln_starts_with( lines, ln_sbo, ' WNS Optimization Summary') for i in range(ln_pbo_w + 3, ln_pbo_w + 18): line = lines[i] if 'Drivers Attempted' in line: cnt_at = line.split('=')[1].strip() elif 'Xform Acceptance Count' in line: cnt_xac = line.split('=')[1].strip() elif 'Xform Rejection Count' in line: cnt_xrj = line.split('=')[1].strip() elif 'Density Check Rejection Count' in line: cnt_drj = line.split('=')[1].strip() elif 'Main Graph Trial Count' in line: cnt_mat = line.split('=')[1].strip() elif 'Main Graph Rejection Count' in line: cnt_mrj = line.split('=')[1].strip() print "sum-pbo-w", cnt_at, cnt_xac, cnt_xrj, cnt_drj, cnt_mat, cnt_mrj cnt_at = cnt_xac = cnt_xrj = cnt_drj = cnt_mat = cnt_mrj = -1 ln_pbo_t = log_util.get_next_ln_starts_with( lines, ln_pbo_w, ' TNS Optimization Summary') for i in range(ln_pbo_t + 3, ln_pbo_t + 18): line = lines[i] if 'Drivers Attempted' in line: cnt_at = line.split('=')[1].strip() elif 'Xform Acceptance Count' in line: cnt_xac = line.split('=')[1].strip() elif 'Xform Rejection Count' in line: cnt_xrj = line.split('=')[1].strip() elif 'Density Check Rejection Count' in line: cnt_drj = line.split('=')[1].strip() elif 'Main Graph Trial Count' in line: cnt_mat = line.split('=')[1].strip() elif 'Main Graph Rejection Count' in line: cnt_mrj = line.split('=')[1].strip() print "sum-pbo-t", cnt_at, cnt_xac, cnt_xrj, cnt_drj, cnt_mat, cnt_mrj return