use of com.jopdesign.wcet.analysis.LocalAnalysis 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.LocalAnalysis in project jop by jop-devel.
the class WCETAnalysis method runMetrics.
private void runMetrics(MethodInfo targetMethod) throws Exception {
/* generate reports later for simple_fit */
wcetTool.setGenerateWCETReport(false);
/* check whether the largest method fits into the cache */
List<MethodInfo> allMethods = wcetTool.getCallGraph().getReachableImplementations(targetMethod);
MethodInfo largestMethod = MethodCacheAnalysis.checkCache(wcetTool, allMethods);
int minWords = MiscUtils.bytesToWords(largestMethod.getCode().getNumberOfBytes());
reportMetric("min-cache-size", largestMethod.getFQMethodName(), minWords);
/* Compute cyclomatic complexity */
exec.info("Cyclomatic complexity: " + wcetTool.computeCyclomaticComplexity(targetMethod));
/* Fast, useful cache approximationx */
CacheCostCalculationMethod cacheApprox = CacheCostCalculationMethod.ALL_FIT_SIMPLE;
/* Perform a few standard analysis (MIN_CACHE_COSdT, ALWAYS_HIT, ALWAYS_MISS) without call strings */
long start, stop;
/* Tree based WCET analysis - has to be equal to ALWAYS_MISS if no flow facts are used */
{
start = System.nanoTime();
TreeAnalysis treeAna = new TreeAnalysis(wcetTool, false);
long treeWCET = treeAna.computeWCET(targetMethod);
stop = System.nanoTime();
reportMetric("progress-measure", treeAna.getMaxProgress(targetMethod));
reportSpecial("wcet.tree", WcetCost.totalCost(treeWCET), start, stop, 0.0);
}
RecursiveWcetAnalysis<AnalysisContextLocal> an = new RecursiveWcetAnalysis<AnalysisContextLocal>(wcetTool, ipetConfig, new LocalAnalysis(wcetTool, ipetConfig));
/* always miss */
start = System.nanoTime();
alwaysMissCost = an.computeCost(targetMethod, new AnalysisContextLocal(CacheCostCalculationMethod.ALWAYS_MISS));
stop = System.nanoTime();
reportSpecial("always-miss", alwaysMissCost, start, stop, LpSolveWrapper.getSolverTime());
/* always hit */
LpSolveWrapper.resetSolverTime();
start = System.nanoTime();
alwaysHitCost = an.computeCost(targetMethod, new AnalysisContextLocal(CacheCostCalculationMethod.ALWAYS_HIT));
stop = System.nanoTime();
reportSpecial("always-hit", alwaysHitCost, start, stop, LpSolveWrapper.getSolverTime());
/* simple approx */
wcetTool.setGenerateWCETReport(true);
start = System.nanoTime();
approxCost = an.computeCost(targetMethod, new AnalysisContextLocal(cacheApprox));
stop = System.nanoTime();
reportSpecial("recursive-report", approxCost, start, stop, LpSolveWrapper.getSolverTime());
wcetTool.setGenerateWCETReport(false);
}
use of com.jopdesign.wcet.analysis.LocalAnalysis 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