Skip to content

Commit 759fa85

Browse files
authored
Merge pull request #3020 from Pinata-Consulting/bazl-local
bazel: use local ORFS files
2 parents 55cd425 + 6a58a44 commit 759fa85

File tree

4 files changed

+123
-7
lines changed

4 files changed

+123
-7
lines changed

flow/BUILD.bazel

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
load("@bazel-orfs//:openroad.bzl", "orfs_pdk")
2+
3+
# files shared between scripts/synth.sh and scripts/flow.sh steps
4+
MAKEFILE_SHARED = [
5+
"scripts/*.py",
6+
"scripts/*.sh",
7+
"scripts/*.yaml",
8+
"scripts/*.mk",
9+
]
10+
11+
# makefile and scripts used by script/synth.sh steps
12+
filegroup(
13+
name = "makefile_yosys",
14+
srcs = ["Makefile"],
15+
data = glob(MAKEFILE_SHARED + [
16+
"scripts/*.script",
17+
"scripts/util.tcl",
18+
"scripts/synth*.tcl",
19+
"platforms/common/**/*.v",
20+
]) +
21+
["//util:makefile_yosys"],
22+
visibility = ["//visibility:public"],
23+
)
24+
25+
# makefile and scripts used in the scripts/flow.sh steps
26+
filegroup(
27+
name = "makefile",
28+
srcs = ["Makefile"],
29+
data = glob(MAKEFILE_SHARED + [
30+
"scripts/*.tcl",
31+
"platforms/common/**/*.v",
32+
]) + [
33+
"//util:makefile",
34+
],
35+
visibility = ["//visibility:public"],
36+
)
37+
38+
# These are the only PDKs for which we have BUILD.bazel files for now
39+
[orfs_pdk(
40+
name = pdk,
41+
config = ":platforms/{pdk}/config.mk".format(pdk = pdk),
42+
srcs = glob([
43+
"platforms/{pdk}/**/*.{ext}".format(pdk = pdk, ext = ext)
44+
for ext in [
45+
"gds",
46+
"lib.gz",
47+
"lef",
48+
"lib",
49+
"lyt",
50+
"mk",
51+
"rules",
52+
"sdc",
53+
"tcl",
54+
"v",
55+
"tlef",
56+
]
57+
]),
58+
visibility = ["//visibility:public"],
59+
) for pdk in [
60+
"asap7",
61+
"sky130hd",
62+
]]

flow/MODULE.bazel

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module(
99
bazel_dep(name = "bazel-orfs")
1010
git_override(
1111
module_name = "bazel-orfs",
12-
commit = "41354d9de46816b79858e43baadf701cf7e997e5",
12+
commit = "48cc8783f285d2a274b1613004dcbea21195f49c",
1313
remote = "https://github.com/The-OpenROAD-Project/bazel-orfs.git",
1414
)
1515

@@ -50,8 +50,17 @@ orfs.default(
5050
# and update "image" to point to the local image.
5151

5252
# Official image https://hub.docker.com/r/openroad/orfs/tags
53-
image = "docker.io/openroad/orfs:v3.0-2707-g044183f3",
54-
sha256 = "34db776930937b94b22f96b68feea87381de70727d12efc47f342b88c8cb3db6",
53+
image = "docker.io/openroad/orfs:v3.0-2734-gcf6f0417",
54+
# Use local files instead of docker image
55+
makefile = "//:makefile",
56+
pdk = "//:asap7",
57+
makefile_yosys = "//:makefile_yosys",
58+
# TODO once openroad is switched to MODULE.bazel, use
59+
# local_path_override(module_name = "openroad", path = "../tools/OpenROAD")
60+
# to point to the local openroad Bazel module instead of
61+
# getting the openroad binary from the docker image.
62+
openroad = "@docker_orfs//:openroad",
63+
sha256 = "ef685898a5e3a2db7166c55238275adcf2dbec7ee0a7eb895a78657bcc27220a",
5564
)
5665
use_repo(orfs, "com_github_nixos_patchelf_download")
5766
use_repo(orfs, "docker_orfs")

flow/MODULE.bazel.lock

Lines changed: 24 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flow/util/BUILD.bazel

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,28 @@ compile_pip_requirements(
1616
src = "requirements.in",
1717
requirements_txt = "requirements_lock.txt",
1818
)
19+
20+
MAKEFILE_SHARED = [
21+
"*.mk",
22+
]
23+
24+
# for scripts/flow.sh steps
25+
filegroup(
26+
name = "makefile",
27+
srcs = glob(MAKEFILE_SHARED + [
28+
"*.pl",
29+
"*.py",
30+
"*.sh",
31+
]),
32+
visibility = ["//visibility:public"],
33+
)
34+
35+
# for scripts/synth.sh steps
36+
filegroup(
37+
name = "makefile_yosys",
38+
srcs = glob(MAKEFILE_SHARED) + [
39+
"preprocessLib.py",
40+
"mergeLib.pl",
41+
],
42+
visibility = ["//visibility:public"],
43+
)

0 commit comments

Comments
 (0)