at.dms.kjc.spacetime
Class CommunicateAddrs

java.lang.Object
  extended by at.dms.kjc.spacetime.CommunicateAddrs

public class CommunicateAddrs
extends Object

This class will generate code to allocate the off chip buffers on the necessary tiles and then communicate each buffer's global address to the tiles that need to know the address. It will also generate the typedefs for the rotating buffers and the functions that will set up the structs for rotation (a circular linked list of buffers). The structure is a circular linked list that has length equal to the rotation length of the buffer, where each entry in the list points to a component (buffer) of the rotated buffer.

It also sets the rotation length for the buffers based on the primepump schedule.

Author:
mgordon

Field Summary
static String freeFunctName
          name of the function that de-allocates the rotation buffers
static String functName
          name of the function that communicates the addresses on each tile
static String rotationSetupFunction
          name of the function that initializes the rotation structures
static String rotTypeDefPrefix
          prefix of the variable name for hte rotating buffers
 
Method Summary
static void doit(RawChip chip, SpaceTimeSchedule stSchedule)
          Generate code to allocate the off chip buffers on the necessary tiles and then communicate each buffer's global address to the tiles that need to know the address.
static String getFields(ComputeNode tile)
          Return a string of C variable declarations that we create for the given tile.
static String getFreeFunction(ComputeNode tile)
          Return for
static String getFunction(ComputeNode tile)
          For
static String getRotationTypes()
          Generate a string that has c code for the type defs for the rotating buffer types.
static String getRotSetupFunct(ComputeNode tile)
          Given a tile return C function declaration for the function that will setup the rotation structure for the buffers mapped to this tile.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rotationSetupFunction

public static String rotationSetupFunction
name of the function that initializes the rotation structures


functName

public static String functName
name of the function that communicates the addresses on each tile


freeFunctName

public static String freeFunctName
name of the function that de-allocates the rotation buffers


rotTypeDefPrefix

public static String rotTypeDefPrefix
prefix of the variable name for hte rotating buffers

Method Detail

getFields

public static String getFields(ComputeNode tile)
Return a string of C variable declarations that we create for the given tile.

Parameters:
tile - The raw tile.
Returns:
For
tile
return the fields that represent the buffers as C variable declarations.

getRotSetupFunct

public static String getRotSetupFunct(ComputeNode tile)
Given a tile return C function declaration for the function that will setup the rotation structure for the buffers mapped to this tile.

Parameters:
tile - The tile
Returns:
The c function.

getFreeFunction

public static String getFreeFunction(ComputeNode tile)
Return for
tile
return a function that will free the buffer memory.

Parameters:
tile - The tile.
Returns:
For
tile
return a function that will free the buffer memory.

getFunction

public static String getFunction(ComputeNode tile)
For
tile
return the function that will allocate the buffers or get the addresses from the static network, this function will not perform the setup of the rotation structures.

Parameters:
tile - The tile.
Returns:
For
tile
return the function that will allocate the buffers or get the addresses from the static network.

getRotationTypes

public static String getRotationTypes()
Generate a string that has c code for the type defs for the rotating buffer types.

Returns:
A string that has c code for the type defs for the rotating buffer types.

doit

public static void doit(RawChip chip,
                        SpaceTimeSchedule stSchedule)
Generate code to allocate the off chip buffers on the necessary tiles and then communicate each buffer's global address to the tiles that need to know the address. It will also generate the typedefs for the rotating buffers and the functions that will set up the structs for rotation (a circular linked list of buffers). It also sets the rotation length for the buffers based on the primepump schedule.

Parameters:
chip - The raw chip.
stSchedule - The space time schedule for the app.