From 7ff4ff6db49f9b6911525daaf8bf1c522ff2b26a Mon Sep 17 00:00:00 2001 From: James Cherry Date: Fri, 1 Jul 2022 19:21:53 -0700 Subject: [PATCH] write_liberty skip internal ports Signed-off-by: James Cherry --- liberty/LibertyWriter.cc | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/liberty/LibertyWriter.cc b/liberty/LibertyWriter.cc index ad119030..d89c3a14 100644 --- a/liberty/LibertyWriter.cc +++ b/liberty/LibertyWriter.cc @@ -282,14 +282,16 @@ LibertyWriter::writeCell(const LibertyCell *cell) LibertyCellPortIterator port_iter(cell); while (port_iter.hasNext()) { const LibertyPort *port = port_iter.next(); - if (port->isBus()) - writeBusPort(port); - else if (port->isBundle()) - report_->error(704, "%s/%s bundled ports not supported.", - library_->name(), - cell->name()); - else - writePort(port); + if (!port->direction()->isInternal()) { + if (port->isBus()) + writeBusPort(port); + else if (port->isBundle()) + report_->error(704, "%s/%s bundled ports not supported.", + library_->name(), + cell->name()); + else + writePort(port); + } } fprintf(stream_, " }\n"); @@ -325,7 +327,10 @@ LibertyWriter::writePortAttrs(const LibertyPort *port) { fprintf(stream_, " direction : %s;\n" , asString(port->direction())); 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()); auto tristate_enable = port->tristateEnable(); if (tristate_enable) {