Skip to content

Commit 87e22ef

Browse files
committed
Add scalalib test code to mypy
1 parent 19cc2d4 commit 87e22ef

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

hammer_ir/scalalib/test/test_placement.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def run_scala(scala: str) -> None:
3232
prep()
3333

3434
# Generate some constraints
35-
# TODO(edwardw): test optional stuff
3635
c1 = PlacementConstraint(
3736
path="Top/rtl/a/b",
3837
type=PlacementConstraintType.Placement,
@@ -47,6 +46,12 @@ def run_scala(scala: str) -> None:
4746
obs_types=None
4847
)
4948

49+
# TODO(edwardw): the optional parameters are only valid for certain
50+
# types of constraints.
51+
# e.g. orientation is only valid for hardmacros
52+
# e.g. obs_types is only valid for obstructions
53+
# We need to create some extra testcases to capture those usecases.
54+
5055
# Export to JSON
5156
with open("tmp_c1.json", "w") as f:
5257
f.write(json.dumps(c1.to_dict()))

src/test/mypy.sh

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ call_mypy ../hammer-vlsi/par/mockpar/__init__.py
3737
call_mypy ../hammer-vlsi/drc/*.py
3838
call_mypy ../hammer-vlsi/lvs/*.py
3939

40+
# Scala library
41+
call_mypy ../../hammer_ir/scalalib/test/*.py
42+
4043
# Plugins which may or may not exist
4144
if [ -f ../hammer-vlsi/synthesis/dc/__init__.py ]; then
4245
call_mypy ../hammer-vlsi/synthesis/dc/__init__.py

0 commit comments

Comments
 (0)