use of org.eclipse.elk.alg.layered.intermediate.loops.SelfHyperLoop in project elk by eclipse.
the class RoutingSlotAssigner method computeLoopActivity.
/**
* Initializes {@link #slLoopActivityOverPorts}. Each loop is mapped to an array indexed by port indices indicating
* whether the loop runs along the given port or not.
*/
private void computeLoopActivity(final SelfLoopHolder slHolder) {
List<SelfHyperLoop> slLoops = slHolder.getSLHyperLoops();
List<LPort> lPorts = slHolder.getLNode().getPorts();
for (SelfHyperLoop slLoop : slLoops) {
boolean[] loopActivity = new boolean[lPorts.size()];
slLoopActivityOverPorts.put(slLoop, loopActivity);
// Run from the loop's start port to the end port, possibly wrapping around, and set everything to true
// along the way
int lPortIdx = slLoop.getLeftmostPort().getLPort().id - 1;
int lPortTargetIdx = slLoop.getRightmostPort().getLPort().id;
while (lPortIdx != lPortTargetIdx) {
lPortIdx = (lPortIdx + 1) % lPorts.size();
loopActivity[lPortIdx] = true;
}
}
}
use of org.eclipse.elk.alg.layered.intermediate.loops.SelfHyperLoop in project elk by eclipse.
the class PortRestorer method processTwoSideOpposingLoops.
private void processTwoSideOpposingLoops() {
for (SelfHyperLoop slLoop : slLoopsByType.get(SelfLoopType.TWO_SIDES_OPPOSING)) {
// Sort the port sides such that they follow a clockwise order
PortSide[] sides = sortedTwoSideLoopPortSides(slLoop);
// We prepend to the start side's end area, and append to the target side's start area
addToTargetArea(slLoop, sides[0], PortSideArea.END, AddMode.PREPEND);
addToTargetArea(slLoop, sides[1], PortSideArea.START, AddMode.APPEND);
}
}
use of org.eclipse.elk.alg.layered.intermediate.loops.SelfHyperLoop in project elk by eclipse.
the class PortRestorer method processTwoSideCornerLoops.
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Self Loop Placement (Two Sides)
private void processTwoSideCornerLoops() {
for (SelfHyperLoop slLoop : slLoopsByType.get(SelfLoopType.TWO_SIDES_CORNER)) {
// Sort the port sides such that they follow a clockwise order
PortSide[] sides = sortedTwoSideLoopPortSides(slLoop);
// Add the ports to their target area
addToTargetArea(slLoop, sides[0], PortSideArea.END, AddMode.PREPEND);
addToTargetArea(slLoop, sides[1], PortSideArea.START, AddMode.APPEND);
}
}
Aggregations