|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.kjc.spacedynamic.Simulator
public abstract class Simulator
Field Summary | |
---|---|
protected HashMap<FlatNode,JoinerScheduleNode> |
currentJoinerCode
the curent node in the joiner schedule we are working on |
HashMap<FlatNode,JoinerScheduleNode> |
initJoinerCode
FlatNode->JoinerScheduleNode, the receiving/sending schedule for the joiner for init |
HashMap<Object,StringBuffer> |
initSchedules
ComputeNode->StringBuffer, the init switch schedule for this tile |
protected boolean |
initSimulation
true if we are simulating the init schedule |
protected HashMap<FlatNode,JoinerScheduleNode> |
joinerCode
the current joiner code we are working on (steady or init) |
protected JoinerSimulator |
joinerSimulator
joinerSimulator gives the receiving schedule for each joiner |
protected Layout |
layout
|
protected RawChip |
rawChip
|
protected SpdStaticStreamGraph |
ssg
|
HashMap<FlatNode,JoinerScheduleNode> |
steadyJoinerCode
FlatNode->JoinerScheduleNode, the receiving/sending schedule for the joiner for steady |
HashMap<Object,StringBuffer> |
steadySchedules
ComputeNode->StringBuffer, the steady switch schedule for this tile |
protected HashMap<Object,StringBuffer> |
switchSchedules
The current switch schedule we are working on |
protected FlatNode |
toplevel
|
Constructor Summary | |
---|---|
Simulator(SpdStaticStreamGraph ssg,
JoinerSimulator joinerSimulator)
|
Method Summary | |
---|---|
protected void |
addJoinerCode(FlatNode fire,
JoinerScheduleNode code)
|
protected void |
asm(ComputeNode fire,
HashMap<ComputeNode,ComputeNode> previous,
HashMap<ComputeNode,HashSet> next)
Create switch assembly code for to route one item from |
abstract boolean |
canFire(FlatNode node,
HashMap<FlatNode,Integer> executionCounts,
SimulationCounter counters)
|
protected int |
consumedItems(FlatNode fire,
SimulationCounter counters,
HashMap<FlatNode,Integer> executionCounts)
return how many items a node consumes (pop's) for one firing given the current state of the simulation |
protected void |
decrementExecutionCounts(FlatNode fire,
HashMap<FlatNode,Integer> executionCounts,
SimulationCounter counters)
Give that a node has just fired, update the simulation state |
protected abstract int |
fireJoiner(FlatNode fire,
SimulationCounter counters,
HashMap<FlatNode,Integer> executionCounts)
this method should fire a joiner, assuming the joiner can fire, and update the simulation state |
protected int |
fireMe(FlatNode fire,
SimulationCounter counters,
HashMap<FlatNode,Integer> executionCounts)
consume the data and return the number of items produced |
protected void |
generateSwitchCode(FlatNode fire,
List<FlatNode> dests)
generate the switch code for 1 data item given the list of destinations we do not want to duplicate items until neccessary, so we have to keep track of all the routes and then generate the switch code this way we can route multiple dests per route instruction |
protected int |
itemsNeededToFire(FlatNode fire,
SimulationCounter counters,
HashMap<FlatNode,Integer> executionCounts)
given a node |
static boolean |
needSimulator(SpdStaticStreamGraph ssg)
|
abstract void |
simulate()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public HashMap<Object,StringBuffer> initSchedules
public HashMap<Object,StringBuffer> steadySchedules
public HashMap<FlatNode,JoinerScheduleNode> initJoinerCode
public HashMap<FlatNode,JoinerScheduleNode> steadyJoinerCode
protected SpdStaticStreamGraph ssg
protected FlatNode toplevel
protected JoinerSimulator joinerSimulator
protected Layout layout
protected RawChip rawChip
protected boolean initSimulation
protected HashMap<Object,StringBuffer> switchSchedules
protected HashMap<FlatNode,JoinerScheduleNode> joinerCode
protected HashMap<FlatNode,JoinerScheduleNode> currentJoinerCode
Constructor Detail |
---|
public Simulator(SpdStaticStreamGraph ssg, JoinerSimulator joinerSimulator)
Method Detail |
---|
public abstract void simulate()
public abstract boolean canFire(FlatNode node, HashMap<FlatNode,Integer> executionCounts, SimulationCounter counters)
public static boolean needSimulator(SpdStaticStreamGraph ssg)
protected void asm(ComputeNode fire, HashMap<ComputeNode,ComputeNode> previous, HashMap<ComputeNode,HashSet> next)
fireto the dests.
previousis a hashmap from ComputeNode -> ComputeNode that maps a node to its previous hop,
nextis similiar...
protected void generateSwitchCode(FlatNode fire, List<FlatNode> dests)
protected int itemsNeededToFire(FlatNode fire, SimulationCounter counters, HashMap<FlatNode,Integer> executionCounts)
fireand the current state of the simulation, return how many items are necessary for the node to fire.
protected void decrementExecutionCounts(FlatNode fire, HashMap<FlatNode,Integer> executionCounts, SimulationCounter counters)
protected int consumedItems(FlatNode fire, SimulationCounter counters, HashMap<FlatNode,Integer> executionCounts)
protected int fireMe(FlatNode fire, SimulationCounter counters, HashMap<FlatNode,Integer> executionCounts)
protected void addJoinerCode(FlatNode fire, JoinerScheduleNode code)
protected abstract int fireJoiner(FlatNode fire, SimulationCounter counters, HashMap<FlatNode,Integer> executionCounts)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |