diff --git a/BUILD.bazel b/BUILD.bazel index 07b9405..ba3c177 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -458,37 +458,49 @@ write_binary( verilog_files = all_source_files, ) for variant in SWEEP] -[orfs_run( - name = "BoomTile_" + variant + "_report", - src = ":BoomTile_" + ("" if variant == "base" else variant + "_") + SWEEP_JSON["stage"], - outs = [ - "BoomTile_" + variant + ".yaml", - ], - arguments = { - "OUTFILE": "$(location :BoomTile_" + variant + ".yaml)", - "REPORT_STAGE": SWEEP_JSON["stage"], - }, - script = ":report-wns.tcl", -) for variant in SWEEP] +[ + orfs_run( + name = "BoomTile_" + variant + "_" + stage + "_report", + src = ":BoomTile_" + ("" if variant == "base" else variant + "_") + stage, + outs = [ + "BoomTile_" + variant + "_" + stage + ".yaml", + ], + arguments = { + "OUTFILE": "$(location :BoomTile_" + variant + "_" + stage + ".yaml)", + "REPORT_STAGE": stage, + }, + script = ":report-wns.tcl", + ) + for variant in SWEEP + for stage in SWEEP_JSON["stages"] +] -[filegroup( - name = "BoomTile_" + variant + "_logs", - srcs = [":BoomTile_" + ("" if variant == "base" else variant + "_") + stage for stage in SWEEP_JSON["stages"]], - output_group = "logs", - visibility = [":__subpackages__"], -) for variant in SWEEP] +[ + filegroup( + name = "BoomTile_" + variant + "_" + stage + "_logs", + srcs = [ + ":BoomTile_" + ("" if variant == "base" else variant + "_") + SWEEP_JSON["stages"][i] + for i in range(SWEEP_JSON["stages"].index(stage) + 1) + ], + output_group = "logs", + visibility = [":__subpackages__"], + ) + for variant in SWEEP + for stage in SWEEP_JSON["stages"] +] -genrule( - name = "wns_report", +[genrule( + name = "wns_report_" + stage, srcs = [ "wns_report.py", "sweep.json", - ] + [":BoomTile_" + variant + ".yaml" for variant in SWEEP] + - [":BoomTile_" + variant + "_logs" for variant in SWEEP], - outs = ["BoomTile_wns_report.md"], + ] + [":BoomTile_" + variant + "_" + stage + ".yaml" for variant in SWEEP] + + [":BoomTile_" + variant + "_" + stage + "_logs" for variant in SWEEP], + outs = ["BoomTile_wns_" + stage + "_report.md"], cmd = ( "$(location :wns_report.py) > $@" + - " $(location :sweep.json)" + " $(location :sweep.json)" + + " " + stage ), visibility = ["//visibility:public"], -) +) for stage in SWEEP_JSON["stages"]] diff --git a/etc/BuildMegaboom.sh b/etc/BuildMegaboom.sh index 5226981..f3060f1 100755 --- a/etc/BuildMegaboom.sh +++ b/etc/BuildMegaboom.sh @@ -8,5 +8,7 @@ exec 2>&1 # Check GCP service account entitlements first test/cred_helper_test.py -bazel build wns_report BoomTile_grt --keep_going -cat bazel-bin/BoomTile_wns_report.md +bazel build wns_report_floorplan wns_report_place wns_report_cts BoomTile_grt --keep_going +cat bazel-bin/BoomTile_wns_floorplan_report.md +cat bazel-bin/BoomTile_wns_place_report.md +cat bazel-bin/BoomTile_wns_cts_report.md diff --git a/wns_report.py b/wns_report.py index 320c233..89c65da 100755 --- a/wns_report.py +++ b/wns_report.py @@ -69,11 +69,12 @@ def print_log_dir_times(f): def main(): - if len(sys.argv) != 2: - print("Usage: python script.py ") + if len(sys.argv) != 3: + print("Usage: python script.py stage") sys.exit(1) sweep_file = sys.argv[1] + stage = sys.argv[2] with open(sweep_file, "r") as file: sweep_json = json.load(file) sweep = sweep_json["sweep"] @@ -87,7 +88,7 @@ def main(): table_data = None for variant in sweep: slack_file = os.path.join( - os.path.dirname(sweep_file), "BoomTile_" + variant + ".yaml" + os.path.dirname(sweep_file), "BoomTile_" + variant + "_" + stage + ".yaml" ) with open(slack_file, "r") as file: stats = yaml.safe_load(file)