|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.kjc.backendSupport.ComputeCodeStore<RawTile>
at.dms.kjc.spacetime.RawComputeCodeStore
public class RawComputeCodeStore
Repository for the compute code (SIR code that is converted to C
and mapped to the compute processor) for a tile. This class is
used by Rawify
as it visits the schedules
to generate the code that will implement the schedules.
This class includes methods to add code to the 3 different schedules
(init, primepump, steady) that are executed at each tile.
This class is then used by at.dms.kjc.spacetime.SliceIRtoC
to
convert the sir code for each tile to C code for each tile.
Field Summary | |
---|---|
static boolean |
GEN_PRESYNCH
If true, generate presynched dram commands when needed |
protected HashMap<FilterContent,RawExecutionCode> |
rawCode
this hash map holds RawExecutionCode that was generated so when we see the filter for the first time in the init and if we see the same filter again, we do not have to add the functions again |
Fields inherited from class at.dms.kjc.backendSupport.ComputeCodeStore |
---|
cleanupBlock, CODE, fields, initBlock, mainMethod, mainName, methods, myMainName, parent, steadyLoop |
Constructor Summary | |
---|---|
RawComputeCodeStore(RawTile parent)
Create a store for the compute code of tile. |
Method Summary | |
---|---|
void |
addDRAMCommand(boolean read,
SchedulingPhase whichPhase,
int bytes,
OffChipBuffer buffer,
boolean staticNet)
Add a dram command and possibly a rotation of the buffer at the current position of this code compute code for either the init stage (including primepump) or the steady state. |
void |
addDRAMGDNReadCommand(SchedulingPhase whichPhase,
int bytes,
OffChipBuffer buffer,
boolean presynched,
RawTile dest)
Add a dram read command at the current position of this code compute code for either the init stage (including primepump) or the steady state over the gdn and send it to the |
void |
addFileCommand(boolean read,
boolean init,
int words,
OffChipBuffer buffer,
boolean staticNet)
Generate a command to read or write from a file daisy-chained to a i/o port. |
void |
addFileGDNReadCommand(SchedulingPhase whichPhase,
int words,
OffChipBuffer buffer,
RawTile dest)
Generate a command to read from a file daisy-chained to a i/o port on the gdn and send the data to |
void |
addGDNFileStoreCommandWithSynch(boolean init,
int words,
OffChipBuffer buffer)
If we are generating a file command for a store over the gdn and the tile that is writing the data is different from the home tile, and we cannot use any other synchronization, we must send a word over the static network to the tile writing the data for the store from this tile to tell it that we have sent the dram command and it can begin the store. |
void |
addGDNStoreCommandWithSynch(SchedulingPhase whichPhase,
int bytes,
OffChipBuffer buffer)
If we are generating a DRAM command for a store over the gdn and the tile that is writing the data is different from the home tile, and we cannot use any other synchronization, we must send a word over the static network to the tile writing the data for the store from this tile to tell it that we have sent the dram command and it can begin the store. |
void |
addSliceInit(FilterInfo filterInfo,
Layout layout)
Add filterInfo's init stage block at the current position of the init stage for this code store. |
void |
addSlicePrimePump(FilterInfo filterInfo,
Layout layout)
Add filterInfo's prime pump block to the current position of the primepump code for this tile. |
void |
addSliceSteady(FilterInfo filterInfo,
Layout layout)
Add the code necessary to execution the filter of filterInfo at the current position in the steady-state code of this store, given the layout. |
static void |
barrier(RawChip chip,
boolean init,
boolean primepump)
Create a barrier in the init stage at this point in code generation. |
void |
disregardIncoming(IODevice dev,
int words,
boolean init)
Generate code to receive |
void |
dummyOutgoing(IODevice dev,
int words,
boolean init)
Generate code on the compute process to send over |
static void |
presynchAllDramsInInit()
This function will create a presynch read command for every dram that is used in the program and add it to the current position in the init block. |
static void |
presynchEmptyTilesInSteady()
This function will create a presynch read command for each dram that does not have a filter assigned to it but initiates DRAM commands. |
void |
sendConstToSwitch(int constant,
boolean init)
Create code on the compute processor to send constant to the switch. |
boolean |
shouldPresynch(boolean read,
SchedulingPhase whichPhase,
OffChipBuffer buffer)
Decide if a dram command should be presynched at the given time based on the command and the buffer. |
static JStatement |
sirDramCommand(boolean read,
int cacheLines,
JExpression sampleAddress,
boolean staticNet,
boolean shouldPreSynch,
JExpression address)
Return sir code that will call the macro for a dram command to transfer |
Methods inherited from class at.dms.kjc.backendSupport.ComputeCodeStore |
---|
addCleanupStatement, addField, addFields, addInitFunctionCall, addInitStatement, addInitStatementFirst, addMethod, addMethods, addSteadyLoop, addSteadyLoop, addSteadyLoopStatement, getFields, getMainFunction, getMethods, getMyMainName, hasMethod, setFields, setMethods, setMyMainName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface at.dms.kjc.sir.SIRCodeUnit |
---|
addField, addFields, addMethod, addMethods, getFields, getMethods, setFields, setMethods |
Field Detail |
---|
public static final boolean GEN_PRESYNCH
protected HashMap<FilterContent,RawExecutionCode> rawCode
Constructor Detail |
---|
public RawComputeCodeStore(RawTile parent)
parent
- Method Detail |
---|
public void addFileCommand(boolean read, boolean init, int words, OffChipBuffer buffer, boolean staticNet)
read
- True if load, false storeinit
- true if we want to append command to init stage, false steadywords
- the number of words to x-ferbuffer
- Used to get the portstaticNet
- True if static net, false gdnpublic void addFileGDNReadCommand(SchedulingPhase whichPhase, int words, OffChipBuffer buffer, RawTile dest)
dest
init
- true if we want to append command to init stage, false steadywords
- the number of words to x-ferbuffer
- Used to get the portdest
- The tile to which to send the data.public void addGDNStoreCommandWithSynch(SchedulingPhase whichPhase, int bytes, OffChipBuffer buffer)
init
- buffer
- public void addGDNFileStoreCommandWithSynch(boolean init, int words, OffChipBuffer buffer)
init
- words
- buffer
- public void dummyOutgoing(IODevice dev, int words, boolean init)
wordswords of data using a header that was already set previously.
dev
- words
- The number of dummy words to sendinit
- public void disregardIncoming(IODevice dev, int words, boolean init)
wordswords into a dummy volatile variable on the compute processor from gdn.
dev
- words
- The number of words to disregardinit
- Which schedule should be append this code to?public boolean shouldPresynch(boolean read, SchedulingPhase whichPhase, OffChipBuffer buffer)
read
- init
- primepump
- buffer
-
public void addDRAMCommand(boolean read, SchedulingPhase whichPhase, int bytes, OffChipBuffer buffer, boolean staticNet)
read
- True if we want to issue a read, false if writeinit
- true if initprimepump
- true if primepumpbytes
- The number of bytesbuffer
- The address to load/storestaticNet
- True if we want to use the static network, false if gdnpublic static JStatement sirDramCommand(boolean read, int cacheLines, JExpression sampleAddress, boolean staticNet, boolean shouldPreSynch, JExpression address)
cacheLinescache-lines from a single address
addressusing
sampleAddressto send the command to the correct dram port.
read
- True then load, false then storecacheLines
- sampleAddress
- An address that resides on the dramsstaticNet
- If true, use static net, otherwise gdnshouldPreSynch
- If true, generate a presynched commandaddress
- The address for the xfer
public void addDRAMGDNReadCommand(SchedulingPhase whichPhase, int bytes, OffChipBuffer buffer, boolean presynched, RawTile dest)
desttile. Don't rotate the buffer we are in the init stage.
init
- true if initprimepump
- true if primepump stagebytes
- The number of bytesbuffer
- The address to load/storepresynched
- True if we want all other dram commands to finish before this
one is issueddest
- The read's destination.public void addSliceSteady(FilterInfo filterInfo, Layout layout)
filterInfo
- The filter to add to the steady-state schedule.layout
- The layout of the application.public void addSlicePrimePump(FilterInfo filterInfo, Layout layout)
filterInfo
- The filter.layout
- The layout of the application.public void addSliceInit(FilterInfo filterInfo, Layout layout)
filterInfo
- The filter.layout
- The layout of the application.public static void presynchEmptyTilesInSteady()
public static void barrier(RawChip chip, boolean init, boolean primepump)
chip
- The raw chip.public static void presynchAllDramsInInit()
public void sendConstToSwitch(int constant, boolean init)
It does nothing on the switch, that is left for somewhere else.
constant
- The number to send.init
- if true add to init stage, otherwise add to steady.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |