Select S/T in AutoSegments_Aligneds. Priority moved to TrackSegment.

* In Katana::AutoSegments_Aligneds, allow the the caller to select
    if we are propagating through source or target only (or both).
    Note that if no flag is given, it is assumed that we want to
    propagate the old way on both source and target.
* In Katana::TrackElement, Katana::TrackSegment and Katana::RoutingEvent,
    move the event priority from RoutingEvent to TrackSegment.
    Add accessor and mutators associated in TrackElement (virtual
    methods).
This commit is contained in:
Jean-Paul Chaput 2017-05-27 20:35:28 +02:00
parent e12e45e495
commit 1e49da1976
12 changed files with 59 additions and 25 deletions

View File

@ -389,7 +389,7 @@ namespace Anabatic {
if (_horizontal->getY() == axis) return;
cdebug_log(145,0) << "_setAxis() @Y " << DbU::getValueString(axis) << " " << this << endl;
cdebug_log(144,0) << "_setAxis() @Y " << DbU::getValueString(axis) << " " << this << endl;
_horizontal->setY( axis );
invalidate();

View File

@ -837,6 +837,8 @@ namespace Anabatic {
if (flags & Flags::Realignate) setAxis( getAxis(), flags );
//setAxis( optimalMin, flags );
cdebug_tabw(149,-1);
return false;
}

View File

@ -329,17 +329,23 @@ namespace Anabatic {
, _stack ()
{
if (not _master) return;
if (not _flags.intersect(Flags::Source|Flags::Target))
_flags |= Flags::Source | Flags::Target;
_flags |= (_master->isHorizontal()) ? Flags::Horizontal : Flags::Vertical;
if (_flags & Flags::WithDoglegs) _flags |= Flags::WithPerpands;
cdebug_log(144,0) << "AutoSegments_Aligneds::Locator::Locator() _flags:" << _flags.asString(FlagsFunction) << endl;
if (_flags & Flags::Source) {
AutoContact* contact = segment->getAutoSource();
if (contact) _stack.push( contact, segment );
}
contact = segment->getAutoTarget();
if (_flags & Flags::Target) {
AutoContact* contact = segment->getAutoTarget();
if (contact) _stack.push( contact, segment );
}
if (not (_flags & Flags::WithSelf)) progress();
}

View File

@ -328,7 +328,7 @@ namespace Anabatic {
if (_vertical->getX() == axis) return;
cdebug_log(149,0) << "_setAxis() @X " << DbU::getValueString(axis) << " " << this << endl;
cdebug_log(144,0) << "_setAxis() @X " << DbU::getValueString(axis) << " " << this << endl;
_vertical->setX( axis );
invalidate();

View File

@ -233,7 +233,7 @@ namespace Anabatic {
public:
// AutoSegments_Aligneds Methods.
AutoSegments_Aligneds ( AutoSegment*, Flags flags=Flags::NoFlags );
AutoSegments_Aligneds ( AutoSegment*, Flags flags );
AutoSegments_Aligneds ( const AutoSegments_Aligneds& );
virtual AutoSegmentHC* getClone () const;
virtual AutoSegmentHL* getLocator () const;

View File

@ -80,6 +80,9 @@ namespace Katana {
if (lhs._eventLevel > rhs._eventLevel) return false;
if (lhs._eventLevel < rhs._eventLevel) return true;
//if (lhs._net->getName() != rhs._net->getName())
// return lhs._net->getName() < rhs._net->getName();
// Process all M2 (terminal access) before any others.
//if ((lhs._layerDepth == 1) and (rhs._layerDepth != 1)) return false;
//if ((lhs._layerDepth != 1) and (rhs._layerDepth == 1)) return true;
@ -178,7 +181,6 @@ namespace Katana {
, _mode (mode)
, _rippleState (0)
, _eventLevel (0)
, _priority (0.0)
, _key (this)
{
if (_idCounter == std::numeric_limits<uint32_t>::max()) {
@ -653,18 +655,7 @@ namespace Katana {
and _segment->base()->getAutoTarget()->isTerminal();
}
double length = DbU::toLambda(_segment->getLength());
double slack = DbU::toLambda(_segment->base()->getSlack());
//if (length > 200.0) length = 200.0 - std::log(length)*20.0;
//if (length < 0.0) length = 0.0;
//if (slack / DbU::toLambda(_segment->getPitch()) < 2.0) slack = 999.0;
_priority = (length + 1.0) * (slack + 1.0);
//if (_priority > 10000.0) cerr << "_priority:" << _priority
// << " length:" << DbU::toLambda(_segment->getLength())
// << " slack:" << DbU::toLambda(_segment->base()->getSlack()) << endl;
_segment->updatePriority();
cdebug_log(159,0) << _segment << " has " << (int)_tracksNb << " choices " << perpandicular << endl;
cdebug_tabw(159,-1);

View File

@ -171,6 +171,14 @@ namespace Katana {
}
float TrackFixedSegment::getPriority () const
{ return 0.0; }
void TrackFixedSegment::updatePriority ( float )
{ }
string TrackFixedSegment::_getTypeName () const
{ return "TrackFixedSegment"; }

View File

@ -65,6 +65,7 @@ namespace Katana {
, _freedomDegree(0)
, _ppitch (0)
, _data (NULL)
, _priority (0.0)
, _dogLegLevel (0)
{
cdebug_log(155,0) << "CTOR TrackSegment " << (void*)this << ":" << this << endl;
@ -172,6 +173,7 @@ namespace Katana {
DbU::Unit TrackSegment::getPPitch () const { return _ppitch; }
DbU::Unit TrackSegment::getAxis () const { return _base->getAxis(); }
unsigned long TrackSegment::getFreedomDegree () const { return _freedomDegree; }
float TrackSegment::getPriority () const { return _priority; }
uint32_t TrackSegment::getDoglegLevel () const { return _dogLegLevel; }
Interval TrackSegment::getSourceConstraints () const { return _base->getSourceConstraints(); }
Interval TrackSegment::getTargetConstraints () const { return _base->getTargetConstraints(); }
@ -307,6 +309,26 @@ namespace Katana {
{ _freedomDegree = _base->getSlack(); }
void TrackSegment::updatePriority ( float forced )
{
if (forced != 0.0) { _priority = forced; return; }
double length = DbU::toLambda(getLength());
double slack = DbU::toLambda(base()->getSlack());
//if (length > 200.0) length = 200.0 - std::log(length)*20.0;
//if (length < 0.0) length = 0.0;
//if (slack / DbU::toLambda(_segment->getPitch()) < 2.0 ) slack = 999.0;
if (slack / DbU::toLambda(getPitch()) > 10.0) slack = 10.0*getPitch();
_priority = (length + 1.0) * (slack + 1.0);
//if (_priority > 10000.0) cerr << "_priority:" << _priority
// << " length:" << DbU::toLambda(getLength())
// << " slack:" << DbU::toLambda(base()->getSlack()) << endl;
}
void TrackSegment::updatePPitch ()
{
_ppitch = _base->getPPitch();

View File

@ -196,7 +196,6 @@ namespace Katana {
unsigned int _mode : 4;
unsigned int _rippleState : 4;
uint32_t _eventLevel;
float _priority;
//vector<TrackElement*> _perpandiculars;
Key _key;
};
@ -224,7 +223,7 @@ namespace Katana {
inline const Interval& RoutingEvent::getOptimal () const { return _optimal; }
inline const Interval& RoutingEvent::getPerpandicularFree () const { return _dataNegociate->getPerpandicularFree(); }
//inline const Interval& RoutingEvent::getPerpandicular () const { return _perpandicular; }
inline float RoutingEvent::getPriority () const { return _priority; }
inline float RoutingEvent::getPriority () const { return _segment->getPriority(); }
inline uint32_t RoutingEvent::getEventLevel () const { return _eventLevel; }
inline uint32_t RoutingEvent::getTracksNb () const { return _tracksNb; }
inline uint32_t RoutingEvent::getTracksFree () const { return _tracksFree; }

View File

@ -132,6 +132,7 @@ namespace Katana {
virtual DbU::Unit getPPitch () const;
inline Track* getTrack () const;
inline size_t getIndex () const;
virtual float getPriority () const = 0;
virtual unsigned long getFreedomDegree () const;
virtual float getMaxUnderDensity ( Flags flags=Flags::NoFlags ) const;
inline Box getBoundingBox () const;
@ -161,6 +162,8 @@ namespace Katana {
virtual void setTrack ( Track* );
inline void setIndex ( size_t );
virtual void setSymmetric ( TrackElement* );
inline void updatePriority ();
virtual void updatePriority ( float priority ) = 0;
virtual void updateFreedomDegree ();
virtual void setDoglegLevel ( uint32_t );
virtual void swapTrack ( TrackElement* );
@ -231,6 +234,7 @@ namespace Katana {
inline DbU::Unit TrackElement::getTargetU () const { return _targetU; }
inline Interval TrackElement::getCanonicalInterval () const { return Interval(getSourceU(),getTargetU()); }
inline void TrackElement::setIndex ( size_t index ) { _index=index; }
inline void TrackElement::updatePriority () { updatePriority( 0.0 ); }
inline void TrackElement::setRouted()
{

View File

@ -53,15 +53,15 @@ namespace Katana {
virtual TrackElement* getPrevious () const;
virtual DbU::Unit getAxis () const;
virtual Interval getFreeInterval () const;
virtual float getPriority () const;
virtual void updatePriority ( float );
virtual Record* _getRecord () const;
virtual string _getString () const;
virtual string _getTypeName () const;
protected:
// Attributes.
static Net* _blockageNet;
Segment* _segment;
protected:
// Constructors & Destructors.
TrackFixedSegment ( Track*, Segment* ) ;
@ -71,7 +71,6 @@ namespace Katana {
private:
TrackFixedSegment ( const TrackFixedSegment& );
TrackFixedSegment& operator= ( const TrackFixedSegment& );
};

View File

@ -88,6 +88,7 @@ namespace Katana {
virtual DbU::Unit getPitch () const;
virtual DbU::Unit getPPitch () const;
virtual unsigned long getFreedomDegree () const;
virtual float getPriority () const;
virtual uint32_t getDoglegLevel () const;
virtual TrackElement* getNext () const;
virtual TrackElement* getPrevious () const;
@ -107,6 +108,7 @@ namespace Katana {
// Mutators.
virtual void setTrack ( Track* );
virtual void setSymmetric ( TrackElement* );
virtual void updatePriority ( float );
virtual void updateFreedomDegree ();
virtual void setDoglegLevel ( uint32_t );
virtual void swapTrack ( TrackElement* );
@ -140,6 +142,7 @@ namespace Katana {
unsigned long _freedomDegree;
DbU::Unit _ppitch;
DataNegociate* _data;
float _priority;
unsigned int _dogLegLevel:4;
protected: