From bba364eecc56be5196da9d826d1c4428f1c087c1 Mon Sep 17 00:00:00 2001
From: Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
Date: Sun, 23 Oct 2022 15:23:22 +0200
Subject: [PATCH] Fix: some AutoSegments where wrongly flagged as reduced.

* Bug: In Anabatic::AutoSegment::canReduce(), when looking at a fixed
    segment we were unconditionally flagging it as reduced if it was
    a "jumper", regardless of it's length.
      It was wrong, now also check for a length below the P-Pitch.
      This was introduced when implementing the channel routing.
---
 anabatic/src/AutoSegment.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/anabatic/src/AutoSegment.cpp b/anabatic/src/AutoSegment.cpp
index 65dd6ea0..7250b0ac 100644
--- a/anabatic/src/AutoSegment.cpp
+++ b/anabatic/src/AutoSegment.cpp
@@ -1802,7 +1802,7 @@ namespace Anabatic {
     AutoContact* source = getAutoSource();
     AutoContact* target = getAutoTarget();
 
-    if (isFixed()) {
+    if (isFixed() and (length < getPPitch())) {
       if (isSpinTopOrBottom() and source->isTurn() and target->isTurn())
         return true;
       return false;