- public boolean routed = false;
- public void unroute() {
- for(PhysicalDevice.PhysicalPip pip : pips) pip.set(false);
- while(pns.size() > 0) pns.iterator().next().removeLogicalNet(this);
- pips.clear();
- pns.clear();
- routed = false;
- }
- public void route(Fpslic fpslic, PhysicalDevice pd) {
- if (driver == null) return;
- if (routed) return;
- Node.Port[] dests = new Node.Port[ports.size() - (ports.contains(driver) ? 1 : 0)];
- int j = 0;
- for(Node.Port p : ports)
- if (p != driver)
- dests[j++] = p;
- PhysicalDevice.PhysicalNet[] destsp = new PhysicalDevice.PhysicalNet[dests.length];
- for(int i=0; i<dests.length; i++) {
- Node.Port dest = dests[i];
- switch(dest.index) {
- case 0: destsp[i] = dest.getNode().physicalCell.getNet("xi"); break;
- case 1: destsp[i] = dest.getNode().physicalCell.getNet("yi"); break;
- default: throw new Error();
- }
- }
- driver.getNode().physicalCell.getNet("out").route(destsp, this);
- routed = true;
- }