if (steady && Rawify.SWITCH_COMP && filterInfo.steadyMult > Rawify.SC_THRESHOLD) {  if (filterInfo.itemsNeededToFire(0, false) > Rawify.SC_INS_THRESH) { block.addStatement(boundToSwitchStmt(filterInfo.itemsNeededToFire(0, false))); }  if (filterInfo.itemsFiring(0, false) > Rawify.SC_INS_THRESH) { block.addStatement(boundToSwitchStmt(filterInfo.itemsFiring(0, false))); } }
sendRatesToSwitch(filterInfo, block);
    private JBlock getWorkFunctionBlock(boolean steady, int mult)    {        JBlock block = new JBlock(null, new JStatement[0], null);        FilterContent filter = filterInfo.filter;              //if we have gdn output then we have to set up the gdn packet header for        //each gdn send        if (gdnOutput) {            block.addStatement(setDynMsgHeader());        }                //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                JStatement workBlock =             getWorkFunctionCall(filter);            //if we are compressing the sends and receives on the switch for this        //filter, we must send them now        if (steady && Rawify.SWITCH_COMP && filterInfo.steadyMult > Rawify.SC_THRESHOLD) {            //if we are compressing the receives, send the trip count to the switch            if (filterInfo.itemsNeededToFire(0, false) > Rawify.SC_INS_THRESH) {                block.addStatement(boundToSwitchStmt(filterInfo.itemsNeededToFire(0, false)));            }            //if we are compressing the sends, send the trip count to the switch            if (filterInfo.itemsFiring(0, false) > Rawify.SC_INS_THRESH) {                block.addStatement(boundToSwitchStmt(filterInfo.itemsFiring(0, false)));            }        }                //reset the simple index        if (filterInfo.isSimple()) {            block.addStatement                (new JExpressionStatement(null,                                          (new JAssignmentExpression                                           (null,                                            new JFieldAccessExpression                                            (null, new JThisExpression(null),                                             generatedVariables.simpleIndex.getIdent()),                                            new JIntLiteral(-1))), null));        }            //add the statements to receive pop 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);        }        return block;    }