use of com.jopdesign.wcet.analysis.WcetCost in project jop by jop-devel.
the class MethodBuilder method visitSummaryNode.
public void visitSummaryNode(ControlFlowGraph.SummaryNode n) {
RecursiveWcetAnalysis<AnalysisContextLocal> an = new RecursiveWcetAnalysis<AnalysisContextLocal>(jTrans.getProject(), new LocalAnalysis());
WcetCost cost = an.runWCETComputation("SUBGRAPH" + n.getId(), n.getSubGraph(), new AnalysisContextLocal(CacheCostCalculationMethod.ALWAYS_MISS)).getTotalCost();
SubAutomaton sumLoc = createBasicBlock(n.getId(), cost.getCost());
this.nodeTemplates.put(n, sumLoc);
}
use of com.jopdesign.wcet.analysis.WcetCost in project jop by jop-devel.
the class UppAalAnalysis method run.
private boolean run(ExecHelper exec) {
File uppaalOutDir;
try {
project.setTopLevelLogger(tlLogger);
tlLogger.info("Loading project");
project.initialize(true, true);
uppaalOutDir = project.getOutDir("uppaal");
} catch (Exception e) {
exec.logException("loading project", e);
return false;
}
UppaalAnalysis ua = new UppaalAnalysis(tlLogger, project, uppaalOutDir);
List<MethodInfo> methods = project.getCallGraph().getReachableImplementations(project.getTargetMethod());
Collections.reverse(methods);
List<WCETEntry> entries = new ArrayList<WCETEntry>();
for (MethodInfo m : methods) {
if (project.computeCyclomaticComplexity(m) > ECC_TRESHOLD) {
tlLogger.info("Skipping UppAal translation for " + m + " because extended cyclomatic complexity " + project.computeCyclomaticComplexity(m) + " > treshold");
} else {
tlLogger.info("Starting UppAal translation for " + m);
WcetCost wcet;
try {
wcet = ua.calculateWCET(m);
entries.add(new WCETEntry(m, wcet.getCost(), ua.getSearchtime(), ua.getSolvertimemax()));
} catch (Exception e) {
exec.logException("Uppaal calculation", e);
return false;
}
}
}
for (WCETEntry entry : entries) {
System.out.println("***" + entry.target.toString());
System.out.println(" wcet: " + entry.wcet);
System.out.println(" complex: " + project.computeCyclomaticComplexity(entry.target));
System.out.println(" searchT: " + entry.searchtime);
System.out.println(" solverTmax: " + entry.solvertime);
}
return true;
}
use of com.jopdesign.wcet.analysis.WcetCost in project jop by jop-devel.
the class WCAInvoker method initAnalysis.
public void initAnalysis(boolean useMethodCacheStrategy) {
IPETConfig ipetConfig = new IPETConfig(wcetTool.getConfig());
RecursiveStrategy<AnalysisContextLocal, WcetCost> strategy;
if (useMethodCacheStrategy) {
strategy = analyses.getMethodCacheAnalysis().createRecursiveStrategy(wcetTool, ipetConfig, cacheApproximation);
} else {
if (cacheApproximation.needsInterProcIPET()) {
strategy = new GlobalAnalysis.GlobalIPETStrategy(ipetConfig);
} else {
strategy = new LocalAnalysis(wcetTool, ipetConfig);
}
}
recursiveAnalysis = new RecursiveWcetAnalysis<AnalysisContextLocal>(wcetTool, ipetConfig, strategy);
// Perform initial analysis
runAnalysis(wcetTool.getCallGraph().getReversedGraph());
updateWCEP();
}
Aggregations