LibertyCell::isInverter
This commit is contained in:
parent
a24048395a
commit
46d2446f88
|
|
@ -493,6 +493,7 @@ public:
|
|||
Report *report,
|
||||
Debug *debug);
|
||||
bool isBuffer() const;
|
||||
bool isInverter() const;
|
||||
// Only valid when isBuffer() returns true.
|
||||
void bufferPorts(// Return values.
|
||||
LibertyPort *&input,
|
||||
|
|
@ -522,6 +523,8 @@ protected:
|
|||
void makeTimingArcPortMaps();
|
||||
bool hasBufferFunc(const LibertyPort *input,
|
||||
const LibertyPort *output) const;
|
||||
bool hasInverterFunc(const LibertyPort *input,
|
||||
const LibertyPort *output) const;
|
||||
|
||||
LibertyLibrary *liberty_library_;
|
||||
float area_;
|
||||
|
|
|
|||
|
|
@ -1064,6 +1064,27 @@ LibertyCell::hasBufferFunc(const LibertyPort *input,
|
|||
&& func->port() == input;
|
||||
}
|
||||
|
||||
bool
|
||||
LibertyCell::isInverter() const
|
||||
{
|
||||
LibertyPort *input;
|
||||
LibertyPort *output;
|
||||
bufferPorts(input, output);
|
||||
return input && output
|
||||
&& hasInverterFunc(input, output);
|
||||
}
|
||||
|
||||
bool
|
||||
LibertyCell::hasInverterFunc(const LibertyPort *input,
|
||||
const LibertyPort *output) const
|
||||
{
|
||||
FuncExpr *func = output->function();
|
||||
return func
|
||||
&& func->op() == FuncExpr::op_not
|
||||
&& func->left()->op() == FuncExpr::op_port
|
||||
&& func->left()->port() == input;
|
||||
}
|
||||
|
||||
void
|
||||
LibertyCell::bufferPorts(// Return values.
|
||||
LibertyPort *&input,
|
||||
|
|
|
|||
|
|
@ -566,6 +566,8 @@ getProperty(const LibertyCell *cell,
|
|||
return PropertyValue(cell->libertyLibrary());
|
||||
else if (stringEqual(property, "is_buffer"))
|
||||
return PropertyValue(cell->isBuffer());
|
||||
else if (stringEqual(property, "is_inverter"))
|
||||
return PropertyValue(cell->isInverter());
|
||||
else if (stringEqual(property, "dont_use"))
|
||||
return PropertyValue(cell->dontUse());
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in New Issue