if(!end) ins.addRoute(src,dest);
if(!end) { if (KjcOptions.magicdram && node.getPrevious() != null && node.getPrevious().isInputTrace()) createMagicDramLoad((InputTraceNode)node.getPrevious(), node, (init || primePump), rawChip); if (KjcOptions.magicdram && node.getNext() != null && node.getNext().isOutputTrace()) createMagicDramStore((OutputTraceNode)node.getNext(), node, (init || primePump), rawChip); ins.addRoute(src,dest);
    private static void createSwitchCodeLinear(FilterTraceNode node, Trace parent, 					       FilterInfo filterInfo, boolean init, boolean primePump, 					       RawTile tile, RawChip rawChip, int mult) {	//createReceiveCode(0,  node,  parent,  filterInfo,  init,  primePump,  tile,  rawChip);	ComputeNode sourceNode = null;	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 		return;	}	SwitchIPort src = rawChip.getIPort(sourceNode, tile);	sourceNode = null;	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		return;	}	SwitchOPort dest = rawChip.getOPort(tile, destNode);	destNode = null;	FilterContent content = node.getFilter();	final int peek = content.getArray().length;	final int pop = content.getPopCount();	final int numPop = peek/pop;	final boolean begin=content.getBegin();	final boolean end=content.getEnd();	System.out.println("SRC: "+src);	System.out.println("DEST: "+dest);	SwitchCodeStore code = tile.getSwitchCode();	boolean first=true;	for(int i = 0; i<numPop-1; i++)	    for(int j = 0; j<pop; j++) {		FullIns ins = new FullIns(tile, new MoveIns(SwitchReg.R1, src));		ins.addRoute(src, SwitchOPort.CSTI);		//if(!first) {		    if(!end)			ins.addRoute(src,dest);		    //}		code.appendIns(ins, init||primePump);		for(int k = i-1; k>= 0; k--) {		    FullIns newIns = new FullIns(tile);		    newIns.addRoute(SwitchReg.R1, SwitchOPort.CSTI);		    code.appendIns(newIns, init||primePump);		}		FullIns newIns=null;		if(!begin) {		    newIns=new FullIns(tile);		    newIns.addRoute(src, SwitchOPort.CSTI);		    code.appendIns(newIns, init||primePump);		}		/*if(!first) {		    newIns = new FullIns(tile);		    newIns.addRoute(SwitchIPort.CSTO,dest);		    code.appendIns(newIns, init||primePump);		}		first=false;*/	    }	final int turns=content.getPos();	for(int turn=0;turn<turns;turn++)	    for(int j = 0; j<pop; j++) {		FullIns ins = new FullIns(tile, new MoveIns(SwitchReg.R1, src));		ins.addRoute(src, SwitchOPort.CSTI);		if(!first) {		    if(!end)			ins.addRoute(src,dest);		    }		code.appendIns(ins, init||primePump);		for(int k = numPop-2; k>= 0; k--) {		    FullIns newIns = new FullIns(tile);		    newIns.addRoute(SwitchReg.R1, SwitchOPort.CSTI);		    code.appendIns(newIns, init||primePump);		}		FullIns newIns=null;		if(!begin) {		    newIns=new FullIns(tile);		    newIns.addRoute(src, SwitchOPort.CSTI);		    code.appendIns(newIns, init||primePump);		}		if(!first) {		    newIns = new FullIns(tile);		    newIns.addRoute(SwitchIPort.CSTO,dest);		    code.appendIns(newIns, init||primePump);		}		first=false;	    }	Label label = code.getFreshLabel();	//for(int rounds=0;rounds<2;rounds++) {	//if(rounds>0)		code.appendIns(label, init||primePump);	    final int numTimes = Linear.getMult(peek);	    int pendingSends=0;	    int times=0;	    FullIns ins;	    for(int i = 0;i<numTimes;i++) {		for(int j=0;j<pop;j++) {		    if(numPop==1&&j==0)			pendingSends++;		    times++;		    ins = new FullIns(tile, new MoveIns(SwitchReg.R1, src));		    ins.addRoute(src, SwitchOPort.CSTI);		    if(!end/*&&rounds>0*/)			ins.addRoute(src,dest);		    code.appendIns(ins, init||primePump);		    if(times==4) {			times=0;			if(pendingSends>0) {			    if(!begin) {				ins=new FullIns(tile);				ins.addRoute(src,SwitchOPort.CSTI);				code.appendIns(ins,init||primePump);			    }			    for(int l=0;l<pendingSends-1;l++) {				ins=new FullIns(tile);				if(!begin)				    ins.addRoute(src,SwitchOPort.CSTI);				//if(rounds>0)				ins.addRoute(SwitchIPort.CSTO,dest);				code.appendIns(ins,init||primePump);			    }			    //if(rounds>0) {				ins=new FullIns(tile);				ins.addRoute(SwitchIPort.CSTO,dest);				code.appendIns(ins,init||primePump);				//}			    pendingSends=0;			}		    }		    for(int k = 1;k<numPop;k++) {			if(j==0&&k==numPop-1)			    pendingSends++;			times++;			ins=new FullIns(tile);			ins.addRoute(SwitchReg.R1, SwitchOPort.CSTI);			code.appendIns(ins, init||primePump);			if(times==4) {			    times=0;			    if(pendingSends>0) {				if(!begin) {				    ins=new FullIns(tile);				    ins.addRoute(src,SwitchOPort.CSTI);				    code.appendIns(ins,init||primePump);				}				for(int l=0;l<pendingSends-1;l++) {				    ins=new FullIns(tile);				    if(!begin)					ins.addRoute(src,SwitchOPort.CSTI);				    //if(rounds>0)				    ins.addRoute(SwitchIPort.CSTO,dest);				    code.appendIns(ins,init||primePump);				}				//if(rounds>0) {				    ins=new FullIns(tile);				    ins.addRoute(SwitchIPort.CSTO,dest);				    code.appendIns(ins,init||primePump);				    //}				pendingSends=0;			    }			}		    }		}    //}	}	/*for(int i=0;i<numTimes-1;i++) {	  FullIns newIns=new FullIns(tile);	  newIns.addRoute(SwitchIPort.CSTO,dest);	  code.appendIns(newIns,init||primePump);	  }	  FullIns newIns=new FullIns(tile,new JumpIns(label.getLabel()));	  newIns.addRoute(SwitchIPort.CSTO,dest);	  code.appendIns(newIns,init||primePump);*/	code.appendIns(new JumpIns(label.getLabel()),init||primePump);    }