Skip to content

Commit f713684

Browse files
authored
Merge pull request #2811 from Pinata-Consulting/make-metadata-out-of-tree-fix
make: fix out of ORFS tree 'make metadata'
2 parents ddfab19 + c989a70 commit f713684

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

flow/util/genMetrics.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,11 @@
1818
import re
1919
from glob import glob
2020

21-
# make sure the working dir is flow/
22-
os.chdir(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
23-
24-
# Parse and validate arguments
25-
# =============================================================================
26-
2721

2822
def parse_args():
2923
parser = argparse.ArgumentParser(
3024
description="Generates metadata from OpenROAD flow"
3125
)
32-
parser.add_argument(
33-
"--flowPath",
34-
"-f",
35-
required=False,
36-
default="./",
37-
help="Path to the flow directory",
38-
)
3926
parser.add_argument(
4027
"--design",
4128
"-d",
@@ -66,11 +53,6 @@ def parse_args():
6653
parser.add_argument("--hier", "-x", action="store_true", help="Hierarchical JSON")
6754
args = parser.parse_args()
6855

69-
if not os.path.isdir(args.flowPath):
70-
print("[ERROR] flowPath does not exist")
71-
print("Path: " + args.flowPath)
72-
exit(1)
73-
7456
return args
7557

7658

@@ -102,7 +84,7 @@ def extractTagFromFile(
10284

10385
# Open file
10486
try:
105-
searchFilePath = os.path.join(args.flowPath, file)
87+
searchFilePath = file
10688
with open(searchFilePath) as f:
10789
content = f.read()
10890

@@ -438,7 +420,7 @@ def extract_metrics(cwd, platform, design, flow_variant, output, hier_json):
438420
f.write(all_df.to_html())
439421
else:
440422
metrics_dict, metrics_df = extract_metrics(
441-
args.flowPath,
423+
os.getcwd(),
442424
args.platform,
443425
args.design,
444426
args.flowVariant,

0 commit comments

Comments
 (0)