org.opencores.structure
Class NodeSPC

java.lang.Object
  |
  +--org.opencores.structure.Node
        |
        +--org.opencores.structure.IndexedNode
              |
              +--org.opencores.structure.NodeSPC

public class NodeSPC
extends IndexedNode

SPC, consisting of Conf.ADD_GROUP_SIZE full adders ports:

0 A0 1 B0

2 A1 3 B1

4 A2 5 B2

6 A3 7 B3

8 CIN 9 S0

10 S1 11 S2

12 S3 13 COUT


Field Summary
static int CARRY_IN_PORT
          index of carry input port
static int CARRY_OUT_PORT
          index of carry ouput port
 NodeSPC group
          first adder of the group
 NodeSPC next
          adder this one passes carry
static int NINPUTS
          number of inputs, they must be listed first in ports
 NodeSPC prev
          adder this one receives carry
 
Fields inherited from class org.opencores.structure.IndexedNode
idx
 
Fields inherited from class org.opencores.structure.Node
dir, flag, fx, fy, INOUT, INPUT, link, name, nfx, nfy, OUTPUT, ports, temp, visited, weight, width, x, y
 
Constructor Summary
NodeSPC()
          constructs new adder
NodeSPC(NodeAdd group, NetGlobal fillWith)
          creates 4bit adder from four NodeAdds, looking at .next.
NodeSPC(NodeAdd a0, NodeAdd a1, NodeAdd a2, NodeAdd a3)
          constructs new 4b adder from four full adders
 
Method Summary
 java.lang.Object clone()
          creates new (unlinked) node with same parameters.
 void duplicate(NodeAdd n)
          duplicates parameters from n to this
static int indexOf(int x, int y)
          returns index in array, based on position in matrix
 int posX()
          Returns its x position.
static int posX(int idx)
          returns SPCs x position.
 int posY()
          returns its y position
static int posY(int idx)
          returns SPCs y position.
 java.lang.String toString()
           
 
Methods inherited from class org.opencores.structure.Node
duplicate, linkNets, setWidth, unlinkNets
 
Methods inherited from class java.lang.Object
, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

NINPUTS

public static final int NINPUTS
number of inputs, they must be listed first in ports

CARRY_IN_PORT

public static final int CARRY_IN_PORT
index of carry input port

CARRY_OUT_PORT

public static final int CARRY_OUT_PORT
index of carry ouput port

prev

public NodeSPC prev
adder this one receives carry

next

public NodeSPC next
adder this one passes carry

group

public NodeSPC group
first adder of the group
Constructor Detail

NodeSPC

public NodeSPC()
constructs new adder

NodeSPC

public NodeSPC(NodeAdd a0,
               NodeAdd a1,
               NodeAdd a2,
               NodeAdd a3)
constructs new 4b adder from four full adders

NodeSPC

public NodeSPC(NodeAdd group,
               NetGlobal fillWith)
creates 4bit adder from four NodeAdds, looking at .next. Some output ports can remain null.
Parameters:
group - lowest bit full adder
fillWith - this global net is linked with unused inputs
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class Node

clone

public java.lang.Object clone()
creates new (unlinked) node with same parameters.
Returns:
duplicated node
Overrides:
clone in class Node

duplicate

public void duplicate(NodeAdd n)
duplicates parameters from n to this
Parameters:
n - node to copy data from

posX

public static int posX(int idx)
returns SPCs x position.
Parameters:
idx - SPC index
Returns:
x position

posY

public static int posY(int idx)
returns SPCs y position.
Parameters:
idx - SPC index
Returns:
y position

posX

public int posX()
Returns its x position.
Returns:
x position
Overrides:
posX in class IndexedNode

posY

public int posY()
returns its y position
Returns:
y position
Overrides:
posY in class IndexedNode

indexOf

public static int indexOf(int x,
                          int y)
returns index in array, based on position in matrix
Parameters:
x - x position
y - y position
Returns:
array index