Skip to content

Commit

Permalink
orfs_run: add extra_args that allows redirection
Browse files Browse the repository at this point in the history
Signed-off-by: Øyvind Harboe <[email protected]>
  • Loading branch information
oharboe committed Oct 29, 2024
1 parent fcc8698 commit b118c35
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/scripts/smoketests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
set -ex

bazel build cell_count

echo These targets should have been pruned
bazel query //:* | grep -q -v lb_32x128_1_synth
bazel query //:* | grep -q -v lb_32x128_2_floorplan
Expand Down
10 changes: 10 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,16 @@ SWEEP = {
script = ":report-wns.tcl",
) for variant in SWEEP]

orfs_run(
name = "cell_count",
src = ":lb_32x128_floorplan",
outs = [
"test.txt",
],
extra_args = "> $WORK_HOME/test.txt",
script = ":cell_count.tcl",
)

genrule(
name = "wns_report",
srcs = ["wns-report.py"] +
Expand Down
6 changes: 6 additions & 0 deletions cell_count.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source $::env(SCRIPTS_DIR)/load.tcl
load_design 2_floorplan.odb 2_floorplan.sdc

report_clock_skew
report_tns
report_cell_usage
10 changes: 9 additions & 1 deletion openroad.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,11 @@ def _run_impl(ctx):
ctx.file._makefile.path,
"run",
],
command = ctx.executable._make.path + " $@",
command = " ".join([
ctx.executable._make.path,
"$@",
ctx.expand_location(ctx.attr.extra_args, ctx.attr.data),
]),
env = _data_arguments(ctx) |
odb_environment(ctx) |
flow_environment(ctx) |
Expand Down Expand Up @@ -637,6 +641,10 @@ orfs_run = rule(
mandatory = True,
allow_empty = False,
),
"extra_args": attr.string(
mandatory = False,
default = "",
),
},
)

Expand Down

0 comments on commit b118c35

Please sign in to comment.