Skip to content

Commit 3f0f079

Browse files
committed
Enable various pyright checks and fix code for them
1 parent bdf6bfc commit 3f0f079

File tree

6 files changed

+13
-18
lines changed

6 files changed

+13
-18
lines changed

chipflow_lib/platforms/silicon.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,18 +386,15 @@ def elaborate(self, platform):
386386
m.d.comb += o_inv.eq(self.o ^ invert)
387387
else:
388388
o_inv = self.o
389+
m.d.comb += self.port.o.eq(o_inv)
390+
m.d.comb += self.port.oe.eq(self.oe)
389391
if self.direction is not io.Direction.Output:
390392
if invert:
391393
i_inv = Signal.like(self.i)
392394
m.d.comb += self.i.eq(i_inv ^ invert)
393395
else:
394396
i_inv = self.i
395-
396-
if self.direction in (io.Direction.Input, io.Direction.Bidir):
397397
m.d.comb += i_inv.eq(self.port.i)
398-
if self.direction in (io.Direction.Output, io.Direction.Bidir):
399-
m.d.comb += self.port.o.eq(o_inv)
400-
m.d.comb += self.port.oe.eq(self.oe)
401398

402399
return m
403400

chipflow_lib/platforms/sim.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import sys
66
from pathlib import Path
77

8-
from amaranth import *
8+
from amaranth import Module, ClockDomain, ClockSignal, ResetSignal
99
from amaranth.lib import io
1010
from amaranth.back import rtlil # type: ignore[reportAttributeAccessIssue]
1111
from amaranth.hdl._ir import PortDirection

chipflow_lib/steps/silicon.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import dotenv
2121

22-
from amaranth import *
22+
from amaranth import Module, Signal, Elaboratable
2323
from halo import Halo
2424

2525
from . import StepBase, _wire_up_ports
@@ -182,6 +182,7 @@ def network_err(e):
182182
sp.start("Sending design to ChipFlow Cloud")
183183

184184
assert self._chipflow_api_key
185+
resp = None
185186
try:
186187
resp = requests.post(
187188
build_submit_url,
@@ -203,6 +204,7 @@ def network_err(e):
203204
except requests.exceptions.ReadTimeout as e:
204205
network_err(e)
205206

207+
assert resp
206208
# Parse response body
207209
try:
208210
resp_data = resp.json()

chipflow_lib/steps/sim.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from doit.doit_cmd import DoitMain
1111
from doit.task import dict_to_task
1212

13-
from amaranth import *
13+
from amaranth import Module
1414

1515
from . import StepBase, _wire_up_ports
1616
from .. import ChipFlowError, _ensure_chipflow_root

pdm.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ build-backend = "pdm.backend"
4444
[tool.pyright]
4545
diagnosticMode=true
4646
typeCheckingMode = "standard"
47-
reportInvalidTypeForm = false
48-
reportMissingImports = false
49-
reportUnboundVariable = false
50-
reportWildcardImportFromLibrary = false
5147

5248
[tool.ruff]
5349
include = [

0 commit comments

Comments
 (0)