19#include "hurricane/Commons.h"
20#include "hurricane/Timer.h"
21#include "hurricane/Observer.h"
22#include "hurricane/DBo.h"
23#include "hurricane/Slot.h"
30#include "crlcore/Measures.h"
31#include "crlcore/ToolEngines.h"
36 using Hurricane::BaseObserver;
37 using Hurricane::Observable;
38 using Hurricane::Timer;
39 using Hurricane::Record;
40 using Hurricane::Name;
42 using Hurricane::Cell;
48 class ToolEngine :
public DBo {
50 static const unsigned int AboutToDestroy = (1 << 0);
55 static ToolEngine*
get (
const Cell* cell,
const Name& name );
57 static bool inDestroyAll ();
60 inline Cell* getCell ()
const;
61 inline uint32_t getPassNumber ()
const;
62 bool placementModificationFlagHasChanged ();
63 bool routingModificationFlagHasChanged ();
64 inline void setInRelationDestroy (
bool );
65 inline const Timer& getTimer ()
const;
66 inline void setPassNumber ( uint32_t );
67 inline std::string getMeasureLabel ( std::string )
const;
68 void startMeasures ();
70 void suspendMeasures ();
71 void resumeMeasures ();
72 void printMeasures ()
const;
73 template<
typename Data>
74 inline void addMeasure ( std::string,
const Data&,
unsigned int width )
const;
75 template<
typename Data>
76 inline void addMeasure ( std::string,
const Data& )
const;
77 template<
typename Data>
78 inline void addMeasure ( std::string, Data* )
const;
79 template<
typename Data>
80 inline const Data* getMeasure ( std::string )
const;
81 void addObserver ( BaseObserver* );
82 void removeObserver ( BaseObserver* );
83 void notify (
unsigned int flags );
84 virtual std::string _getTypeName ()
const;
85 virtual std::string _getString ()
const;
86 virtual Record* _getRecord ()
const;
88 static bool _inDestroyAll;
92 Observable _observers;
93 unsigned int _placementModificationFlag;
94 unsigned int _routingModificationFlag;
95 bool _inRelationDestroy;
100 ToolEngine (
Cell* cell,
bool verbose=
true );
101 virtual void _postCreate ();
102 virtual void _preDestroy ();
104 void grabPlacementModificationFlag ();
105 void getPlacementModificationFlag ();
106 void grabRoutingModificationFlag ();
107 void getRoutingModificationFlag ();
115 inline Cell* ToolEngine::getCell ()
const {
return _cell; }
116 inline void ToolEngine::setInRelationDestroy (
bool state ) { _inRelationDestroy = state; }
117 inline const Timer& ToolEngine::getTimer ()
const {
return _timer; }
118 inline uint32_t ToolEngine::getPassNumber ()
const {
return _passNumber; }
119 inline void ToolEngine::setPassNumber ( uint32_t n ) { _passNumber = n; }
121 inline std::string ToolEngine::getMeasureLabel ( std::string label )
const
122 {
return _getTypeName() +
"." + label; }
124 template<
typename Data>
125 inline void ToolEngine::addMeasure ( std::string name,
const Data& data,
unsigned int width )
const
126 { ::CRL::addMeasure( getCell(), getMeasureLabel(name), getPassNumber(), data, width ); }
128 template<
typename Data>
129 inline void ToolEngine::addMeasure ( std::string name,
const Data& data )
const
130 { ::CRL::addMeasure( getCell(), getMeasureLabel(name), getPassNumber(), data ); }
132 template<
typename Data>
133 inline void ToolEngine::addMeasure ( std::string name, Data* data )
const
134 { ::CRL::addMeasure( getCell(), getMeasureLabel(name), getPassNumber(), data ); }
136 template<
typename Data>
137 inline const Data* ToolEngine::getMeasure ( std::string name )
const
139 const Measure<Data>* measure = ::CRL::getMeasure<Data>( getCell(), getMeasureLabel(name) );
140 if (not measure)
return NULL;
141 return &(measure->getData( getPassNumber() ));
The namespace of Coriolis Core.
Definition AcmSigda.h:28
GenericCollection< ToolEngine * > ToolEngines
Definition ToolEngines.h:53