diff --git a/doc/BugLog b/doc/BugLog index 4868b3e1..88115d74 100644 --- a/doc/BugLog +++ b/doc/BugLog @@ -7,3 +7,4 @@ Release 2.0 Patches 2018/12/24 all_fanout from input port 2018/12/25 liberty pg_types 2019/01/03 liberty 2D bus names +2019/01/07 WritePathSpice don't barf on spice subckts missing liberty cells diff --git a/search/WritePathSpice.cc b/search/WritePathSpice.cc index 561e0265..ef7be1d0 100644 --- a/search/WritePathSpice.cc +++ b/search/WritePathSpice.cc @@ -883,17 +883,19 @@ WritePathSpice::recordSpicePortNames(const char *cell_name, StringVector &tokens) { auto cell = network_->findLibertyCell(cell_name); - auto spice_port_names = new StringVector; - for (int i = 2; i < tokens.size(); i++) { - const char *port_name = tokens[i].c_str(); - auto port = cell->findLibertyPort(port_name); - auto pg_port = cell->findPgPort(port_name); - if (port == NULL && pg_port == NULL) - report_->error("subckt %s port %s has no corresponding liberty port or pg_port.\n", - cell_name, port_name); - spice_port_names->push_back(port_name); + if (cell) { + auto spice_port_names = new StringVector; + for (int i = 2; i < tokens.size(); i++) { + const char *port_name = tokens[i].c_str(); + auto port = cell->findLibertyPort(port_name); + auto pg_port = cell->findPgPort(port_name); + if (port == NULL && pg_port == NULL) + report_->error("subckt %s port %s has no corresponding liberty port or pg_port.\n", + cell_name, port_name); + spice_port_names->push_back(port_name); + } + cell_spice_port_names_[cell_name] = spice_port_names; } - cell_spice_port_names_[cell_name] = spice_port_names; } ////////////////////////////////////////////////////////////////