Merge pull request #43 from wuheng01/master

Add is_pad attribute for LibertyPort
This commit is contained in:
James Cherry 2024-06-26 09:44:15 -07:00 committed by GitHub
commit ebd71eb2ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 24 additions and 5 deletions

View File

@ -764,6 +764,8 @@ public:
// Is the clock for timing checks.
bool isCheckClk() const { return is_check_clk_; }
void setIsCheckClk(bool is_clk);
bool isPad() const { return is_pad_; }
void setIsPad(bool is_pad);
RiseFall *pulseClkTrigger() const { return pulse_clk_trigger_; }
// Rise for high, fall for low.
RiseFall *pulseClkSense() const { return pulse_clk_sense_; }
@ -863,6 +865,7 @@ protected:
bool level_shifter_data_:1;
bool is_switch_:1;
bool is_disabled_constraint_:1;
bool is_pad_:1;
private:
friend class LibertyLibrary;

View File

@ -1996,7 +1996,8 @@ LibertyPort::LibertyPort(LibertyCell *cell,
isolation_cell_enable_(false),
level_shifter_data_(false),
is_switch_(false),
is_disabled_constraint_(false)
is_disabled_constraint_(false),
is_pad_(false)
{
liberty_port_ = this;
min_pulse_width_[RiseFall::riseIndex()] = 0.0;

View File

@ -297,6 +297,7 @@ LibertyReader::defineVisitors()
defineAttrVisitor("dont_use", &LibertyReader::visitDontUse);
defineAttrVisitor("is_macro_cell", &LibertyReader::visitIsMacro);
defineAttrVisitor("is_memory", &LibertyReader::visitIsMemory);
defineAttrVisitor("pad_cell", &LibertyReader::visitIsPadCell);
defineAttrVisitor("is_pad", &LibertyReader::visitIsPad);
defineAttrVisitor("is_clock_cell", &LibertyReader::visitIsClockCell);
defineAttrVisitor("is_level_shifter", &LibertyReader::visitIsLevelShifter);
@ -2887,13 +2888,13 @@ LibertyReader::visitIsMemory(LibertyAttr *attr)
}
void
LibertyReader::visitIsPad(LibertyAttr *attr)
LibertyReader::visitIsPadCell(LibertyAttr *attr)
{
if (cell_) {
bool is_pad, exists;
getAttrBool(attr, is_pad, exists);
bool pad_cell, exists;
getAttrBool(attr, pad_cell, exists);
if (exists)
cell_->setIsPad(is_pad);
cell_->setIsPad(pad_cell);
}
}
@ -3358,6 +3359,19 @@ LibertyReader::visitClock(LibertyAttr *attr)
}
}
void
LibertyReader::visitIsPad(LibertyAttr *attr)
{
if (ports_) {
bool is_pad, exists;
getAttrBool(attr, is_pad, exists);
if (exists) {
for (LibertyPort *port : *ports_)
port->setIsPad(is_pad);
}
}
}
void
LibertyReader::visitCapacitance(LibertyAttr *attr)
{

View File

@ -187,6 +187,7 @@ public:
virtual void visitDontUse(LibertyAttr *attr);
virtual void visitIsMacro(LibertyAttr *attr);
virtual void visitIsMemory(LibertyAttr *attr);
virtual void visitIsPadCell(LibertyAttr *attr);
virtual void visitIsPad(LibertyAttr *attr);
virtual void visitIsClockCell(LibertyAttr *attr);
virtual void visitIsLevelShifter(LibertyAttr *attr);