org.opencores.structure
Class Graph

java.lang.Object
  |
  +--org.opencores.structure.Graph

public class Graph
extends java.lang.Object

Graph, that holds all nodes and nets.


Field Summary
 NetGlobal[] global
          all global nets
 boolean mapped
          specifies if graph has been mapped
 java.lang.String name
          graph name
 java.util.Vector nets
          all the nets
 java.util.Vector nodes
          all the nodes
 NodeRoutable[][] pos
          Nodes by position.
 NodeSR[] SR
          special resources
 
Constructor Summary
Graph()
          Constructs new empty graph.
 
Method Summary
 void calcPositions()
          Calculates positions (.x, .y) of IndexedNodes
 int check(boolean report)
          checks graph for possible annomalies (unidirected lines) and can posts warnings.
 void clearNodes()
          Sets all segments costs to MAX_VALUE.
 void constructSegments()
          Constructs neighb field of all NodeRoutable nodes.
 void createFloatPositions()
          copies (x,y) to (fx,fy) suitable for display
 void emtpySegments()
          Empty all channel segments, and allocates those (on perimeter) that cannon be used.
 int repair(boolean report)
          repairs graph, removing floating nodes and nets
 void setRandomPositions(int X, int Y)
          sets random values for x from 0..X-1 and y from 0..Y-1
 java.lang.String toString()
          outputs graph to String
 java.lang.String toString(java.lang.String comment)
          outputs graph to String
 void writeBitstream(BitStreamWriter stream, boolean clear)
          Writes (necessary) bistream representation of this object to stream.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

name

public java.lang.String name
graph name

nodes

public java.util.Vector nodes
all the nodes

nets

public java.util.Vector nets
all the nets

global

public NetGlobal[] global
all global nets

pos

public NodeRoutable[][] pos
Nodes by position. Not initialized on start.
See Also:
costructSegments

SR

public NodeSR[] SR
special resources

mapped

public boolean mapped
specifies if graph has been mapped
Constructor Detail

Graph

public Graph()
Constructs new empty graph.
Method Detail

constructSegments

public void constructSegments()
Constructs neighb field of all NodeRoutable nodes.

clearNodes

public void clearNodes()
Sets all segments costs to MAX_VALUE.

emtpySegments

public void emtpySegments()
Empty all channel segments, and allocates those (on perimeter) that cannon be used.

toString

public java.lang.String toString()
outputs graph to String
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.lang.String comment)
outputs graph to String
Parameters:
comment - graph comment

setRandomPositions

public void setRandomPositions(int X,
                               int Y)
sets random values for x from 0..X-1 and y from 0..Y-1
Parameters:
X - maximum horizontal position
Y - maximum vertical position

check

public int check(boolean report)
checks graph for possible annomalies (unidirected lines) and can posts warnings.
Parameters:
report - reports warnings to Conf.log if true
Returns:
number of warnings

repair

public int repair(boolean report)
repairs graph, removing floating nodes and nets
Parameters:
report - reports warnings to Conf.log if true
Returns:
number of repaired annomalies

createFloatPositions

public void createFloatPositions()
copies (x,y) to (fx,fy) suitable for display

calcPositions

public void calcPositions()
Calculates positions (.x, .y) of IndexedNodes

writeBitstream

public void writeBitstream(BitStreamWriter stream,
                           boolean clear)
                    throws java.io.IOException
Writes (necessary) bistream representation of this object to stream. This method should be called after routing
Parameters:
stream - stream to write to
clear - whether should reset unused elements