502
530
Technology tech = startArc.getTechnology();
532
PrimitivePort pp = User.getUserTool().getCurrentContactPortProto(startArc, endArc);
535
if (DEBUGSEARCH) System.out.println(ds+"Checking if "+pp+" connects between "+startArc+" and "+endArc);
536
specifiedRoute.add(pp);
537
saveRoute(specifiedRoute);
504
541
// see if we can find a port in the current technology
505
542
// that will connect the two arcs
506
for (Iterator<PrimitiveNode> nodesIt = tech.getNodes(); nodesIt.hasNext(); ) {
507
PrimitiveNode pn = nodesIt.next();
508
// ignore anything that is noy CONTACT
509
if (pn.getFunction() != PrimitiveNode.Function.CONTACT) continue;
510
if (pn.isNotUsed()) continue;
512
for (Iterator<PortProto> portsIt = pn.getPorts(); portsIt.hasNext(); ) {
513
PrimitivePort pp = (PrimitivePort)portsIt.next();
514
if (DEBUGSEARCH) System.out.println(ds+"Checking if "+pp+" connects between "+startArc+" and "+endArc);
515
if (pp.connectsTo(startArc) && pp.connectsTo(endArc)) {
516
specifiedRoute.add(pp);
517
saveRoute(specifiedRoute);
518
return; // this connects between both arcs
543
// for (Iterator<PrimitiveNode> nodesIt = tech.getNodes(); nodesIt.hasNext(); ) {
544
// PrimitiveNode pn = nodesIt.next();
545
// //for (PrimitiveNode pn : contacts) {
546
// // ignore anything that is not CONTACT
547
// if (!pn.getFunction().isContact()) continue;
548
// if (pn.isNotUsed()) continue;
550
// for (Iterator<PortProto> portsIt = pn.getPorts(); portsIt.hasNext(); ) {
551
// PrimitivePort ppp = (PrimitivePort)portsIt.next();
552
// if (DEBUGSEARCH) System.out.println(ds+"Checking if "+ppp+" connects between "+startArc+" and "+endArc);
553
// if (ppp.connectsTo(startArc) && ppp.connectsTo(endArc)) {
554
// specifiedRoute.add(ppp);
556
// System.out.println("something diff");
557
// saveRoute(specifiedRoute);
558
// return; // this connects between both arcs
523
563
// try all contact ports as an intermediate
524
for (Iterator<PrimitiveNode> nodesIt = tech.getNodes(); nodesIt.hasNext(); ) {
525
PrimitiveNode pn = nodesIt.next();
526
// ignore anything that is noy CONTACT
527
if (pn.getFunction() != PrimitiveNode.Function.CONTACT) continue;
528
if (pn.isNotUsed()) continue;
530
for (Iterator<PortProto> portsIt = pn.getPorts(); portsIt.hasNext(); ) {
531
PrimitivePort pp = (PrimitivePort)portsIt.next();
532
if (DEBUGSEARCH) System.out.println(ds+"Checking if "+pp+" (parent is "+pp.getParent()+") connects to "+startArc);
533
if (pp.connectsTo(startArc)) {
564
// for (Iterator<PrimitiveNode> nodesIt = tech.getNodes(); nodesIt.hasNext(); )
566
// PrimitiveNode pn = nodesIt.next();
567
// //for (PrimitiveNode pn : contacts) {
568
// // ignore anything that is not CONTACT
569
// if (!pn.getFunction().isContact()) continue;
570
// if (pn.isNotUsed()) continue;
572
// for (Iterator<PortProto> portsIt = pn.getPorts(); portsIt.hasNext(); )
574
// pp = (PrimitivePort)portsIt.next();
575
List<PrimitivePort> portsList = User.getUserTool().getPrimitivePortConnectedToArc(startArc);
576
for (PrimitivePort p : portsList)
579
if (DEBUGSEARCH) System.out.println(ds+"Checking if "+pp+" (parent is "+pp.getParent()+") connects to "+startArc);
580
assert(pp.connectsTo(startArc));
581
// if (pp.connectsTo(startArc))
534
583
if (pp == startPort) continue; // ignore start port
535
584
if (pp == endPort) continue; // ignore end port
536
if (specifiedRoute.contains(pp)) continue; // ignore ones we've already hit
586
if (isPortProtoContained(pp))
587
// if (specifiedRoute.contains(pp))
588
continue; // ignore ones we've already hit
538
591
int prePortSize = specifiedRoute.size();
539
specifiedRoute.add(pp);
592
// pp = User.getUserTool().getCurrentContactPortProto(pp); // get the equivalent
593
specifiedRoute.add(pp);
541
595
// now try to connect through all arcs that can connect to the found pp
542
596
int preArcSize = specifiedRoute.size();
543
597
ArcProto [] arcs = pp.getConnections();
544
598
for (int i=0; i<arcs.length; i++) {
545
599
ArcProto tryarc = arcs[i];
546
if (tryarc == Generic.tech().universal_arc) continue;
547
if (tryarc == Generic.tech().invisible_arc) continue;
548
if (tryarc == Generic.tech().unrouted_arc) continue;
549
if (tryarc.isNotUsed()) continue;
600
// if (tryarc == Generic.tech().universal_arc) continue;
601
// if (tryarc == Generic.tech().invisible_arc) continue;
602
// if (tryarc == Generic.tech().unrouted_arc) continue;
603
if (tryarc.getTechnology() == Generic.tech()) continue;
604
if (tryarc.isNotUsed()) continue;
550
605
if (tryarc == startArc) continue; // already connecting through startArc
551
606
if (tryarc == this.startArc) continue; // original arc connecting from
552
if (specifiedRoute.contains(tryarc)) continue; // already used this arc
607
// if (specifiedRoute.contains(tryarc)) continue; // already used this arc
608
if (isPortProtoContained(tryarc)) continue; // already used this arc
553
609
// if it is not the first specific route, then avoid to come back to the startPin
554
610
// if (specifiedRoute.size() > 0)