Merge pull request #83 from AcKoucher/footprint-support

add cell footprint support & add it to equiv check
This commit is contained in:
James Cherry 2024-09-06 14:41:58 -07:00 committed by GitHub
commit bd13bc409e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 44 additions and 2 deletions

View File

@ -73,4 +73,8 @@ bool
equivCellSequentials(const LibertyCell *cell1,
const LibertyCell *cell2);
bool
equivCellFootprints(const LibertyCell *cell1,
const LibertyCell *cell2);
} // namespace

View File

@ -541,6 +541,8 @@ public:
// for all the defined corners.
static void checkLibertyCorners();
void ensureVoltageWaveforms(const DcalcAnalysisPtSeq &dcalc_aps);
const char *footprint() const;
void setFootprint(const char *footprint);
protected:
void addPort(ConcretePort *port);
@ -631,6 +633,7 @@ protected:
bool has_internal_ports_;
bool have_voltage_waveforms_;
std::mutex waveform_lock_;
const char *footprint_;
private:
friend class LibertyLibrary;

View File

@ -325,7 +325,8 @@ equivCells(const LibertyCell *cell1,
&& equivCellPgPorts(cell1, cell2)
&& equivCellSequentials(cell1, cell2)
&& equivCellStatetables(cell1, cell2)
&& equivCellTimingArcSets(cell1, cell2);
&& equivCellTimingArcSets(cell1, cell2)
&& equivCellFootprints(cell1, cell2);
}
bool
@ -525,4 +526,11 @@ equivCellTimingArcSets(const LibertyCell *cell1,
}
}
bool
equivCellFootprints(const LibertyCell *cell1,
const LibertyCell *cell2)
{
return stringEqIf(cell1->footprint(), cell2->footprint());
}
} // namespace

View File

@ -940,7 +940,8 @@ LibertyCell::LibertyCell(LibertyLibrary *library,
leakage_power_(0.0),
leakage_power_exists_(false),
has_internal_ports_(false),
have_voltage_waveforms_(false)
have_voltage_waveforms_(false),
footprint_(nullptr)
{
liberty_cell_ = this;
}
@ -968,6 +969,8 @@ LibertyCell::~LibertyCell()
ocv_derate_map_.deleteContents();
pg_port_map_.deleteContents();
stringDelete(footprint_);
}
LibertyPort *
@ -1989,6 +1992,18 @@ LibertyCell::ensureVoltageWaveforms(const DcalcAnalysisPtSeq &dcalc_aps)
}
}
void
LibertyCell::setFootprint(const char *footprint)
{
footprint_ = stringCopy(footprint);
}
const char*
LibertyCell::footprint() const
{
return footprint_;
}
////////////////////////////////////////////////////////////////
LibertyCellPortIterator::LibertyCellPortIterator(const LibertyCell *cell) :

View File

@ -310,6 +310,7 @@ LibertyReader::defineVisitors()
defineAttrVisitor("switch_cell_type", &LibertyReader::visitSwitchCellType);
defineAttrVisitor("interface_timing", &LibertyReader::visitInterfaceTiming);
defineAttrVisitor("scaling_factors", &LibertyReader::visitScalingFactors);
defineAttrVisitor("cell_footprint", &LibertyReader::visitCellFootprint);
// Pins
defineGroupVisitor("pin", &LibertyReader::beginPin,&LibertyReader::endPin);
@ -3065,6 +3066,16 @@ LibertyReader::visitClockGatingIntegratedCell(LibertyAttr *attr)
}
}
void
LibertyReader::visitCellFootprint(LibertyAttr *attr)
{
if (cell_) {
const char *footprint = getAttrString(attr);
if (footprint)
cell_->setFootprint(stringCopy(footprint));
}
}
////////////////////////////////////////////////////////////////
void

View File

@ -205,6 +205,7 @@ public:
virtual void visitInterfaceTiming(LibertyAttr *attr);
virtual void visitScalingFactors(LibertyAttr *attr);
virtual void visitCellLeakagePower(LibertyAttr *attr);
virtual void visitCellFootprint(LibertyAttr *attr);
virtual void beginPin(LibertyGroup *group);
virtual void endPin(LibertyGroup *group);