Skip to content

Commit 9c3dfda

Browse files
committed
Add typing stubs for IOBuffer, FFBuffer
1 parent a03904d commit 9c3dfda

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

chipflow_lib/platforms/silicon.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,15 @@ def port_for_process(p: Process):
336336

337337

338338
class IOBuffer(io.Buffer):
339+
# Type annotation - should go in amaranth-stubs eventually
340+
@property
341+
def i(self) -> Signal: ...
342+
@property
343+
def o(self) -> Signal: ...
344+
@property
345+
def oe(self) -> Signal: ...
346+
347+
339348
def elaborate(self, platform):
340349
if not isinstance(self.port, SiliconPlatformPort):
341350
raise TypeError(f"Cannot elaborate SiliconPlatform buffer with port {self.port!r}")
@@ -362,6 +371,15 @@ def elaborate(self, platform):
362371

363372

364373
class FFBuffer(io.FFBuffer):
374+
# Type annotation - should go in amaranth-stubs eventually
375+
@property
376+
def i(self) -> Signal: ...
377+
@property
378+
def o(self) -> Signal: ...
379+
@property
380+
def oe(self) -> Signal: ...
381+
382+
365383
def elaborate(self, platform):
366384
if not isinstance(self.port, SiliconPlatformPort):
367385
raise TypeError(f"Cannot elaborate SiliconPlatform buffer with port {self.port!r}")

0 commit comments

Comments
 (0)