Skip to content

Commit 9d26954

Browse files
authored
Merge branch 'parallaxsw:master' into main
2 parents 75ffc39 + 7025327 commit 9d26954

File tree

6 files changed

+40
-21
lines changed

6 files changed

+40
-21
lines changed

include/sta/Liberty.hh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,5 +1150,7 @@ private:
11501150

11511151
string
11521152
portLibertyToSta(const char *port_name);
1153+
const char *
1154+
scanSignalTypeName(ScanSignalType scan_type);
11531155

11541156
} // namespace

liberty/Liberty.cc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,6 +2145,25 @@ LibertyPort::setScanSignalType(ScanSignalType type)
21452145
scan_signal_type_ = type;
21462146
}
21472147

2148+
static EnumNameMap<ScanSignalType> scan_signal_type_map =
2149+
{{ScanSignalType::enable, "enable"},
2150+
{ScanSignalType::enable_inverted, "enable_inverted"},
2151+
{ScanSignalType::clock, "clock"},
2152+
{ScanSignalType::clock_a, "clock_a"},
2153+
{ScanSignalType::clock_b, "clock_b"},
2154+
{ScanSignalType::input, "input"},
2155+
{ScanSignalType::input_inverted, "input_inverted"},
2156+
{ScanSignalType::output, "output"},
2157+
{ScanSignalType::output_inverted, "output_inverted"},
2158+
{ScanSignalType::none, "none"}};
2159+
2160+
2161+
const char *
2162+
scanSignalTypeName(ScanSignalType scan_type)
2163+
{
2164+
return scan_signal_type_map.find(scan_type);
2165+
}
2166+
21482167
LibertyPort *
21492168
LibertyPort::findLibertyMember(int index) const
21502169
{

liberty/Liberty.i

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,12 @@ set_direction(const char *dir)
339339
self->setDirection(PortDirection::find(dir));
340340
}
341341

342+
const char *
343+
scan_signal_type()
344+
{
345+
return scanSignalTypeName(self->scanSignalType());
346+
}
347+
342348
} // LibertyPort methods
343349

344350
%extend TimingArcSet {

liberty/LibertyReader.cc

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ LibertyReader::init(const char *filename,
9696
ocv_derate_name_ = nullptr;
9797
op_cond_ = nullptr;
9898
ports_ = nullptr;
99-
port_ = nullptr;
10099
port_group_ = nullptr;
101100
saved_ports_ = nullptr;
102101
saved_port_group_ = nullptr;
@@ -3179,11 +3178,6 @@ LibertyReader::beginPin(LibertyGroup *group)
31793178
port_group_ = new PortGroup(ports_, group->line());
31803179
cell_port_groups_.push_back(port_group_);
31813180
}
3182-
if (test_cell_) {
3183-
const char *pin_name = group->firstName();
3184-
if (pin_name)
3185-
port_ = findPort(save_cell_, pin_name);
3186-
}
31873181
}
31883182

31893183
void
@@ -3196,7 +3190,6 @@ LibertyReader::endPin(LibertyGroup *)
31963190
port_group_ = saved_port_group_;
31973191
}
31983192
}
3199-
port_ = nullptr;
32003193
}
32013194

32023195
void
@@ -3794,7 +3787,7 @@ LibertyReader::visitIsPllFeedbackPin(LibertyAttr *attr)
37943787
void
37953788
LibertyReader::visitSignalType(LibertyAttr *attr)
37963789
{
3797-
if (test_cell_ && port_) {
3790+
if (test_cell_ && ports_) {
37983791
const char *type = getAttrString(attr);
37993792
if (type) {
38003793
ScanSignalType signal_type = ScanSignalType::none;
@@ -3820,8 +3813,8 @@ LibertyReader::visitSignalType(LibertyAttr *attr)
38203813
libWarn(1299, attr, "unknown signal_type %s.", type);
38213814
return;
38223815
}
3823-
if (port_)
3824-
port_->setScanSignalType(signal_type);
3816+
for (LibertyPort *port : *ports_)
3817+
port->setScanSignalType(signal_type);
38253818
}
38263819
}
38273820
}

liberty/LibertyReaderPvt.hh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,6 @@ protected:
621621
PortGroupSeq cell_port_groups_;
622622
OperatingConditions *op_cond_;
623623
LibertyPortSeq *ports_;
624-
LibertyPort *port_; // Used by test_cell.
625624
PortGroup *port_group_;
626625
LibertyPortSeq *saved_ports_;
627626
PortGroup *saved_port_group_;

search/ReportPath.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,8 +1102,8 @@ ReportPath::reportJson(const PathEnd *end,
11021102
reportJson(end->targetClkPath(), "target_clock_path", 2, true, result);
11031103

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

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

1118-
stringAppend(result, " \"crpr\": %s,\n",
1119-
delayAsString(end->checkCrpr(this), this, 3));
1120-
stringAppend(result, " \"margin\": %s,\n",
1121-
delayAsString(end->margin(this), this, 3));
1122-
stringAppend(result, " \"required_time\": %s,\n",
1123-
delayAsString(end->requiredTimeOffset(this), this, 3));
1124-
stringAppend(result, " \"slack\": %s\n",
1125-
delayAsString(end->slack(this), this, 3));
1118+
stringAppend(result, " \"crpr\": %.3e,\n",
1119+
delayAsFloat(end->checkCrpr(this)));
1120+
stringAppend(result, " \"margin\": %.3e,\n",
1121+
delayAsFloat(end->margin(this)));
1122+
stringAppend(result, " \"required_time\": %.3e,\n",
1123+
delayAsFloat(end->requiredTimeOffset(this)));
1124+
stringAppend(result, " \"slack\": %.3e\n",
1125+
delayAsFloat(end->slack(this)));
11261126
}
11271127
result += "}";
11281128
if (!last)

0 commit comments

Comments
 (0)