From 2553f3b8bec1132331e502f74a84a1a0e379ad72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Hovind?= Date: Wed, 16 Oct 2024 10:14:43 +0200 Subject: [PATCH 01/10] openroad.bzl: Remove redundant inputs --- openroad.bzl | 2 -- 1 file changed, 2 deletions(-) diff --git a/openroad.bzl b/openroad.bzl index 7c43326d..6bfe546e 100644 --- a/openroad.bzl +++ b/openroad.bzl @@ -201,8 +201,6 @@ def source_inputs(ctx): return depset( ctx.files.src, transitive = [ - ctx.attr.src[DefaultInfo].default_runfiles.files, - ctx.attr.src[DefaultInfo].default_runfiles.symlinks, ctx.attr.src[OrfsInfo].additional_gds, ctx.attr.src[OrfsInfo].additional_lefs, ctx.attr.src[OrfsInfo].additional_libs, From 57032922bd30680ce53da9bcfc08ec733cef201f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Hovind?= Date: Wed, 16 Oct 2024 10:26:20 +0200 Subject: [PATCH 02/10] openroad.bzl: Exclude logs from default outputs --- openroad.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openroad.bzl b/openroad.bzl index 6bfe546e..70c1208d 100644 --- a/openroad.bzl +++ b/openroad.bzl @@ -845,7 +845,7 @@ def _make_impl(ctx, stage, steps, forwarded_names = [], result_names = [], objec DefaultInfo( executable = exe, files = depset( - forwards + results + logs + reports, + forwards + results + reports, transitive = [ ctx.attr.src[OrfsInfo].additional_gds, ctx.attr.src[OrfsInfo].additional_lefs, From a0a8dd58baeafc11f8fffe4121155cbfcd9b99fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Hovind?= Date: Wed, 16 Oct 2024 11:15:45 +0200 Subject: [PATCH 03/10] openroad.bzl: Remove redundant substitutions --- openroad.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openroad.bzl b/openroad.bzl index 70c1208d..c4548a26 100644 --- a/openroad.bzl +++ b/openroad.bzl @@ -281,7 +281,7 @@ def _deps_impl(ctx): ctx.actions.expand_template( template = ctx.file._deploy_template, output = exe, - substitutions = flow_substitutions(ctx) | { + substitutions = { "${GENFILES}": " ".join(sorted([f.short_path for f in ctx.attr.src[OrfsDepInfo].files])), "${CONFIG}": ctx.attr.src[OrfsDepInfo].config.short_path, "${MAKE}": ctx.attr.src[OrfsDepInfo].make.short_path, From a935cdebcfb1fa9e60aeb690ce8eca00affe6679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Hovind?= Date: Wed, 16 Oct 2024 13:44:14 +0200 Subject: [PATCH 04/10] openroad.bzl: Remove redundant runfiles --- openroad.bzl | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/openroad.bzl b/openroad.bzl index c4548a26..a7bd62e2 100644 --- a/openroad.bzl +++ b/openroad.bzl @@ -685,15 +685,7 @@ def _yosys_impl(ctx): executable = exe, files = depset(outputs), runfiles = ctx.runfiles( - outputs + canon_logs + synth_logs + [config_short, make] + - ctx.files.verilog_files + ctx.files.extra_configs, - transitive_files = depset(transitive = [ - flow_inputs(ctx), - yosys_inputs(ctx), - data_inputs(ctx), - pdk_inputs(ctx), - deps_inputs(ctx), - ]), + outputs + canon_logs + synth_logs + [config_short, make], ), ), OutputGroupInfo( @@ -854,13 +846,7 @@ def _make_impl(ctx, stage, steps, forwarded_names = [], result_names = [], objec ), runfiles = ctx.runfiles( [config_short, make] + - forwards + results + logs + reports + - ctx.files.extra_configs, - transitive_files = depset(transitive = [ - flow_inputs(ctx), - data_inputs(ctx), - source_inputs(ctx), - ]), + forwards + results + logs + reports, ), ), OutputGroupInfo( From df358d4db78c252b9a5de3877f184d5c7f366a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Hovind?= Date: Wed, 16 Oct 2024 13:46:57 +0200 Subject: [PATCH 05/10] openroad.bzl: Remove redundant genfiles --- openroad.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openroad.bzl b/openroad.bzl index a7bd62e2..5e64ff1a 100644 --- a/openroad.bzl +++ b/openroad.bzl @@ -827,7 +827,7 @@ def _make_impl(ctx, stage, steps, forwarded_names = [], result_names = [], objec template = ctx.file._deploy_template, output = exe, substitutions = { - "${GENFILES}": " ".join(sorted([f.short_path for f in [config_short] + results + logs + reports + ctx.files.data])), + "${GENFILES}": " ".join(sorted([f.short_path for f in [config_short] + results + logs + reports])), "${CONFIG}": config_short.short_path, "${MAKE}": make.short_path, }, From fbab155a6c38a1b7ec8d35a2a01b9c4524354c81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Hovind?= Date: Wed, 16 Oct 2024 14:29:04 +0200 Subject: [PATCH 06/10] openroad.bzl: Add transitive runfiles for synthesis --- openroad.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/openroad.bzl b/openroad.bzl index 5e64ff1a..1888a67f 100644 --- a/openroad.bzl +++ b/openroad.bzl @@ -686,6 +686,7 @@ def _yosys_impl(ctx): files = depset(outputs), runfiles = ctx.runfiles( outputs + canon_logs + synth_logs + [config_short, make], + transitive_files = deps_inputs(ctx), ), ), OutputGroupInfo( From e22212a6dced9e13aebffc9aedfc99f05820a6b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Hovind?= Date: Wed, 16 Oct 2024 14:35:01 +0200 Subject: [PATCH 07/10] openroad.bzl: Pass extra config files to runfiles --- openroad.bzl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openroad.bzl b/openroad.bzl index 1888a67f..701f722b 100644 --- a/openroad.bzl +++ b/openroad.bzl @@ -685,7 +685,8 @@ def _yosys_impl(ctx): executable = exe, files = depset(outputs), runfiles = ctx.runfiles( - outputs + canon_logs + synth_logs + [config_short, make], + [config_short, make] + outputs + canon_logs + synth_logs + + ctx.files.extra_configs, transitive_files = deps_inputs(ctx), ), ), @@ -847,7 +848,7 @@ def _make_impl(ctx, stage, steps, forwarded_names = [], result_names = [], objec ), runfiles = ctx.runfiles( [config_short, make] + - forwards + results + logs + reports, + forwards + results + logs + reports + ctx.files.extra_configs, ), ), OutputGroupInfo( From 7dc1cbdcdf372e4713c21dbf08cd26cabadac46d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Hovind?= Date: Wed, 16 Oct 2024 14:37:00 +0200 Subject: [PATCH 08/10] openroad.bzl: Move lefs and libs to runfiles --- openroad.bzl | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/openroad.bzl b/openroad.bzl index 701f722b..9f286f8b 100644 --- a/openroad.bzl +++ b/openroad.bzl @@ -838,17 +838,15 @@ def _make_impl(ctx, stage, steps, forwarded_names = [], result_names = [], objec return [ DefaultInfo( executable = exe, - files = depset( - forwards + results + reports, - transitive = [ - ctx.attr.src[OrfsInfo].additional_gds, - ctx.attr.src[OrfsInfo].additional_lefs, - ctx.attr.src[OrfsInfo].additional_libs, - ], - ), + files = depset(forwards + results + reports), runfiles = ctx.runfiles( [config_short, make] + forwards + results + logs + reports + ctx.files.extra_configs, + transitive_files = depset(transitive = [ + ctx.attr.src[OrfsInfo].additional_gds, + ctx.attr.src[OrfsInfo].additional_lefs, + ctx.attr.src[OrfsInfo].additional_libs, + ]), ), ), OutputGroupInfo( From 6ecffe81dcf1513e91d4a357d18d3bc9e4dfe702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Hovind?= Date: Wed, 16 Oct 2024 15:13:32 +0200 Subject: [PATCH 09/10] openroad.bzl: Fix runfile mistakes --- openroad.bzl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/openroad.bzl b/openroad.bzl index 9f286f8b..5bb4c4db 100644 --- a/openroad.bzl +++ b/openroad.bzl @@ -687,7 +687,11 @@ def _yosys_impl(ctx): runfiles = ctx.runfiles( [config_short, make] + outputs + canon_logs + synth_logs + ctx.files.extra_configs, - transitive_files = deps_inputs(ctx), + transitive_files = depset(transitive = [ + flow_inputs(ctx), + deps_inputs(ctx), + pdk_inputs(ctx), + ]), ), ), OutputGroupInfo( @@ -843,6 +847,8 @@ def _make_impl(ctx, stage, steps, forwarded_names = [], result_names = [], objec [config_short, make] + forwards + results + logs + reports + ctx.files.extra_configs, transitive_files = depset(transitive = [ + flow_inputs(ctx), + ctx.attr.src[PdkInfo].files, ctx.attr.src[OrfsInfo].additional_gds, ctx.attr.src[OrfsInfo].additional_lefs, ctx.attr.src[OrfsInfo].additional_libs, From 204779022c40ab4e89f7c0c1489233900b45ac1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Wed, 16 Oct 2024 10:22:52 +0200 Subject: [PATCH 10/10] test: add test that build run downloads what it should MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Øystein Hovind Signed-off-by: Øyvind Harboe --- .github/scripts/build_local_target.sh | 18 ++++++++++++++++-- .github/workflows/ci.yml | 25 ++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/.github/scripts/build_local_target.sh b/.github/scripts/build_local_target.sh index f6ab2328..816b1d7c 100755 --- a/.github/scripts/build_local_target.sh +++ b/.github/scripts/build_local_target.sh @@ -1,8 +1,9 @@ #!/bin/bash -set -e +set -ex -target_name=${TARGET:-"tag_array_64x184"} +# Test local build with submacros +target_name=${TARGET:-"L1MetadataArray"} if [[ -z "$STAGES" ]]; then # Skip "grt" "route", takes too long STAGES=("synth" "floorplan" "place" "cts") @@ -10,6 +11,10 @@ else eval "STAGES=($STAGES)" fi + +if [[ "$target_name" == "L1MetadataArray" || "$target_name" == "subpackage:L1MetadataArray" || "$target_name" == "//sram:top_mix" ]]; then + macro="true" +fi echo "Build ${target_name} macro" for stage in "${STAGES[@]}" do @@ -33,9 +38,18 @@ do elif [[ $stage == "route" ]]; then stages+=("do-5_2_route") stages+=("do-5_3_fillcell") + elif [[ $stage == "cts" ]]; then + stages+=("do-cts") + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.odb' | wc -l) -eq 1 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.sdc' | wc -l) -eq 1 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.v' | wc -l) -eq 0 ] else stages+=("do-${stage}") fi + if [[ "$macro" == "true" ]]; then + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.lef' | wc -l) -eq 1 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.lib' | wc -l) -eq 1 ] + fi for local_stage in "${stages[@]}" do echo "[${target_name}] ${local_stage}: Run make script" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d74bc9cf..b1da85d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,11 +97,30 @@ jobs: uses: actions/checkout@v4 - name: Run target run: | - rm -rf ./build + set -ex + + rm -rf ./build/ bazel run ${{ matrix.STAGE_TARGET }}_synth -- `pwd`/build OR_ARGS=-exit open_synth - rm -rf ./build + if [[ "${{ matrix.STAGE_TARGET }}" == "L1MetadataArray" || "${{ matrix.STAGE_TARGET }}" == "subpackage:L1MetadataArray" || "${{ matrix.STAGE_TARGET }}" == "//sram:top_mix" ]]; then + macro="true" + fi + if [[ "$macro" == "true" ]]; then + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.lib' | wc -l) -eq 1 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.lef' | wc -l) -eq 1 ] + fi + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*/1_.*\.log' | wc -l) -gt 1 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*/2_.*\.log' | wc -l) -eq 0 ] + rm -rf ./build/ bazel run ${{ matrix.STAGE_TARGET }}_floorplan -- `pwd`/build OR_ARGS=-exit open_floorplan - + if [[ "$macro" == "true" ]]; then + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.lib' | wc -l) -eq 1 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.lef' | wc -l) -eq 1 ] + fi + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.odb' | wc -l) -eq 1 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.sdc' | wc -l) -eq 1 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.v' | wc -l) -eq 0 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*/1_.*\.log' | wc -l) -eq 0 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*/2_.*\.log' | wc -l) -gt 1 ] test-target-local-clean-setup: name: Local flow - clean setup