Coverage for pyEDAA / OutputFilter / Xilinx / PlaceDesign.py: 100%

211 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-01-23 22:13 +0000

1# ==================================================================================================================== # 

2# _____ ____ _ _ ___ _ _ _____ _ _ _ # 

3# _ __ _ _| ____| _ \ / \ / \ / _ \ _ _| |_ _ __ _ _| |_| ___(_) | |_ ___ _ __ # 

4# | '_ \| | | | _| | | | |/ _ \ / _ \ | | | | | | | __| '_ \| | | | __| |_ | | | __/ _ \ '__| # 

5# | |_) | |_| | |___| |_| / ___ \ / ___ \ | |_| | |_| | |_| |_) | |_| | |_| _| | | | || __/ | # 

6# | .__/ \__, |_____|____/_/ \_\/_/ \_(_)___/ \__,_|\__| .__/ \__,_|\__|_| |_|_|\__\___|_| # 

7# |_| |___/ |_| # 

8# ==================================================================================================================== # 

9# Authors: # 

10# Patrick Lehmann # 

11# # 

12# License: # 

13# ==================================================================================================================== # 

14# Copyright 2025-2026 Electronic Design Automation Abstraction (EDA²) # 

15# # 

16# Licensed under the Apache License, Version 2.0 (the "License"); # 

17# you may not use this file except in compliance with the License. # 

18# You may obtain a copy of the License at # 

19# # 

20# http://www.apache.org/licenses/LICENSE-2.0 # 

21# # 

22# Unless required by applicable law or agreed to in writing, software # 

23# distributed under the License is distributed on an "AS IS" BASIS, # 

24# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # 

25# See the License for the specific language governing permissions and # 

26# limitations under the License. # 

27# # 

28# SPDX-License-Identifier: Apache-2.0 # 

29# ==================================================================================================================== # 

30# 

31"""A filtering anc classification processor for AMD/Xilinx Vivado Synthesis outputs.""" 

32from re import compile, Pattern 

33from typing import Generator, ClassVar, List, Type, Dict, Tuple 

34 

35from pyTooling.Decorators import export 

36 

37from pyEDAA.OutputFilter.Xilinx import Line, VivadoMessage, LineKind 

38from pyEDAA.OutputFilter.Xilinx.Common2 import TaskWithPhases, Phase, SubPhase, SubSubPhase, SubSubSubPhase, \ 

39 PhaseWithChildren, SubPhaseWithChildren, SubSubPhaseWithChildren 

40from pyEDAA.OutputFilter.Xilinx.Common2 import MAJOR, MAJOR_MINOR, MAJOR_MINOR_MICRO, MAJOR_MINOR_MICRO_NANO 

41 

42 

43@export 

44class SubPhase_PlacerInitializationNetlistSorting(SubPhase): 

45 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Placer Initialization Netlist Sorting") 

46 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Placer Initialization Netlist Sorting | Checksum:" 

47 _TIME: ClassVar[str] = "Time (s):" 

48 

49 

50@export 

51class SubPhase_IOPlacement_ClockPlacement_BuildPlacerDevice(SubPhase): 

52 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} IO Placement/ Clock Placement/ Build Placer Device") 

53 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} IO Placement/ Clock Placement/ Build Placer Device | Checksum:" 

54 _TIME: ClassVar[str] = "Time (s):" 

55 

56 

57@export 

58class SubPhase_BuildPlacerNetlistModel(SubPhase): 

59 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Build Placer Netlist Model") 

60 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Build Placer Netlist Model | Checksum:" 

61 _TIME: ClassVar[str] = "Time (s):" 

62 

63 

64@export 

65class SubPhase_ConstrainClocks_Macros(SubPhase): 

66 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Constrain Clocks/Macros") 

67 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Constrain Clocks/Macros | Checksum:" 

68 _TIME: ClassVar[str] = "Time (s):" 

69 

70 

71@export 

72class Phase_PlacerInitialization(PhaseWithChildren): 

73 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR} Placer Initialization") 

74 _FINISH: ClassVar[str] = "Phase {phaseIndex} Placer Initialization | Checksum:" 

75 _TIME: ClassVar[str] = "Time (s):" 

76 _FINAL: ClassVar[str] = None 

77 

78 _PARSERS: ClassVar[Tuple[Type[SubPhase], ...]] = ( 

79 SubPhase_PlacerInitializationNetlistSorting, 

80 SubPhase_IOPlacement_ClockPlacement_BuildPlacerDevice, 

81 SubPhase_BuildPlacerNetlistModel, 

82 SubPhase_ConstrainClocks_Macros 

83 ) 

84 

85 

86@export 

