20 #include "hurricane/Name.h" 21 #include "hurricane/Property.h" 22 #include "hurricane/Slot.h" 37 using Hurricane::_TName;
39 using Hurricane::Record;
47 extern const char* MissingStateProperty;
66 void saveToFile (
const string& path,
Library* library );
68 string _getPrint ()
const;
69 inline string _getTypeName ()
const;
70 string _getString ()
const;
71 Record* _getRecord ()
const;
78 enum Flags { TerminalNetlist = 1 << 0
87 , VstUseConcat = 1 << 9
88 , VstNoLowerCase = 1 << 10
89 , VstUniquifyUpperCase = 1 << 11
90 , VstNoLinkage = 1 << 12
97 inline bool isTerminalNetlist ()
const;
98 inline bool isFeed ()
const;
99 inline bool isPad ()
const;
100 inline bool isGds ()
const;
104 inline bool isInMemory ()
const;
106 inline unsigned int getFlags (
unsigned int mask=(
unsigned int)-1 )
const;
107 inline bool setFlags (
unsigned int mask,
bool value );
108 inline bool setTerminalNetlist (
bool value );
109 inline bool setFeed (
bool value );
110 inline bool setPad (
bool value );
111 inline bool setGds (
bool value );
115 inline bool setInMemory (
bool value );
119 inline unsigned int getDepth ()
const;
124 inline void setDepth (
unsigned int depth );
126 void toJson ( JsonWriter* w )
const;
127 inline string _getTypeName ()
const;
128 string _getString ()
const;
129 Record* _getRecord ()
const;
142 static void initialize ();
143 JsonState (
unsigned long flags );
144 virtual string getTypeName ()
const;
145 virtual JsonState* clone (
unsigned long )
const;
152 map<Name,State*> _states;
156 static bool readLine (
const string& s,
string& name, State* state );
164 class CatalogProperty :
public PrivateProperty {
169 static CatalogProperty* create ( Catalog::State* state );
170 static Name getPropertyName ();
171 virtual Name getName ()
const;
172 inline Catalog::State* getState ()
const;
173 inline void setState ( Catalog::State* state );
174 virtual void onReleasedBy ( DBo* owner );
175 virtual bool hasJson ()
const;
176 virtual void toJson ( JsonWriter* w,
const DBo* )
const;
177 virtual string _getTypeName ()
const;
178 virtual string _getString ()
const;
179 virtual Record* _getRecord ()
const;
183 Catalog::State* _state;
187 inline CatalogProperty ( Catalog::State* state );
194 class JsonCatalogProperty :
public JsonObject {
196 static void initialize ();
197 JsonCatalogProperty (
unsigned long );
198 virtual string getTypeName ()
const;
199 virtual JsonCatalogProperty* clone (
unsigned long )
const;
200 virtual void toData ( JsonStack& );
208 inline bool Catalog::State::isTerminalNetlist ()
const {
return (_flags&TerminalNetlist)?1:0; }
215 inline bool Catalog::State::isInMemory ()
const {
return (_flags&InMemory )?1:0; }
218 if (value) { _flags |= mask; }
219 else { _flags &= ~mask; }
220 return ((_flags&mask) ?
true :
false);
222 inline bool Catalog::State::setTerminalNetlist (
bool value ) {
return setFlags(TerminalNetlist,value); }
229 inline bool Catalog::State::setInMemory (
bool value ) {
return setFlags(InMemory ,value); }
231 inline void Catalog::State::setDepth (
unsigned int depth ) { _depth = depth; }
235 inline string Catalog::State::_getTypeName ()
const {
return _TName(
"Catalog::State"); }
238 inline map<Name,Catalog::State*>*
240 inline string Catalog::_getTypeName ()
const {
return _TName(
"Catalog"); }
242 inline CatalogProperty::CatalogProperty ( Catalog::State* state ) : PrivateProperty(), _state(state) {}
243 inline Catalog::State* CatalogProperty::getState ()
const {
return _state; }
244 inline void CatalogProperty::setState ( Catalog::State* state ) { _state = state; }
255 static inline bool isTerminalNetlist (
const Cell* );
257 static inline bool isPad (
const Cell* );
258 static inline bool isGds (
const Cell* );
263 static inline unsigned int getFlags (
const Cell*,
unsigned int mask=(
unsigned int)-1 );
264 static inline bool setFlags (
const Cell*,
unsigned int mask,
bool value );
265 static inline bool setTerminalNetlist (
const Cell*,
bool value );
266 static inline bool setFeed (
const Cell*,
bool value );
267 static inline bool setPad (
const Cell*,
bool value );
268 static inline bool setGds (
const Cell*,
bool value );
277 static inline void setDepth (
const Cell*,
unsigned int depth );
279 static const Cell* _owner;
284 inline bool CatalogExtension::isTerminalNetlist (
const Cell* cell )
287 return (state == NULL) ? false : state->isTerminalNetlist();
294 return (state == NULL) ? false : state->
isFeed();
301 return (state == NULL) ? false : state->
isGds();
308 return (state == NULL) ? false : state->
isPad();
315 return (state == NULL) ? false : state->
isDelete();
322 return (state == NULL) ? false : state->
isPhysical();
329 return (state == NULL) ? false : state->
isLogical();
336 return (state == NULL) ? 0 : state->
getFlags();
343 return (state == NULL) ? false : state->
setFlags(mask,value);
347 inline bool CatalogExtension::setTerminalNetlist (
const Cell* cell,
bool value )
350 return (state == NULL) ? false : state->setTerminalNetlist(value);
357 return (state == NULL) ? false : state->
setFeed(value);
364 return (state == NULL) ? false : state->
setPad(value);
371 return (state == NULL) ? false : state->
setGds(value);
378 return (state == NULL) ? false : state->
setDelete(value);
385 return (state == NULL) ? false : state->
setPhysical(value);
392 return (state == NULL) ? false : state->
setLogical(value);
399 return (state == NULL) ? NULL : state->
getLibrary();
406 return (state == NULL) ? 0 : state->
getDepth();
413 return (state == NULL) ? NULL : state->
setLibrary(library);
417 inline void CatalogExtension::setDepth (
const Cell* cell,
unsigned int depth )
420 if ( state == NULL ) state->setDepth(depth);
434 inline std::string getPrint (
const CRL::Catalog &CATAL ) {
return CATAL._getPrint(); }
unsigned int getFlags(unsigned int mask=(unsigned int) -1) const
Definition: Catalog.h:216
static bool setPad(const Cell *, bool value)
Definition: Catalog.h:361
An entry to store the Cell State in the Catalog.
Definition: Catalog.h:75
static bool setLogical(const Cell *, bool value)
Definition: Catalog.h:389
bool setPad(bool value)
Definition: Catalog.h:224
static bool isGds(const Cell *)
Definition: Catalog.h:298
bool setGds(bool value)
Definition: Catalog.h:225
Cell * setCell(Cell *cell)
Catalog()
Definition: Catalog.h:237
static bool isDelete(const Cell *)
Definition: Catalog.h:312
static bool isLogical(const Cell *)
Definition: Catalog.h:326
static bool setFeed(const Cell *, bool value)
Definition: Catalog.h:354
bool isLogical() const
Definition: Catalog.h:214
void merge(const State &other)
bool isPhysical() const
Definition: Catalog.h:213
bool isDelete() const
Definition: Catalog.h:212
static unsigned int getFlags(const Cell *, unsigned int mask=(unsigned int) -1)
Definition: Catalog.h:333
Library * setLibrary(Library *library)
Definition: Catalog.h:230
bool setLogical(bool value)
Definition: Catalog.h:228
static bool setGds(const Cell *, bool value)
Definition: Catalog.h:368
bool deleteState(const Name &name)
void mergeState(const Name &name, const State &other)
bool setFeed(bool value)
Definition: Catalog.h:223
Library * getLibrary() const
Definition: Catalog.h:233
Cell * getCell() const
Definition: Catalog.h:232
bool setFlags(unsigned int mask, bool value)
Definition: Catalog.h:217
map< Name, State * > * getStates()
Definition: Catalog.h:239
static bool isFeed(const Cell *)
Definition: Catalog.h:291
static Library * getLibrary(const Cell *)
Definition: Catalog.h:396
State * getState(const Name &name, bool add=false)
State()
Definition: Catalog.h:207
static bool isPad(const Cell *)
Definition: Catalog.h:305
bool loadFromFile(const string &path, Library *library)
bool isFeed() const
Definition: Catalog.h:209
bool setDelete(bool value)
Definition: Catalog.h:226
static Library * setLibrary(const Cell *, Library *library)
Definition: Catalog.h:410
static bool setPhysical(const Cell *, bool value)
Definition: Catalog.h:382
bool isPad() const
Definition: Catalog.h:210
A Registry to store Alliance Cell metadatas.
Definition: Catalog.h:54
static bool setDelete(const Cell *, bool value)
Definition: Catalog.h:375
Wrapper to access a Hurricane::Cell Catalog::State.
Definition: Catalog.h:251
bool setPhysical(bool value)
Definition: Catalog.h:227
bool isGds() const
Definition: Catalog.h:211
static bool isPhysical(const Cell *)
Definition: Catalog.h:319
static unsigned int getDepth(const Cell *)
Definition: Catalog.h:403
Flags
Definition: Catalog.h:78
The namespace of Coriolis Core.
Definition: Environment.h:24
unsigned int getDepth() const
Definition: Catalog.h:234
static bool setFlags(const Cell *, unsigned int mask, bool value)
Definition: Catalog.h:340