Skip to content

Commit

Permalink
Purgeodb.dbDatabase.create (#2146)
Browse files Browse the repository at this point in the history
* Synchronize tool versions with OpenLane 2.1.1.
* Downgrade Magic to 8.3.478: See RTimothyEdwards/magic#317
* Purge `odb.dbDatabase.create` from the codebase: See The-OpenROAD-Project/OpenROAD#4743
  • Loading branch information
donn authored Aug 14, 2024
1 parent 679d5ba commit aaee345
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 25 deletions.
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 7 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
};

inputs = {
openlane2.url = github:efabless/openlane2/dev;
openlane2.url = github:efabless/openlane2/2.1.1;
};

outputs = {
Expand Down Expand Up @@ -50,9 +50,15 @@
};
openroad = pkgs.openroad.override {
# openroad-rev-sha
# https://github.com/The-OpenROAD-Project/OpenROAD/discussions/4743
openroad-abc = self.openroad-abc;
opensta = self.opensta;
};
magic = pkgs.magic.override {
# https://github.com/RTimothyEdwards/magic/issues/317
rev = "8.3.478";
sha256 = "sha256-aFFKbSqIgpkYjFZfpW3C52N1yQc5+KiLyf5jC16K5UU=";
};
openlane1 = callPythonPackage ./default.nix {};
default = self.openlane1;
}
Expand All @@ -63,13 +69,5 @@
});
in
self);

# devShells = self.forAllSystems (
# pkgs: let
# callPackage = pkgs.lib.callPackageWith (pkgs // self.packages.${pkgs.system});
# callPythonPackage = pkgs.lib.callPackageWith (pkgs // pkgs.python3.pkgs // self.packages.${pkgs.system});
# in rec {
# }
# );
};
}
9 changes: 2 additions & 7 deletions scripts/odbpy/defutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ def merge_components(reader, donor_def, input_lef):


def move_diearea(target_db, input_lef, template_def):
source_db = odb.dbDatabase.create()

odb.read_lef(source_db, input_lef)
odb.read_def(source_db.getTech(), template_def)
source_db = OdbReader(input_lef, template_def).db

assert (
source_db.getTech().getManufacturingGrid()
Expand Down Expand Up @@ -164,9 +161,7 @@ def relocate_pins(db, input_lef, template_def):
# --------------------------------
# 2. Read the donor def
# --------------------------------
template_db = odb.dbDatabase.create()
odb.read_lef(template_db, input_lef)
odb.read_def(template_db.getTech(), template_def)
template_db = OdbReader(input_lef, template_def).db
template_bterms = template_db.getChip().getBlock().getBTerms()

assert (
Expand Down
3 changes: 1 addition & 2 deletions scripts/odbpy/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ class OdbReader(object):

def __init__(self, *args):
if primary := OdbReader.primary_reader:
self.db = odb.dbDatabase.create()
self.db.setLogger(primary.design.getLogger())
self.db = primary.design.createDetachedDb()
else:
self.ord_tech = Tech()
self.design = Design(self.ord_tech)
Expand Down
5 changes: 4 additions & 1 deletion tests/1007-buffer_insertion/hooks/post_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@

import os
import odb
from openroad import Tech, Design

db = odb.dbDatabase.create()
ord_tech = Tech()
design = Design(ord_tech)
db = ord_tech.getDB()
odb.read_db(db, os.getenv("CURRENT_ODB"))
instances = db.getChip().getBlock().getInsts()
buffers = [
Expand Down
5 changes: 4 additions & 1 deletion tests/1413-odb_remover/hooks/post_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@

import os
import odb
from openroad import Tech, Design

db = odb.dbDatabase.create()
ord_tech = Tech()
design = Design(ord_tech)
db = ord_tech.getDB()
odb.read_db(db, os.getenv("CURRENT_ODB"))
nets = db.getChip().getBlock().getNets()
pins = db.getChip().getBlock().getBTerms()
Expand Down
2 changes: 1 addition & 1 deletion tests/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def run_test_case(test_case):

result = subprocess.Popen(
[
"flow.tcl",
os.path.join(openlane_root, "flow.tcl"),
"-design",
test_case,
"-verbose",
Expand Down

0 comments on commit aaee345

Please sign in to comment.