87class SubPhase_Floorplanning(SubPhase): 

88 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Floorplanning") 

89 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Floorplanning | Checksum:" 

90 _TIME: ClassVar[str] = "Time (s):" 

91 

92 

93@export 

94class SubPhase_UpdateTimingBeforeSLRPathOpt(SubPhase): 

95 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Update Timing before SLR Path Opt") 

96 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Update Timing before SLR Path Opt | Checksum:" 

97 _TIME: ClassVar[str] = "Time (s):" 

98 

99 

100@export 

101class SubPhase_PostProcessingInFloorplanning(SubPhase): 

102 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Post-Processing in Floorplanning") 

103 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Post-Processing in Floorplanning | Checksum:" 

104 _TIME: ClassVar[str] = "Time (s):" 

105 

106 

107@export 

108class SubSubPhase_UpdateTimingBeforePhysicalSynthesis(SubSubPhase): 

109 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR_MICRO} UpdateTiming Before Physical Synthesis") 

110 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex}.{subSubPhaseIndex} UpdateTiming Before Physical Synthesis | Checksum:" 

111 _TIME: ClassVar[str] = "Time (s):" 

112 

113 

114@export 

115class SubSubPhase_PhysicalSynthesisInPlacer(SubSubPhase): 

116 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR_MICRO} Physical Synthesis In Placer") 

117 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex}.{subSubPhaseIndex} Physical Synthesis In Placer | Checksum:" 

118 _TIME: ClassVar[str] = "Time (s):" 

119 

120 

121@export 

122class SubPhase_GlobalPlacementCore(SubPhaseWithChildren): 

123 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Global Placement Core") 

124 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Global Placement Core | Checksum:" 

125 _TIME: ClassVar[str] = "Time (s):" 

126 

127 _PARSERS: ClassVar[Tuple[Type[SubSubPhase], ...]] = ( 

128 SubSubPhase_UpdateTimingBeforePhysicalSynthesis, 

129 SubSubPhase_PhysicalSynthesisInPlacer 

130 ) 

131 

132 

133@export 

134class SubPhase_GlobalPlacePhase1(SubPhase): 

135 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Global Place Phase1") 

136 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Global Place Phase1 | Checksum:" 

137 _TIME: ClassVar[str] = "Time (s):" 

138 

139 

140# @export 

141# class SubSubPhase_UpdateTimingBeforePhysicalSynthesis(SubSubPhase): 

142# _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR_MICRO} UpdateTiming Before Physical Synthesis") 

143# _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex}.{subSubPhaseIndex} UpdateTiming Before Physical Synthesis | Checksum:" 

144# _TIME: ClassVar[str] = "Time (s):" 

145 

146 

147# @export 

148# class SubSubPhase_PhysicalSynthesisInPlacer(SubSubPhase): 

149# _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR_MICRO} Physical Synthesis In Placer") 

150# _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex}.{subSubPhaseIndex} Physical Synthesis In Placer | Checksum:" 

151# _TIME: ClassVar[str] = "Time (s):" 

152 

153 

154@export 

155class SubPhase_GlobalPlacePhase2(SubPhaseWithChildren): 

156 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Global Place Phase2") 

157 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Global Place Phase2 | Checksum:" 

158 _TIME: ClassVar[str] = "Time (s):" 

159 

160 _PARSERS: ClassVar[Tuple[Type[SubSubPhase], ...]] = ( 

161 SubSubPhase_UpdateTimingBeforePhysicalSynthesis, 

162 SubSubPhase_PhysicalSynthesisInPlacer 

163 ) 

164 

165 

166@export 

167class Phase_GlobalPlacement(PhaseWithChildren): 

168 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR} Global Placement") 

169 _FINISH: ClassVar[str] = "Phase {phaseIndex} Global Placement | Checksum:" 

170 _TIME: ClassVar[str] = "Time (s):" 

171 _FINAL: ClassVar[str] = None 

172 

173 _PARSERS: ClassVar[Tuple[Type[SubPhase], ...]] = ( 

174 SubPhase_Floorplanning, 

175 SubPhase_UpdateTimingBeforeSLRPathOpt, 

176 SubPhase_PostProcessingInFloorplanning, 

177 SubPhase_GlobalPlacePhase1, 

178 SubPhase_GlobalPlacePhase2, 

179 SubPhase_GlobalPlacementCore 

180 ) 

181 

182 

183@export 

184class SubPhase_CommitMultiColumnMacros(SubPhase): 

185 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Commit Multi Column Macros") 

186 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Commit Multi Column Macros | Checksum:" 

187 _TIME: ClassVar[str] = "Time (s):" 

188 

189 

190@export 

