Search in sources :

Example 1 with UppaalAnalysis

use of com.jopdesign.wcet.analysis.UppaalAnalysis in project jop by jop-devel.

the class WCETAnalysis method runUppaal.

/**
	 * @throws BadConfigurationException 
	 * @throws XmlSerializationException 
	 * @throws DuplicateKeyException 
	 * @throws IOException 
	 */
private void runUppaal(MethodInfo targetMethod) throws BadConfigurationException, IOException, DuplicateKeyException, XmlSerializationException {
    UppaalAnalysis an = new UppaalAnalysis(exec.getExecLogger(), wcetTool, wcetTool.getOutDir("uppaal"));
    config.checkPresent(UppAalConfig.UPPAAL_VERIFYTA_BINARY);
    /* Run uppaal analysis */
    long start = System.nanoTime();
    wcet = an.computeWCET(targetMethod, alwaysMissCost.getCost());
    long stop = System.nanoTime();
    reportUppaal(wcet, start, stop, an.getSearchtime(), an.getSolvertimemax());
}
Also used : UppaalAnalysis(com.jopdesign.wcet.analysis.UppaalAnalysis)

Example 2 with UppaalAnalysis

use of com.jopdesign.wcet.analysis.UppaalAnalysis 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)

Aggregations

UppaalAnalysis (com.jopdesign.wcet.analysis.UppaalAnalysis)2 MethodInfo (com.jopdesign.common.MethodInfo)1 WcetCost (com.jopdesign.wcet.analysis.WcetCost)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1