at.dms.kjc.spacedynamic
Class SimpleSimulator

java.lang.Object
  extended by at.dms.kjc.spacedynamic.Simulator
      extended by at.dms.kjc.spacedynamic.SimpleSimulator

public class SimpleSimulator
extends Simulator

This class will create switch code (but not create the file) for a layout that has no overlapping routes. It does not really simulate the execution of the graph, it just dumps the switch code based the properties of the filters and joiners.

Author:
mgordon

Field Summary
 
Fields inherited from class at.dms.kjc.spacedynamic.Simulator
currentJoinerCode, initJoinerCode, initSchedules, initSimulation, joinerCode, joinerSimulator, layout, rawChip, ssg, steadyJoinerCode, steadySchedules, switchSchedules, toplevel
 
Constructor Summary
SimpleSimulator(SpdStaticStreamGraph ssg, JoinerSimulator joinerSimulator)
           
 
Method Summary
 boolean canFire(FlatNode node, HashMap<FlatNode,Integer> executionCounts, SimulationCounter counters)
           
protected  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
static boolean isSimple(Layout layout)
           
 void simulate()
           
 
Methods inherited from class at.dms.kjc.spacedynamic.Simulator
addJoinerCode, asm, consumedItems, decrementExecutionCounts, fireMe, generateSwitchCode, itemsNeededToFire, needSimulator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleSimulator

public SimpleSimulator(SpdStaticStreamGraph ssg,
                       JoinerSimulator joinerSimulator)
Method Detail

isSimple

public static boolean isSimple(Layout layout)
Parameters:
layout - The layout.
Returns:
True if the layout is simple (meaning no overlapping routes and no empty tiles involved in routing) and we can use the simple simulator to generate switch code.

simulate

public void simulate()
Specified by:
simulate in class Simulator

canFire

public boolean canFire(FlatNode node,
                       HashMap<FlatNode,Integer> executionCounts,
                       SimulationCounter counters)
Specified by:
canFire in class Simulator

fireJoiner

protected int fireJoiner(FlatNode fire,
                         SimulationCounter counters,
                         HashMap<FlatNode,Integer> executionCounts)
Description copied from class: Simulator
this method should fire a joiner, assuming the joiner can fire, and update the simulation state

Specified by:
fireJoiner in class Simulator