191class SubPhase_CommitMostMacrosLUTRAMs(SubPhase): 

192 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Commit Most Macros & LUTRAMs") 

193 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Commit Most Macros & LUTRAMs | Checksum:" 

194 _TIME: ClassVar[str] = "Time (s):" 

195 

196 

197@export 

198class SubSubPhase_SmallShapeClustering(SubSubPhase): 

199 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR_MICRO} Small Shape Clustering") 

200 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex}.{subSubPhaseIndex} Small Shape Clustering | Checksum:" 

201 _TIME: ClassVar[str] = "Time (s):" 

202 

203 

204@export 

205class SubSubSubPhase_SliceAreaSwapInitial(SubSubSubPhase): 

206 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR_MICRO_NANO} Slice Area Swap Initial") 

207 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex}.{subSubPhaseIndex}.{subSubSubPhaseIndex} Slice Area Swap Initial | Checksum:" 

208 _TIME: ClassVar[str] = "Time (s):" 

209 

210 

211@export 

212class SubSubPhase_SliceAreaSwap(SubSubPhaseWithChildren): 

213 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR_MICRO} Slice Area Swap") 

214 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex}.{subSubPhaseIndex} Slice Area Swap | Checksum:" 

215 _TIME: ClassVar[str] = "Time (s):" 

216 

217 _PARSERS: ClassVar[Tuple[Type[SubSubSubPhase], ...]] = ( 

218 SubSubSubPhase_SliceAreaSwapInitial, 

219 ) 

220 

221 

222@export 

223class SubPhase_SmallShapeDP(SubPhaseWithChildren): 

224 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Small Shape DP") 

225 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Small Shape DP | Checksum:" 

226 _TIME: ClassVar[str] = "Time (s):" 

227 

228 _PARSERS: ClassVar[Tuple[Type[SubSubPhase], ...]] = ( 

229 SubSubPhase_SmallShapeClustering, 

230 SubSubPhase_SliceAreaSwap 

231 ) 

232 

233 

234@export 

235class SubPhase_AreaSwapOptimization(SubPhase): 

236 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Area Swap Optimization") 

237 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Area Swap Optimization | Checksum:" 

238 _TIME: ClassVar[str] = "Time (s):" 

239 

240 

241@export 

242class SubPhase_ReassignLUTPins(SubPhase): 

243 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Re-assign LUT pins") 

244 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Re-assign LUT pins | Checksum:" 

245 _TIME: ClassVar[str] = "Time (s):" 

246 

247 

248@export 

249class SubPhase_PipelineRegisterOptimization_1(SubPhase): 

250 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Pipeline Register Optimization") 

251 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Pipeline Register Optimization | Checksum:" 

252 _TIME: ClassVar[str] = "Time (s):" 

253 

254 

255@export 

256class SubPhase_PipelineRegisterOptimization_2(SubPhase): 

257 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Pipeline Register Optimization") 

258 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Pipeline Register Optimization | Checksum:" 

259 _TIME: ClassVar[str] = "Time (s):" 

260 

261 

262@export 

263class SubPhase_FastOptimization_1(SubPhase): 

264 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Fast Optimization") 

265 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Fast Optimization | Checksum:" 

266 _TIME: ClassVar[str] = "Time (s):" 

267 

268 

269@export 

270class SubPhase_FastOptimization_2(SubPhase): 

271 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Fast Optimization") 

272 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Fast Optimization | Checksum:" 

273 _TIME: ClassVar[str] = "Time (s):" 

274 

275 

276@export 

277class SubPhase_SmallShapeDetailPlacement(SubPhase): 

278 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Small Shape Detail Placement") 

279 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Small Shape Detail Placement | Checksum:" 

280 _TIME: ClassVar[str] = "Time (s):" 

281 

282 

283@export 

284class Phase_DetailPlacement(PhaseWithChildren): 

285 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR} Detail Placement") 

286 _FINISH: ClassVar[str] = "Phase {phaseIndex} Detail Placement | Checksum:" 

287 _TIME: ClassVar[str] = "Time (s):" 

288 _FINAL: ClassVar[str] = None 

289 

290 _PARSERS: ClassVar[Tuple[Type[SubPhase], ...]] = ( 

291 SubPhase_CommitMultiColumnMacros, 

292 SubPhase_CommitMostMacrosLUTRAMs, 

293 SubPhase_SmallShapeDP, 

294 SubPhase_AreaSwapOptimization, 

295 SubPhase_PipelineRegisterOptimization_1, 

296 SubPhase_PipelineRegisterOptimization_2, 

297 SubPhase_FastOptimization_1, 

298 SubPhase_FastOptimization_2, 

299 SubPhase_SmallShapeDetailPlacement, 

300 SubPhase_ReassignLUTPins 

301 ) 

