You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This document describes the package pin interface in ChipFlow, introduced to provide a more structured and consistent way to specify pin configurations for chip packages.
4
+
5
+
## Overview
6
+
7
+
The package pin interface provides definitions for various types of pins in a chip package:
8
+
9
+
- Power and ground pins
10
+
- Clock pins
11
+
- Reset pins
12
+
- JTAG pins
13
+
- Heartbeat pins
14
+
15
+
Each package type (PGA, bare die, etc.) defines its own implementation of these pin types, with appropriate pin numbering and allocation strategies.
16
+
17
+
## Configuration in TOML Files
18
+
19
+
### Legacy Format (still supported)
20
+
```toml
21
+
[chipflow.silicon.power]
22
+
vdd = { type = "power", loc = "1" }
23
+
gnd = { type = "ground", loc = "2" }
24
+
25
+
[chipflow.silicon.pads]
26
+
reset = { type = "reset", loc = "3" }
27
+
clock = { type = "clock", loc = "4" }
28
+
```
29
+
30
+
### New Format
31
+
```toml
32
+
[chipflow.silicon.power]
33
+
vdd = { type = "power", name = "vdd", voltage = "1.8V" }
34
+
gnd = { type = "ground", name = "gnd" }
35
+
```
36
+
37
+
In the new format, the package definition provides default locations for standard pins like power, ground, clocks, and resets. You only need to specify the name and properties.
38
+
39
+
## Using the Package Pin Interface in Code
40
+
41
+
### Getting Default Pins
42
+
43
+
```python
44
+
from chipflow_lib.platforms.utils importPACKAGE_DEFINITIONS, PowerType, JTAGWireName
45
+
46
+
# Get a package definition
47
+
package_def =PACKAGE_DEFINITIONS["pga144"]
48
+
49
+
# Get power pins
50
+
power_pins = package_def.power
51
+
vdd_pin = power_pins[PowerType.POWER] # Get the default power pin
52
+
gnd_pin = power_pins[PowerType.GROUND] # Get the default ground pin
53
+
54
+
# Get clock pins
55
+
clock_pins = package_def.clocks
56
+
default_clock = clock_pins[0] # Get the first clock pin
57
+
58
+
# Get JTAG pins
59
+
jtag_pins = package_def.jtag
60
+
tck_pin = jtag_pins[JTAGWireName.TCK] # Get the TCK pin
61
+
tms_pin = jtag_pins[JTAGWireName.TMS] # Get the TMS pin
62
+
```
63
+
64
+
### Creating a Package with Default Pins
65
+
66
+
```python
67
+
from chipflow_lib.platforms.utils import Package, PACKAGE_DEFINITIONS
68
+
69
+
# Create a package with a specific package definition
0 commit comments