Skip to content

Commit

Permalink
tests: add check_mock_area test
Browse files Browse the repository at this point in the history
Signed-off-by: Øyvind Harboe <[email protected]>
  • Loading branch information
oharboe committed Nov 20, 2024
1 parent b141f49 commit 1834db8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .github/scripts/smoketests.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
#!/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
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"
Expand Down
10 changes: 10 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down Expand Up @@ -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",
Expand Down
24 changes: 24 additions & 0 deletions check_mock_area.tcl
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1834db8

Please sign in to comment.