Search in sources :

Example 6 with OptionGroup

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

the class PhaseExecutor method dumpCallgraph.

/////////////////////////////////////////////////////////////////////////////////////
// Dump Callgraph
/////////////////////////////////////////////////////////////////////////////////////
public void dumpCallgraph(String graphName) {
    if (getDebugConfig().getOption(DUMP_CALLGRAPH) == CallGraph.DUMPTYPE.off && getDebugConfig().getOption(DUMP_JVM_CALLGRAPH) == CallGraph.DUMPTYPE.off) {
        return;
    }
    try {
        // Dumping the full graph is a bit much, we split it into several graphs
        Set<ExecutionContext> appRoots = new LinkedHashSet<ExecutionContext>();
        Set<ExecutionContext> jvmRoots = new LinkedHashSet<ExecutionContext>();
        Set<ExecutionContext> clinitRoots = new LinkedHashSet<ExecutionContext>();
        Set<String> jvmClasses = new LinkedHashSet<String>();
        if (appInfo.getProcessorModel() != null) {
            jvmClasses.addAll(appInfo.getProcessorModel().getJVMClasses());
            jvmClasses.addAll(appInfo.getProcessorModel().getNativeClasses());
        }
        CallGraph graph = appInfo.getCallGraph();
        for (ExecutionContext ctx : graph.getRootNodes()) {
            if (ctx.getMethodInfo().getMethodSignature().equals(ClinitOrder.clinitSig)) {
                clinitRoots.add(ctx);
            } else if (jvmClasses.contains(ctx.getMethodInfo().getClassName())) {
                jvmRoots.add(ctx);
            } else if (appInfo.isJVMThread(ctx.getMethodInfo().getClassInfo())) {
                // This is to add Runnables like Scheduler and RtThread to the JVM classes.
                jvmRoots.add(ctx);
            } else {
                appRoots.add(ctx);
            }
        }
        OptionGroup debug = getDebugConfig();
        // TODO to keep the CG size down, we could add options to exclude methods (like '<init>') or packages
        // from dumping and skip dumping methods reachable only over excluded methods
        graph.dumpCallgraph(getConfig(), graphName, "app", appRoots, debug.getOption(DUMP_CALLGRAPH), false);
        graph.dumpCallgraph(getConfig(), graphName, "clinit", clinitRoots, debug.getOption(DUMP_CALLGRAPH), false);
        graph.dumpCallgraph(getConfig(), graphName, "jvm", jvmRoots, debug.getOption(DUMP_JVM_CALLGRAPH), !debug.getOption(DUMP_NOIM_CALLS));
    } catch (IOException e) {
        throw new AppInfoError("Unable to export to .dot file", e);
    }
}
Also used : LinkedHashSet(java.util.LinkedHashSet) ExecutionContext(com.jopdesign.common.code.ExecutionContext) OptionGroup(com.jopdesign.common.config.OptionGroup) CallGraph(com.jopdesign.common.code.CallGraph) IOException(java.io.IOException) AppInfoError(com.jopdesign.common.misc.AppInfoError)

Example 7 with OptionGroup

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

the class PhaseExecutor method registerOptions.

public static void registerOptions(Config config) {
    OptionGroup options = config.getOptions();
    CallGraph.registerOptions(config);
    // Add phase options
    // .. nothing to configure yet ..
    // add debug options
    config.getDebugGroup().addOptions(debugOptions);
    // Add options of all used optimizations
    OptionGroup opt = options.getGroup(GROUP_OPTIMIZE);
    opt.addOptions(optimizeOptions);
    opt.addOptions(UnusedCodeRemover.optionList);
    OptionGroup greedy = options.getGroup(GROUP_GREEDY);
    GreedyConfig.registerOptions(greedy);
    OptionGroup inline = options.getGroup(GROUP_INLINE);
    InlineConfig.registerOptions(inline);
}
Also used : OptionGroup(com.jopdesign.common.config.OptionGroup)

Example 8 with OptionGroup

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

the class JCopter method registerOptions.

@Override
public void registerOptions(Config config) {
    OptionGroup options = config.getOptions();
    JCopterConfig.registerOptions(options);
    // TODO add options/profiles/.. to this so that only a subset of
    //      optimizations/analyses are initialized ? Overwrite PhaseExecutor for this?
    //      Or user simply uses phaseExecutor directly
    PhaseExecutor.registerOptions(config);
}
Also used : OptionGroup(com.jopdesign.common.config.OptionGroup)

Example 9 with OptionGroup

use of com.jopdesign.common.config.OptionGroup 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)

Aggregations

OptionGroup (com.jopdesign.common.config.OptionGroup)9 Config (com.jopdesign.common.config.Config)2 JOPConfig (com.jopdesign.common.processormodel.JOPConfig)2 IPETConfig (com.jopdesign.wcet.ipet.IPETConfig)2 ReportConfig (com.jopdesign.wcet.report.ReportConfig)2 UppAalConfig (com.jopdesign.wcet.uppaal.UppAalConfig)2 CallGraph (com.jopdesign.common.code.CallGraph)1 ExecutionContext (com.jopdesign.common.code.ExecutionContext)1 AppInfoError (com.jopdesign.common.misc.AppInfoError)1 IOException (java.io.IOException)1 LinkedHashSet (java.util.LinkedHashSet)1