resizer support
This commit is contained in:
parent
6934b4ebcd
commit
e7d8689f70
|
|
@ -1029,21 +1029,11 @@ LibertyCell::setClockGateType(ClockGateType type)
|
||||||
bool
|
bool
|
||||||
LibertyCell::isBuffer() const
|
LibertyCell::isBuffer() const
|
||||||
{
|
{
|
||||||
int input_count = 0;
|
LibertyPort *input;
|
||||||
int output_count = 0;
|
LibertyPort *output;
|
||||||
for (ConcretePort *cport : ports_) {
|
bufferPorts(input, output);
|
||||||
LibertyPort *port = static_cast<LibertyPort*>(cport);
|
return input && output
|
||||||
PortDirection *dir = port->direction();
|
&& hasBufferFunc(input, output);
|
||||||
if (dir->isInput())
|
|
||||||
input_count++;
|
|
||||||
else if (dir->isOutput())
|
|
||||||
output_count++;
|
|
||||||
else if (!dir->isPowerGround())
|
|
||||||
return false;
|
|
||||||
if (input_count > 1 || output_count > 1)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return input_count == 1 && output_count == 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
@ -1059,19 +1049,36 @@ LibertyCell::hasBufferFunc(const LibertyPort *input,
|
||||||
void
|
void
|
||||||
LibertyCell::bufferPorts(// Return values.
|
LibertyCell::bufferPorts(// Return values.
|
||||||
LibertyPort *&input,
|
LibertyPort *&input,
|
||||||
LibertyPort *&output)
|
LibertyPort *&output) const
|
||||||
{
|
{
|
||||||
input = nullptr;
|
input = nullptr;
|
||||||
output = nullptr;
|
output = nullptr;
|
||||||
for (ConcretePort *cport : ports_) {
|
for (ConcretePort *cport : ports_) {
|
||||||
LibertyPort *port = static_cast<LibertyPort*>(cport);
|
LibertyPort *port = static_cast<LibertyPort*>(cport);
|
||||||
PortDirection *dir = port->direction();
|
PortDirection *dir = port->direction();
|
||||||
if (dir->isInput())
|
if (dir->isInput()) {
|
||||||
|
if (input) {
|
||||||
|
// More than one input.
|
||||||
|
input = nullptr;
|
||||||
|
output = nullptr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
input = port;
|
input = port;
|
||||||
else if (dir->isOutput())
|
}
|
||||||
|
else if (dir->isOutput()) {
|
||||||
|
if (output) {
|
||||||
|
// More than one output.
|
||||||
|
input = nullptr;
|
||||||
|
output = nullptr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
output = port;
|
output = port;
|
||||||
if (input && output)
|
}
|
||||||
return;
|
else if (!dir->isPowerGround()) {
|
||||||
|
input = nullptr;
|
||||||
|
output = nullptr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -494,7 +494,7 @@ public:
|
||||||
// Only valid when isBuffer() returns true.
|
// Only valid when isBuffer() returns true.
|
||||||
void bufferPorts(// Return values.
|
void bufferPorts(// Return values.
|
||||||
LibertyPort *&input,
|
LibertyPort *&input,
|
||||||
LibertyPort *&output);
|
LibertyPort *&output) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void addPort(ConcretePort *port);
|
void addPort(ConcretePort *port);
|
||||||
|
|
|
||||||
|
|
@ -456,7 +456,19 @@ LibertyLibrary *
|
||||||
ConcreteNetwork::findLiberty(const char *name)
|
ConcreteNetwork::findLiberty(const char *name)
|
||||||
{
|
{
|
||||||
ConcreteLibrary *lib = library_map_.findKey(name);
|
ConcreteLibrary *lib = library_map_.findKey(name);
|
||||||
return static_cast<LibertyLibrary*>(lib);
|
if (lib) {
|
||||||
|
if (lib->isLiberty())
|
||||||
|
return static_cast<LibertyLibrary*>(lib);
|
||||||
|
// Potential name conflict
|
||||||
|
else {
|
||||||
|
for (ConcreteLibrary *lib : library_seq_) {
|
||||||
|
if (stringEq(lib->name(), name)
|
||||||
|
&& lib->isLiberty())
|
||||||
|
return static_cast<LibertyLibrary*>(lib);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
LibertyLibrary *
|
LibertyLibrary *
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue