From b118c35e39b913ca921ad874179f5c148c572d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Tue, 29 Oct 2024 09:55:04 +0100 Subject: [PATCH] orfs_run: add extra_args that allows redirection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Øyvind Harboe --- .github/scripts/smoketests.sh | 2 ++ BUILD | 10 ++++++++++ cell_count.tcl | 6 ++++++ openroad.bzl | 10 +++++++++- 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 cell_count.tcl diff --git a/.github/scripts/smoketests.sh b/.github/scripts/smoketests.sh index fd4c600..4c7ccde 100755 --- a/.github/scripts/smoketests.sh +++ b/.github/scripts/smoketests.sh @@ -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 diff --git a/BUILD b/BUILD index 6ed9651..b8f9a5a 100644 --- a/BUILD +++ b/BUILD @@ -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"] + diff --git a/cell_count.tcl b/cell_count.tcl new file mode 100644 index 0000000..0726aa6 --- /dev/null +++ b/cell_count.tcl @@ -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 diff --git a/openroad.bzl b/openroad.bzl index 7bee87e..31dc84c 100644 --- a/openroad.bzl +++ b/openroad.bzl @@ -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) | @@ -637,6 +641,10 @@ orfs_run = rule( mandatory = True, allow_empty = False, ), + "extra_args": attr.string( + mandatory = False, + default = "", + ), }, )