From 1834db8b5d0bd74fcc752d87ead8996c637762fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Wed, 30 Oct 2024 22:34:13 +0100 Subject: [PATCH] tests: add check_mock_area test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Øyvind Harboe --- .github/scripts/smoketests.sh | 4 +--- BUILD | 10 ++++++++++ check_mock_area.tcl | 24 ++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 check_mock_area.tcl diff --git a/.github/scripts/smoketests.sh b/.github/scripts/smoketests.sh index 4c7ccde..be5596c 100755 --- a/.github/scripts/smoketests.sh +++ b/.github/scripts/smoketests.sh @@ -1,8 +1,6 @@ #!/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 @@ -10,7 +8,7 @@ bazel query //:* | grep -q -v lb_32x128_3_place echo This target should exist bazel query //:* | grep -q -v lb_32x128_4_synth -bazel build lb_32x128_shared_synth_floorplan wns_report //sram:sdq_17x64_mock-naja_floorplan_deps //sram:mock-naja +bazel build check_mock_area cell_count lb_32x128_shared_synth_floorplan wns_report //sram:sdq_17x64_mock-naja_floorplan_deps //sram:mock-naja grep naja bazel-bin/sram/mock-naja.v grep -q naja bazel-bin/sram/results/asap7/sdq_17x64/mock-naja/1_synth.v && false || true (bazel build //sram:sdq_17x64_naja-error_floorplan 2>&1 || true) | grep "syntax error" diff --git a/BUILD b/BUILD index b8f9a5a..080f2e0 100644 --- a/BUILD +++ b/BUILD @@ -78,6 +78,7 @@ orfs_flow( "CORE_ASPECT_RATIO": "2", "SKIP_REPORT_METRICS": "1", }, + mock_area = 0.8, stage_sources = { "synth": [":constraints-sram"], "floorplan": [":io-sram"], @@ -247,6 +248,15 @@ orfs_flow( verilog_files = ["test/rtl/L1MetadataArray.sv"], ) +orfs_run( + name = "check_mock_area", + src = ":L1MetadataArray_floorplan", + outs = [ + "area_ok.txt", + ], + script = ":check_mock_area.tcl", +) + orfs_run( name = "tag_array_64x184_report", src = ":tag_array_64x184_place", diff --git a/check_mock_area.tcl b/check_mock_area.tcl new file mode 100644 index 0000000..d2afd63 --- /dev/null +++ b/check_mock_area.tcl @@ -0,0 +1,24 @@ +source $::env(SCRIPTS_DIR)/load.tcl +load_design 2_floorplan.odb 2_floorplan.sdc + +set macros [find_macros] +if {[llength $macros] != 1} { + puts "Expected exactly one macro, but found [llength $macros]" + exit 1 +} + +set tag_array_64x184 [lindex [find_macros] 0] +set bbox [$tag_array_64x184 getBBox] +set width [ord::dbu_to_microns [$bbox getDX]] +set height [ord::dbu_to_microns [$bbox getDY]] + +proc expect {value a b} { + if {$a != $b} { + puts "Expected $value $a == $b" + exit 1 + } +} +expect Width $width 29.105 +expect Height $height 56.61 + +exec touch $::env(WORK_HOME)/area_ok.txt