Skip to content

Commit

Permalink
fix(precheck): second pin test should fail
Browse files Browse the repository at this point in the history
  • Loading branch information
htfab committed Apr 30, 2024
1 parent b409a21 commit f0fd6eb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
5 changes: 1 addition & 4 deletions precheck/pin_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
import re

import gdstk


class PrecheckFailure(Exception):
pass
from precheck_failure import PrecheckFailure


def parsefp3(value: str):
Expand Down
5 changes: 1 addition & 4 deletions precheck/precheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import yaml
from klayout_tools import parse_lyp_layers
from pin_check import pin_check
from precheck_failure import PrecheckFailure

PDK_ROOT = os.getenv("PDK_ROOT")
PDK_NAME = os.getenv("PDK_NAME") or "sky130A"
Expand All @@ -24,10 +25,6 @@
exit(1)


class PrecheckFailure(Exception):
pass


def has_sky130_devices(gds: str):
for cell_name in gdstk.read_rawcells(gds):
if cell_name.startswith("sky130_fd_"):
Expand Down
2 changes: 2 additions & 0 deletions precheck/precheck_failure.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class PrecheckFailure(Exception):
pass
18 changes: 11 additions & 7 deletions precheck/test_precheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,14 @@ def test_pin_analog_example(gds_lef_analog_example: tuple[str, str]):


def test_pin_analog_wrong_vgnd(gds_lef_analog_wrong_vgnd: tuple[str, str]):
gds_file, lef_file = gds_lef_analog_wrong_vgnd
precheck.pin_check(
gds_file,
lef_file,
"../def/analog/tt_block_1x2_pg_ana.def",
"TEST_analog_wrong_vgnd",
)
with pytest.raises(
precheck.PrecheckFailure,
match="Some ports are missing or have wrong dimensions",
):
gds_file, lef_file = gds_lef_analog_wrong_vgnd
precheck.pin_check(
gds_file,
lef_file,
"../def/analog/tt_block_1x2_pg_ana.def",
"TEST_analog_wrong_vgnd",
)

0 comments on commit f0fd6eb

Please sign in to comment.