@@ -114,6 +114,16 @@ def BidirPinSignature(width, **kwargs):
114114PinList = List [Pin ]
115115Pins = Union [PinSet , PinList ]
116116
117+ class PowerPins (enum .Enum ):
118+ POWER = "power"
119+ GROUND = "ground"
120+
121+ class JTAGPins (enum .Enum ):
122+ TRST = "trst"
123+ TCK = "tck"
124+ TMS = "tms"
125+ TDI = "tdi"
126+ TDO = "tdo"
117127
118128class _Side (enum .IntEnum ):
119129 N = 1
@@ -206,18 +216,70 @@ class _BasePackageDef(pydantic.BaseModel, abc.ABC):
206216 @property
207217 @abc .abstractmethod
208218 def pins (self ) -> PinSet :
219+ "Returns the full set of pins for the package"
209220 ...
210221
211222 @abc .abstractmethod
212223 def allocate (self , available : PinSet , width : int ) -> PinList :
224+ """
225+ Allocates pins as close to each other as possible from available pins.
226+
227+ Args:
228+ available: set of available pins
229+ width: number of pins to allocate
230+
231+ Returns:
232+ An ordered list of pins
233+ """
234+ ...
235+
236+ @property
237+ @abc .abstractmethod
238+ def power (self ) -> Dict [PowerType , Pin ]:
239+ """
240+ The set of power pins for the package
241+ """
242+ ...
243+
244+ @property
245+ @abc .abstractmethod
246+ def resets (self ) -> Dict [int , Pin ]:
247+ """
248+ Numbered set of reset pins for the package
249+ """
213250 ...
214251
252+ @property
253+ @abc .abstractmethod
254+ def clocks (self ) -> Dict [int , Pin ]:
255+ """
256+ Numbered set of clock pins for the package
257+ """
258+ ...
259+
260+ @property
261+ @abc .abstractmethod
262+ def jtag (self ) -> Dict [JTAGPin , Pin ]:
263+ """
264+ Map of JTAG pins for the package
265+ """
266+ ...
267+
268+ @property
269+ @abc .abstractmethod
270+ def heartbeat (self ) -> Dict (int , Pin ):
271+ """
272+ Numbered set of heartbeat pins for the package
273+ """
274+
215275 def to_string (pins : Pins ):
216276 return ['' .join (map (str , t )) for t in pins ]
217277
218278 def sortpins (self , pins : Pins ) -> PinList :
219279 return list (pins ).sort ()
220280
281+
282+
221283
222284class _BareDiePackageDef (_BasePackageDef ):
223285 """Definition of a package with pins on four sides, labelled north, south, east, west
0 commit comments