diff --git a/Changelog.md b/Changelog.md index 17e9559d5..7bed78d61 100644 --- a/Changelog.md +++ b/Changelog.md @@ -13,6 +13,14 @@ ## API Breaks ## Documentation --> +# 2.0.2 + +## Steps + +* `Odb.ReportDisconnectedPins` + * Fixed table not being written to step directory + * Fixed bug where table widths were not being set properly + * Fixed bug where pins with `USE SIGNAL` would be considered power pins # 2.0.1 diff --git a/openlane/__version__.py b/openlane/__version__.py index fa72cd119..1636a2e28 100644 --- a/openlane/__version__.py +++ b/openlane/__version__.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "2.0.1" +__version__ = "2.0.2" if __name__ == "__main__": print(__version__, end="") diff --git a/openlane/scripts/odbpy/disconnected_pins.py b/openlane/scripts/odbpy/disconnected_pins.py index 1751ed5bf..8c55f68d1 100644 --- a/openlane/scripts/odbpy/disconnected_pins.py +++ b/openlane/scripts/odbpy/disconnected_pins.py @@ -24,6 +24,7 @@ from reader import click, click_odb, OdbReader from reader import rich from reader import Table +from rich.console import Console def is_connected(term: Union[odb.dbITerm, odb.dbBTerm]) -> bool: @@ -38,7 +39,7 @@ def is_connected(term: Union[odb.dbITerm, odb.dbBTerm]) -> bool: @dataclass class Port: polarity: Literal["INPUT", "OUTPUT", "INOUT"] - pg: Optional[Literal["POWER", "GROUND"]] + signal_type: Optional[Literal["POWER", "GROUND", "SIGNAL"]] connected: bool = False @@ -62,7 +63,7 @@ def from_object( module: "Module", ): result = Self() - for terminal in module.ports.values(): + for name, terminal in module.ports.items(): if terminal.polarity == "INPUT": result.inputs += 1 if terminal.connected: @@ -72,11 +73,11 @@ def from_object( if terminal.connected: result.outputs_connected += 1 elif terminal.polarity == "INOUT": - if terminal.pg == "POWER": + if terminal.signal_type == "POWER": result.power_inouts += 1 if terminal.connected: result.power_inouts_connected += 1 - elif terminal.pg == "GROUND": + elif terminal.signal_type == "GROUND": result.ground_inouts += 1 if terminal.connected: result.ground_inouts_connected += 1 @@ -140,14 +141,14 @@ def __init__(self, object: Union[odb.dbBlock, odb.dbInst]) -> None: power_found = False ground_found = True for terminal in terminals: - pg = terminal.getSigType() - if pg == "POWER": + signal_type = terminal.getSigType() + if signal_type == "POWER": power_found = True - elif pg == "GROUND": + elif signal_type == "GROUND": ground_found = True self.ports[terminal.getName()] = Port( terminal.getIoType(), - pg=terminal.getSigType(), + signal_type=terminal.getSigType(), connected=is_connected(terminal), ) if not power_found: @@ -189,20 +190,32 @@ def write_disconnected_pins(self, full_table: Table, critical_table: Table): row = ( self.name, "\n".join( - [k for k, v in self.ports.items() if v.pg is not None and v.connected] + [ + k + for k, v in self.ports.items() + if v.signal_type in ["POWER", "GROUND"] and v.connected + ] ), "\n".join( [ k for k, v in self.ports.items() - if v.pg is not None and not v.connected + if v.signal_type in ["POWER", "GROUND"] and not v.connected ] ), "\n".join( - [k for k, v in self.ports.items() if v.pg is None and v.connected] + [ + k + for k, v in self.ports.items() + if v.signal_type == "SIGNAL" and v.connected + ] ), "\n".join( - [k for k, v in self.ports.items() if v.pg is None and not v.connected] + [ + k + for k, v in self.ports.items() + if v.signal_type == "SIGNAL" and not v.connected + ] ), ) full_table.add_row(*row) @@ -242,6 +255,7 @@ def main( "Signal Pins", "Disconnected", title="", + show_lines=True, ) critical_table = Table( "Macro/Instance", @@ -277,8 +291,10 @@ def main( rich.print(critical_table) if full_table.row_count > 0: if full_table_path := write_full_table_to: - full_table.width = 160 - rich.print(full_table, file=open(full_table_path, "w", encoding="utf8")) + console = Console( + file=open(full_table_path, "w", encoding="utf8"), width=160 + ) + console.print(full_table) utl.metric_integer("design__disconnected_pin__count", disconnected_pin_count) utl.metric_integer( diff --git a/openlane/steps/odb.py b/openlane/steps/odb.py index 0f170f2fa..c7a3c1b6b 100644 --- a/openlane/steps/odb.py +++ b/openlane/steps/odb.py @@ -474,6 +474,8 @@ def get_command(self) -> List[str]: for module in ignored_modules: command.append("--ignore-module") command.append(module) + command.append("--write-full-table-to") + command.append(os.path.join(self.step_dir, "full_disconnected_pins_table.txt")) return command