Skip to content

Commit abdeb88

Browse files
committed
grt/cugr: extend via_priority test to cover single-cut over default multi-cut
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
1 parent 19820be commit abdeb88

3 files changed

Lines changed: 23 additions & 9 deletions

File tree

src/grt/test/via_priority.lef

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ LAYER metal2
3030
AREA 0.02 ;
3131
END metal2
3232

33-
# Two vias for the metal1/metal2 pair, neither marked OR_DEFAULT. The larger
34-
# one is declared first, so a db-order pick would take it; the priority ranking
35-
# must instead choose VIA_SMALL (smaller enclosure).
33+
# Vias for the metal1/metal2 pair, none marked OR_DEFAULT. The ranking must
34+
# choose VIA_SMALL:
35+
# - VIA_BIG is declared first, so a db-order pick would wrongly take it.
36+
# - VIA_MULTI is a LEF DEFAULT via with an even smaller enclosure, so ranking
37+
# the default flag before cut count would wrongly take it; single-cut must win.
3638
VIA VIA_BIG
3739
LAYER metal1 ;
3840
RECT -0.1 -0.15 0.1 0.15 ;
@@ -51,4 +53,14 @@ VIA VIA_SMALL
5153
RECT -0.075 -0.05 0.075 0.05 ;
5254
END VIA_SMALL
5355

56+
VIA VIA_MULTI DEFAULT
57+
LAYER metal1 ;
58+
RECT -0.05 -0.05 0.05 0.05 ;
59+
LAYER via12 ;
60+
RECT -0.05 -0.05 -0.01 0.05 ;
61+
RECT 0.01 -0.05 0.05 0.05 ;
62+
LAYER metal2 ;
63+
RECT -0.05 -0.05 0.05 0.05 ;
64+
END VIA_MULTI
65+
5466
END LIBRARY

src/grt/test/via_priority_cugr.ok

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[INFO ODB-0227] LEF file: via_priority.lef, created 3 layers, 2 vias
1+
[INFO ODB-0227] LEF file: via_priority.lef, created 3 layers, 3 vias
22
[INFO ODB-0128] Design: via_priority
33
[INFO ODB-0130] Created 2 pins.
44
[INFO ODB-0133] Created 1 nets and 0 connections.

src/grt/test/via_priority_cugr.tcl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# CUGR ranks via candidates by priority (OR_DEFAULT, then LEF-default, then
2-
# fewest cuts, then smallest enclosure) rather than db declaration order.
3-
# via_priority.lef declares the larger VIA_BIG before VIA_SMALL for the
4-
# metal1/metal2 pair, neither marked OR_DEFAULT; the via-demand model must pick
5-
# VIA_SMALL. The via_geom debug line pins the chosen via and its enclosure.
1+
# CUGR ranks via candidates by priority (OR_DEFAULT, then fewest cuts, then
2+
# LEF-default, then smallest enclosure) rather than db declaration order.
3+
# via_priority.lef offers three metal1/metal2 vias, none OR_DEFAULT: VIA_BIG
4+
# (declared first, large), VIA_SMALL (single-cut, small), and VIA_MULTI (LEF
5+
# DEFAULT but two cuts, even smaller). The model must pick VIA_SMALL -- proving
6+
# db order does not win and that single-cut beats a LEF-default multi-cut via.
7+
# The via_geom debug line pins the chosen via and its enclosure.
68
source "helpers.tcl"
79
read_lef "via_priority.lef"
810
read_def "via_priority.def"

0 commit comments

Comments
 (0)