17 #ifndef KATABATIC_KATABATIC_ENGINE_H 18 #define KATABATIC_KATABATIC_ENGINE_H 25 #include "hurricane/DbU.h" 26 #include "hurricane/Torus.h" 27 #include "hurricane/Layer.h" 28 #include "hurricane/Net.h" 29 #include "hurricane/NetRoutingProperty.h" 37 #include "crlcore/ToolEngine.h" 41 class RoutingLayerGauge;
44 #include "katabatic/Constants.h" 45 #include "katabatic/Configuration.h" 46 #include "katabatic/GCell.h" 47 #include "katabatic/AutoSegments.h" 48 #include "katabatic/AutoContact.h" 49 #include "katabatic/ChipTools.h" 58 using Hurricane::Timer;
61 using Hurricane::Torus;
66 using Hurricane::NetRoutingExtension;
67 using Hurricane::NetRoutingState;
78 struct NetCompareByName {
79 inline bool operator() (
const Net* lhs,
const Net* rhs )
const;
82 inline bool NetCompareByName::operator() (
const Net* lhs,
const Net* rhs )
const 83 {
return lhs->getName() < rhs->getName(); }
89 typedef map<Name,NetRoutingState*> NetRoutingStates;
94 typedef set<Net*,NetCompareByName>
NetSet;
101 static const Name& staticGetName ();
102 inline bool isGMetal (
const Layer* )
const;
103 inline bool isGContact (
const Layer* )
const;
104 inline bool isChip ()
const;
105 inline bool isInDemoMode ()
const;
106 inline bool doWarnOnGCellOverload ()
const;
107 inline bool doDestroyBaseContact ()
const;
108 inline bool doDestroyBaseSegment ()
const;
109 inline bool doDestroyTool ()
const;
110 virtual const Name& getName ()
const;
112 inline unsigned int getFlags (
unsigned int mask )
const;
113 inline Configuration* getKatabaticConfiguration ();
114 virtual Configuration* getConfiguration ();
115 inline CellGauge* getCellGauge ()
const;
118 inline const Layer* getRoutingLayer (
size_t depth )
const ;
119 inline Layer* getContactLayer (
size_t depth )
const ;
121 inline const NetSet& getRoutingNets ()
const;
122 inline DbU::Unit getGlobalThreshold ()
const;
123 inline float getSaturateRatio ()
const;
124 inline size_t getSaturateRp ()
const;
125 inline DbU::Unit getExtensionCap ()
const;
126 inline const ChipTools& getChipTools ()
const;
127 inline const NetRoutingStates& getNetRoutingStates ()
const;
128 void xmlWriteGCellGrid ( ostream& );
129 void xmlWriteGCellGrid (
const string& );
132 inline void setFlags (
unsigned int );
133 inline void unsetFlags (
unsigned int );
134 inline void setGlobalThreshold (
DbU::Unit );
135 inline void setSaturateRatio (
float );
136 inline void setSaturateRp (
size_t );
137 void printMeasures (
const string& )
const;
138 void refresh (
unsigned int flags=KbOpenSession );
139 virtual void createDetailedGrid ();
141 void findSpecialNets ();
142 void makePowerRails ();
143 virtual void loadGlobalRouting (
unsigned int method );
145 void slackenBlockIos (
Instance* core );
150 void balanceGlobalDensity ();
151 void layerAssign (
unsigned int method );
152 void updateNetTopology (
Net* );
153 void computeNetConstraints (
Net* );
154 void toOptimals (
Net* );
155 virtual void finalizeLayout ();
157 NetRoutingState* getRoutingState (
Net*,
unsigned int flags=KbNoFlags );
158 void _computeNetOptimals (
Net* );
159 void _computeNetTerminals (
Net* );
160 bool _check (
const char* message=NULL )
const;
161 void _check (
Net* )
const;
162 void _gutKatabatic ();
169 void _destroyAutoSegments ();
170 void _destroyAutoContacts ();
171 void _loadGrByNet ();
172 void _loadNetGlobalRouting (
Net* );
173 void _alignate (
Net* );
174 void _balanceGlobalDensity (
unsigned int depth );
175 void _desaturate (
unsigned int depth, set<Net*>&,
unsigned long& total,
unsigned long& globals );
176 void _layerAssignByLength (
unsigned long& total,
unsigned long& global, set<Net*>& );
177 void _layerAssignByLength (
Net*,
unsigned long& total,
unsigned long& global, set<Net*>& );
178 void _layerAssignByTrunk (
unsigned long& total,
unsigned long& global, set<Net*>& );
179 void _layerAssignByTrunk (
Net*, set<Net*>&,
unsigned long& total,
unsigned long& global );
180 void _saveNet (
Net* );
181 void _print ()
const;
182 void _print (
Net* )
const;
183 inline const AutoContactLut& _getAutoContactLut ()
const;
184 inline const AutoSegmentLut& _getAutoSegmentLut ()
const;
186 virtual Record* _getRecord ()
const;
187 virtual string _getString ()
const;
188 virtual string _getTypeName ()
const;
192 static Name _toolName;
195 Configuration* _configuration;
198 AutoSegmentLut _autoSegmentLut;
199 AutoContactLut _autoContactLut;
200 NetRoutingStates _netRoutingStates;
206 virtual void _postCreate ();
207 virtual void _preDestroy ();
215 inline bool KatabaticEngine::doDestroyBaseContact ()
const {
return _flags & EngineDestroyBaseContact; }
216 inline bool KatabaticEngine::doDestroyBaseSegment ()
const {
return _flags & EngineDestroyBaseSegment; }
217 inline bool KatabaticEngine::doDestroyTool ()
const {
return _state >=
EngineGutted; }
218 inline bool KatabaticEngine::doWarnOnGCellOverload ()
const {
return _flags & EngineWarnOnGCellOverload; }
219 inline bool KatabaticEngine::isInDemoMode ()
const {
return _flags & EngineDemoMode; }
220 inline Configuration* KatabaticEngine::getKatabaticConfiguration () {
return _configuration; }
221 inline bool KatabaticEngine::isGMetal (
const Layer* layer )
const {
return _configuration->isGMetal(layer); }
222 inline bool KatabaticEngine::isGContact (
const Layer* layer )
const {
return _configuration->isGContact(layer); }
223 inline void KatabaticEngine::setFlags (
unsigned int flags ) { _flags |= flags; }
224 inline void KatabaticEngine::unsetFlags (
unsigned int flags ) { _flags &= ~flags; }
225 inline void KatabaticEngine::setSaturateRatio (
float ratio ) { _configuration->setSaturateRatio(ratio); }
226 inline void KatabaticEngine::setSaturateRp (
size_t threshold ) { _configuration->setSaturateRp(threshold); }
227 inline void KatabaticEngine::setGlobalThreshold (
DbU::Unit threshold ) { _configuration->setGlobalThreshold(threshold); }
228 inline unsigned int KatabaticEngine::getFlags (
unsigned int mask )
const {
return _flags & mask; }
229 inline EngineState KatabaticEngine::getState ()
const {
return _state; }
230 inline CellGauge* KatabaticEngine::getCellGauge ()
const {
return _configuration->getCellGauge(); }
231 inline RoutingGauge* KatabaticEngine::getRoutingGauge ()
const {
return _configuration->getRoutingGauge(); }
232 inline RoutingLayerGauge* KatabaticEngine::getLayerGauge (
size_t depth )
const {
return _configuration->getLayerGauge(depth); }
233 inline const Layer* KatabaticEngine::getRoutingLayer (
size_t depth )
const {
return _configuration->getRoutingLayer(depth); }
234 inline Layer* KatabaticEngine::getContactLayer (
size_t depth )
const {
return _configuration->getContactLayer(depth); }
235 inline GCellGrid* KatabaticEngine::getGCellGrid ()
const {
return _gcellGrid; }
236 inline DbU::Unit KatabaticEngine::getGlobalThreshold ()
const {
return _configuration->getGlobalThreshold(); }
237 inline float KatabaticEngine::getSaturateRatio ()
const {
return _configuration->getSaturateRatio(); }
238 inline size_t KatabaticEngine::getSaturateRp ()
const {
return _configuration->getSaturateRp(); }
239 inline const AutoContactLut& KatabaticEngine::_getAutoContactLut ()
const {
return _autoContactLut; }
240 inline const AutoSegmentLut& KatabaticEngine::_getAutoSegmentLut ()
const {
return _autoSegmentLut; }
241 inline void KatabaticEngine::setState (
EngineState state ) { _state = state; }
242 inline bool KatabaticEngine::isChip ()
const {
return _chipTools.isChip(); }
243 inline const ChipTools& KatabaticEngine::getChipTools ()
const {
return _chipTools; }
244 inline const NetRoutingStates& KatabaticEngine::getNetRoutingStates ()
const {
return _netRoutingStates; }
251 extern const char* missingKTBT;
252 extern const char* badMethod;
257 #endif // KATABATIC_KATABATIC_ENGINE_H set< Net *, NetCompareByName > NetSet
Definition: KatabaticEngine.h:94
Hurricane::Mask< unsigned long long > Mask
GCell Grid.
Definition: GCellGrid.h:42
Abstract base class for AutoSegment.
Definition: AutoSegment.h:104
set< GCell *, CompareByIndex > SetIndex
Definition: GCell.h:105
The namespace dedicated to Katabatic.
Definition: Katabatic.dox:13
The Katabatic Tool.
Definition: KatabaticEngine.h:91
Definition: Constants.h:59
EngineState
Definition: Constants.h:54