((RawTile)source).getSwitchCode().appendCommAddrIns(ins[i]);
source.getRawChip().getTile(i).getSwitchCode().appendCommAddrIns(ins[i]);
    public static void generateSwitchCode(ComputeNode source, ComputeNode[] dests,					   int stage)    {	RouteIns[] ins = new RouteIns[source.getRawChip().getXSize() *				      source.getRawChip().getYSize()];		for (int i = 0; i < dests.length; i++) {	    ComputeNode dest = dests[i];	    	    LinkedList route = Router.getRoute(source, dest);	    //append the dest again to the end of route 	    //so we can place the item in the processor queue	    route.add(dest);	    Iterator it = route.iterator();	    if (!it.hasNext()) {		System.err.println("Warning sending item to itself");		continue;	    }	    	    ComputeNode prev = (ComputeNode)it.next();	    ComputeNode current = prev;	    ComputeNode next;	    	    while (it.hasNext()) {		next = (ComputeNode)it.next();		//only add the instructions to the raw tile		if (current instanceof RawTile) {		//create the route instruction if it does not exist		    if (ins[((RawTile)current).getTileNumber()] == null)			ins[((RawTile)current).getTileNumber()] = new RouteIns((RawTile)current);		    //add this route to it		    //RouteIns will take care of the duplicate routes 		    ins[((RawTile)current).getTileNumber()].addRoute(prev, next);		}		prev = current;		current = next;	    }	}	//add the non-null instructions	for (int i = 0; i < ins.length; i++) {	    if (ins[i] != null) {		if (stage == 0) 		    ((RawTile)source).getSwitchCode().appendCommAddrIns(ins[i]);		if (stage == 1) 		    ((RawTile)source).getSwitchCode().appendIns(ins[i], true);		if (stage == 1)		    ((RawTile)source).getSwitchCode().appendIns(ins[i], false);	    }	}    }