Search in sources :

Example 6 with Config

use of com.jopdesign.common.config.Config in project jop by jop-devel.

the class WCETTool method recordResultUppaal.

public void recordResultUppaal(WcetCost wcet, double timeDiff, double searchtime, double solvertimemax) {
    if (resultRecord == null)
        return;
    Config c = projectConfig.getConfig();
    OptionGroup o = JOPConfig.getOptions(c);
    if (projectConfig.addPerformanceResults()) {
        recordCVS("wcet", "uppaal", wcet, timeDiff, searchtime, solvertimemax, o.getOption(JOPConfig.CACHE_IMPL), o.getOption(JOPConfig.CACHE_SIZE_WORDS), o.getOption(JOPConfig.CACHE_BLOCKS), c.getOption(UppAalConfig.UPPAAL_CACHE_APPROX), c.getOption(UppAalConfig.UPPAAL_COMPLEXITY_TRESHOLD), c.getOption(UppAalConfig.UPPAAL_COLLAPSE_LEAVES), c.getOption(UppAalConfig.UPPAAL_CONVEX_HULL), c.getOption(UppAalConfig.UPPAAL_TIGHT_BOUNDS), c.getOption(UppAalConfig.UPPAAL_PROGRESS_MEASURE), c.getOption(UppAalConfig.UPPAAL_SUPERGRAPH_TEMPLATE), c.getOption(UppAalConfig.UPPAAL_EMPTY_INITIAL_CACHE));
    } else {
        recordCVS("wcet", "uppaal", wcet, o.getOption(JOPConfig.CACHE_IMPL), o.getOption(JOPConfig.CACHE_SIZE_WORDS), o.getOption(JOPConfig.CACHE_BLOCKS), c.getOption(UppAalConfig.UPPAAL_CACHE_APPROX), c.getOption(UppAalConfig.UPPAAL_COMPLEXITY_TRESHOLD), c.getOption(UppAalConfig.UPPAAL_COLLAPSE_LEAVES), c.getOption(UppAalConfig.UPPAAL_CONVEX_HULL), c.getOption(UppAalConfig.UPPAAL_TIGHT_BOUNDS), c.getOption(UppAalConfig.UPPAAL_PROGRESS_MEASURE), c.getOption(UppAalConfig.UPPAAL_SUPERGRAPH_TEMPLATE), c.getOption(UppAalConfig.UPPAAL_EMPTY_INITIAL_CACHE));
    }
}
Also used : OptionGroup(com.jopdesign.common.config.OptionGroup) JOPConfig(com.jopdesign.common.processormodel.JOPConfig) IPETConfig(com.jopdesign.wcet.ipet.IPETConfig) UppAalConfig(com.jopdesign.wcet.uppaal.UppAalConfig) Config(com.jopdesign.common.config.Config) ReportConfig(com.jopdesign.wcet.report.ReportConfig)

Example 7 with Config

use of com.jopdesign.common.config.Config in project jop by jop-devel.

the class WcetAppInfoTest method main.

/*
     * DEMO
     * ~~~~
     */
/* small demo using the class loader */
public static void main(String[] argv) {
    AppSetup appSetup = new AppSetup();
    WCETTool wcetTool = new WCETTool();
    appSetup.registerTool("wcet", wcetTool);
    Config config = appSetup.getConfig();
    config.setOption(ProjectConfig.PROJECT_NAME, "typegraph");
    AppInfo appInfo = appSetup.initAndLoad(argv, false, false, false);
    ProjectConfig pConfig = wcetTool.getProjectConfig();
    try {
        System.out.println("Classloader Demo: " + pConfig.getAppClassName());
        String rootClass = pConfig.getAppClassName();
        String rootPkg = rootClass.substring(0, rootClass.lastIndexOf("."));
        ClassInfo ci = appInfo.getClassInfo(pConfig.getAppClassName());
        System.out.println("Source file: " + ci.getSourceFileName());
        System.out.println("Root class: " + ci.toString());
        {
            System.out.println("Writing type graph to " + pConfig.getOutFile("typegraph.png"));
            File dotFile = pConfig.getOutFile("typegraph.dot");
            FileWriter dotWriter = new FileWriter(dotFile);
            // FIXME TypeGraph is not used anymore, export ClassInfo/.. graph
            TypeGraph typeGraph = new TypeGraph();
            typeGraph.exportDOT(dotWriter, rootPkg);
            dotWriter.close();
            InvokeDot.invokeDot(wcetTool.getConfig(), dotFile, pConfig.getOutFile("typegraph.png"));
        }
        SuperGraph sg = new SuperGraph(appInfo, pConfig.getTargetMethodInfo().getCode().getControlFlowGraph(false), 0);
        {
            System.out.println("Writing supergraph graph to " + pConfig.getOutFile("supergraph.png"));
            File dotFile = pConfig.getOutFile("callgraph.dot");
            sg.exportDOT(dotFile);
            InvokeDot.invokeDot(wcetTool.getConfig(), dotFile, pConfig.getOutFile("supergraph.png"));
        }
        CallGraph cg = appInfo.buildCallGraph(false);
        {
            System.out.println("Writing call graph to " + pConfig.getOutFile("callgraph.png"));
            File dotFile = pConfig.getOutFile("callgraph.dot");
            FileWriter dotWriter = new FileWriter(dotFile);
            cg.exportDOT(dotWriter);
            dotWriter.close();
            InvokeDot.invokeDot(wcetTool.getConfig(), dotFile, pConfig.getOutFile("callgraph.png"));
        }
    } catch (IOException e) {
        e.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : Config(com.jopdesign.common.config.Config) SuperGraph(com.jopdesign.common.code.SuperGraph) FileWriter(java.io.FileWriter) TypeGraph(com.jopdesign.common.graphutils.TypeGraph) IOException(java.io.IOException) IOException(java.io.IOException) AppInfo(com.jopdesign.common.AppInfo) CallGraph(com.jopdesign.common.code.CallGraph) AppSetup(com.jopdesign.common.AppSetup) File(java.io.File) ClassInfo(com.jopdesign.common.ClassInfo)

Aggregations

Config (com.jopdesign.common.config.Config)7 JOPConfig (com.jopdesign.common.processormodel.JOPConfig)5 IPETConfig (com.jopdesign.wcet.ipet.IPETConfig)4 BadConfigurationException (com.jopdesign.common.config.Config.BadConfigurationException)3 ReportConfig (com.jopdesign.wcet.report.ReportConfig)3 UppAalConfig (com.jopdesign.wcet.uppaal.UppAalConfig)3 File (java.io.File)3 IOException (java.io.IOException)3 OptionGroup (com.jopdesign.common.config.OptionGroup)2 LogConfig (com.jopdesign.common.logger.LogConfig)2 FileNotFoundException (java.io.FileNotFoundException)2 AppInfo (com.jopdesign.common.AppInfo)1 AppSetup (com.jopdesign.common.AppSetup)1 ClassInfo (com.jopdesign.common.ClassInfo)1 CallGraph (com.jopdesign.common.code.CallGraph)1 SuperGraph (com.jopdesign.common.code.SuperGraph)1 TypeGraph (com.jopdesign.common.graphutils.TypeGraph)1 AppInfoException (com.jopdesign.common.misc.AppInfoException)1 BadGraphException (com.jopdesign.common.misc.BadGraphException)1 MethodNotFoundException (com.jopdesign.common.misc.MethodNotFoundException)1