Skip to content

Commit 0153639

Browse files
committed
Add typing stubs for IOBuffer, FFBuffer
1 parent ba4a001 commit 0153639

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
@@ -334,6 +334,15 @@ def port_for_process(p: Process):
334334

335335

336336
class IOBuffer(io.Buffer):
337+
# Type annotation - should go in amaranth-stubs eventually
338+
@property
339+
def i(self) -> Signal: ...
340+
@property
341+
def o(self) -> Signal: ...
342+
@property
343+
def oe(self) -> Signal: ...
344+
345+
337346
def elaborate(self, platform):
338347
if not isinstance(self.port, SiliconPlatformPort):
339348
raise TypeError(f"Cannot elaborate SiliconPlatform buffer with port {self.port!r}")
@@ -360,6 +369,15 @@ def elaborate(self, platform):
360369

361370

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

0 commit comments

Comments
 (0)