use of com.jopdesign.common.AppSetup in project jop by jop-devel.
the class ExampleTool method main.
public static void main(String[] args) {
// setup some defaults, initialize without any per-program defaults
AppSetup setup = new AppSetup();
setup.setUsageInfo("example", "This is an example application just to show off.");
setup.setVersionInfo("The version of this whole application is 0.1");
// We do not load an (optional) config file automatically, user has to specify it explicitly
// using '@config.props' to avoid unintentional misconfiguration
// setup.setConfigFilename("example.properties");
ExampleTool example = new ExampleTool();
setup.registerTool("example", example);
setup.initAndLoad(args, true, true, true);
example.doSomething(setup.getConfig());
// write results
setup.writeClasses();
}
use of com.jopdesign.common.AppSetup in project jop by jop-devel.
the class TypeGraphTool method main.
public static void main(String[] args) {
// setup some defaults, initialize without any per-program defaults
AppSetup setup = new AppSetup();
setup.setUsageInfo("typegraph", "This is tool to examine the type graph.");
setup.setVersionInfo("The version of this whole application is 0.1");
// set the name of the (optional) user-provided config file
setup.setConfigFilename("typegraph.properties");
TypeGraphTool typeGraph = new TypeGraphTool();
setup.registerTool("typegraph", typeGraph);
AppInfo appInfo = setup.initAndLoad(args, false, true, true);
typeGraph.run(setup.getConfig());
}
use of com.jopdesign.common.AppSetup in project jop by jop-devel.
the class SuperGraphTest method main.
public static void main(String[] args) {
TestFramework testFramework = new TestFramework();
AppSetup setup = testFramework.setupAppSetup("java/tools/test/test/cg1.zip", null);
AppInfo appInfo = testFramework.setupAppInfo("wcet.devel.CallGraph1.run", true);
SuperGraphTest testInst = new SuperGraphTest();
testInst.appInfo = appInfo;
MethodInfo mainMethod = appInfo.getMainMethod();
SuperGraph sg0 = new SuperGraph(testInst, testInst.getFlowGraph(mainMethod), 0);
try {
testInst.getFlowGraph(mainMethod).exportDOT(new File("/tmp/cg1-run.dot"));
sg0.exportDOT(new File("/tmp/cg1-super0.dot"));
} catch (IOException e) {
e.printStackTrace();
}
SuperGraph sg2 = new SuperGraph(testInst, testInst.getFlowGraph(mainMethod), 2);
try {
FileWriter fw = new FileWriter("/tmp/cg1-super2.dot");
sg2.exportDOT(new File("/tmp/cg1-super2.dot"));
fw.close();
} catch (IOException e) {
e.printStackTrace();
}
}
use of com.jopdesign.common.AppSetup in project jop by jop-devel.
the class JCopter method main.
public static void main(String[] args) {
// setup some defaults
AppSetup setup = new AppSetup();
setup.setUsageInfo("jcopter", "A WCET driven Java bytecode optimizer.");
setup.setVersionInfo(VERSION);
// We do not load a config file automatically, user has to specify it explicitly to avoid
// unintentional misconfiguration
// setup.setConfigFilename(CONFIG_FILE_NAME);
DFATool dfaTool = new DFATool();
WCETTool wcetTool = new WCETTool();
JCopter jcopter = new JCopter();
wcetTool.setAvailableOptions(false, true, false, false);
setup.registerTool("dfa", dfaTool, true, false);
setup.registerTool("wca", wcetTool);
setup.registerTool("jcopter", jcopter);
setup.addSourceLineOptions(true);
setup.initAndLoad(args, true, true, true);
if (setup.useTool("dfa")) {
wcetTool.setDfaTool(dfaTool);
jcopter.setDfaTool(dfaTool);
}
jcopter.setWcetTool(wcetTool);
wcetTool.getEventHandler().setIgnoreMissingLoopBounds(!jcopter.useWCA());
// run optimizations
jcopter.optimize();
// write results
setup.writeClasses();
}
use of com.jopdesign.common.AppSetup in project jop by jop-devel.
the class WCETAnalysis method main.
public static void main(String[] args) {
// We set a different output path for this tool if invoked by cmdline
// Note that WCETTool could also override defaults, but we do not want to change the
// default value of outdir if WCETTool is invoked from another tool
Properties defaultProps = new Properties();
defaultProps.put("outdir", "java/target/wcet/${projectname}");
AppSetup setup = new AppSetup(defaultProps, false);
setup.setVersionInfo("1.0.1");
// We do not load a config file automatically, user has to specify it explicitly to avoid
// unintentional misconfiguration
// setup.setConfigFilename(CONFIG_FILE_NAME);
setup.setUsageInfo("WCETAnalysis", "WCET Analysis tool");
WCETTool wcetTool = new WCETTool();
DFATool dfaTool = new DFATool();
setup.registerTool("dfa", dfaTool, true, false);
setup.registerTool("wcet", wcetTool);
setup.addSourceLineOptions(false);
setup.initAndLoad(args, true, false, false);
if (setup.useTool("dfa")) {
wcetTool.setDfaTool(dfaTool);
}
ExecHelper exec = new ExecHelper(setup.getConfig(), Logger.getLogger(WCETTool.LOG_WCET + ".WCETAnalysis"));
exec.dumpConfig();
/* Load config */
exec.checkLibs();
/* check environment */
WCETAnalysis inst = new WCETAnalysis(wcetTool, exec);
try {
inst.run();
exec.info("Worst Case Analysis finished");
exec.info("Cumulative LP/ILP solver time: " + LpSolveWrapper.getTotalSolverTime());
exec.info("Cumulative WCET Calculation time: " + inst.totalWCETCalculationTime);
} catch (Exception e) {
exec.bail("Worst Case Analysis failed: " + e);
}
}
Aggregations