Skip to content

Commit d6586a5

Browse files
committed
Merge remote-tracking branch 'private/master' into secure-gpl-binSize-float
2 parents 02f274f + 38f93c6 commit d6586a5

File tree

8 files changed

+72
-69
lines changed

8 files changed

+72
-69
lines changed

flow/MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ bazel_dep(name = "bazel-orfs")
1111
# To bump version, run: bazelisk run @bazel-orfs//:bump
1212
git_override(
1313
module_name = "bazel-orfs",
14-
commit = "9b00feceb3f2d695787c45708131a5e39e30d08e",
14+
commit = "126765508161956f8f82ae169084da0235230637",
1515
remote = "https://github.com/The-OpenROAD-Project/bazel-orfs.git",
1616
)
1717

@@ -61,7 +61,7 @@ orfs.default(
6161
# and update "image" to point to the local image.
6262

6363
# Official image https://hub.docker.com/r/openroad/orfs/tags
64-
image = "docker.io/openroad/orfs:v3.0-2784-g6bb4f353",
64+
image = "docker.io/openroad/orfs:v3.0-2883-ge22e4fc7",
6565
# Use local files instead of docker image
6666
makefile = "//:makefile",
6767
makefile_yosys = "//:makefile_yosys",
@@ -79,7 +79,7 @@ orfs.default(
7979
# bazelisk build -c opt :openroad
8080
openroad = "//test:openroad",
8181
pdk = "//:asap7",
82-
sha256 = "67535c7e4a1bdf6adc98eebc3a17988c80674760293887447e750dd526fe6427",
82+
sha256 = "6ad0b1b7fbf290f33f0050ead4da181c83c6e8a9337b65f5f9cff65d67788424",
8383
)
8484
use_repo(orfs, "com_github_nixos_patchelf_download")
8585
use_repo(orfs, "docker_orfs")

flow/MODULE.bazel.lock

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

flow/designs/asap7/gcd/BUILD

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
load("@bazel-orfs//:openroad.bzl", "orfs_flow")
2+
3+
orfs_flow(
4+
name = "gcd",
5+
arguments = {
6+
# Faster builds
7+
"SKIP_INCREMENTAL_REPAIR": "1",
8+
"GPL_TIMING_DRIVEN": "0",
9+
"SKIP_LAST_GASP": "1",
10+
# Various
11+
"DIE_AREA": "0 0 16.2 16.2",
12+
"CORE_AREA": "1.08 1.08 15.12 15.12",
13+
"PLACE_DENSITY": "0.35",
14+
},
15+
sources = {
16+
"RULES_JSON": [":rules-base.json"],
17+
"SDC_FILE": [":constraint.sdc"],
18+
},
19+
verilog_files = ["//designs/src/gcd:verilog"],
20+
tags = ["manual"],
21+
)

flow/designs/asap7/gcd/BUILD.bazel

Lines changed: 0 additions & 47 deletions
This file was deleted.

flow/util/genMetrics.py

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ def parse_args():
5151
"--output", "-o", required=False, default="metadata.json", help="Output file"
5252
)
5353
parser.add_argument("--hier", "-x", action="store_true", help="Hierarchical JSON")
54+
parser.add_argument("--logs", help="Path to logs", default=None)
55+
parser.add_argument(
56+
"--reports",
57+
help="Path to reports",
58+
default=None,
59+
)
60+
parser.add_argument(
61+
"--results",
62+
help="Path to results",
63+
default=None,
64+
)
5465
args = parser.parse_args()
5566

5667
return args
@@ -190,13 +201,11 @@ def merge_jsons(root_path, output, files):
190201
file.close()
191202

192203

193-
def extract_metrics(cwd, platform, design, flow_variant, output, hier_json):
204+
def extract_metrics(
205+
cwd, platform, design, flow_variant, output, hier_json, logPath, rptPath, resultPath
206+
):
194207
baseRegEx = "^{}\n^-*\n^{}"
195208

196-
logPath = os.path.join(cwd, "logs", platform, design, flow_variant)
197-
rptPath = os.path.join(cwd, "reports", platform, design, flow_variant)
198-
resultPath = os.path.join(cwd, "results", platform, design, flow_variant)
199-
200209
metrics_dict = defaultdict(dict)
201210
metrics_dict["run__flow__generate_date"] = now.strftime("%Y-%m-%d %H:%M")
202211
metrics_dict["run__flow__metrics_version"] = "Metrics_2.1.2"
@@ -404,7 +413,20 @@ def extract_metrics(cwd, platform, design, flow_variant, output, hier_json):
404413
continue
405414
print(f"Extract Metrics for {plt}, {des}, {variant}")
406415
file = "/".join(["reports", plt, des, variant, "metrics.json"])
407-
metrics, df = extract_metrics(cwd, plt, des, variant, file, args.hier)
416+
logPath = os.path.join(cwd, "logs", plt, des, variant)
417+
rptPath = os.path.join(cwd, "reports", plt, des, variant)
418+
resultPath = os.path.join(cwd, "results", plt, des, variant)
419+
metrics, df = extract_metrics(
420+
cwd,
421+
plt,
422+
des,
423+
variant,
424+
file,
425+
args.hier,
426+
logPath,
427+
rptPath,
428+
resultPath,
429+
)
408430
all_d.append(metrics)
409431
if all_df.shape[0] == 0:
410432
all_df = df
@@ -424,4 +446,7 @@ def extract_metrics(cwd, platform, design, flow_variant, output, hier_json):
424446
args.flowVariant,
425447
args.output,
426448
args.hier,
449+
args.logs,
450+
args.reports,
451+
args.results,
427452
)

