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);
}
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);
}
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);
}
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));
}
}
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();
}
Aggregations