Give priority of non-pref segments anchored on punctuals over regular ones.

Introduce a new kind of flag "NonPrefOnVSmall" to mark non-preferred
segments anchoreds on small terminals (i.e. punctual). They should have
absolute priority over segments in prefered direction.
This commit is contained in:
Jean-Paul Chaput 2023-07-03 19:59:10 +02:00
parent 30b92ff33a
commit 47aadd8ef4
10 changed files with 23 additions and 1 deletions

View File

@ -3069,6 +3069,7 @@ namespace Anabatic {
if (wPitch > 1) segment->setFlags( SegWide );
if (source->canDrag() or target->canDrag()) segment->setFlags( SegDrag );
if (dir & Flags::UseNonPref) segment->setFlags( SegNonPref );
if (dir.contains(Flags::UseNonPref|Flags::OnVSmall)) segment->setFlags( SegOnVSmall );
return segment;
}

View File

@ -132,6 +132,7 @@ namespace Anabatic {
const BaseFlags Flags::NoMinLength = (1L << 37);
const BaseFlags Flags::NoSegExt = (1L << 38);
const BaseFlags Flags::NullLength = (1L << 39);
const BaseFlags Flags::OnVSmall = (1L << 40);
Flags::~Flags ()

View File

@ -278,6 +278,8 @@ namespace Anabatic {
if (flags & (VSmall|UseNonPref)) {
cdebug_log(145,0) << "case: UseNonPref" << endl;
if (flags & VSmall)
useNonPref.reset( Flags::UseNonPref );
AutoContact* subContact1 = AutoContactTurn::create( gcell, rp->getNet(), Session::getBuildContactLayer(rpDepth+1) );
AutoSegment::create( rpSourceContact, subContact1, Flags::Vertical|useNonPref );
rpSourceContact = subContact1;

View File

@ -109,6 +109,7 @@ namespace Anabatic {
static const uint64_t SegNonPref = (1L<<37);
static const uint64_t SegAtMinArea = (1L<<38);
static const uint64_t SegNoMoveUp = (1L<<39);
static const uint64_t SegOnVSmall = (1L<<40);
// Masks.
static const uint64_t SegWeakTerminal = SegStrongTerminal|SegWeakTerminal1|SegWeakTerminal2;
static const uint64_t SegNotAligned = SegNotSourceAligned|SegNotTargetAligned;
@ -202,6 +203,7 @@ namespace Anabatic {
inline bool isTerminal () const;
inline bool isUnbreakable () const;
inline bool isNonPref () const;
inline bool isNonPrefOnVSmall () const;
inline bool isDrag () const;
inline bool isAtMinArea () const;
inline bool isNotSourceAligned () const;
@ -536,6 +538,7 @@ namespace Anabatic {
inline bool AutoSegment::isLocal () const { return not (_flags & SegGlobal); }
inline bool AutoSegment::isUnbreakable () const { return _flags & SegUnbreakable; }
inline bool AutoSegment::isNonPref () const { return _flags & SegNonPref; }
inline bool AutoSegment::isNonPrefOnVSmall () const { return (_flags & SegNonPref) and (_flags & SegOnVSmall); }
inline bool AutoSegment::isBipoint () const { return _flags & SegBipoint; }
inline bool AutoSegment::isWeakTerminal () const { return (_rpDistance < 2); }
inline bool AutoSegment::isWeakTerminal1 () const { return (_rpDistance == 1); }

View File

@ -110,6 +110,7 @@ namespace Anabatic {
static const BaseFlags NoMinLength ;
static const BaseFlags NoSegExt ;
static const BaseFlags NullLength ;
static const BaseFlags OnVSmall ;
public:
inline Flags ( uint64_t flags = NoFlags );
inline Flags ( const Hurricane::BaseFlags& );

View File

@ -76,6 +76,16 @@ namespace {
cdebug_tabw(159,-1);
return;
}
if (segment->isNonPrefOnVSmall()) {
cdebug_log(159,0) << "Infinite cost from (NonPref on VSmall): " << segment << endl;
cost.setInfinite ();
cost.setOverlap ();
cost.setHardOverlap();
cost.setBlockage ();
cdebug_tabw(159,-1);
return;
}
}
if (cost.getInterval().getVMax() > intersect.getVMax()) cost.setLeftOverlap();

View File

@ -152,6 +152,7 @@ namespace Katana {
bool TrackElement::isAnalog () const { return false; }
bool TrackElement::isWide () const { return false; }
bool TrackElement::isNonPref () const { return false; }
bool TrackElement::isNonPrefOnVSmall () const { return false; }
bool TrackElement::isShortNet () const { return false; }
// Predicates.
bool TrackElement::hasSymmetric () const { return false; }

View File

@ -195,6 +195,7 @@ namespace Katana {
bool TrackSegment::isWide () const { return _base->isWide(); }
bool TrackSegment::isShortNet () const { return _base->isShortNet(); }
bool TrackSegment::isPriorityLocked () const { return _flags & PriorityLocked; }
bool TrackSegment::isNonPrefOnVSmall () const { return _base->isNonPrefOnVSmall(); }
// Predicates.
bool TrackSegment::hasSymmetric () const { return _symmetric != NULL; }
// Accessors.

View File

@ -106,6 +106,7 @@ namespace Katana {
virtual bool isVertical () const = 0;
virtual bool isWide () const;
virtual bool isNonPref () const;
virtual bool isNonPrefOnVSmall () const;
virtual bool isUnbreakable () const;
virtual bool isLocal () const;
virtual bool isGlobal () const;

View File

@ -82,6 +82,7 @@ namespace Katana {
virtual bool isAnalog () const;
virtual bool isWide () const;
virtual bool isShortNet () const;
virtual bool isNonPrefOnVSmall () const;
virtual bool isPriorityLocked () const;
// Predicates.
virtual bool hasSymmetric () const;