From 1124e92ac2e450d8ad8a629b5501b1c909a66eb3 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 20 Aug 2019 16:30:03 +0200 Subject: [PATCH] Correcting non-deterministic behavior in Anabatic/Katana (again). This non-deterministic behavior was showing only in the ARMv2a benchmark around event 180k... * Bug: In Anabatic::Session::_netInvalidateds & _netRevalidateds, the set<> was still sorted on pointers. As contacts & segments can be created to maintain connexity after a layer change, we got a discrepency in objects Ids that may generate a change in ordering later. * Bug: In Katana::Session::_doRemovalEvents(), the set of Tracks that got elements deleted was still using pointers. Now we use a TrackSet sorted on (direction,depth,axis). This should not have created a change in the results, as destructions do not change Ids, but it genereate extra differences in traces. --- anabatic/src/AutoSegment.cpp | 2 +- anabatic/src/LayerAssign.cpp | 4 + anabatic/src/anabatic/Session.h | 362 +++++++++++++------------- etesian/src/EtesianEngine.cpp | 31 --- katana/src/Session.cpp | 9 +- katana/src/Track.cpp | 4 +- katana/src/TrackElement.cpp | 2 +- katana/src/TrackFixedSegment.cpp | 6 + katana/src/TrackSegment.cpp | 4 +- katana/src/TrackSegmentNonPref.cpp | 6 +- katana/src/katana/Session.h | 10 +- katana/src/katana/Track.h | 39 ++- katana/src/katana/TrackElement.h | 5 +- katana/src/katana/TrackFixedSegment.h | 1 + katana/src/katana/TrackSegment.h | 2 +- 15 files changed, 244 insertions(+), 243 deletions(-) diff --git a/anabatic/src/AutoSegment.cpp b/anabatic/src/AutoSegment.cpp index 6eee13c0..d33cbad3 100644 --- a/anabatic/src/AutoSegment.cpp +++ b/anabatic/src/AutoSegment.cpp @@ -718,7 +718,7 @@ namespace Anabatic { if (getFlags() & SegSourceTop ) cap = getViaToTopCap (depth); else if (getFlags() & SegSourceBottom) cap = getViaToBottomCap(depth); else cap = getViaToSameCap (depth); - cdebug_log(159,0) << "getExtensionCap(): flags:" << getFlags() + cdebug_log(145,0) << "getExtensionCap(): flags:" << getFlags() << " VIA cap:" << DbU::getValueString(cap) << " " << (getFlags() & SegSourceBottom) << endl; diff --git a/anabatic/src/LayerAssign.cpp b/anabatic/src/LayerAssign.cpp index 76ca3255..b9955ac7 100644 --- a/anabatic/src/LayerAssign.cpp +++ b/anabatic/src/LayerAssign.cpp @@ -875,6 +875,8 @@ namespace Anabatic { void AnabaticEngine::layerAssign ( uint32_t method ) { + //DebugSession::open( 145, 150 ); + cdebug_log(9000,0) << "Deter| Layer Assignment" << endl; set globalNets; @@ -980,6 +982,8 @@ namespace Anabatic { // cmess2 << " - Global segments : " << global << endl; // cmess2 << " - Ratio : " // << ((float)global/(float)total)*100.0 << "%." << endl; + + //DebugSession::close(); } diff --git a/anabatic/src/anabatic/Session.h b/anabatic/src/anabatic/Session.h index 14720a17..70698b93 100644 --- a/anabatic/src/anabatic/Session.h +++ b/anabatic/src/anabatic/Session.h @@ -24,6 +24,7 @@ #include #include "hurricane/Commons.h" #include "hurricane/Box.h" +#include "hurricane/DBo.h" #include "crlcore/CellGauge.h" #include "crlcore/RoutingGauge.h" #include "anabatic/Constants.h" @@ -55,6 +56,7 @@ namespace Anabatic { using Hurricane::DbU; using Hurricane::Point; using Hurricane::Box; + using Hurricane::DBo; using Hurricane::Net; using Hurricane::Contact; using Hurricane::Segment; @@ -71,118 +73,118 @@ namespace Anabatic { class Session { public: // Static Methods. - static inline bool isOpen (); - static inline bool doDestroyBaseContact (); - static inline bool doDestroyBaseSegment (); - static inline bool doDestroyTool (); - static bool isInDemoMode (); - static bool doWarnGCellOverload (); - static Session* get ( const char* message=NULL ); - static inline Technology* getTechnology (); - static inline AnabaticEngine* getAnabatic (); - static inline const Configuration* getConfiguration (); - static float getSaturateRatio (); - static size_t getSaturateRp (); - static inline size_t getAllowedDepth (); - static DbU::Unit getExtensionCap (); - static inline CellGauge* getCellGauge (); - static inline DbU::Unit getSliceHeight (); - static inline DbU::Unit getSliceStep (); - static inline size_t getGVerticalDepth (); - static inline size_t getGHorizontalDepth (); - static inline DbU::Unit getGHorizontalPitch (); - static inline DbU::Unit getGVerticalPitch (); - static inline size_t getDVerticalDepth (); - static inline const Layer* getDVerticalLayer (); - static inline DbU::Unit getDVerticalWidth (); - static inline DbU::Unit getDVerticalPitch (); - static inline DbU::Unit getDVerticalOffset (); - static inline size_t getDHorizontalDepth (); - static inline const Layer* getDHorizontalLayer (); - static inline DbU::Unit getDHorizontalWidth (); - static inline DbU::Unit getDHorizontalPitch (); - static inline DbU::Unit getDHorizontalOffset (); - static inline size_t getDContactDepth (); - static inline const Layer* getDContactLayer (); - static inline DbU::Unit getDContactWidth (); - static inline DbU::Unit getDContactPitch (); - static inline RoutingGauge* getRoutingGauge (); - static inline RoutingLayerGauge* getLayerGauge ( size_t depth ); - static inline size_t getDepth (); - static inline size_t getViaDepth ( const Layer* layer ); - static inline size_t getLayerDepth ( const Layer* layer ); - static inline const Layer* getRoutingLayer ( size_t ); - static inline const Layer* getContactLayer ( size_t ); - static Flags getDirection ( size_t depth ); - static inline DbU::Unit getPitch ( size_t depth, Flags flags ); - static inline DbU::Unit getOffset ( size_t depth ); - static inline DbU::Unit getWireWidth ( size_t depth ); - static inline DbU::Unit getViaWidth ( size_t depth ); - static inline Flags getDirection ( const Layer* ); - static inline DbU::Unit getPitch ( const Layer*, Flags flags ); - static inline DbU::Unit getOffset ( const Layer* ); - static inline DbU::Unit getWireWidth ( const Layer* ); - static inline DbU::Unit getViaWidth ( const Layer* ); - static inline DbU::Unit getExtensionCap ( const Layer* ); - static inline Point getNearestGridPoint ( Point, Box constraints ); - static inline size_t getSegmentStackSize (); - static inline size_t getContactStackSize (); - static inline const vector& getInvalidateds (); - static inline const vector& getRevalidateds (); - static inline const set& getDestroyeds (); - static inline const vector& getDoglegs (); - static inline const set& getNetsModificateds (); - static void close (); - static void setAnabaticFlags ( Flags ); - static inline void dogleg ( AutoSegment* ); - static inline void doglegReset (); - static inline void revalidateTopology (); - static inline void setInvalidateMask ( Flags ); - static inline void invalidate ( Net* ); - static inline void invalidate ( AutoContact* ); - static inline void invalidate ( AutoSegment* ); - static inline size_t revalidate (); - static void link ( AutoContact* ); - static void link ( AutoSegment* ); - static void unlink ( AutoContact* ); - static void unlink ( AutoSegment* ); - static AutoContact* lookup ( Contact* ); - static AutoSegment* lookup ( Segment* ); - static inline void destroyRequest ( AutoSegment* ); + static inline bool isOpen (); + static inline bool doDestroyBaseContact (); + static inline bool doDestroyBaseSegment (); + static inline bool doDestroyTool (); + static bool isInDemoMode (); + static bool doWarnGCellOverload (); + static Session* get ( const char* message=NULL ); + static inline Technology* getTechnology (); + static inline AnabaticEngine* getAnabatic (); + static inline const Configuration* getConfiguration (); + static float getSaturateRatio (); + static size_t getSaturateRp (); + static inline size_t getAllowedDepth (); + static DbU::Unit getExtensionCap (); + static inline CellGauge* getCellGauge (); + static inline DbU::Unit getSliceHeight (); + static inline DbU::Unit getSliceStep (); + static inline size_t getGVerticalDepth (); + static inline size_t getGHorizontalDepth (); + static inline DbU::Unit getGHorizontalPitch (); + static inline DbU::Unit getGVerticalPitch (); + static inline size_t getDVerticalDepth (); + static inline const Layer* getDVerticalLayer (); + static inline DbU::Unit getDVerticalWidth (); + static inline DbU::Unit getDVerticalPitch (); + static inline DbU::Unit getDVerticalOffset (); + static inline size_t getDHorizontalDepth (); + static inline const Layer* getDHorizontalLayer (); + static inline DbU::Unit getDHorizontalWidth (); + static inline DbU::Unit getDHorizontalPitch (); + static inline DbU::Unit getDHorizontalOffset (); + static inline size_t getDContactDepth (); + static inline const Layer* getDContactLayer (); + static inline DbU::Unit getDContactWidth (); + static inline DbU::Unit getDContactPitch (); + static inline RoutingGauge* getRoutingGauge (); + static inline RoutingLayerGauge* getLayerGauge ( size_t depth ); + static inline size_t getDepth (); + static inline size_t getViaDepth ( const Layer* layer ); + static inline size_t getLayerDepth ( const Layer* layer ); + static inline const Layer* getRoutingLayer ( size_t ); + static inline const Layer* getContactLayer ( size_t ); + static Flags getDirection ( size_t depth ); + static inline DbU::Unit getPitch ( size_t depth, Flags flags ); + static inline DbU::Unit getOffset ( size_t depth ); + static inline DbU::Unit getWireWidth ( size_t depth ); + static inline DbU::Unit getViaWidth ( size_t depth ); + static inline Flags getDirection ( const Layer* ); + static inline DbU::Unit getPitch ( const Layer*, Flags flags ); + static inline DbU::Unit getOffset ( const Layer* ); + static inline DbU::Unit getWireWidth ( const Layer* ); + static inline DbU::Unit getViaWidth ( const Layer* ); + static inline DbU::Unit getExtensionCap ( const Layer* ); + static inline Point getNearestGridPoint ( Point, Box constraints ); + static inline size_t getSegmentStackSize (); + static inline size_t getContactStackSize (); + static inline const vector& getInvalidateds (); + static inline const vector& getRevalidateds (); + static inline const set& getDestroyeds (); + static inline const vector& getDoglegs (); + static inline const set& getNetsModificateds (); + static void close (); + static void setAnabaticFlags ( Flags ); + static inline void dogleg ( AutoSegment* ); + static inline void doglegReset (); + static inline void revalidateTopology (); + static inline void setInvalidateMask ( Flags ); + static inline void invalidate ( Net* ); + static inline void invalidate ( AutoContact* ); + static inline void invalidate ( AutoSegment* ); + static inline size_t revalidate (); + static void link ( AutoContact* ); + static void link ( AutoSegment* ); + static void unlink ( AutoContact* ); + static void unlink ( AutoSegment* ); + static AutoContact* lookup ( Contact* ); + static AutoSegment* lookup ( Segment* ); + static inline void destroyRequest ( AutoSegment* ); // Methods. - static Session* _open ( AnabaticEngine* ); - bool _doDestroyBaseContact (); - bool _doDestroyBaseSegment (); - bool _doDestroyTool (); - virtual Configuration* _getConfiguration (); - inline void _dogleg ( AutoSegment* ); - inline void _doglegReset (); - void _invalidate ( Net* ); - inline void _invalidate ( AutoContact* ); - inline void _invalidate ( AutoSegment* ); - inline void _destroyRequest ( AutoSegment* ); - void _canonize (); - void _revalidateTopology (); - virtual size_t _revalidate (); - DbU::Unit _getPitch ( size_t depth, Flags flags ) const; - Point _getNearestGridPoint ( Point, Box constraints ); - Record* _getRecord () const; - string _getString () const; - inline string _getTypeName () const; + static Session* _open ( AnabaticEngine* ); + bool _doDestroyBaseContact (); + bool _doDestroyBaseSegment (); + bool _doDestroyTool (); + virtual Configuration* _getConfiguration (); + inline void _dogleg ( AutoSegment* ); + inline void _doglegReset (); + void _invalidate ( Net* ); + inline void _invalidate ( AutoContact* ); + inline void _invalidate ( AutoSegment* ); + inline void _destroyRequest ( AutoSegment* ); + void _canonize (); + void _revalidateTopology (); + virtual size_t _revalidate (); + DbU::Unit _getPitch ( size_t depth, Flags flags ) const; + Point _getNearestGridPoint ( Point, Box constraints ); + Record* _getRecord () const; + string _getString () const; + inline string _getTypeName () const; protected: - static Session* _session; - AnabaticEngine* _anabatic; - Technology* _technology; - CellGauge* _cellGauge; - RoutingGauge* _routingGauge; - vector _autoContacts; - vector _doglegs; - vector _segmentInvalidateds; - vector _segmentRevalidateds; - set _netInvalidateds; - set _netRevalidateds; - set _destroyedSegments; + static Session* _session; + AnabaticEngine* _anabatic; + Technology* _technology; + CellGauge* _cellGauge; + RoutingGauge* _routingGauge; + vector _autoContacts; + vector _doglegs; + vector _segmentInvalidateds; + vector _segmentRevalidateds; + set _netInvalidateds; + set _netRevalidateds; + set _destroyedSegments; // Constructors. protected: @@ -197,77 +199,77 @@ namespace Anabatic { // Inline Functions. - inline bool Session::isOpen () { return get() != NULL; } - inline Technology* Session::getTechnology () { return get("getTechnology()")->_technology; } - inline CellGauge* Session::getCellGauge () { return get("getCellGauge()")->_cellGauge; } - inline RoutingGauge* Session::getRoutingGauge () { return get("getRoutingGauge()")->_routingGauge; } - inline bool Session::doDestroyBaseContact () { return get("doDestroyBaseContact()")->_doDestroyBaseContact(); } - inline bool Session::doDestroyBaseSegment () { return get("doDestroyBaseSegment()")->_doDestroyBaseSegment(); } - inline bool Session::doDestroyTool () { return get("doDestroyTool()")->_doDestroyTool(); } - inline const Configuration* Session::getConfiguration () { return get("getConfiguration()")->_getConfiguration(); } - inline AnabaticEngine* Session::getAnabatic () { return get("getAnabatic()")->_anabatic; } - inline void Session::revalidateTopology () { return get("revalidateTopology()")->_revalidateTopology(); } - inline size_t Session::revalidate () { return get("revalidate()")->_revalidate(); } - inline size_t Session::getSegmentStackSize () { return get("getSegmentStackSize()")->_segmentInvalidateds.size(); } - inline size_t Session::getContactStackSize () { return get("getContactStackSize()")->_autoContacts.size(); } - inline const vector& Session::getInvalidateds () { return get("getInvalidateds()")->_segmentInvalidateds; } - inline const vector& Session::getRevalidateds () { return get("getRevalidateds()")->_segmentRevalidateds; } - inline const set& Session::getDestroyeds () { return get("getDestroyeds()")->_destroyedSegments; } - inline const vector& Session::getDoglegs () { return get("getDoglegs()")->_doglegs; } - inline const set& Session::getNetsModificateds () { return get("getNetsModificateds()")->_netRevalidateds; } - inline void Session::doglegReset () { return get("doglegReset()")->_doglegReset (); } - inline void Session::invalidate ( Net* net ) { return get("invalidate(Net*)")->_invalidate(net); } - inline void Session::invalidate ( AutoContact* autoContact ) { return get("invalidate(AutoContact*)")->_invalidate(autoContact); } - inline void Session::invalidate ( AutoSegment* autoSegment ) { return get("invalidate(AutoSegment*)")->_invalidate(autoSegment); } - inline void Session::dogleg ( AutoSegment* autoSegment ) { return get("dogleg(AutoSegment*)")->_dogleg(autoSegment); } - inline void Session::destroyRequest ( AutoSegment* autoSegment ) { return get("destroyRequest(AutoSegment*)")->_destroyRequest(autoSegment); } - - inline size_t Session::getAllowedDepth () { return getConfiguration()->getAllowedDepth(); } - - inline DbU::Unit Session::getSliceHeight () { return getCellGauge()->getSliceHeight(); } - inline DbU::Unit Session::getSliceStep () { return getCellGauge()->getSliceStep(); } - inline size_t Session::getGVerticalDepth () { return getConfiguration()->getGVerticalDepth(); } - inline size_t Session::getGHorizontalDepth () { return getConfiguration()->getGHorizontalDepth(); } - inline DbU::Unit Session::getGVerticalPitch () { return getConfiguration()->getGVerticalPitch(); } - inline DbU::Unit Session::getGHorizontalPitch () { return getConfiguration()->getGHorizontalPitch(); } - inline size_t Session::getDVerticalDepth () { return getConfiguration()->getDVerticalDepth(); } - inline const Layer* Session::getDVerticalLayer () { return getConfiguration()->getDVerticalLayer(); } - inline DbU::Unit Session::getDVerticalWidth () { return getConfiguration()->getDVerticalWidth(); } - inline DbU::Unit Session::getDVerticalPitch () { return getConfiguration()->getDVerticalPitch(); } - inline DbU::Unit Session::getDVerticalOffset () { return getConfiguration()->getDVerticalOffset(); } - inline size_t Session::getDHorizontalDepth () { return getConfiguration()->getDHorizontalDepth(); } - inline const Layer* Session::getDHorizontalLayer () { return getConfiguration()->getDHorizontalLayer(); } - inline DbU::Unit Session::getDHorizontalWidth () { return getConfiguration()->getDHorizontalWidth(); } - inline DbU::Unit Session::getDHorizontalPitch () { return getConfiguration()->getDHorizontalPitch(); } - inline DbU::Unit Session::getDHorizontalOffset () { return getConfiguration()->getDHorizontalOffset(); } - inline size_t Session::getDContactDepth () { return getConfiguration()->getDContactDepth(); } - inline const Layer* Session::getDContactLayer () { return getConfiguration()->getDContactLayer(); } - inline DbU::Unit Session::getDContactWidth () { return getConfiguration()->getDContactWidth(); } - inline DbU::Unit Session::getDContactPitch () { return getConfiguration()->getDContactPitch(); } - inline RoutingLayerGauge* Session::getLayerGauge ( size_t depth ) { return getRoutingGauge()->getLayerGauge(depth); } - inline size_t Session::getDepth () { return getRoutingGauge()->getDepth(); } - inline size_t Session::getViaDepth ( const Layer* layer ) { return getRoutingGauge()->getViaDepth(layer); } - inline size_t Session::getLayerDepth ( const Layer* layer ) { return getRoutingGauge()->getLayerDepth(layer); } - inline const Layer* Session::getRoutingLayer ( size_t depth ) { return getRoutingGauge()->getRoutingLayer(depth); } - inline const Layer* Session::getContactLayer ( size_t depth ) { return getRoutingGauge()->getContactLayer(depth); } - inline DbU::Unit Session::getPitch ( size_t depth, Flags flags=Flags::NoFlags ) { return get("getPitch(depth,flags)")->_getPitch( depth, flags ); } - inline DbU::Unit Session::getOffset ( size_t depth ) { return getRoutingGauge()->getLayerOffset(depth); } - inline DbU::Unit Session::getWireWidth ( size_t depth ) { return getRoutingGauge()->getLayerWireWidth(depth); } - inline DbU::Unit Session::getViaWidth ( size_t depth ) { return getRoutingGauge()->getViaWidth(depth); } - inline DbU::Unit Session::getPitch ( const Layer* layer, Flags flags=Flags::NoFlags ) { return getPitch( getLayerDepth(layer), flags ); } - inline DbU::Unit Session::getOffset ( const Layer* layer ) { return getOffset ( getLayerDepth(layer) ); } - inline DbU::Unit Session::getWireWidth ( const Layer* layer ) { return getWireWidth( getLayerDepth(layer) ); } - inline DbU::Unit Session::getViaWidth ( const Layer* layer ) { return getViaWidth ( getViaDepth(layer) ); } - inline DbU::Unit Session::getExtensionCap ( const Layer* layer ) { return getConfiguration()->getExtensionCap(layer); } - inline Flags Session::getDirection ( const Layer* layer ) { return getDirection( getLayerDepth(layer) ); } - inline Point Session::getNearestGridPoint ( Point p, Box b ) { return get("getNearestGridPoint()")->_getNearestGridPoint(p,b); } - - inline void Session::_dogleg ( AutoSegment* segment ) { _doglegs.push_back(segment); } - inline void Session::_doglegReset () { _doglegs.clear(); } - inline void Session::_invalidate ( AutoContact* contact ) { _autoContacts.push_back(contact); } - inline void Session::_invalidate ( AutoSegment* segment ) { _segmentInvalidateds.push_back(segment); } - inline void Session::_destroyRequest ( AutoSegment* segment ) { _destroyedSegments.insert(segment); } - inline string Session::_getTypeName () const { return _TName("Session"); } + inline bool Session::isOpen () { return get() != NULL; } + inline Technology* Session::getTechnology () { return get("getTechnology()")->_technology; } + inline CellGauge* Session::getCellGauge () { return get("getCellGauge()")->_cellGauge; } + inline RoutingGauge* Session::getRoutingGauge () { return get("getRoutingGauge()")->_routingGauge; } + inline bool Session::doDestroyBaseContact () { return get("doDestroyBaseContact()")->_doDestroyBaseContact(); } + inline bool Session::doDestroyBaseSegment () { return get("doDestroyBaseSegment()")->_doDestroyBaseSegment(); } + inline bool Session::doDestroyTool () { return get("doDestroyTool()")->_doDestroyTool(); } + inline const Configuration* Session::getConfiguration () { return get("getConfiguration()")->_getConfiguration(); } + inline AnabaticEngine* Session::getAnabatic () { return get("getAnabatic()")->_anabatic; } + inline void Session::revalidateTopology () { return get("revalidateTopology()")->_revalidateTopology(); } + inline size_t Session::revalidate () { return get("revalidate()")->_revalidate(); } + inline size_t Session::getSegmentStackSize () { return get("getSegmentStackSize()")->_segmentInvalidateds.size(); } + inline size_t Session::getContactStackSize () { return get("getContactStackSize()")->_autoContacts.size(); } + inline const vector& Session::getInvalidateds () { return get("getInvalidateds()")->_segmentInvalidateds; } + inline const vector& Session::getRevalidateds () { return get("getRevalidateds()")->_segmentRevalidateds; } + inline const set& Session::getDestroyeds () { return get("getDestroyeds()")->_destroyedSegments; } + inline const vector& Session::getDoglegs () { return get("getDoglegs()")->_doglegs; } + inline const set& Session::getNetsModificateds () { return get("getNetsModificateds()")->_netRevalidateds; } + inline void Session::doglegReset () { return get("doglegReset()")->_doglegReset (); } + inline void Session::invalidate ( Net* net ) { return get("invalidate(Net*)")->_invalidate(net); } + inline void Session::invalidate ( AutoContact* autoContact ) { return get("invalidate(AutoContact*)")->_invalidate(autoContact); } + inline void Session::invalidate ( AutoSegment* autoSegment ) { return get("invalidate(AutoSegment*)")->_invalidate(autoSegment); } + inline void Session::dogleg ( AutoSegment* autoSegment ) { return get("dogleg(AutoSegment*)")->_dogleg(autoSegment); } + inline void Session::destroyRequest ( AutoSegment* autoSegment ) { return get("destroyRequest(AutoSegment*)")->_destroyRequest(autoSegment); } + + inline size_t Session::getAllowedDepth () { return getConfiguration()->getAllowedDepth(); } + + inline DbU::Unit Session::getSliceHeight () { return getCellGauge()->getSliceHeight(); } + inline DbU::Unit Session::getSliceStep () { return getCellGauge()->getSliceStep(); } + inline size_t Session::getGVerticalDepth () { return getConfiguration()->getGVerticalDepth(); } + inline size_t Session::getGHorizontalDepth () { return getConfiguration()->getGHorizontalDepth(); } + inline DbU::Unit Session::getGVerticalPitch () { return getConfiguration()->getGVerticalPitch(); } + inline DbU::Unit Session::getGHorizontalPitch () { return getConfiguration()->getGHorizontalPitch(); } + inline size_t Session::getDVerticalDepth () { return getConfiguration()->getDVerticalDepth(); } + inline const Layer* Session::getDVerticalLayer () { return getConfiguration()->getDVerticalLayer(); } + inline DbU::Unit Session::getDVerticalWidth () { return getConfiguration()->getDVerticalWidth(); } + inline DbU::Unit Session::getDVerticalPitch () { return getConfiguration()->getDVerticalPitch(); } + inline DbU::Unit Session::getDVerticalOffset () { return getConfiguration()->getDVerticalOffset(); } + inline size_t Session::getDHorizontalDepth () { return getConfiguration()->getDHorizontalDepth(); } + inline const Layer* Session::getDHorizontalLayer () { return getConfiguration()->getDHorizontalLayer(); } + inline DbU::Unit Session::getDHorizontalWidth () { return getConfiguration()->getDHorizontalWidth(); } + inline DbU::Unit Session::getDHorizontalPitch () { return getConfiguration()->getDHorizontalPitch(); } + inline DbU::Unit Session::getDHorizontalOffset () { return getConfiguration()->getDHorizontalOffset(); } + inline size_t Session::getDContactDepth () { return getConfiguration()->getDContactDepth(); } + inline const Layer* Session::getDContactLayer () { return getConfiguration()->getDContactLayer(); } + inline DbU::Unit Session::getDContactWidth () { return getConfiguration()->getDContactWidth(); } + inline DbU::Unit Session::getDContactPitch () { return getConfiguration()->getDContactPitch(); } + inline RoutingLayerGauge* Session::getLayerGauge ( size_t depth ) { return getRoutingGauge()->getLayerGauge(depth); } + inline size_t Session::getDepth () { return getRoutingGauge()->getDepth(); } + inline size_t Session::getViaDepth ( const Layer* layer ) { return getRoutingGauge()->getViaDepth(layer); } + inline size_t Session::getLayerDepth ( const Layer* layer ) { return getRoutingGauge()->getLayerDepth(layer); } + inline const Layer* Session::getRoutingLayer ( size_t depth ) { return getRoutingGauge()->getRoutingLayer(depth); } + inline const Layer* Session::getContactLayer ( size_t depth ) { return getRoutingGauge()->getContactLayer(depth); } + inline DbU::Unit Session::getPitch ( size_t depth, Flags flags=Flags::NoFlags ) { return get("getPitch(depth,flags)")->_getPitch( depth, flags ); } + inline DbU::Unit Session::getOffset ( size_t depth ) { return getRoutingGauge()->getLayerOffset(depth); } + inline DbU::Unit Session::getWireWidth ( size_t depth ) { return getRoutingGauge()->getLayerWireWidth(depth); } + inline DbU::Unit Session::getViaWidth ( size_t depth ) { return getRoutingGauge()->getViaWidth(depth); } + inline DbU::Unit Session::getPitch ( const Layer* layer, Flags flags=Flags::NoFlags ) { return getPitch( getLayerDepth(layer), flags ); } + inline DbU::Unit Session::getOffset ( const Layer* layer ) { return getOffset ( getLayerDepth(layer) ); } + inline DbU::Unit Session::getWireWidth ( const Layer* layer ) { return getWireWidth( getLayerDepth(layer) ); } + inline DbU::Unit Session::getViaWidth ( const Layer* layer ) { return getViaWidth ( getViaDepth(layer) ); } + inline DbU::Unit Session::getExtensionCap ( const Layer* layer ) { return getConfiguration()->getExtensionCap(layer); } + inline Flags Session::getDirection ( const Layer* layer ) { return getDirection( getLayerDepth(layer) ); } + inline Point Session::getNearestGridPoint ( Point p, Box b ) { return get("getNearestGridPoint()")->_getNearestGridPoint(p,b); } + + inline void Session::_dogleg ( AutoSegment* segment ) { _doglegs.push_back(segment); } + inline void Session::_doglegReset () { _doglegs.clear(); } + inline void Session::_invalidate ( AutoContact* contact ) { _autoContacts.push_back(contact); } + inline void Session::_invalidate ( AutoSegment* segment ) { _segmentInvalidateds.push_back(segment); } + inline void Session::_destroyRequest ( AutoSegment* segment ) { _destroyedSegments.insert(segment); } + inline string Session::_getTypeName () const { return _TName("Session"); } } // Anabatic namespace. diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index d077cfa6..bb8b63a1 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -1035,37 +1035,6 @@ namespace Etesian { } -#if DISABLED - void EtesianEngine::place ( Instance* instance ) - { - setBlock( instance ); - - if (getCell()->getAbutmentBox().isEmpty()) { - cmess2 << Error( "EtesianEngine::place(): Cell \"%s\" must have an abutment box." - , getString(getCell()->getName()).c_str() - ) << std::endl; - return; - } - if (getBlockCell()->getAbutmentBox().isEmpty()) { - cmess2 << Error( "EtesianEngine::place(): Instance \"%s\" must have an abutment box." - , getString(instance->getName()).c_str() - ) << std::endl; - return; - } - if(getBlockCell()->isPlaced()){ - cmess2 << Error( "EtesianEngine::place(): The instance \"%s\" is already placed." - , getString(instance->getName()).c_str() - ) << std::endl; - return; - } - getBlockCell()->uniquify(); - - getConfiguration()->print( getCell() ); - findYSpin(); - } -#endif - - void EtesianEngine::_progressReport1 ( string label ) const { size_t w = label.size(); diff --git a/katana/src/Session.cpp b/katana/src/Session.cpp index d975efd7..a59715f5 100644 --- a/katana/src/Session.cpp +++ b/katana/src/Session.cpp @@ -211,10 +211,10 @@ namespace Katana { { cdebug_log(159,1) << "Katana::Session::_doRemovalEvents()" << endl; - set packTracks; + TrackSet packTracks; for ( size_t i=0 ; i<_removeEvents.size() ; ++i ) { - cdebug_log(159,0) << "Event:" << _removeEvents[i]._segment << endl; + cdebug_log(159,0) << "Remove event for:" << _removeEvents[i]._segment << endl; if (not _removeEvents[i]._segment->getTrack()) continue; _removeEvents[i]._segment->detach( packTracks ); @@ -222,7 +222,7 @@ namespace Katana { } _removeEvents.clear(); - for ( set::iterator it=packTracks.begin() ; it != packTracks.end() ; ++it ) + for ( TrackSet::iterator it=packTracks.begin() ; it != packTracks.end() ; ++it ) (*it)->doRemoval(); cdebug_tabw(159,-1); @@ -453,7 +453,8 @@ namespace Katana { return; } if (forced) track->invalidate(); - _sortEvents.insert( track ); + for ( Track* elem : _sortEvents ) if (elem == track) return; + _sortEvents.push_back( track ); } diff --git a/katana/src/Track.cpp b/katana/src/Track.cpp index 1cb809a6..a6b2e584 100644 --- a/katana/src/Track.cpp +++ b/katana/src/Track.cpp @@ -93,7 +93,7 @@ namespace Katana { { cdebug_log(155,1) << "Track::_preDestroy() - " << (void*)this << " " << this << endl; - set dummy; + TrackSet dummy; for ( size_t i=0 ; i<_segments.size() ; i++ ) if (_segments[i]) { _segments[i]->detach( dummy ); @@ -520,7 +520,7 @@ namespace Katana { bool holes = false; if (message) cerr << " o Checking Track - " << message << endl; - cdebug_log(155,0) << (void*)this << ":" << this << endl; + cdebug_log(155,0) << /*(void*)this << ":" <<*/ this << endl; for ( size_t i=0 ; i<_segments.size() ; i++ ) { if (_segments[i]) { diff --git a/katana/src/TrackElement.cpp b/katana/src/TrackElement.cpp index 9968db8a..63ab5725 100644 --- a/katana/src/TrackElement.cpp +++ b/katana/src/TrackElement.cpp @@ -189,7 +189,7 @@ namespace Katana { void TrackElement::swapTrack ( TrackElement* ) { } void TrackElement::reschedule ( uint32_t ) { } //void TrackElement::detach () { } - void TrackElement::detach ( set& ) { } +//void TrackElement::detach ( TrackSet& ) { } void TrackElement::revalidate () { } void TrackElement::updatePPitch () { } void TrackElement::updateTrackSpan () { } diff --git a/katana/src/TrackFixedSegment.cpp b/katana/src/TrackFixedSegment.cpp index 38823e22..80bd6b7b 100644 --- a/katana/src/TrackFixedSegment.cpp +++ b/katana/src/TrackFixedSegment.cpp @@ -237,6 +237,12 @@ namespace Katana { { } + void TrackFixedSegment::detach ( TrackSet& removeds ) + { + // cerr << Error( "TrackFixedSegment::detach(): Must never be called on %s." + // , getString(this).c_str()) << endl; + } + string TrackFixedSegment::_getTypeName () const { return "TrackFixedSegment"; } diff --git a/katana/src/TrackSegment.cpp b/katana/src/TrackSegment.cpp index f18d3811..4a18f2fe 100644 --- a/katana/src/TrackSegment.cpp +++ b/katana/src/TrackSegment.cpp @@ -441,9 +441,9 @@ namespace Katana { // } - void TrackSegment::detach ( set& removeds ) + void TrackSegment::detach ( TrackSet& removeds ) { - cdebug_log(159,1) << "TrackSegment::detach(set&) - trackSpan:" + cdebug_log(159,1) << "TrackSegment::detach(TrackSet&) - trackSpan:" << getTrackSpan() << endl; Track* wtrack = getTrack(); diff --git a/katana/src/TrackSegmentNonPref.cpp b/katana/src/TrackSegmentNonPref.cpp index 13fc27b5..d1f5afd1 100644 --- a/katana/src/TrackSegmentNonPref.cpp +++ b/katana/src/TrackSegmentNonPref.cpp @@ -60,8 +60,8 @@ namespace Katana { , _trackSpan (0) , _trackCount(0) { - cdebug_log(159,1) << "CTOR TrackSegmentNonPref " << (void*)this << ":" << this << endl; - cdebug_log(159,0) << " over " << (void*)segment << ":" << segment << endl; + cdebug_log(159,1) << "CTOR TrackSegmentNonPref " << /*(void*)this << ":" <<*/ this << endl; + cdebug_log(159,0) << " over " << /*(void*)segment << ":" <<*/ segment << endl; updateTrackSpan(); @@ -94,7 +94,7 @@ namespace Katana { void TrackSegmentNonPref::updateTrackSpan () { DebugSession::open( getNet(), 150, 160 ); - cdebug_log(159,1) << "TrackSegmentNonPref::updateTrackspan() " << (void*)this << ":" << this << endl; + cdebug_log(159,1) << "TrackSegmentNonPref::updateTrackspan() " << /*(void*)this << ":" <<*/ this << endl; RoutingPlane* plane = Session::getKatanaEngine()->getRoutingPlaneByLayer(_base->getLayer()); Interval newAxisSpan ( _base->getSourcePosition(), _base->getTargetPosition() ); diff --git a/katana/src/katana/Session.h b/katana/src/katana/Session.h index 1f6d61cb..fea8218c 100644 --- a/katana/src/katana/Session.h +++ b/katana/src/katana/Session.h @@ -128,11 +128,11 @@ namespace Katana { }; protected: // Attributes. - vector _indirectInvalids; - vector _insertEvents; - vector _removeEvents; - vector _lockEvents; - set _sortEvents; + vector _indirectInvalids; + vector _insertEvents; + vector _removeEvents; + vector _lockEvents; + vector _sortEvents; protected: // Constructors & Destructors. Session ( KatanaEngine* ); diff --git a/katana/src/katana/Track.h b/katana/src/katana/Track.h index 2f607041..d14be33d 100644 --- a/katana/src/katana/Track.h +++ b/katana/src/katana/Track.h @@ -87,7 +87,7 @@ namespace Katana { TrackElement* getPrevious ( size_t& index, Net* ) const; TrackElement* getNextFixed ( size_t& index ) const; size_t find ( const TrackElement* ) const; - DbU::Unit getSourcePosition ( vector::iterator ) const; + DbU::Unit getSourcePosition ( std::vector::iterator ) const; DbU::Unit getMinimalPosition ( size_t index, uint32_t state ) const; DbU::Unit getMaximalPosition ( size_t index, uint32_t state ) const; Interval getFreeInterval ( DbU::Unit position, Net* net=NULL ) const; @@ -115,16 +115,16 @@ namespace Katana { protected: // Attributes. - RoutingPlane* _routingPlane; - size_t _index; - DbU::Unit _axis; - DbU::Unit _min; - DbU::Unit _max; - vector _segments; - vector _markers; - bool _localAssigned; - bool _segmentsValid; - bool _markersValid; + RoutingPlane* _routingPlane; + size_t _index; + DbU::Unit _axis; + DbU::Unit _min; + DbU::Unit _max; + std::vector _segments; + std::vector _markers; + bool _localAssigned; + bool _segmentsValid; + bool _markersValid; protected: // Constructors & Destructors. @@ -153,6 +153,11 @@ namespace Katana { struct SegmentCompare { inline bool operator() ( const TrackElement* lhs, const TrackElement* rhs ); }; + + public: + struct Compare { + inline bool operator() ( const Track* lhs, const Track* rhs ) const; + }; }; @@ -210,6 +215,18 @@ namespace Katana { } + inline bool Track::Compare::operator() ( const Track* lhs, const Track* rhs ) const + { + if (lhs->isHorizontal() xor rhs->isHorizontal()) return lhs->isHorizontal(); + if (lhs->getDepth () != rhs->getDepth ()) return lhs->getDepth() < rhs->getDepth(); + + return (lhs->getAxis() < rhs->getAxis()); + } + + + class TrackSet : public std::set { }; + + } // Katana namespace. diff --git a/katana/src/katana/TrackElement.h b/katana/src/katana/TrackElement.h index d5808031..119f9f5d 100644 --- a/katana/src/katana/TrackElement.h +++ b/katana/src/katana/TrackElement.h @@ -55,6 +55,7 @@ namespace Katana { class Track; class TrackCost; class TrackSegment; + class TrackSet; typedef map TrackElementPairing; @@ -174,7 +175,7 @@ namespace Katana { virtual Interval getTargetConstraints () const; virtual DataNegociate* getDataNegociate ( Flags flags=Flags::DataSelf ) const; inline TrackElement* getCanonical ( Interval& ); - virtual size_t getGCells ( vector& ) const; + virtual size_t getGCells ( std::vector& ) const; virtual TrackElement* getParent () const; virtual uint32_t getDoglegLevel () const; virtual TrackElement* getSourceDogleg (); @@ -197,7 +198,7 @@ namespace Katana { virtual void swapTrack ( TrackElement* ); virtual void reschedule ( uint32_t level ); //virtual void detach (); - virtual void detach ( std::set& ); + virtual void detach ( TrackSet& ) = 0; virtual void invalidate (); virtual void revalidate (); virtual void updatePPitch (); diff --git a/katana/src/katana/TrackFixedSegment.h b/katana/src/katana/TrackFixedSegment.h index 977034c9..51cdfb6a 100644 --- a/katana/src/katana/TrackFixedSegment.h +++ b/katana/src/katana/TrackFixedSegment.h @@ -65,6 +65,7 @@ namespace Katana { virtual void forcePriority ( float ); virtual void computePriority (); virtual void computeAlignedPriority (); + virtual void detach ( TrackSet& ); virtual Record* _getRecord () const; virtual string _getString () const; virtual string _getTypeName () const; diff --git a/katana/src/katana/TrackSegment.h b/katana/src/katana/TrackSegment.h index c799b208..4f9ef1a4 100644 --- a/katana/src/katana/TrackSegment.h +++ b/katana/src/katana/TrackSegment.h @@ -134,7 +134,7 @@ namespace Katana { virtual void swapTrack ( TrackElement* ); virtual void reschedule ( uint32_t level ); //virtual void detach (); - virtual void detach ( std::set& ); + virtual void detach ( TrackSet& ); virtual void invalidate (); virtual void revalidate (); virtual void updatePPitch ();