Add PropertyRegistry for Clock. (#298)
* Add PropertyRegistry for Clock. Signed-off-by: Mike Inouye <mikeinouye@google.com> * Remove extra blank line. --------- Signed-off-by: Mike Inouye <mikeinouye@google.com>
This commit is contained in:
parent
8e50916693
commit
cf060169aa
|
|
@ -94,7 +94,7 @@ public:
|
|||
const std::string property);
|
||||
|
||||
// Define handler for external property.
|
||||
// proerties->defineProperty("foo",
|
||||
// properties->defineProperty("foo",
|
||||
// [] (const Instance *, Sta *) -> PropertyValue {
|
||||
// return PropertyValue("bar");
|
||||
// });
|
||||
|
|
@ -116,6 +116,8 @@ public:
|
|||
PropertyRegistry<const Pin *>::PropertyHandler handler);
|
||||
void defineProperty(std::string &property,
|
||||
PropertyRegistry<const Net *>::PropertyHandler handler);
|
||||
void defineProperty(std::string &property,
|
||||
PropertyRegistry<const Clock *>::PropertyHandler handler);
|
||||
|
||||
protected:
|
||||
PropertyValue portSlew(const Port *port,
|
||||
|
|
@ -159,6 +161,7 @@ protected:
|
|||
PropertyRegistry<const Instance*> registry_instance_;
|
||||
PropertyRegistry<const Pin*> registry_pin_;
|
||||
PropertyRegistry<const Net*> registry_net_;
|
||||
PropertyRegistry<const Clock*> registry_clock_;
|
||||
|
||||
Sta *sta_;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1240,8 +1240,14 @@ Properties::getProperty(const Clock *clk,
|
|||
return PropertyValue(clk->isVirtual());
|
||||
else if (property == "is_propagated")
|
||||
return PropertyValue(clk->isPropagated());
|
||||
else {
|
||||
PropertyValue value = registry_clock_.getProperty(clk, property,
|
||||
"clock", sta_);
|
||||
if (value.type() != PropertyValue::Type::type_none)
|
||||
return value;
|
||||
else
|
||||
throw PropertyUnknown("clock", property);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
|
@ -1376,6 +1382,13 @@ Properties::defineProperty(std::string &property,
|
|||
registry_net_.defineProperty(property, handler);
|
||||
}
|
||||
|
||||
void
|
||||
Properties::defineProperty(std::string &property,
|
||||
PropertyRegistry<const Clock *>::PropertyHandler handler)
|
||||
{
|
||||
registry_clock_.defineProperty(property, handler);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
template<class TYPE>
|
||||
|
|
|
|||
Loading…
Reference in New Issue