if (stage == 3)
if (!stage)
    private static void outputDRAMCommands(OutputTraceNode output,                                           boolean init, boolean primepump) {        FilterTraceNode filter = (FilterTraceNode) output.getPrevious();         // don't do anything for a redundant buffer        if (OffChipBuffer.unnecessary(output))            return;        // if we are in the init set to zero, 1 to primepump        // if steady set to 3, used for addDRAMCommand(...)        int stage;        if (init)            stage = 0;        else if (primepump)            stage = 1;        else //steady            stage = 3;        OffChipBuffer srcBuffer = IntraTraceBuffer.getBuffer(filter, output);        int readWords = FilterInfo.getFilterInfo(filter).totalItemsSent(init,                                                                        primepump)            * Util.getTypeSize(filter.getFilter().getOutputType());        if (readWords > 0) {            SpaceTimeBackend.println("Generating the read command for "                                     + output + " on " + srcBuffer.getOwner()                                     + (primepump ? "(primepump)" : ""));            // in the primepump stage a real output trace always reads from the            // init buffers            // never use stage 2 for reads            if (output.isFileReader() && OffChipBuffer.unnecessary(output))                srcBuffer.getOwner().getComputeCode().addFileCommand(true,                        init || primepump, readWords, srcBuffer, srcBuffer.isStaticNet());            else                srcBuffer.getOwner().getComputeCode().addDRAMCommand(true,                        (stage < 3 ? 0 : 3),                         Util.cacheLineDiv(readWords * 4),                        srcBuffer, true, srcBuffer.isStaticNet());        }        // now generate the store drm command        Iterator dests = output.getDestSet().iterator();        while (dests.hasNext()) {            Edge edge = (Edge) dests.next();            InterTraceBuffer destBuffer = InterTraceBuffer.getBuffer(edge);            int typeSize = Util.getTypeSize(edge.getType());            int writeWords = typeSize;            // do steady-state            if (stage == 3)                writeWords *= edge.steadyItems();            else if (stage == 0)                writeWords *= edge.initItems();            else                writeWords *= edge.primePumpItems();            // make write bytes cache line div            if (writeWords > 0) {                if (destBuffer.getEdge().getDest().isFileWriter()                    && OffChipBuffer.unnecessary(destBuffer.getEdge()                                                 .getDest()))                    destBuffer.getOwner().getComputeCode().addFileCommand(false,                             init || primepump, writeWords, destBuffer, destBuffer.isStaticNet());                else                    destBuffer.getOwner().getComputeCode().addDRAMCommand(false, stage,                                 Util.cacheLineDiv(writeWords * 4),                                destBuffer, false, destBuffer.isStaticNet());            }        }    }