liberty handle missing library group

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2023-10-24 19:19:44 -07:00
parent 50bd00034b
commit bcaa96df99
1 changed files with 15 additions and 11 deletions

View File

@ -1670,6 +1670,7 @@ LibertyReader::visitScaleFactor(LibertyAttr *attr)
void void
LibertyReader::beginOpCond(LibertyGroup *group) LibertyReader::beginOpCond(LibertyGroup *group)
{ {
if (library_) {
const char *name = group->firstName(); const char *name = group->firstName();
if (name) { if (name) {
op_cond_ = new OperatingConditions(name); op_cond_ = new OperatingConditions(name);
@ -1678,6 +1679,7 @@ LibertyReader::beginOpCond(LibertyGroup *group)
else else
libWarn(68, group, "operating_conditions missing name."); libWarn(68, group, "operating_conditions missing name.");
} }
}
void void
LibertyReader::visitProc(LibertyAttr *attr) LibertyReader::visitProc(LibertyAttr *attr)
@ -1863,10 +1865,12 @@ LibertyReader::beginCell(LibertyGroup *group)
const char *name = group->firstName(); const char *name = group->firstName();
if (name) { if (name) {
debugPrint(debug_, "liberty", 1, "cell %s", name); debugPrint(debug_, "liberty", 1, "cell %s", name);
if (library_) {
cell_ = builder_.makeCell(library_, name, filename_); cell_ = builder_.makeCell(library_, name, filename_);
in_bus_ = false; in_bus_ = false;
in_bundle_ = false; in_bundle_ = false;
} }
}
else else
libWarn(78, group, "cell missing name."); libWarn(78, group, "cell missing name.");
} }
@ -4196,7 +4200,7 @@ LibertyReader::beginTable(LibertyGroup *group,
float scale) float scale)
{ {
const char *template_name = group->firstName(); const char *template_name = group->firstName();
if (template_name) { if (library_ && template_name) {
tbl_template_ = library_->findTableTemplate(template_name, type); tbl_template_ = library_->findTableTemplate(template_name, type);
if (tbl_template_) { if (tbl_template_) {
axis_[0] = tbl_template_->axis1(); axis_[0] = tbl_template_->axis1();
@ -4385,7 +4389,7 @@ LibertyReader::endLut(LibertyGroup *)
void void
LibertyReader::beginTestCell(LibertyGroup *group) LibertyReader::beginTestCell(LibertyGroup *group)
{ {
if (cell_->testCell()) if (cell_ && cell_->testCell())
libWarn(169, group, "cell %s test_cell redefinition.", cell_->name()); libWarn(169, group, "cell %s test_cell redefinition.", cell_->name());
else { else {
test_cell_ = new TestCell; test_cell_ = new TestCell;