17 #ifndef CRL_ALLIANCE_FRAMEWORK_H 18 #define CRL_ALLIANCE_FRAMEWORK_H 22 #include "hurricane/Cell.h" 23 #include "crlcore/Environment.h" 24 #include "crlcore/AllianceLibrary.h" 25 #include "crlcore/Catalog.h" 26 #include "crlcore/ParsersDrivers.h" 31 using Hurricane::Observable;
32 using Hurricane::BaseObserver;
45 enum FunctionsFlags { NoFlags = 0
46 , NoPythonInit = (1<<0)
52 , AppendLibrary = (1<<1)
55 enum NotifyFlags { AddedLibrary = (1<<0)
56 , RemovedLibrary = (1<<1)
57 , ConfigChanged = (1<<2)
60 static AllianceFramework*
create (
unsigned long flags=NoFlags );
61 virtual void _postCreate ();
62 virtual void _preDestroy ();
64 static AllianceFramework*
get ();
67 Catalog::State* isInCatalog (
const Name& );
68 Catalog::State* isInCatalog (
string );
69 inline bool isPOWER (
const char* name );
70 inline bool isPOWER (
const string& name );
71 inline bool isPOWER (
const Name& name );
72 inline bool isGROUND (
const char* name );
73 inline bool isGROUND (
const string& name );
74 inline bool isGROUND (
const Name& name );
75 inline bool isCLOCK (
const char* name );
76 inline bool isCLOCK (
const string& name );
77 inline bool isCLOCK (
const Name& name );
78 inline bool isBLOCKAGE (
const char* name );
79 inline bool isBLOCKAGE (
const string& name );
80 inline bool isBLOCKAGE (
const Name& name );
81 inline bool isBLOCKAGE (
const Net* net );
82 inline bool isPad (
const char* name );
83 inline bool isPad (
const string& name );
84 inline bool isPad (
const Name& name );
85 inline bool isPad (
const Cell* );
96 AllianceLibrary*
createLibrary (
const string& path,
unsigned int flags,
string libName=
"" );
97 AllianceLibrary* wrapLibrary ( Library*,
unsigned int flags );
98 inline const AllianceLibraries& getAllianceLibraries ()
const;
102 CellGauge* getCellGauge (
const Name& name=
"" );
104 CellGauge* matchCellGaugeByHeight (
DbU::Unit height )
const;
107 RoutingGauge* setRoutingGauge (
const Name& name=
"" );
108 CellGauge* setCellGauge (
const Name& name=
"" );
111 void addObserver ( BaseObserver* );
112 void removeObserver ( BaseObserver* );
113 void notify (
unsigned int flags );
115 Cell* cellLoader (
const string& rpath );
116 Cell*
getCell (
const string& name
118 ,
unsigned int depth=(
unsigned int)-1 );
119 Cell*
createCell (
const string& name, AllianceLibrary* library=NULL );
120 void saveCell ( Cell* ,
unsigned int mode );
121 void bindLibraries ();
126 void toJson ( JsonWriter* )
const;
127 virtual string _getTypeName ()
const;
128 virtual Record* _getRecord ()
const;
132 static const Name _parentLibraryName;
133 static AllianceFramework* _singleton;
134 Observable _observers;
135 Environment _environment;
139 AllianceLibraries _libraries;
140 Library* _parentLibrary;
141 map<Name,RoutingGauge*> _routingGauges;
142 RoutingGauge* _defaultRoutingGauge;
143 map<Name,CellGauge*> _cellGauges;
144 CellGauge* _defaultCellGauge;
147 AllianceFramework ();
148 AllianceFramework (
const AllianceFramework& );
149 AllianceFramework& operator= (
const AllianceFramework& );
151 ~AllianceFramework ();
153 bool _readLocate (
const string& file,
unsigned int mode,
bool isLib=
false );
154 bool _writeLocate (
const string& file,
unsigned int mode,
bool isLib=
false );
155 AllianceLibrary* _createLibrary (
const string& path,
bool& hasCatalog );
158 inline bool AllianceFramework::isPOWER (
const char* name ) {
return _environment.
isPOWER(name); }
159 inline bool AllianceFramework::isPOWER (
const string& name ) {
return isPOWER(name.c_str()); }
160 inline bool AllianceFramework::isPOWER (
const Name& name ) {
return isPOWER(getString(name)); }
161 inline bool AllianceFramework::isGROUND (
const char* name ) {
return _environment.
isGROUND(name); }
162 inline bool AllianceFramework::isGROUND (
const string& name ) {
return isGROUND(name.c_str()); }
163 inline bool AllianceFramework::isGROUND (
const Name& name ) {
return isGROUND(getString(name)); }
164 inline bool AllianceFramework::isCLOCK (
const char* name ) {
return _environment.
isCLOCK(name); }
165 inline bool AllianceFramework::isCLOCK (
const string& name ) {
return isCLOCK(name.c_str()); }
166 inline bool AllianceFramework::isCLOCK (
const Name& name ) {
return isCLOCK(getString(name)); }
167 inline bool AllianceFramework::isBLOCKAGE (
const char* name ) {
return _environment.
isBLOCKAGE(name); }
168 inline bool AllianceFramework::isBLOCKAGE (
const string& name ) {
return isBLOCKAGE(name.c_str()); }
169 inline bool AllianceFramework::isBLOCKAGE (
const Name& name ) {
return isBLOCKAGE(getString(name)); }
170 inline bool AllianceFramework::isBLOCKAGE (
const Net* net ) {
return isBLOCKAGE(net->getName()); }
171 inline bool AllianceFramework::isPad (
const char* name ) {
return _environment.
isPad(name); }
172 inline bool AllianceFramework::isPad (
const string& name ) {
return isPad(name.c_str()); }
173 inline bool AllianceFramework::isPad (
const Name& name ) {
return isPad(getString(name)); }
174 inline bool AllianceFramework::isPad (
const Cell* cell ) {
return isPad(cell->getName()); }
178 ()
const {
return _parentLibraryName; }
180 inline const AllianceLibraries&
181 AllianceFramework::getAllianceLibraries ()
const {
return _libraries; }
184 ()
const {
return "CALU1"; }
187 class JsonAllianceFramework :
public JsonObject {
189 static void initialize ();
190 JsonAllianceFramework(
unsigned long );
191 virtual ~JsonAllianceFramework();
192 virtual string getTypeName ()
const;
193 virtual JsonAllianceFramework* clone (
unsigned long )
const;
196 std::string _defaultRoutingGauge;
197 std::string _defaultCellGauge;
206 #endif // CRL_ALLIANCE_FRAMEWORK_H bool isBLOCKAGE(const char *name) const
Library * getParentLibrary()
Definition: AllianceFramework.h:179
bool isCLOCK(const char *name) const
A Framework to work with Alliance formats.
Definition: AllianceFramework.h:42
const Name getDefaultCGPinLayerName() const
Definition: AllianceFramework.h:184
bool isPOWER(const char *name) const
void addCellGauge(CellGauge *)
InstancesCountFlags
Definition: AllianceFramework.h:48
static size_t getInstancesCount(Cell *, unsigned int flags)
void saveCell(Cell *, unsigned int mode)
AllianceLibrary * createLibrary(const string &path, unsigned int flags, string libName="")
LibraryFlags
Definition: AllianceFramework.h:51
bool isPad(const char *name) const
bool isGROUND(const char *name) const
Definition: AllianceFramework.h:48
Library * getLibrary(unsigned int index)
const Name & getParentLibraryName() const
Definition: AllianceFramework.h:178
void addRoutingGauge(RoutingGauge *)
Definition: AllianceFramework.h:51
unsigned int loadLibraryCells(Library *)
Cell * createCell(const string &name, AllianceLibrary *library=NULL)
Catalog * getCatalog()
Definition: AllianceFramework.h:176
Definition: AllianceFramework.h:49
RoutingGauge * getRoutingGauge(const Name &name="")
A Registry to store Alliance Cell metadatas.
Definition: Catalog.h:54
AllianceLibrary * getAllianceLibrary(unsigned int index)
Definition: AllianceFramework.h:53
Holds all the Alliance environment variables.
Definition: Environment.h:33
Environment * getEnvironment()
Definition: AllianceFramework.h:175
void saveLibrary(Library *)
Cell * getCell(const string &name, unsigned int mode, unsigned int depth=(unsigned int) -1)
static AllianceFramework * create(unsigned long flags=NoFlags)
The namespace of Coriolis Core.
Definition: Environment.h:24