Parse and store user_function_class from Liberty. (#90)
Added user_function_class and cell_footprint to LibertyWriter for testing. Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
This commit is contained in:
parent
61fefed647
commit
26f20e48b5
|
|
@ -543,6 +543,8 @@ public:
|
|||
void ensureVoltageWaveforms(const DcalcAnalysisPtSeq &dcalc_aps);
|
||||
const char *footprint() const;
|
||||
void setFootprint(const char *footprint);
|
||||
const char *userFunctionClass() const;
|
||||
void setUserFunctionClass(const char *user_function_class);
|
||||
|
||||
protected:
|
||||
void addPort(ConcretePort *port);
|
||||
|
|
@ -634,6 +636,7 @@ protected:
|
|||
bool have_voltage_waveforms_;
|
||||
std::mutex waveform_lock_;
|
||||
const char *footprint_;
|
||||
const char *user_function_class_;
|
||||
|
||||
private:
|
||||
friend class LibertyLibrary;
|
||||
|
|
|
|||
|
|
@ -941,7 +941,8 @@ LibertyCell::LibertyCell(LibertyLibrary *library,
|
|||
leakage_power_exists_(false),
|
||||
has_internal_ports_(false),
|
||||
have_voltage_waveforms_(false),
|
||||
footprint_(nullptr)
|
||||
footprint_(nullptr),
|
||||
user_function_class_(nullptr)
|
||||
{
|
||||
liberty_cell_ = this;
|
||||
}
|
||||
|
|
@ -971,6 +972,7 @@ LibertyCell::~LibertyCell()
|
|||
pg_port_map_.deleteContents();
|
||||
|
||||
stringDelete(footprint_);
|
||||
stringDelete(user_function_class_);
|
||||
}
|
||||
|
||||
LibertyPort *
|
||||
|
|
@ -2004,6 +2006,18 @@ LibertyCell::footprint() const
|
|||
return footprint_;
|
||||
}
|
||||
|
||||
void
|
||||
LibertyCell::setUserFunctionClass(const char *user_function_class)
|
||||
{
|
||||
user_function_class_ = stringCopy(user_function_class);
|
||||
}
|
||||
|
||||
const char*
|
||||
LibertyCell::userFunctionClass() const
|
||||
{
|
||||
return user_function_class_;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
LibertyCellPortIterator::LibertyCellPortIterator(const LibertyCell *cell) :
|
||||
|
|
|
|||
|
|
@ -311,6 +311,8 @@ LibertyReader::defineVisitors()
|
|||
defineAttrVisitor("interface_timing", &LibertyReader::visitInterfaceTiming);
|
||||
defineAttrVisitor("scaling_factors", &LibertyReader::visitScalingFactors);
|
||||
defineAttrVisitor("cell_footprint", &LibertyReader::visitCellFootprint);
|
||||
defineAttrVisitor("user_function_class",
|
||||
&LibertyReader::visitCellUserFunctionClass);
|
||||
|
||||
// Pins
|
||||
defineGroupVisitor("pin", &LibertyReader::beginPin,&LibertyReader::endPin);
|
||||
|
|
@ -3077,6 +3079,16 @@ LibertyReader::visitCellFootprint(LibertyAttr *attr)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
LibertyReader::visitCellUserFunctionClass(LibertyAttr *attr)
|
||||
{
|
||||
if (cell_) {
|
||||
const char *user_function_class = getAttrString(attr);
|
||||
if (user_function_class)
|
||||
cell_->setUserFunctionClass(stringCopy(user_function_class));
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -206,6 +206,7 @@ public:
|
|||
virtual void visitScalingFactors(LibertyAttr *attr);
|
||||
virtual void visitCellLeakagePower(LibertyAttr *attr);
|
||||
virtual void visitCellFootprint(LibertyAttr *attr);
|
||||
virtual void visitCellUserFunctionClass(LibertyAttr *attr);
|
||||
|
||||
virtual void beginPin(LibertyGroup *group);
|
||||
virtual void endPin(LibertyGroup *group);
|
||||
|
|
|
|||
|
|
@ -289,6 +289,13 @@ LibertyWriter::writeCell(const LibertyCell *cell)
|
|||
fprintf(stream_, " is_macro_cell : true;\n");
|
||||
if (cell->interfaceTiming())
|
||||
fprintf(stream_, " interface_timing : true;\n");
|
||||
const char *footprint = cell->footprint();
|
||||
if (footprint)
|
||||
fprintf(stream_, " cell_footprint : \"%s\";\n", footprint);
|
||||
const char *user_function_class = cell->userFunctionClass();
|
||||
if (user_function_class)
|
||||
fprintf(stream_, " user_function_class : \"%s\";\n",
|
||||
user_function_class);
|
||||
|
||||
LibertyCellPortIterator port_iter(cell);
|
||||
while (port_iter.hasNext()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue