Search in sources :

Example 1 with OptionGroup

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

the class JCopter method onSetupAppInfo.

@Override
public void onSetupAppInfo(AppSetup setup, AppInfo appInfo) throws BadConfigurationException {
    OptionGroup options = setup.getConfig().getOptions();
    config.initialize();
    executor = new PhaseExecutor(this, options);
}
Also used : OptionGroup(com.jopdesign.common.config.OptionGroup)

Example 2 with OptionGroup

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

the class JCopter method onSetupConfig.

@Override
public void onSetupConfig(AppSetup setup) throws Config.BadConfigurationException {
    OptionGroup options = setup.getConfig().getOptions();
    config = new JCopterConfig(options);
    // Silence the CFG.. We know that ATHROW is bad.
    ControlFlowGraph.setIgnoreATHROW(true);
}
Also used : OptionGroup(com.jopdesign.common.config.OptionGroup)

Example 3 with OptionGroup

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

the class JOPConfig method registerOptions.

public static void registerOptions(Config configData) {
    OptionGroup jopConfig = getOptions(configData);
    jopConfig.addOptions(jopOptions);
}
Also used : OptionGroup(com.jopdesign.common.config.OptionGroup)

Example 4 with OptionGroup

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

the class WCETTool method recordResult.

/* recording for scripted evaluation */
public void recordResult(WcetCost wcet, double timeDiff, double solverTime) {
    if (resultRecord == null)
        return;
    Config c = projectConfig.getConfig();
    OptionGroup o = JOPConfig.getOptions(c);
    if (projectConfig.addPerformanceResults()) {
        recordCVS("wcet", "ipet", wcet, timeDiff, solverTime, o.getOption(JOPConfig.CACHE_IMPL), o.getOption(JOPConfig.CACHE_SIZE_WORDS), o.getOption(JOPConfig.CACHE_BLOCKS), c.getOption(IPETConfig.STATIC_CACHE_APPROX), c.getOption(IPETConfig.ASSUME_MISS_ONCE_ON_INVOKE));
    } else {
        recordCVS("wcet", "ipet", wcet, o.getOption(JOPConfig.CACHE_IMPL), o.getOption(JOPConfig.CACHE_SIZE_WORDS), o.getOption(JOPConfig.CACHE_BLOCKS), c.getOption(IPETConfig.STATIC_CACHE_APPROX), c.getOption(IPETConfig.ASSUME_MISS_ONCE_ON_INVOKE));
    }
}
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 5 with OptionGroup

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

the class AppSetup method printUsage.

public void printUsage() {
    String optionDesc;
    OptionGroup options = config.getOptions();
    if (optionSyntax != null) {
        optionDesc = " " + optionSyntax;
    } else {
        optionDesc = " [@<propertyfile>] <options>";
        if (options.hasCommands()) {
            optionDesc += " <cmd> <cmd-options>";
        }
        if (handleAppInfoInit) {
            optionDesc += " [--] [<main-method> [<additional-roots>]]";
        }
    }
    System.out.print("Usage: " + (programName != null ? programName : ""));
    System.out.println(optionDesc);
    System.out.println();
    if (usageDescription != null && !"".equals(usageDescription)) {
        System.out.println(usageDescription);
        System.out.println();
    }
    System.out.println("Available options:");
    for (Option<?> option : options.availableOptions()) {
        System.out.println(option.toString(config.getDefaultIndent(), options));
    }
    System.out.println();
    // TODO this does not handle sub-subgroups
    for (String name : options.availableSubgroups()) {
        System.out.println("Options in group " + name + ":");
        OptionGroup group = options.getGroup(name);
        for (Option<?> option : group.availableOptions()) {
            System.out.println(option.toString(config.getDefaultIndent(), group));
        }
        System.out.println();
    }
    System.out.println("The @<filename> syntax can be used multiple times. Entries in the property-file");
    System.out.println("overwrite previous options and can be overwritten by successive options.");
    System.out.println("Every property-file can contain additional log4j configuration options.");
    System.out.println();
    if (config.hasOption(Config.MAIN_METHOD_NAME)) {
        System.out.println("If '--" + Config.MAIN_METHOD_NAME.getKey() + "' specifies a fully-qualified method name, <main-method> is optional.");
    }
    if (loadSystemProps && configFilename != null) {
        System.out.println("Config values can be set in the JVM system properties and in '" + configFilename + "'");
        System.out.println("in the working directory.");
    } else if (configFilename != null) {
        System.out.println("Config values can be set in '" + configFilename + "' in the working directory.");
    } else if (loadSystemProps) {
        System.out.println("Config values can be set in the JVM system properties.");
    }
    System.out.println();
}
Also used : OptionGroup(com.jopdesign.common.config.OptionGroup)

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