org.opencores.placement
Class RxRPlacement

java.lang.Object
  |
  +--org.opencores.placement.RxRPlacement

public class RxRPlacement
extends java.lang.Object

This algorithm tries to arrange graph nodes similarly to graph drawing algorithms. Nodes may overlap and they are placed in RxR space. Also this class contains some preplacement functions, that are based on RxR placement. After preplacement we have valid placement. Annealing uses two forces - temperature and distancing force. First nets acts like elastics and tries to approach nodes together, on the other hand nodes are distanced by the power of distancing force. Preplacement consist of three steps: - preplacement of SPCs - preplacement of GPCs - preplacement of ports


Field Summary
 int curStep
          Current step number.
 boolean done
          true if final solution was found.
private static float DONE_FACTOR
          process terminates when change is small enough
 float energy
          Current placement quality.
private static float FINAL_FORCE
          force flow definition (linear)
private static float FINAL_TEMP
          temperature flow definition (linear)
 float force
          force, that distances nodes
private  Graph g
          graph representation we are working on
private  java.util.Vector groupList
          used internally to store groups
private static float INIT_FORCE
          force flow definition (linear)
private static float INIT_TEMP
          temperature flow definition (linear)
private static float MIN_DIST
          minimum allowed distance between nodes
 int nGPC
          Number of GPCs detected by preplacement
 int nPorts
          Number of Ports detected by preplacement
 int nSPC
          Number of SPCs detected by preplacement
private static int NUM_STEPS
          number of annealing steps - temp and force is linearly interpolated
private  int[] pos
          position array, knowing number of LUTs at that position
private  float prevEnergy
          Previous (from previous step) placement quality.
 float temperature
          current annealing temperature
 java.util.Vector vna
          vector that contains all placed adders
 java.util.Vector vnl
          vector, that contains all GPCs
 
Constructor Summary
RxRPlacement(Graph g)
          Initializes RxR placement.
 
Method Summary
 void approach(float factor)
          approaches all connected nodes
 void distance(float factor)
          distances nodes, that are close together by factor
private  int distribute(NodeSPC n)
          Distributes adders by force (no nearby free column available)
 void doStep()
          does one step of simulated annealing.
private  float portDist(float x, float y, int pi)
          returns manhattan distance between specified position (x,y) and port with index pi.
 void prePlacement(SPCMap ma)
          Does preplacement.
 void prePlacementGPC()
          Assigns valid positions for GPCs.
 void prePlacementPort()
          Assigns valid positions for Ports.
 void prePlacementSPC(SPCMap ma)
          Place adders (SPCs), based on RxR placement.
 void setGraph(Graph g)
          Changes working graph.
 void zoom()
          zooms all nodes to fit onto arhitecture rectangle
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

MIN_DIST

private static final float MIN_DIST
minimum allowed distance between nodes

INIT_TEMP

private static final float INIT_TEMP
temperature flow definition (linear)

FINAL_TEMP

private static final float FINAL_TEMP
temperature flow definition (linear)

INIT_FORCE

private static final float INIT_FORCE
force flow definition (linear)

FINAL_FORCE

private static final float FINAL_FORCE
force flow definition (linear)

DONE_FACTOR

private static final float DONE_FACTOR
process terminates when change is small enough

NUM_STEPS

private static final int NUM_STEPS
number of annealing steps - temp and force is linearly interpolated

g

private Graph g
graph representation we are working on

temperature

public float temperature
current annealing temperature

force

public float force
force, that distances nodes

energy

public float energy
Current placement quality.

prevEnergy

private float prevEnergy
Previous (from previous step) placement quality.

curStep

public int curStep
Current step number.

done

public boolean done
true if final solution was found.

nSPC

public int nSPC
Number of SPCs detected by preplacement

nGPC

public int nGPC
Number of GPCs detected by preplacement

nPorts

public int nPorts
Number of Ports detected by preplacement

vna

public java.util.Vector vna
vector that contains all placed adders

groupList

private java.util.Vector groupList
used internally to store groups

vnl

public java.util.Vector vnl
vector, that contains all GPCs

pos

private int[] pos
position array, knowing number of LUTs at that position
Constructor Detail

RxRPlacement

public RxRPlacement(Graph g)
Initializes RxR placement.
Parameters:
g - graph to do placement on.
Method Detail

setGraph

public void setGraph(Graph g)
Changes working graph.
Parameters:
g - graph to work on
See Also:
Graph

approach

public void approach(float factor)
approaches all connected nodes
Parameters:
factor - attraction strength

distance

public void distance(float factor)
distances nodes, that are close together by factor
Parameters:
factor - repulsive strength

zoom

public void zoom()
zooms all nodes to fit onto arhitecture rectangle

doStep

public void doStep()
does one step of simulated annealing. This function sets done flag when done.

prePlacementSPC

public void prePlacementSPC(SPCMap ma)
Place adders (SPCs), based on RxR placement. Place them based on their .fx sequentially. Important nets have a priority. This is just a preplacement. Adders are also optimized in main SA algorithm
Parameters:
ma - mapped adders NOTE: Netlist must be mapped first.
See Also:
SPCMap

distribute

private int distribute(NodeSPC n)
Distributes adders by force (no nearby free column available)
Parameters:
n - NodeSPC to distribute
Returns:
(csize) number of actually place elements

prePlacementGPC

public void prePlacementGPC()
Assigns valid positions for GPCs. This placement is improved by main SA placement.

prePlacementPort

public void prePlacementPort()
Assigns valid positions for Ports. This placement is improved by main SA placement.

portDist

private float portDist(float x,
                       float y,
                       int pi)
returns manhattan distance between specified position (x,y) and port with index pi. Ports are arranged: {(0..X-1,0),(0..X-1,Y-1),(0,0..Y-1),(X-1,0..Y-1)}
Parameters:
x - x position
y - y position
pi - port index
Returns:
manhattan distance

prePlacement

public void prePlacement(SPCMap ma)
Does preplacement.
Parameters:
ma - mapped adders
See Also:
prePlacementGPC, prePlacementSPC, NOTE: Netlist must be mapped first., org.opencores.mapping.Adders