Search in sources :

Example 1 with WcetCost

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);
}
Also used : WcetCost(com.jopdesign.wcet.analysis.WcetCost) AnalysisContextLocal(com.jopdesign.wcet.analysis.AnalysisContextLocal) RecursiveWcetAnalysis(com.jopdesign.wcet.analysis.RecursiveWcetAnalysis) LocalAnalysis(com.jopdesign.wcet.analysis.LocalAnalysis)

Example 2 with WcetCost

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;
}
Also used : WcetCost(com.jopdesign.wcet.analysis.WcetCost) UppaalAnalysis(com.jopdesign.wcet.analysis.UppaalAnalysis) ArrayList(java.util.ArrayList) MethodInfo(com.jopdesign.common.MethodInfo) File(java.io.File)

Example 3 with WcetCost

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();
}
Also used : WcetCost(com.jopdesign.wcet.analysis.WcetCost) GlobalAnalysis(com.jopdesign.wcet.analysis.GlobalAnalysis) IPETConfig(com.jopdesign.wcet.ipet.IPETConfig) AnalysisContextLocal(com.jopdesign.wcet.analysis.AnalysisContextLocal) LocalAnalysis(com.jopdesign.wcet.analysis.LocalAnalysis)

Aggregations

WcetCost (com.jopdesign.wcet.analysis.WcetCost)3 AnalysisContextLocal (com.jopdesign.wcet.analysis.AnalysisContextLocal)2 LocalAnalysis (com.jopdesign.wcet.analysis.LocalAnalysis)2 MethodInfo (com.jopdesign.common.MethodInfo)1 GlobalAnalysis (com.jopdesign.wcet.analysis.GlobalAnalysis)1 RecursiveWcetAnalysis (com.jopdesign.wcet.analysis.RecursiveWcetAnalysis)1 UppaalAnalysis (com.jopdesign.wcet.analysis.UppaalAnalysis)1 IPETConfig (com.jopdesign.wcet.ipet.IPETConfig)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1