Skip to content

Commit db006b9

Browse files
committed
Add a bit more documentation
1 parent 016a484 commit db006b9

File tree

5 files changed

+664
-369
lines changed

5 files changed

+664
-369
lines changed

chipflow_lib/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
"""
2+
Chipflow library
3+
"""
4+
15
import importlib.metadata
26
import os
37
import sys
@@ -7,7 +11,6 @@
711

812
__version__ = importlib.metadata.version("chipflow_lib")
913

10-
1114
class ChipFlowError(Exception):
1215
pass
1316

chipflow_lib/platforms/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
"""
2+
Platform definititions
3+
----------------------
4+
5+
This module defines the functionality you use in you code to target the ChipFlow platform
6+
7+
"""
8+
19
from .silicon import *
210
from .sim import *
311
from .utils import *
12+
13+
__all__ = ['PIN_ANNOTATION_SCHEMA', 'PinSignature',
14+
'OutputPinSignature', 'InputPinSignature', 'BidirPinSignature',
15+
'load_pinlock', "PACKAGE_DEFINITIONS", 'top_interfaces']

chipflow_lib/platforms/utils.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,24 @@ def __init__(self, direction: io.Direction, width: int = 1, all_have_oe: bool =
9999
super().__init__(sig)
100100

101101
@property
102-
def direction(self):
102+
def direction(self) -> io.Direction:
103+
"The direction of the IO port"
103104
return self._direction
104105

105-
def width(self):
106+
def width(self) -> int:
107+
"The width of the IO port, in wires"
106108
return self._width
107109

108-
def options(self):
110+
def options(self) -> dict:
111+
"""
112+
Options set on the io port at construction
113+
114+
Valid options are:
115+
"all_have_oe": For a bidirectional port, each wire can
116+
have it's direction dynamically controlled seperately,
117+
so each wire also has a corresponding Output Enable wire.
118+
"init": the initial value that this io port will have at power-up and reset.
119+
"""
109120
return self._options
110121

111122
def annotations(self, *args):

0 commit comments

Comments
 (0)