def getWcetFromImm(imm_file_name, generateILPOnly= False): print 'running chronos...' ret,out,err = runExtract([chronos_executable, imm_file_name]) print 'chronos completed, ret: %s, err: %s\n' % (ret,err) if ret: print 'Chronos FAILED\n out: %s\n err: %s\n' % (out,err) print 'Chronos FAILED\n' return None else: pass print 'Chronos succeeded' if generateILPOnly: print "ILP file generated" return None return float(cplex.cplexSolve(imm_file_name+'.ilp')),out,err
def getWcetFromImm(imm_file_name, generateILPOnly=False): print 'running chronos...' ret, out, err = runExtract([chronos_executable, imm_file_name]) print 'chronos completed, ret: %s, err: %s\n' % (ret, err) if ret: print 'Chronos FAILED\n out: %s\n err: %s\n' % (out, err) print 'Chronos FAILED\n' return None else: pass print 'Chronos succeeded' if generateILPOnly: print "ILP file generated" return None return float(cplex.cplexSolve(imm_file_name + '.ilp')), out, err
def conflict(entry_point_function, tcfg_map, conflict_files, old_ilp, new_ilp, dir_name, sol_file, emit_conflicts=False, do_cplex=False, interactive=False, silent_cplex=False, preempt_limit=None, default_phantom_preempt=False): if preempt_limit == None: preempt_limit = 5 if default_phantom_preempt: conflict_files.append( convert_loop_bounds.phantomPreemptsAnnoFileName(dir_name)) #initialise graph_to_graph so we get immFunc #load the loop_counts print 'conflict.conflict: sol_file %s' % sol_file bench.bench(dir_name, entry_point_function, False, True, False, parse_only=True) #we need the loop data immFunc().process() global bbAddr bbAddr = immFunc().bbAddr read_tcfg_map(tcfg_map) if interactive: assert False, 'Halt' if emit_conflicts: print 'new_ilp:%s' % new_ilp print_constraints(conflict_files, old_ilp, new_ilp, sol_file, preempt_limit) if do_cplex: cplex_ret = cplex.cplexSolve(new_ilp, silent=silent_cplex, sol_file=sol_file) print 'cplex_ret: %s' % cplex_ret return cplex_ret
def conflict(entry_point_function, tcfg_map, conflict_files, old_ilp, new_ilp, dir_name, sol_file, emit_conflicts=False, do_cplex=False, interactive=False, silent_cplex=False, preempt_limit= None, default_phantom_preempt=False): if preempt_limit == None: preempt_limit = 5 if default_phantom_preempt: conflict_files.append(convert_loop_bounds.phantomPreemptsAnnoFileName(dir_name)) #initialise graph_to_graph so we get immFunc #load the loop_counts print 'conflict.conflict: sol_file %s' % sol_file bench.bench(dir_name, [entry_point_function],False,True,False,parse_only=True ) #we need the loop data immFunc().process() global bbAddr bbAddr = immFunc().bbAddr read_tcfg_map(tcfg_map) if interactive: assert False, 'Halt' if emit_conflicts: print 'new_ilp:%s' % new_ilp print_constraints(conflict_files, old_ilp, new_ilp, sol_file, preempt_limit) if do_cplex: cplex_ret = cplex.cplexSolve(new_ilp,silent=silent_cplex,sol_file=sol_file) print 'cplex_ret: %s' % cplex_ret return cplex_ret