use of com.jopdesign.wcet.ipet.IPETConfig in project jop by jop-devel.
the class CachePersistenceAnalysis method computeMissOnceCost.
/**
* Analyze the cost for loading each distinct tag in the given segment at most once.
* This can also be used to count the number of distinct tags (given each tag the cost of 1),
* or the number of cache blocks for the variable block method cache (given each tag a cost
* equal to the number of cache blocks it needs)
* @param segment the segment to analyze
* @param accessEdges cache access edges partitioned by tag
* @param costModel
* @param useILP use integer variables (more expensive, more accurate)
* @param analysisKey
* @param wcetTool
* @return
* @throws InvalidFlowFactException
* @throws LpSolveException
*/
protected <T> long computeMissOnceCost(Segment segment, Iterable<Entry<T, List<SuperGraphEdge>>> partition, F1<SuperGraphEdge, Long> costModel, boolean useILP, String analysisKey, WCETTool wcetTool) throws InvalidFlowFactException, LpSolveException {
IPETConfig ipetConfig = new IPETConfig(wcetTool.getConfig());
String problemKey = GlobalAnalysis.formatProblemName(analysisKey, segment.getEntryCFGs().toString());
/* create an global IPET problem for the supergraph */
IPETSolver<SuperGraphEdge> ipetSolver = GlobalAnalysis.buildIpetProblem(wcetTool, problemKey, segment, ipetConfig);
/* add persistence constraints */
addPersistenceSegmentConstraints(segment, partition, ipetSolver, costModel, analysisKey);
/* Solve */
double lpCost = ipetSolver.solve(null, useILP);
long maxCacheCost = (long) (lpCost + 0.5);
return maxCacheCost;
}
use of com.jopdesign.wcet.ipet.IPETConfig in project jop by jop-devel.
the class ObjectCacheAnalysis method computeCacheCost.
/**
* Compute object cache cost for the given persistence segment
* @param segment the segment to consider
* @param usedRefs DFA result: the set of objects a reference might point to during one execution
* of the segment
* @param costModel The object cost model to use
* @param usedSetOut <b>out</b> set of all symbolic objects names in the segment (pass in empty set)
* @return the object cache cost for the specified segment
* @throws InvalidFlowFactException
* @throws LpSolveException
*/
private ObjectCacheCost computeCacheCost(Segment segment, LocalPointsToResult usedRefs, ObjectCacheCostModel costModel, HashSet<SymbolicAddress> usedSetOut) throws InvalidFlowFactException, LpSolveException {
/* create an ILP graph for all reachable methods */
String key = GlobalAnalysis.formatProblemName(KEY, segment.getEntryCFGs().toString());
IPETSolver<SuperGraphEdge> ipetSolver = GlobalAnalysis.buildIpetProblem(project, key, segment, new IPETConfig(project.getConfig()));
ObjectCacheIPETModel ocim = addObjectCacheCostEdges(segment, usedRefs, costModel, ipetSolver);
/* solve */
double lpCost;
Map<SuperGraphEdge, Long> flowMap = new HashMap<SuperGraphEdge, Long>();
lpCost = ipetSolver.solve(flowMap, true);
long cost = (long) (lpCost + 0.5);
return extractCost(segment, cost, flowMap, ocim.accessCostInfo, costModel, ocim.refMissEdges, ocim.blockMissEdges);
}
use of com.jopdesign.wcet.ipet.IPETConfig in project jop by jop-devel.
the class WCETAnalysis method runWCETAnalysis.
private boolean runWCETAnalysis(MethodInfo targetMethod) {
/* Run */
ipetConfig = new IPETConfig(config);
try {
/* Analysis */
/* some metrics and some cheap analyses for comparison and
* report logging (not supported by global/uppaal at the moment) */
runMetrics(targetMethod);
if (wcetTool.getProjectConfig().doBlockingTimeAnalysis()) {
runBlockingTimeAnalysis(targetMethod);
}
exec.info("Starting precise WCET analysis");
/* uppaal */
if (wcetTool.getProjectConfig().useUppaal()) {
runUppaal(targetMethod);
} else /* global IPET */
{
runGlobal(targetMethod);
}
exec.info("WCET analysis finished: " + wcet);
/* report generation */
return generateReport();
} catch (Exception e) {
exec.logException("analysis", e);
return false;
}
}
use of com.jopdesign.wcet.ipet.IPETConfig in project jop by jop-devel.
the class WCAInvoker method initAnalysis.
public void initAnalysis(boolean useMethodCacheStrategy) {
IPETConfig ipetConfig = new IPETConfig(wcetTool.getConfig());
RecursiveStrategy<AnalysisContextLocal, WcetCost> strategy;
if (useMethodCacheStrategy) {
strategy = analyses.getMethodCacheAnalysis().createRecursiveStrategy(wcetTool, ipetConfig, cacheApproximation);
} else {
if (cacheApproximation.needsInterProcIPET()) {
strategy = new GlobalAnalysis.GlobalIPETStrategy(ipetConfig);
} else {
strategy = new LocalAnalysis(wcetTool, ipetConfig);
}
}
recursiveAnalysis = new RecursiveWcetAnalysis<AnalysisContextLocal>(wcetTool, ipetConfig, strategy);
// Perform initial analysis
runAnalysis(wcetTool.getCallGraph().getReversedGraph());
updateWCEP();
}
Aggregations