~ubuntu-branches/ubuntu/maverick/electric/maverick

« back to all changes in this revision

Viewing changes to com/sun/electric/tool/routing/VerticalRoute.java

  • Committer: Bazaar Package Importer
  • Author(s): Onkar Shinde
  • Date: 2010-01-09 16:26:04 UTC
  • mfrom: (1.1.4 upstream) (3.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100109162604-1ypvmy8ijmlc6oq7
Tags: 8.10-1
* New upstream version.
* debian/control
  - Add libjava3d-java and quilt build dependencies.
  - Update standards version to 3.8.3.
  - Add libjava3d-java as recommends to binary package.
* debian/rules
  - Use quilt patch system instead of simple patchsys.
  - Add java3d related jar files to DEB_JARS.
* debian/patches/*
  - Update as per current upstream source. Convert to quilt.
* debian/ant.properties
  - Do not disable 3D plugin anymore.
  - Use new property to disable compilation of OS X related classes.
* debian/wrappers/electric
  - Add java3d related jar files to runtime classpath.
* debian/README.source
  - Change text to the appropriate one for quilt.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
    /** list of all valid specified routes */   private List<SpecifiedRoute> allSpecifiedRoutes;
67
67
    /** first arc (from startRE) */             private ArcProto startArc;
68
68
    /** last arct (to endRE) */                 private ArcProto endArc;
 
69
    /** list of contacts to use */              private List<PrimitiveNode> contacts;
69
70
 
70
71
    /** the possible start arcs */              private ArcProto [] startArcs;
71
72
    /** the possible end arcs */                private ArcProto [] endArcs;
430
431
                specifiedRoute.startArc = startArc;
431
432
                specifiedRoute.endArc = endArc;
432
433
                searchNumber = 0;
 
434
                Technology tech = startArc.getTechnology();
 
435
                //this.contacts = tech.getPreferredContacts();
433
436
                if (DEBUGSEARCH || DEBUGTERSE) System.out.println("** Start search startArc="+startArc+", endArc="+endArc);
434
437
                findConnectingPorts(startArc, endArc, new StringBuffer());
435
438
                if (DEBUGSEARCH || DEBUGTERSE) System.out.println("   Search reached searchNumber "+searchNumber);
467
470
    }
468
471
 
469
472
    /**
 
473
     * Method to check whether an equivalent PortProto has been added to the list.
 
474
     * @param pp
 
475
     * @return
 
476
     */
 
477
    private boolean isPortProtoContained(Object pp)
 
478
    {
 
479
        if (specifiedRoute.contains(pp)) return true; // exactly the same port
 
480
 
 
481
        if (!(pp instanceof PrimitivePort)) return false; // not a concern
 
482
 
 
483
        PrimitivePort ppp = (PrimitivePort)pp;
 
484
        List<PrimitivePort> equivalent = User.getUserTool().getEquivalentPorts(ppp);
 
485
 
 
486
        if (equivalent != null)
 
487
        {
 
488
            for (PrimitivePort p : equivalent)
 
489
            {
 
490
                if (specifiedRoute.contains(p))
 
491
                    return true;
 
492
            }
 
493
        }
 
494
        return false;
 
495
    }
 
496
 
 
497
    /**
470
498
     * Recursive method to create a specification list of ports and arcs
471
499
     * that connect startArc to endArc.  The list will be odd in length
472
500
     * (or zero if startArc and endArc are the same). It will consist
501
529
        searchNumber++;
502
530
        Technology tech = startArc.getTechnology();
503
531
 
 
532
        PrimitivePort pp = User.getUserTool().getCurrentContactPortProto(startArc, endArc);
 
533
        if (pp != null)
 
534
        {
 
535
            if (DEBUGSEARCH) System.out.println(ds+"Checking if "+pp+" connects between "+startArc+" and "+endArc);
 
536
            specifiedRoute.add(pp);
 
537
            saveRoute(specifiedRoute);
 
538
            return;
 
539
        }
 
540
 
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;
511
 
 
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
519
 
                                }
520
 
                        }
521
 
                }
 
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;
 
549
//
 
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);
 
555
//                    if (ppp != pp)
 
556
//                        System.out.println("something diff");
 
557
//                    saveRoute(specifiedRoute);
 
558
//                                      return;                                // this connects between both arcs
 
559
//                              }
 
560
//                      }
 
561
//              }
522
562
 
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;
529
 
 
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(); )
 
565
//        {
 
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;
 
571
//
 
572
//                      for (Iterator<PortProto> portsIt = pn.getPorts(); portsIt.hasNext(); )
 
573
//            {
 
574
//                              pp = (PrimitivePort)portsIt.next();
 
575
        List<PrimitivePort> portsList = User.getUserTool().getPrimitivePortConnectedToArc(startArc);
 
576
        for (PrimitivePort p : portsList)
 
577
        {
 
578
            pp = p;
 
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))
 
582
                {
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
537
 
                                        // add to list
 
585
 
 
586
                    if (isPortProtoContained(pp))
 
587
//                    if (specifiedRoute.contains(pp))
 
588
                        continue;          // ignore ones we've already hit
 
589
 
 
590
                    // add to list
538
591
                                        int prePortSize = specifiedRoute.size();
539
 
                                        specifiedRoute.add(pp);
 
592
//                    pp = User.getUserTool().getCurrentContactPortProto(pp); // get the equivalent
 
593
                    specifiedRoute.add(pp);
540
594
 
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)
555
611
//                        {
581
637
                                                specifiedRoute.remove(specifiedRoute.size()-1);
582
638
                                        }
583
639
                                }
584
 
                        }
 
640
//                      }
585
641
                }
586
642
 
587
643
        if (DEBUGSEARCH) System.out.println(ds+"--- Bad path ---");