flow/util/genReportTable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
args = parser.parse_args()
5252

5353
goldFilename = f"metadata-{args.variant}-ok.json"
54-
runFilename = f"metadata-{args.variant}.json"
54+
runFilename = f"metadata.json"
5555

5656

5757
def readMetrics(fname, justLoad=False):

flow/util/uploadMetadata.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
args = parser.parse_args()
3232

3333

34-
def upload_data(db, datafile, platform, design, variant, args, rules):
34+
def upload_data(db, dataFile, platform, design, variant, args, rules):
3535
# Set the document data
3636
key = args.commitSHA + "-" + platform + "-" + design + "-" + variant
3737
doc_ref = db.collection("build_metrics").document(key)
@@ -166,9 +166,7 @@ def upload_data(db, datafile, platform, design, variant, args, rules):
166166
raise Exception(f"Failed to upload data for {platform} {design} {variant}.")
167167

168168

169-
def get_rules(platform, design, variant):
170-
runFilename = f"rules-{variant}.json"
171-
dataFile = os.path.join("designs", platform, design, runFilename)
169+
def get_rules(dataFile):
172170
data = {}
173171
if os.path.exists(dataFile):
174172
with open(dataFile) as f:
@@ -182,7 +180,7 @@ def get_rules(platform, design, variant):
182180
# Initialize Firestore client
183181
db = firestore.client()
184182

185-
runFilename = f"metadata-{args.variant}.json"
183+
RUN_FILENAME = "metadata.json"
186184

187185
for reportDir, dirs, files in sorted(os.walk("reports", topdown=False)):
188186
dirList = reportDir.split(os.sep)
@@ -193,14 +191,14 @@ def get_rules(platform, design, variant):
193191
platform = dirList[1]
194192
design = dirList[2]
195193
variant = dirList[3]
196-
dataFile = os.path.join(reportDir, runFilename)
194+
dataFile = os.path.join(reportDir, RUN_FILENAME)
197195
if not os.path.exists(dataFile):
198196
print(f"[WARN] No data file for {platform} {design} {variant}.")
199197
continue
200198
if platform == "sky130hd_fakestack" or platform == "src":
201199
print(f"[WARN] Skiping upload {platform} {design} {variant}.")
202200
continue
203201
print(f"[INFO] Get rules for {platform} {design} {variant}.")
204-
rules = get_rules(platform, design, variant)
202+
rules = get_rules(os.path.join("designs", platform, design, RUN_FILENAME))
205203
print(f"[INFO] Upload data for {platform} {design} {variant}.")
206204
upload_data(db, dataFile, platform, design, variant, args, rules)

flow/util/utils.mk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ metadata: finish metadata-generate metadata-check
77
metadata-generate:
88
@mkdir -p $(REPORTS_DIR)
99
@echo $(DESIGN_DIR) > $(REPORTS_DIR)/design-dir.txt
10-
@$(UTILS_DIR)/genMetrics.py -d $(DESIGN_NICKNAME) \
10+
$(UTILS_DIR)/genMetrics.py -d $(DESIGN_NICKNAME) \
1111
-p $(PLATFORM) \
1212
-v $(FLOW_VARIANT) \
13+
--logs $(LOG_DIR) \
14+
--reports $(REPORTS_DIR) \
15+
--results $(RESULTS_DIR) \
1316
-o $(REPORTS_DIR)/metadata.json 2>&1 \
1417
| tee $(abspath $(REPORTS_DIR)/metadata-generate.log)
1518

@@ -74,6 +77,9 @@ update_metadata_autotuner:
7477
@$(UTILS_DIR)/genMetrics.py -d $(DESIGN_NICKNAME) \
7578
-p $(PLATFORM) \
7679
-v $(FLOW_VARIANT) \
80+
--logs $(LOG_DIR) \
81+
--reports $(REPORTS_DIR) \
82+
--results $(RESULTS_DIR) \
7783
-o $(DESIGN_DIR)/metadata-$(FLOW_VARIANT)-at.json -x
7884

7985
#-------------------------------------------------------------------------------

0 commit comments

Comments
 (0)