From dfbc668017a301b85e91b56a09d16e86745955be Mon Sep 17 00:00:00 2001 From: liulixinkerry Date: Wed, 24 Apr 2024 13:48:43 +0800 Subject: [PATCH] support DefPin Port definition --- cpp_to_py/common/io/file_lefdef_db.cpp | 25 +++++++++++++++++++++++++ src/database.py | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/cpp_to_py/common/io/file_lefdef_db.cpp b/cpp_to_py/common/io/file_lefdef_db.cpp index 1f56b16..a756ed1 100644 --- a/cpp_to_py/common/io/file_lefdef_db.cpp +++ b/cpp_to_py/common/io/file_lefdef_db.cpp @@ -1541,6 +1541,31 @@ int readDefPin(defrCallbackType_e c, defiPin* dpin, defiUserData ud) { } } + if (dpin->hasPort()) { + for (int j = 0; j < dpin->numPorts(); j++) { + if (j > 1) { + string pinName(dpin->pinName()); + logger.warning("DefPin %s has multiple ports. We currently only support single port definition", + pinName.c_str()); + break; + } + defiPinPort* port = dpin->pinPort(j); + + if (port->hasPlacement()) { + iopin->x = port->placementX(); + iopin->y = port->placementY(); + iopin->_orient = port->orient(); + } + + for (int i = 0; i < port->numLayer(); i++) { + Layer* layer = db->getLayer(string(port->layer(i))); + int lx, ly, hx, hy; + port->bounds(i, &lx, &ly, &hx, &hy); + iopin->type->addShape(*layer, lx, ly, hx, hy); + } + } + } + return 0; } diff --git a/src/database.py b/src/database.py index 52faa10..f97f62e 100644 --- a/src/database.py +++ b/src/database.py @@ -171,7 +171,7 @@ class PlaceData(object): new_num_bin_y = int(2 ** math.floor(math.log2(num_rows))) new_num_bin_x = int(round(args.num_bin_x / args.num_bin_y * new_num_bin_y)) logger.warning( - "Given num_bin_y %d is larger than num_rows %d." + "Given num_bin_y %d is larger than num_rows %d. " "Use (num_bin_x=%d, num_bin_y=%d) instead" % (args.num_bin_y, num_rows, new_num_bin_x, new_num_bin_y) )