write_sdf use corner library pvt

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2023-09-18 16:02:30 -07:00
parent 2d8247a1f1
commit 2054d01d6c
3 changed files with 21 additions and 18 deletions

View File

@ -108,7 +108,7 @@ public:
PathAnalysisPt *findPathAnalysisPt(const MinMax *min_max) const; PathAnalysisPt *findPathAnalysisPt(const MinMax *min_max) const;
void addLiberty(LibertyLibrary *lib, void addLiberty(LibertyLibrary *lib,
const MinMax *min_max); const MinMax *min_max);
LibertySeq *libertyLibraries(const MinMax *min_max); const LibertySeq &libertyLibraries(const MinMax *min_max) const;
int libertyIndex(const MinMax *min_max) const; int libertyIndex(const MinMax *min_max) const;
protected: protected:

View File

@ -215,14 +215,17 @@ SdfWriter::writeHeader(LibertyLibrary *default_lib,
gzprintf(stream_, " (VERSION \"%s\")\n", STA_VERSION); gzprintf(stream_, " (VERSION \"%s\")\n", STA_VERSION);
gzprintf(stream_, " (DIVIDER %c)\n", sdf_divider_); gzprintf(stream_, " (DIVIDER %c)\n", sdf_divider_);
OperatingConditions *cond_min = LibertyLibrary *lib_min = default_lib;
sdc_->operatingConditions(MinMax::min()); const LibertySeq &libs_min = corner_->libertyLibraries(MinMax::min());
if (cond_min == nullptr) if (!libs_min.empty())
cond_min = default_lib->defaultOperatingConditions(); lib_min = libs_min[0];
OperatingConditions *cond_max = LibertyLibrary *lib_max = default_lib;
sdc_->operatingConditions(MinMax::max()); const LibertySeq &libs_max = corner_->libertyLibraries(MinMax::max());
if (cond_max == nullptr) if (!libs_max.empty())
cond_max = default_lib->defaultOperatingConditions(); lib_max = libs_max[0];
OperatingConditions *cond_min = lib_min->defaultOperatingConditions();
OperatingConditions *cond_max = lib_max->defaultOperatingConditions();
if (cond_min && cond_max) { if (cond_min && cond_max) {
gzprintf(stream_, " (VOLTAGE %.3f::%.3f)\n", gzprintf(stream_, " (VOLTAGE %.3f::%.3f)\n",
cond_min->voltage(), cond_min->voltage(),

View File

@ -467,10 +467,10 @@ Corner::addLiberty(LibertyLibrary *lib,
liberty_[min_max->index()].push_back(lib); liberty_[min_max->index()].push_back(lib);
} }
LibertySeq * const LibertySeq &
Corner::libertyLibraries(const MinMax *min_max) Corner::libertyLibraries(const MinMax *min_max) const
{ {
return &liberty_[min_max->index()]; return liberty_[min_max->index()];
} }
int int