Commit 31ceb99
Deduplicate allocate_pins implementation in package definitions
Move common allocate_pins() implementation from LinearAllocPackageDef
and GAPackageDef to BasePackageDef to eliminate code duplication.
Changes:
- BasePackageDef.allocate_pins(): Now concrete method with common logic
- BasePackageDef._allocate(): New abstract method for allocation strategy
- LinearAllocPackageDef: Removed duplicate allocate_pins(), kept _allocate()
- GAPackageDef: Removed duplicate allocate_pins(), kept _allocate()
- Both subclasses now only implement their specific allocation strategies
The method bodies were identical except for docstrings. Both used
_linear_allocate_components with self._allocate callback and the same
pattern for bringup pins and lockfile creation.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent a1159e7 commit 31ceb99
File tree
3 files changed
+35
-38
lines changed- chipflow_lib/packaging
3 files changed
+35
-38
lines changedBinary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
133 | | - | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
141 | 145 | | |
142 | 146 | | |
143 | 147 | | |
| |||
149 | 153 | | |
150 | 154 | | |
151 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
152 | 185 | | |
153 | 186 | | |
154 | 187 | | |
| |||
186 | 219 | | |
187 | 220 | | |
188 | 221 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | 222 | | |
208 | 223 | | |
209 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | 16 | | |
22 | 17 | | |
23 | 18 | | |
| |||
187 | 182 | | |
188 | 183 | | |
189 | 184 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | 185 | | |
204 | 186 | | |
205 | 187 | | |
| |||
0 commit comments