Skip to content

Commit

Permalink
test: update magic drc test cases to use BoundingBox dataclass
Browse files Browse the repository at this point in the history
Signed-off-by: Kareem Farid <[email protected]>
  • Loading branch information
kareefardi committed Nov 28, 2024
1 parent af4a258 commit e24b168
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion openlane/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
ScopedFile,
)
from .toolbox import Toolbox
from .drc import DRC, Violation
from .drc import DRC, Violation, BoundingBox
from . import cli
from .tpe import get_tpe, set_tpe
from .ring_buffer import RingBuffer
46 changes: 23 additions & 23 deletions test/common/test_misc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,62 +171,62 @@ def test_magic_drc_exceptions():


def test_magic_feedback():
from openlane.common import DRC, Violation
from openlane.common import DRC, Violation, BoundingBox

expected_violations = {
"obsm4-metal4.ILLEGAL_OVERLAP": Violation(
rules=[("obsm4-metal4", "ILLEGAL_OVERLAP")],
description="Illegal overlap between obsm4 and metal4 (types do not connect)",
bounding_boxes=[
(
BoundingBox(
Decimal("11137.80"),
Decimal("4449.70"),
Decimal("11153.80"),
Decimal("4458.80"),
),
(
BoundingBox(
Decimal("11137.80"),
Decimal("4437.90"),
Decimal("11139.90"),
Decimal("4449.70"),
),
(
BoundingBox(
Decimal("11151.70"),
Decimal("4437.90"),
Decimal("11153.80"),
Decimal("4449.70"),
),
(
BoundingBox(
Decimal("11137.80"),
Decimal("4433.70"),
Decimal("11153.80"),
Decimal("4437.90"),
),
(
BoundingBox(
Decimal("11137.80"),
Decimal("4421.90"),
Decimal("11139.90"),
Decimal("4433.70"),
),
(
BoundingBox(
Decimal("11151.70"),
Decimal("4421.90"),
Decimal("11153.80"),
Decimal("4433.70"),
),
(
BoundingBox(
Decimal("11137.80"),
Decimal("4417.70"),
Decimal("11153.80"),
Decimal("4421.90"),
),
(
BoundingBox(
Decimal("11137.80"),
Decimal("4412.80"),
Decimal("11139.90"),
Decimal("4417.70"),
),
(
BoundingBox(
Decimal("11151.70"),
Decimal("4412.80"),
Decimal("11153.80"),
Expand All @@ -238,19 +238,19 @@ def test_magic_feedback():
rules=[("obsm4-via4", "ILLEGAL_OVERLAP")],
description="Illegal overlap between obsm4 and via4 (types do not connect)",
bounding_boxes=[
(
BoundingBox(
Decimal("11139.90"),
Decimal("4437.90"),
Decimal("11151.70"),
Decimal("4449.70"),
),
(
BoundingBox(
Decimal("11139.90"),
Decimal("4421.90"),
Decimal("11151.70"),
Decimal("4433.70"),
),
(
BoundingBox(
Decimal("11139.90"),
Decimal("4412.80"),
Decimal("11151.70"),
Expand All @@ -262,31 +262,31 @@ def test_magic_feedback():
rules=[("UNKNOWN", "UNKNOWN2")],
description="device missing 1 terminal;\n connecting remainder to node VGND",
bounding_boxes=[
(
BoundingBox(
Decimal("8232.15"),
Decimal("8080.15"),
Decimal("8238.05"),
Decimal("8085.65"),
),
(
BoundingBox(
Decimal("8204.55"),
Decimal("8080.15"),
Decimal("8224.25"),
Decimal("8085.65"),
),
(
BoundingBox(
Decimal("8186.15"),
Decimal("8035.95"),
Decimal("8215.05"),
Decimal("8041.45"),
),
(
BoundingBox(
Decimal("8149.35"),
Decimal("8080.15"),
Decimal("8196.65"),
Decimal("8085.65"),
),
(
BoundingBox(
Decimal("393.75"),
Decimal("8025.75"),
Decimal("404.25"),
Expand All @@ -298,31 +298,31 @@ def test_magic_feedback():
rules=[("UNKNOWN", "UNKNOWN3")],
description="device missing 1 terminal;\n connecting remainder to node VPWR",
bounding_boxes=[
(
BoundingBox(
Decimal("8232.15"),
Decimal("8063.15"),
Decimal("8238.05"),
Decimal("8071.85"),
),
(
BoundingBox(
Decimal("8204.55"),
Decimal("8063.15"),
Decimal("8224.25"),
Decimal("8071.85"),
),
(
BoundingBox(
Decimal("8186.15"),
Decimal("8049.75"),
Decimal("8215.05"),
Decimal("8058.45"),
),
(
BoundingBox(
Decimal("8149.35"),
Decimal("8063.15"),
Decimal("8196.65"),
Decimal("8071.85"),
),
(
BoundingBox(
Decimal("393.75"),
Decimal("8008.75"),
Decimal("404.25"),
Expand Down

0 comments on commit e24b168

Please sign in to comment.