if (!KjcOptions.magicdram && filterInfo.isSimple() && filterInfo.traceNode.getPrevious() != null && filterInfo.traceNode.getPrevious().isInputTrace()) { block.addStatementFirst (new JExpressionStatement(null, (new JAssignmentExpression (null, new JFieldAccessExpression (null, new JThisExpression(null), generatedVariables.simpleIndex.getIdent()), new JIntLiteral(-1))), null)); }
    private JBlock getWorkFunctionBlock(int mult)    {	JBlock block = new JBlock(null, new JStatement[0], null);	FilterContent filter = filterInfo.filter;	//get the upsteam filter assuming that it does not pass thru another trace	//this is only here for compatablility with the intra-tile, inter-trace	//implementation	//not rate matching	    	JBlock workBlock = 	    (JBlock)ObjectDeepCloner.	    deepCopy(filter.getWork().getBody());	//reset the simple index	if (filterInfo.isSimple() && 	    (KjcOptions.magicdram || 	    filterInfo.traceNode.getPrevious().isFilterTrace())) {	    block.addStatement		(new JExpressionStatement(null,					  (new JAssignmentExpression					   (null,					    new JFieldAccessExpression					    (null, new JThisExpression(null),					     generatedVariables.simpleIndex.getIdent()),					    new JIntLiteral(-1))), null));	}		if (KjcOptions.magicdram || filterInfo.traceNode.getPrevious().isFilterTrace()) {	    //add the statements to receive pop * steady mult items into the buffer	    //execute this before the for loop that has the work function	    block.addStatement		(makeForLoop(receiveCode(filter, filter.getInputType(),					 generatedVariables),			     generatedVariables.exeIndex,			     new JIntLiteral(filterInfo.pop)));	}	//if we are in debug mode, print out that the filter is firing	if (SpaceTimeBackend.FILTER_DEBUG_MODE) {	    block.addStatement		(new SIRPrintStatement(null,				       new JStringLiteral(null, filter.getName() + " firing."),				       null));	}	//add the cloned work function to the block	block.addStatement(workBlock);		//if we are in decoupled mode do not put the work function in a for loop	//and add the print statements	if (KjcOptions.decoupled) {	    block.addStatementFirst		(new SIRPrintStatement(null, 				       new JIntLiteral(0),				       null));	    block.addStatement(block.size(), 			       new SIRPrintStatement(null, 						     new JIntLiteral(1),						     null));	}	else {	    //create the for loop that will execute the work function	    //local variable for the work loop	    JVariableDefinition loopCounter = new JVariableDefinition(null,								      0,								      CStdType.Integer,								      workCounter,								      null);	 	 	    JStatement loop = makeForLoop(block, loopCounter, new JIntLiteral(mult));	    block = new JBlock(null, new JStatement[0], null);	    block.addStatement(new JVariableDeclarationStatement(null,								 loopCounter,								 null));	    block.addStatement(loop);	}		//reset the simple index outside of the loop if this filter is the first	//in the trace because it uses the buffer that for the entire steady state	if (!KjcOptions.magicdram && filterInfo.isSimple() && 	    filterInfo.traceNode.getPrevious() != null &&	    filterInfo.traceNode.getPrevious().isInputTrace()) {	    block.addStatementFirst		(new JExpressionStatement(null,					  (new JAssignmentExpression					   (null,					    new JFieldAccessExpression					    (null, new JThisExpression(null),					     generatedVariables.simpleIndex.getIdent()),					    new JIntLiteral(-1))), null));	}		//reset the simple index if we are receiving from another trace	//to allow it to write to the buffer in the correct index	/*	  if (filterInfo.isSimple() && 	    filterInfo.traceNode.getPrevious().isInputTrace()) {	    block.addStatement		(new JExpressionStatement(null,					  (new JAssignmentExpression					   (null,					    new JFieldAccessExpression					    (null, new JThisExpression(null),					     generatedVariables.simpleIndex.getIdent()),					    new JIntLiteral(-1))), null));	}	*/	/*	return new JMethodDeclaration(null, at.dms.kjc.Constants.ACC_PUBLIC,				      CStdType.Void,				      steadyStage + uniqueID,				      JFormalParameter.EMPTY,				      CClassType.EMPTY,				      block,				      null,				      null);	*/	return block;    }