if (KjcOptions.magicdram || filterInfo.traceNode.getPrevious().isFilterTrace()) { statements.addStatement (makeForLoop(receiveCode(filter, filter.getInputType(), generatedVariables), generatedVariables.exeIndex, new JIntLiteral(filterInfo.peek))); }
statements.addStatement (makeForLoop(receiveCode(filter, filter.getInputType(), generatedVariables), generatedVariables.exeIndex, new JIntLiteral(filterInfo.prePeek)));
    public JMethodDeclaration getInitStageMethod()     {	JBlock statements = new JBlock(null, new JStatement[0], null);	FilterContent filter = filterInfo.filter;		//add the call to initWork	if (filterInfo.isTwoStage()) {	    //FilterContent two = filter;	    JBlock body = 		(JBlock)ObjectDeepCloner.deepCopy		(filter.getInitWork().getBody());	    //add the code to receive the items into the buffer from the network	    //but only if its upstream neighbor is a filter trace node...	    if (KjcOptions.magicdram || filterInfo.traceNode.getPrevious().isFilterTrace()) {		statements.addStatement		    (makeForLoop(receiveCode(filter, filter.getInputType(), 					     generatedVariables),				 generatedVariables.exeIndex,				 new JIntLiteral(filterInfo.peek)));	    }	    	    //now inline the init work body	    statements.addStatement(body);	    //if a simple filter, reset the simpleIndex	    if (filterInfo.isSimple() && 		(KjcOptions.magicdram ||		 filterInfo.traceNode.getPrevious().isFilterTrace())) {		statements.addStatement		    (new JExpressionStatement(null,					      (new JAssignmentExpression					       (null,						new JFieldAccessExpression						(null, new JThisExpression(null), 						 generatedVariables.simpleIndex.getIdent()),						new JIntLiteral(-1))), null));	    }	}		if (initFire - 1 > 0) {	//add the code to collect enough data necessary to fire the 	//work function for the first time	    	    if (filterInfo.bottomPeek > 0 && 		(KjcOptions.magicdram ||		filterInfo.traceNode.getPrevious().isFilterTrace())) {		statements.addStatement		    (makeForLoop(receiveCode(filter, filter.getInputType(),					     generatedVariables),				 generatedVariables.exeIndex,				 new JIntLiteral(filterInfo.bottomPeek)));	    }	    	    //add the calls for the work function in the initialization stage	    statements.addStatement(generateInitWorkLoop				    (filter, generatedVariables));	}	//add the code to collect all data produced by the upstream filter 	//but not consumed by this filter in the initialization stage	if (filterInfo.remaining > 0 &&	    (KjcOptions.magicdram ||	    filterInfo.traceNode.getPrevious().isFilterTrace())) {	   statements.addStatement		(makeForLoop(receiveCode(filter, filter.getInputType(),					 generatedVariables),			     generatedVariables.exeIndex,			     new JIntLiteral(filterInfo.remaining))); 	}	if (SpaceTimeBackend.FILTER_DEBUG_MODE) {	    statements.addStatement		(new SIRPrintStatement(null,				       new JStringLiteral(null, filter.getName() + " Starting Steady-State"),				       null));	}		//reset the simple index if we are receiving from another trace	//to allow it to write to the buffer in the correct index	//IS THIS STILL CORRECT?	if (!KjcOptions.magicdram && filterInfo.isSimple() && 		filterInfo.traceNode.getPrevious().isInputTrace()) {		statements.addStatement		    (new JExpressionStatement(null,					      (new JAssignmentExpression					       (null,						new JFieldAccessExpression						(null, new JThisExpression(null),						 generatedVariables.simpleIndex.getIdent()),						new JIntLiteral(-1))), null));	}	//add the calls to the work function for the priming of the pipeline	statements.addStatement(getWorkFunctionBlock(filterInfo.primePump));	return new JMethodDeclaration(null, at.dms.kjc.Constants.ACC_PUBLIC,				      CStdType.Void,				      initStage + uniqueID,				      JFormalParameter.EMPTY,				      CClassType.EMPTY,				      statements,				      null,				      null);     }