Esempio n. 1
0
 public Simulator(SpdStaticStreamGraph ssg, JoinerSimulator joinerSimulator) {
   this.ssg = ssg;
   this.joinerSimulator = joinerSimulator;
   this.toplevel = ssg.getTopLevel();
   this.layout = ((SpdStreamGraph) ssg.getStreamGraph()).getLayout();
   this.rawChip = ((SpdStreamGraph) ssg.getStreamGraph()).getRawChip();
 }
Esempio n. 2
0
  /**
   * @return true if we need switch code for this graph, otherwise we can just use the dynamic
   *     network because there are no overlapping routes and no splitters or joiners
   */
  public static boolean needSimulator(SpdStaticStreamGraph ssg) {
    // check if there are any overlapping routes...
    if (((SpdStreamGraph) ssg.getStreamGraph()).getLayout().getIntermediateTiles().size() > 0)
      return true;

    // check if there are any splitters...
    Iterator it = ssg.getFlatNodes().iterator();
    while (it.hasNext()) {
      FlatNode node = (FlatNode) it.next();
      if (node.isJoiner() || node.isSplitter()) return true;
    }
    // all's good!
    return false;
  }