newIns.addRoute(src, SwitchOPort.CSTI);
    private static void createLinearSwitchCode(FilterTraceNode node/*,boolean init,boolean primePump*/,int mult,RawTile tile,RawChip rawChip) {	System.err.println("Creating switchcode linear: "+node+" "+mult);	ComputeNode sourceNode = null;	//Get sourceNode and input port	if (node.getPrevious().isFilterTrace())	    sourceNode = rawChip.getTile(((FilterTraceNode)node.getPrevious()).getX(), 					 ((FilterTraceNode)node.getPrevious()).getY());	else {	    if (KjcOptions.magicdram && node.getPrevious() != null &&		node.getPrevious().isInputTrace() &&		tile.hasIODevice()) 		sourceNode = tile.getIODevice();	    else 		sourceNode = 		    IntraTraceBuffer.getBuffer((InputTraceNode)node.getPrevious(), 					       node).getNonRedundant().getDRAM();	}	SwitchIPort src = rawChip.getIPort(sourceNode, tile);	SwitchIPort src2 = rawChip.getIPort2(sourceNode, tile);	sourceNode = null;	//Get destNode and output port	ComputeNode destNode = null;	if (node.getNext().isFilterTrace())	    destNode = rawChip.getTile(((FilterTraceNode)node.getNext()).getX(), 				       ((FilterTraceNode)node.getNext()).getY());	else {	    if (KjcOptions.magicdram && node.getNext() != null &&		node.getNext().isOutputTrace() && tile.hasIODevice())		destNode = tile.getIODevice();	    else {		destNode = 		    IntraTraceBuffer.getBuffer(node, (OutputTraceNode)node.getNext()).		    getNonRedundant().getDRAM();	    }	}	SwitchOPort dest = rawChip.getOPort(tile, destNode);	//SwitchOPort dest2 = rawChip.getOPort2(tile, destNode);	destNode = null;	//Get filter properties	FilterContent content = node.getFilter();	final int numCoeff = content.getArray().length;	final int pop = content.getPopCount();	final int numPop = numCoeff/pop;	final boolean begin=content.getBegin();	final boolean end=content.getEnd();	final int pos=content.getPos();	final int turns=pos*numCoeff;	//System.out.println("SRC: "+src);	//System.out.println("DEST: "+dest);	//Begin codegen	SwitchCodeStore code = tile.getSwitchCode();	//System.err.println("Getting HERE!");	code.appendIns(new Comment("HERE!"),false);	//Get loop counter	FullIns loopCount=new FullIns(tile,new MoveIns(SwitchReg.R3,SwitchIPort.CSTO));	code.appendIns(loopCount,false);	//Preloop	if(begin) {	    //Test: pass start down	    FullIns testIns=new FullIns(tile);	    testIns.addRoute(SwitchIPort.CSTO,dest);	    code.appendIns(testIns,false);	    if(turns>0) {		if(turns>1) {		    boolean first=true;		    //Order between values (from peek buffer) and partial sums is reversed		    for(int turn=1;turn<turns;turn++)			for(int j = 0; j<pop; j++) {			    if(j==0) {				//FullIns newIns=new FullIns(tile);				//newIns.addRoute(SwitchIPort.CSTO,dest); //Used to be dest2				FullIns newIns=new FullIns(tile,new MoveIns(SwitchReg.R1,SwitchIPort.CSTO));				if(first)				    first=false;				else				    newIns.addRoute(SwitchReg.R1,dest);				code.appendIns(newIns, false);			    }			    FullIns ins=new FullIns(tile);			    ins.addRoute(SwitchIPort.CSTO,dest);			    code.appendIns(ins,false);			}		    //Route remainder		    FullIns ins=new FullIns(tile);		    ins.addRoute(SwitchReg.R1,dest);		    code.appendIns(ins,false);		}		//Order back to normal		for(int j = 0; j<pop; j++) {		    //Pass first value		    FullIns ins=new FullIns(tile, new MoveIns(SwitchReg.R1, src));		    ins.addRoute(src, SwitchOPort.CSTI);		    //if(!end)		    ins.addRoute(src,dest);		    code.appendIns(ins, false);		    //Repeat first value		    for(int k = numPop-2; k>= 0; k--) {			FullIns newIns = new FullIns(tile);			newIns.addRoute(SwitchReg.R1, SwitchOPort.CSTI);			code.appendIns(newIns, false);		    }		    //Pass in partial sum		    if(j==0) {			FullIns newIns=new FullIns(tile);			newIns.addRoute(src, SwitchOPort.CSTI); //Used to be src2,csti2			//Pass out partial sum to next filter			newIns.addRoute(SwitchIPort.CSTO,dest); //Used to be dest2			code.appendIns(newIns, false);		    }		}	    }	} else {	    //Test: passing start down	    FullIns testIns=new FullIns(tile);	    testIns.addRoute(src,dest);	    code.appendIns(testIns,false);	    for(int i = 0; i<numPop; i++) {		for(int j = 0; j<pop; j++) {		    //Pass first value		    FullIns ins = new FullIns(tile, new MoveIns(SwitchReg.R1, src));		    ins.addRoute(src, SwitchOPort.CSTI);		    code.appendIns(ins, false);		    //Repeat first value		    for(int k = i-1; k>= 0; k--) {			FullIns newIns = new FullIns(tile);			newIns.addRoute(SwitchReg.R1, SwitchOPort.CSTI);			code.appendIns(newIns, false);		    }		    //Pass in partial sum		    if(j==0) {			FullIns newIns=new FullIns(tile);			newIns.addRoute(src, SwitchOPort.CSTI); //Used to be src2,csti2			code.appendIns(newIns, false);		    }		}	    }	    for(int turn=0;turn<turns;turn++)		for(int j = 0; j<pop; j++) {		    //Pass first value		    FullIns ins = new FullIns(tile, new MoveIns(SwitchReg.R1, src));		    ins.addRoute(src, SwitchOPort.CSTI);		    if(!end)			ins.addRoute(src,dest);		    code.appendIns(ins, false);		    //Repeat first value		    for(int k = numPop-2; k>= 0; k--) {			FullIns newIns = new FullIns(tile);			newIns.addRoute(SwitchReg.R1, SwitchOPort.CSTI);			code.appendIns(newIns, false);		    }		    //Pass in partial sum		    if(j==0) {			FullIns newIns=new FullIns(tile);			newIns.addRoute(src, SwitchOPort.CSTI); //Used to be src2,csti2			//Pass out partial sum to next filter			newIns.addRoute(SwitchIPort.CSTO,dest); //Used to be dest2			code.appendIns(newIns, false);		    }		}	}	//Innerloop	Label label = code.getFreshLabel();	code.appendIns(label,false);	final int numTimes=Linear.getMult(numCoeff);	int pendingSends=0;	int times=0;	FullIns ins=null;	for(int i = 0;i<numTimes;i++) {	    for(int j=0;j<pop;j++) {		for(int k=0;k<numPop;k++) {		    if(j==0&&k==numPop-1)			pendingSends++;		    times++;		    if(k==0) {			ins=new FullIns(tile,new MoveIns(SwitchReg.R1, src));			ins.addRoute(src, SwitchOPort.CSTI);			if(!end) {			    ins.addRoute(src,dest);			}		    } else {			ins=new FullIns(tile);			ins.addRoute(SwitchReg.R1, SwitchOPort.CSTI); //Temp reg		    }		    code.appendIns(ins, false);		    if(times==4) {			times=0;			if(pendingSends>0) {			    for(int l=0;l<pendingSends;l++) {				ins=new FullIns(tile);				if(!begin) {				    ins.addRoute(src,SwitchOPort.CSTI); //was src2,csti2				}				ins.addRoute(SwitchIPort.CSTO,dest);				code.appendIns(ins,false);			    }			    pendingSends=0;			}		    }		}	    }	}	ins.setProcessorIns(new BnezdIns(SwitchReg.R3,SwitchReg.R3,label.getLabel()));	//Postloop    }