302 

303 

304@export 

305class SubSubSubPhase_BUFGInsertion(SubSubSubPhase): 

306 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR_MICRO_NANO} BUFG Insertion") 

307 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex}.{subSubPhaseIndex}.{subSubSubPhaseIndex} BUFG Insertion | Checksum:" 

308 _TIME: ClassVar[str] = "Time (s):" 

309 

310 

311@export 

312class SubSubSubPhase_PostPlacementTimingOptimization(SubSubSubPhase): 

313 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR_MICRO_NANO} Post Placement Timing Optimization") 

314 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex}.{subSubPhaseIndex}.{subSubSubPhaseIndex} Post Placement Timing Optimization | Checksum:" 

315 _TIME: ClassVar[str] = "Time (s):" 

316 

317 

318@export 

319class SubSubPhase_PostPlacementOptimization(SubSubPhaseWithChildren): 

320 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR_MICRO} Post Placement Optimization") 

321 _FINISH: ClassVar[str] = None # Phase 4.1.1 Post Placement Optimization | Checksum:" 

322 _TIME: ClassVar[str] = "Time (s):" 

323 

324 _PARSERS: ClassVar[Tuple[Type[SubSubSubPhase], ...]] = ( 

325 SubSubSubPhase_BUFGInsertion, 

326 SubSubSubPhase_PostPlacementTimingOptimization 

327 ) 

328 

329 

330@export 

331class SubPhase_PostCommitOptimization(SubPhaseWithChildren): 

332 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Post Commit Optimization") 

333 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Post Commit Optimization | Checksum:" 

334 _TIME: ClassVar[str] = "Time (s):" 

335 

336 _PARSERS: ClassVar[Tuple[Type[SubSubPhase], ...]] = ( 

337 SubSubPhase_PostPlacementOptimization, 

338 ) 

339 

340 

341@export 

342class SubPhase_PostPlacementCleanup(SubPhase): 

343 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Post Placement Cleanup") 

344 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Post Placement Cleanup | Checksum:" 

345 _TIME: ClassVar[str] = "Time (s):" 

346 

347 

348@export 

349class SubSubPhase_PrintEstimatedCongestion(SubSubPhase): 

350 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR_MICRO} Print Estimated Congestion") 

351 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex}.{subSubPhaseIndex} Print Estimated Congestion | Checksum:" 

352 _TIME: ClassVar[str] = "Time (s):" 

353 

354 

355@export 

356class SubPhase_PlacerReporting(SubPhaseWithChildren): 

357 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Placer Reporting") 

358 _FINISH: ClassVar[str] = "Phase {phaseIndex}.{subPhaseIndex} Placer Reporting | Checksum:" 

359 _TIME: ClassVar[str] = "Time (s):" 

360 

361 _PARSERS: ClassVar[Tuple[Type[SubSubPhase], ...]] = ( 

362 SubSubPhase_PrintEstimatedCongestion, 

363 ) 

364 

365 

366@export 

367class SubPhase_FinalPlacementCleanup(SubPhase): 

368 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR_MINOR} Final Placement Cleanup") 

369 _FINISH: ClassVar[Pattern] = compile(r"Time \(s\):") 

370 _TIME: ClassVar[str] = None 

371 

372 

373@export 

374class Phase_PostPlacementOptimizationAndCleanUp(PhaseWithChildren): 

375 _START: ClassVar[Pattern] = compile(f"^Phase {MAJOR} Post Placement Optimization and Clean-Up") 

376 _FINISH: ClassVar[str] = "Phase {phaseIndex} Post Placement Optimization and Clean-Up | Checksum:" 

377 _TIME: ClassVar[str] = "Time (s):" 

378 _FINAL: ClassVar[str] = None 

379 

380 _PARSERS: ClassVar[Tuple[Type[SubPhase], ...]] = ( 

381 SubPhase_PostCommitOptimization, 

382 SubPhase_PostPlacementCleanup, 

383 SubPhase_PlacerReporting, 

384 SubPhase_FinalPlacementCleanup 

385 ) 

386 

387 

388@export 

389class PlacerTask(TaskWithPhases): 

390 _START: ClassVar[str] = "Starting Placer Task" 

391 _FINISH: ClassVar[str] = "Ending Placer Task" 

392 

393 _PARSERS: ClassVar[Tuple[Type[Phase], ...]] = ( 

394 Phase_PlacerInitialization, 

395 Phase_GlobalPlacement, 

396 Phase_DetailPlacement, 

397 Phase_PostPlacementOptimizationAndCleanUp 

398 )