Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reports: one report per stage #172

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 37 additions & 25 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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"]]
6 changes: 4 additions & 2 deletions etc/BuildMegaboom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 4 additions & 3 deletions wns_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ def print_log_dir_times(f):


def main():
if len(sys.argv) != 2:
print("Usage: python script.py <sweep_file>")
if len(sys.argv) != 3:
print("Usage: python script.py <sweep_file> 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"]
Expand All @@ -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)
Expand Down