19 #include "hurricane/Cell.h"
20 #include "crlcore/Environment.h"
21 #include "crlcore/AllianceLibrary.h"
22 #include "crlcore/Catalog.h"
23 #include "crlcore/ParsersDrivers.h"
28 using Hurricane::Observable;
29 using Hurricane::BaseObserver;
42 enum FunctionsFlags { NoFlags = 0
43 , NoPythonInit = (1<<0)
47 , IgnoreDiodes = (1<<2)
48 , IgnorePowerFeeds = (1<<3)
49 , IgnoreNonLogic =
IgnoreFeeds|IgnoreDiodes|IgnorePowerFeeds
50 , TerminalNetlist = (1<<4)
53 , AppendLibrary = (1<<1)
56 enum NotifyFlags { AddedLibrary = (1<<0)
57 , RemovedLibrary = (1<<1)
58 , ConfigChanged = (1<<2)
62 virtual void _postCreate ();
63 virtual void _preDestroy ();
70 inline bool isPOWER (
const char* name );
71 inline bool isPOWER (
const string& name );
72 inline bool isPOWER (
const Name& name );
73 inline bool isGROUND (
const char* name );
74 inline bool isGROUND (
const string& name );
75 inline bool isGROUND (
const Name& name );
76 inline bool isCLOCK (
const char* name );
77 inline bool isCLOCK (
const string& name );
78 inline bool isCLOCK (
const Name& name );
79 inline bool isBLOCKAGE (
const char* name );
80 inline bool isBLOCKAGE (
const string& name );
81 inline bool isBLOCKAGE (
const Name& name );
82 inline bool isBLOCKAGE (
const Net* net );
83 inline bool isPad (
const char* name );
84 inline bool isPad (
const string& name );
85 inline bool isPad (
const Name& name );
86 inline bool isPad (
const Cell* );
87 inline bool isRegister (
const char* name );
88 inline bool isRegister (
const string& name );
89 inline bool isRegister (
const Name& name );
90 inline bool isRegister (
const Cell* );
103 inline const AllianceLibraries& getAllianceLibraries ()
const;
107 CellGauge* getCellGauge (
const Name& name=
"" );
109 CellGauge* matchCellGaugeByHeight (
DbU::Unit height )
const;
113 CellGauge* setCellGauge (
const Name& name=
"" );
116 void addObserver ( BaseObserver* );
117 void removeObserver ( BaseObserver* );
118 void notify (
unsigned int flags );
120 Cell* cellLoader (
const string& rpath );
123 ,
unsigned int depth=(
unsigned int)-1 );
126 void bindLibraries ();
131 void toJson ( JsonWriter* )
const;
132 virtual string _getTypeName ()
const;
133 virtual Record* _getRecord ()
const;
137 static const Name _parentLibraryName;
139 Observable _observers;
144 AllianceLibraries _libraries;
146 map<Name,RoutingGauge*> _routingGauges;
148 map<Name,CellGauge*> _cellGauges;
149 CellGauge* _defaultCellGauge;
158 bool _readLocate (
const string& file,
unsigned int mode,
bool isLib=
false );
159 bool _writeLocate (
const string& file,
unsigned int mode,
bool isLib=
false );
160 AllianceLibrary* _createLibrary (
const string& path,
bool& hasCatalog );
163 inline bool AllianceFramework::isPOWER (
const char* name ) {
return _environment.
isPOWER(name); }
164 inline bool AllianceFramework::isPOWER (
const string& name ) {
return isPOWER(name.c_str()); }
165 inline bool AllianceFramework::isPOWER (
const Name& name ) {
return isPOWER(getString(name)); }
166 inline bool AllianceFramework::isGROUND (
const char* name ) {
return _environment.
isGROUND(name); }
167 inline bool AllianceFramework::isGROUND (
const string& name ) {
return isGROUND(name.c_str()); }
168 inline bool AllianceFramework::isGROUND (
const Name& name ) {
return isGROUND(getString(name)); }
169 inline bool AllianceFramework::isCLOCK (
const char* name ) {
return _environment.
isCLOCK(name); }
170 inline bool AllianceFramework::isCLOCK (
const string& name ) {
return isCLOCK(name.c_str()); }
171 inline bool AllianceFramework::isCLOCK (
const Name& name ) {
return isCLOCK(getString(name)); }
172 inline bool AllianceFramework::isBLOCKAGE (
const char* name ) {
return _environment.
isBLOCKAGE(name); }
173 inline bool AllianceFramework::isBLOCKAGE (
const string& name ) {
return isBLOCKAGE(name.c_str()); }
174 inline bool AllianceFramework::isBLOCKAGE (
const Name& name ) {
return isBLOCKAGE(getString(name)); }
175 inline bool AllianceFramework::isBLOCKAGE (
const Net* net ) {
return isBLOCKAGE(net->getName()); }
176 inline bool AllianceFramework::isPad (
const char* name ) {
return _environment.
isPad(name); }
177 inline bool AllianceFramework::isPad (
const string& name ) {
return isPad(name.c_str()); }
178 inline bool AllianceFramework::isPad (
const Name& name ) {
return isPad(getString(name)); }
179 inline bool AllianceFramework::isPad (
const Cell* cell ) {
return isPad(cell->getName()); }
180 inline bool AllianceFramework::isRegister (
const char* name ) {
return _environment.isRegister(name); }
181 inline bool AllianceFramework::isRegister (
const string& name ) {
return isRegister(name.c_str()); }
182 inline bool AllianceFramework::isRegister (
const Name& name ) {
return isRegister(getString(name)); }
183 inline bool AllianceFramework::isRegister (
const Cell* cell ) {
return isRegister(cell->getName()); }
187 ()
const {
return _parentLibraryName; }
189 inline const AllianceLibraries&
190 AllianceFramework::getAllianceLibraries ()
const {
return _libraries; }
193 ()
const {
return "CALU1"; }
196 class JsonAllianceFramework :
public JsonObject {
198 static void initialize ();
199 JsonAllianceFramework(
unsigned long );
200 virtual ~JsonAllianceFramework();
201 virtual string getTypeName ()
const;
202 virtual JsonAllianceFramework* clone (
unsigned long )
const;
205 std::string _defaultRoutingGauge;
206 std::string _defaultCellGauge;
A Framework to work with Alliance formats.
Definition: AllianceFramework.h:39
Catalog * getCatalog()
Definition: AllianceFramework.h:185
InstancesCountFlags
Definition: AllianceFramework.h:45
@ Recursive
Definition: AllianceFramework.h:45
@ IgnoreFeeds
Definition: AllianceFramework.h:46
LibraryFlags
Definition: AllianceFramework.h:52
@ HasCatalog
Definition: AllianceFramework.h:54
@ CreateLibrary
Definition: AllianceFramework.h:52
unsigned int loadLibraryCells(Library *)
Cell * getCell(const string &name, unsigned int mode, unsigned int depth=(unsigned int) -1)
AllianceLibrary * getAllianceLibrary(unsigned int index)
AllianceLibrary * createLibrary(const string &path, unsigned int flags, string libName="")
const Name & getParentLibraryName() const
Definition: AllianceFramework.h:187
void saveLibrary(Library *)
static AllianceFramework * create(unsigned long flags=NoFlags)
AllianceLibrary * getAllianceLibrary(Library *)
Environment * getEnvironment()
Definition: AllianceFramework.h:184
static size_t getInstancesCount(Cell *, unsigned int flags)
static AllianceFramework * get()
void addCellGauge(CellGauge *)
Library * getLibrary(unsigned int index)
void saveCell(Cell *, unsigned int mode)
Cell * createCell(const string &name, AllianceLibrary *library=NULL)
unsigned int loadLibraryCells(const Name &)
RoutingGauge * getRoutingGauge(const Name &name="")
void addRoutingGauge(RoutingGauge *)
const Name getDefaultCGPinLayerName() const
Definition: AllianceFramework.h:193
void saveLibrary(AllianceLibrary *)
Library * getParentLibrary()
Definition: AllianceFramework.h:188
A small wrapper around Hurricane::Library.
Definition: AllianceLibrary.h:42
An entry to store the Cell State in the Catalog.
Definition: Catalog.h:75
A Registry to store Alliance Cell metadatas.
Definition: Catalog.h:54
Holds all the Alliance environment variables.
Definition: Environment.h:33
bool isGROUND(const char *name) const
bool isBLOCKAGE(const char *name) const
bool isPad(const char *name) const
bool isCLOCK(const char *name) const
bool isPOWER(const char *name) const
Gauge for the detailed routing.
Definition: RoutingGauge.h:46
The namespace of Coriolis Core.
Definition: AcmSigda.h:28