Search in sources :

Example 1 with ExecutionEdge

use of com.jopdesign.wcet.ipet.IPETBuilder.ExecutionEdge in project jop by jop-devel.

the class IPETUtils method infeasibleEdgeConstraints.

/**
 * Compute flow constraints: Infeasible edge constraints
 *
 * @param g   the flow graph
 * @param ctx the invocation context
 * @return A list of flow constraints
 */
public static <C extends CallStringProvider> List<LinearConstraint<ExecutionEdge>> infeasibleEdgeConstraints(ControlFlowGraph g, IPETBuilder<C> ctx) {
    List<LinearConstraint<ExecutionEdge>> constraints = new ArrayList<LinearConstraint<ExecutionEdge>>();
    // -- edge = 0
    for (CFGEdge edge : ctx.getWCETTool().getInfeasibleEdges(g, ctx.getCallString())) {
        LinearConstraint<ExecutionEdge> infeasibleConstraint = new LinearConstraint<ExecutionEdge>(ConstraintType.Equal);
        infeasibleConstraint.addLHS(ctx.newEdge(edge));
        infeasibleConstraint.addRHS(0);
        constraints.add(infeasibleConstraint);
    }
    return constraints;
}
Also used : ArrayList(java.util.ArrayList) ExecutionEdge(com.jopdesign.wcet.ipet.IPETBuilder.ExecutionEdge) CFGEdge(com.jopdesign.common.code.ControlFlowGraph.CFGEdge)

Aggregations

CFGEdge (com.jopdesign.common.code.ControlFlowGraph.CFGEdge)1 ExecutionEdge (com.jopdesign.wcet.ipet.IPETBuilder.ExecutionEdge)1 ArrayList (java.util.ArrayList)1