Search in sources :

Example 1 with ObjectCacheCost

use of com.jopdesign.wcet.jop.ObjectCache.ObjectCacheCost in project jop by jop-devel.

the class ObjectCacheAnalysis method addMissOnceCost.

/**
	 * Add miss once cost: for each method cache persistence segment, add maximum miss cost to the segment entries
	 * @param segment
	 * @param ipetSolver
	 * @param checks
	 * @throws LpSolveException 
	 * @throws InvalidFlowFactException 
	 */
@Override
public Set<SuperGraphEdge> addMissOnceCost(Segment segment, IPETSolver<SuperGraphEdge> ipetSolver, EnumSet<PersistenceCheck> checks) throws InvalidFlowFactException, LpSolveException {
    Set<SuperGraphEdge> missCostEdges = new HashSet<SuperGraphEdge>();
    Set<SuperGraphNode> alwaysMissNodes = new HashSet<SuperGraphNode>();
    Collection<Segment> cover = findPersistenceSegmentCover(segment, EnumSet.allOf(PersistenceCheck.class), false, alwaysMissNodes);
    int tag = 0;
    for (Segment persistenceSegment : cover) {
        tag++;
        /* Compute cost for persistence segment */
        HashSet<SymbolicAddress> usedSetOut = new HashSet<SymbolicAddress>();
        ObjectCacheCost cost = computeCacheCost(persistenceSegment, getUsedRefs(persistenceSegment), objectCache.getCostModel(), usedSetOut);
        WCETTool.logger.info("O$-addMissOnceCost: " + cost.toString());
        F1<SuperGraphEdge, Long> costModel = MiscUtils.const1(cost.getCost());
        Set<SuperGraphEdge> costEdges = addFixedCostEdges(persistenceSegment.getEntryEdges(), ipetSolver, costModel, KEY + "_miss_once", tag);
        missCostEdges.addAll(costEdges);
    }
    AccessCostInfo alwaysMissAccessInfo = extractAccessesAndCosts(alwaysMissNodes, null, objectCache.getCostModel());
    missCostEdges.addAll(addStaticCost(segment, alwaysMissAccessInfo, ipetSolver));
    return missCostEdges;
}
Also used : ObjectCacheCost(com.jopdesign.wcet.jop.ObjectCache.ObjectCacheCost) Segment(com.jopdesign.common.code.Segment) AccessCostInfo(com.jopdesign.wcet.analysis.cache.ObjectCacheAnalysis.AccessCostInfo) SuperGraphEdge(com.jopdesign.common.code.SuperGraph.SuperGraphEdge) SuperGraphNode(com.jopdesign.common.code.SuperGraph.SuperGraphNode) SymbolicAddress(com.jopdesign.dfa.analyses.SymbolicAddress) HashSet(java.util.HashSet)

Aggregations

Segment (com.jopdesign.common.code.Segment)1 SuperGraphEdge (com.jopdesign.common.code.SuperGraph.SuperGraphEdge)1 SuperGraphNode (com.jopdesign.common.code.SuperGraph.SuperGraphNode)1 SymbolicAddress (com.jopdesign.dfa.analyses.SymbolicAddress)1 AccessCostInfo (com.jopdesign.wcet.analysis.cache.ObjectCacheAnalysis.AccessCostInfo)1 ObjectCacheCost (com.jopdesign.wcet.jop.ObjectCache.ObjectCacheCost)1 HashSet (java.util.HashSet)1