Skip to content

Commit f39d8d8

Browse files
committed
Add typing stubs for IOBuffer, FFBuffer
1 parent 9568679 commit f39d8d8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

chipflow_lib/platforms/silicon.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,13 @@ 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: ...
339346

340347
def elaborate(self, platform):
341348
if not isinstance(self.port, SiliconPlatformPort):
@@ -363,6 +370,15 @@ def elaborate(self, platform):
363370

364371

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

0 commit comments

Comments
 (0)