2019/01/07 WritePathSpice don't barf on spice subckts missing liberty cells

This commit is contained in:
James Cherry 2019-01-07 22:15:17 -08:00
parent 2d9d5459d3
commit b0d30fed3c
2 changed files with 13 additions and 10 deletions

View File

@ -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

View File

@ -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;
}
////////////////////////////////////////////////////////////////