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 diff --git a/openroad.bzl b/openroad.bzl index 7c43326d..5bb4c4db 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, @@ -283,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, @@ -687,14 +685,12 @@ 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, + [config_short, make] + outputs + canon_logs + synth_logs + + ctx.files.extra_configs, transitive_files = depset(transitive = [ flow_inputs(ctx), - yosys_inputs(ctx), - data_inputs(ctx), - pdk_inputs(ctx), deps_inputs(ctx), + pdk_inputs(ctx), ]), ), ), @@ -837,7 +833,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, }, @@ -846,22 +842,16 @@ def _make_impl(ctx, stage, steps, forwarded_names = [], result_names = [], objec return [ DefaultInfo( executable = exe, - files = depset( - forwards + results + logs + 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, + forwards + results + logs + reports + ctx.files.extra_configs, transitive_files = depset(transitive = [ flow_inputs(ctx), - data_inputs(ctx), - source_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, ]), ), ),