at.dms.kjc.spacetime
Class RawChip

java.lang.Object
  extended by at.dms.kjc.spacetime.RawProcElements
      extended by at.dms.kjc.spacetime.RawChip
All Implemented Interfaces:
ComputeNodesI<RawComputeCodeStore>

public class RawChip
extends RawProcElements
implements ComputeNodesI<RawComputeCodeStore>

This class represents the raw chip to which we are compiling. This class tries to deal with the collection of RAW tiles. See RawProcElements for dealing with I/O devices, and dealing with geometry that could include I/O devices as well as tiles.

Author:
mgordon

Field Summary
static int cacheLineBytes
           
static int cacheLineWords
           
static String ConstructDynHdr
          the name of the function that constructs dynamic headers in raw.h
static int DRAM_GDN_DATA_OPCODE
          the opcode that for a packet of data for the dram send over the gdn
static int MAX_GDN_PKT_SIZE
          the maximum packet size of a gdn packet (not including the header)
 
Fields inherited from class at.dms.kjc.spacetime.RawProcElements
devices, gXSize, gYSize, tiles
 
Constructor Summary
RawChip(int size)
          Create a RawChip and its associated RawTiles given a total number of tiles.
RawChip(int xSize, int ySize)
          Initialize a
 
Method Summary
 boolean canAllocateNewComputeNode()
          Does this implementation have dynamic creation of new nodes or are all nodes statically allocated.
 int computingTiles()
          Returns the numbers of tiles of the raw chip that have compute code at the given tile
 RawTile getNthComputeNode(int n)
          Get the nth element of the collection of compute nodes.
 RawTile getTile(int tileNumber)
           
 RawTile getTile(int x, int y)
           
 RawTile getTile(RawTile tile, char dir)
          Get the tile that is at the specified
 int getTotalTiles()
           
 boolean isValidComputeNodeNumber(int tileNum)
          Does a number correspond to a compute node?
 int newComputeNode()
          Create a new compute node if compute nodes are dynamically creatable.
 void printChip()
           
 int size()
          Return the (current) number of compute nodes.
 
Methods inherited from class at.dms.kjc.spacetime.RawProcElements
areNeighbors, getComputeNode, getDevices, getDirection, getIPort, getIPort2, getNumDev, getOPort, getOPort2, getXDir, getXSize, getYDir, getYSize, manhattanDistance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cacheLineBytes

public static final int cacheLineBytes
See Also:
Constant Field Values

cacheLineWords

public static final int cacheLineWords
See Also:
Constant Field Values

ConstructDynHdr

public static final String ConstructDynHdr
the name of the function that constructs dynamic headers in raw.h

See Also:
Constant Field Values

MAX_GDN_PKT_SIZE

public static final int MAX_GDN_PKT_SIZE
the maximum packet size of a gdn packet (not including the header)

See Also:
Constant Field Values

DRAM_GDN_DATA_OPCODE

public static final int DRAM_GDN_DATA_OPCODE
the opcode that for a packet of data for the dram send over the gdn

See Also:
Constant Field Values
Constructor Detail

RawChip

public RawChip(int xSize,
               int ySize)
Initialize a
xSize
x
ySize
raw chip.

Parameters:
xSize -
ySize -

RawChip

public RawChip(int size)
Create a RawChip and its associated RawTiles given a total number of tiles.

Parameters:
size - number of tiles, in a square array.
Method Detail

isValidComputeNodeNumber

public boolean isValidComputeNodeNumber(int tileNum)
Description copied from interface: ComputeNodesI
Does a number correspond to a compute node?

Specified by:
isValidComputeNodeNumber in interface ComputeNodesI<RawComputeCodeStore>
Parameters:
tileNum - number to check
Returns:
true if a valid compute node number, false otherwise.

getTile

public RawTile getTile(int tileNumber)

getNthComputeNode

public RawTile getNthComputeNode(int n)
Description copied from interface: ComputeNodesI
Get the nth element of the collection of compute nodes.

Specified by:
getNthComputeNode in interface ComputeNodesI<RawComputeCodeStore>

getTile

public RawTile getTile(int x,
                       int y)

getTotalTiles

public int getTotalTiles()

size

public int size()
Description copied from interface: ComputeNodesI
Return the (current) number of compute nodes.

Specified by:
size in interface ComputeNodesI<RawComputeCodeStore>
Returns:
size of collection of compute nodes.

canAllocateNewComputeNode

public boolean canAllocateNewComputeNode()
Description copied from interface: ComputeNodesI
Does this implementation have dynamic creation of new nodes or are all nodes statically allocated.

Specified by:
canAllocateNewComputeNode in interface ComputeNodesI<RawComputeCodeStore>
Returns:
if false, ComputeNodesI.newComputeNode() may throw any throwable.

newComputeNode

public int newComputeNode()
Description copied from interface: ComputeNodesI
Create a new compute node if compute nodes are dynamically creatable.

Specified by:
newComputeNode in interface ComputeNodesI<RawComputeCodeStore>
Returns:
unique number for the new compute node, usable with #getComputeNode(int).

computingTiles

public int computingTiles()
Returns the numbers of tiles of the raw chip that have compute code at the given tile


getTile

public RawTile getTile(RawTile tile,
                       char dir)
Get the tile that is at the specified
dir
from
tile
.

Parameters:
tile -
dir - 'N', 'S', 'W', 'E'
Returns:
the tile

printChip

public void printChip()