write_liberty skip internal ports

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2022-07-01 19:21:53 -07:00
parent 097086eaad
commit 7ff4ff6db4
1 changed files with 14 additions and 9 deletions

View File

@ -282,14 +282,16 @@ LibertyWriter::writeCell(const LibertyCell *cell)
LibertyCellPortIterator port_iter(cell); LibertyCellPortIterator port_iter(cell);
while (port_iter.hasNext()) { while (port_iter.hasNext()) {
const LibertyPort *port = port_iter.next(); const LibertyPort *port = port_iter.next();
if (port->isBus()) if (!port->direction()->isInternal()) {
writeBusPort(port); if (port->isBus())
else if (port->isBundle()) writeBusPort(port);
report_->error(704, "%s/%s bundled ports not supported.", else if (port->isBundle())
library_->name(), report_->error(704, "%s/%s bundled ports not supported.",
cell->name()); library_->name(),
else cell->name());
writePort(port); else
writePort(port);
}
} }
fprintf(stream_, " }\n"); fprintf(stream_, " }\n");
@ -325,7 +327,10 @@ LibertyWriter::writePortAttrs(const LibertyPort *port)
{ {
fprintf(stream_, " direction : %s;\n" , asString(port->direction())); fprintf(stream_, " direction : %s;\n" , asString(port->direction()));
auto func = port->function(); auto func = port->function();
if (func) if (func
// cannot ref internal ports until sequentials are written
&& !(func->port()
&& func->port()->direction()->isInternal()))
fprintf(stream_, " function : \"%s\";\n", func->asString()); fprintf(stream_, " function : \"%s\";\n", func->asString());
auto tristate_enable = port->tristateEnable(); auto tristate_enable = port->tristateEnable();
if (tristate_enable) { if (tristate_enable) {