Skip to content

Commit

Permalink
Merge branch 'parallaxsw:master' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
akashlevy authored Nov 16, 2024
2 parents 75ffc39 + 7025327 commit 9d26954
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 21 deletions.
2 changes: 2 additions & 0 deletions include/sta/Liberty.hh
Original file line number Diff line number Diff line change
Expand Up @@ -1150,5 +1150,7 @@ private:

string
portLibertyToSta(const char *port_name);
const char *
scanSignalTypeName(ScanSignalType scan_type);

} // namespace
19 changes: 19 additions & 0 deletions liberty/Liberty.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2145,6 +2145,25 @@ LibertyPort::setScanSignalType(ScanSignalType type)
scan_signal_type_ = type;
}

static EnumNameMap<ScanSignalType> scan_signal_type_map =
{{ScanSignalType::enable, "enable"},
{ScanSignalType::enable_inverted, "enable_inverted"},
{ScanSignalType::clock, "clock"},
{ScanSignalType::clock_a, "clock_a"},
{ScanSignalType::clock_b, "clock_b"},
{ScanSignalType::input, "input"},
{ScanSignalType::input_inverted, "input_inverted"},
{ScanSignalType::output, "output"},
{ScanSignalType::output_inverted, "output_inverted"},
{ScanSignalType::none, "none"}};


const char *
scanSignalTypeName(ScanSignalType scan_type)
{
return scan_signal_type_map.find(scan_type);
}

LibertyPort *
LibertyPort::findLibertyMember(int index) const
{
Expand Down
6 changes: 6 additions & 0 deletions liberty/Liberty.i
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,12 @@ set_direction(const char *dir)
self->setDirection(PortDirection::find(dir));
}

const char *
scan_signal_type()
{
return scanSignalTypeName(self->scanSignalType());
}

} // LibertyPort methods

%extend TimingArcSet {
Expand Down
13 changes: 3 additions & 10 deletions liberty/LibertyReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ LibertyReader::init(const char *filename,
ocv_derate_name_ = nullptr;
op_cond_ = nullptr;
ports_ = nullptr;
port_ = nullptr;
port_group_ = nullptr;
saved_ports_ = nullptr;
saved_port_group_ = nullptr;
Expand Down Expand Up @@ -3179,11 +3178,6 @@ LibertyReader::beginPin(LibertyGroup *group)
port_group_ = new PortGroup(ports_, group->line());
cell_port_groups_.push_back(port_group_);
}
if (test_cell_) {
const char *pin_name = group->firstName();
if (pin_name)
port_ = findPort(save_cell_, pin_name);
}
}

void
Expand All @@ -3196,7 +3190,6 @@ LibertyReader::endPin(LibertyGroup *)
port_group_ = saved_port_group_;
}
}
port_ = nullptr;
}

void
Expand Down Expand Up @@ -3794,7 +3787,7 @@ LibertyReader::visitIsPllFeedbackPin(LibertyAttr *attr)
void
LibertyReader::visitSignalType(LibertyAttr *attr)
{
if (test_cell_ && port_) {
if (test_cell_ && ports_) {
const char *type = getAttrString(attr);
if (type) {
ScanSignalType signal_type = ScanSignalType::none;
Expand All @@ -3820,8 +3813,8 @@ LibertyReader::visitSignalType(LibertyAttr *attr)
libWarn(1299, attr, "unknown signal_type %s.", type);
return;
}
if (port_)
port_->setScanSignalType(signal_type);
for (LibertyPort *port : *ports_)
port->setScanSignalType(signal_type);
}
}
}
Expand Down
1 change: 0 additions & 1 deletion liberty/LibertyReaderPvt.hh
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,6 @@ protected:
PortGroupSeq cell_port_groups_;
OperatingConditions *op_cond_;
LibertyPortSeq *ports_;
LibertyPort *port_; // Used by test_cell.
PortGroup *port_group_;
LibertyPortSeq *saved_ports_;
PortGroup *saved_port_group_;
Expand Down
20 changes: 10 additions & 10 deletions search/ReportPath.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1102,8 +1102,8 @@ ReportPath::reportJson(const PathEnd *end,
reportJson(end->targetClkPath(), "target_clock_path", 2, true, result);

if (end->checkRole(this)) {
stringAppend(result, " \"data_arrival_time\": %s,\n",
delayAsString(end->dataArrivalTimeOffset(this), this, 3));
stringAppend(result, " \"data_arrival_time\": %.3e,\n",
delayAsFloat(end->dataArrivalTimeOffset(this)));

const MultiCyclePath *mcp = end->multiCyclePath();
if (mcp)
Expand All @@ -1115,14 +1115,14 @@ ReportPath::reportJson(const PathEnd *end,
stringAppend(result, " \"path_delay\": %.3e,\n",
path_delay->delay());

stringAppend(result, " \"crpr\": %s,\n",
delayAsString(end->checkCrpr(this), this, 3));
stringAppend(result, " \"margin\": %s,\n",
delayAsString(end->margin(this), this, 3));
stringAppend(result, " \"required_time\": %s,\n",
delayAsString(end->requiredTimeOffset(this), this, 3));
stringAppend(result, " \"slack\": %s\n",
delayAsString(end->slack(this), this, 3));
stringAppend(result, " \"crpr\": %.3e,\n",
delayAsFloat(end->checkCrpr(this)));
stringAppend(result, " \"margin\": %.3e,\n",
delayAsFloat(end->margin(this)));
stringAppend(result, " \"required_time\": %.3e,\n",
delayAsFloat(end->requiredTimeOffset(this)));
stringAppend(result, " \"slack\": %.3e\n",
delayAsFloat(end->slack(this)));
}
result += "}";
if (!last)
Expand Down

0 comments on commit 9d26954

Please sign in to comment.