Cypress PCB 布局优化调优
cypress-tuning
系统性地诊断、调优并执行 Cypress GPU 加速的 PCB 布局优化运行。在运行 DREAMPlace/Cypress 元件布局、诊断布局发散或器件聚集问题,或调整线长、密度、旋转和跨线网(net crossing)参数时触发。
- License 许可
- GPL-2.0
- 最近更新
- 2026-08-23
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- cypress-tuning
- description
- Systematically diagnoses, tunes, and executes Cypress GPU-accelerated PCB placement optimization runs. Trigger when running DREAMPlace/Cypress component placement, diagnosing placement divergence or clumping, or tuning wirelength, density, rotation, and net crossing parameters.
02 资源文件 5
- 参考文档references/environment_and_troubleshooting.md2.2 KB
- 参考文档references/mathematical_foundations.md2.8 KB
- 参考文档references/telemetry_metrics.md2.3 KB
- 脚本tools/run_placer_tuner.sh827 B
- 脚本tools/run_placer.sh774 B
03 SKILL.md 正文
Cypress Placement Diagnostic & Hyperparameter Tuning Skill
This skill provides a systematic, cause-and-effect methodology to analyze log telemetry, diagnose optimization regimes, execute parameter adjustments, and run component placement optimization using the Cypress PCB Placement Framework.
1. Operational Knowledge
Tool Execution Wrappers
Cypress executes GPU non-linear placement optimization within its designated container workspace. Use the bundled wrapper scripts under tools/:
-
Run Placement Optimization:
tools/run_placer.sh <path_to_config_json>Example:
tools/run_placer.sh configs/test_small1.json -
Run Hyperparameter Exploration (MOTPE Search):
tools/run_placer_tuner.sh <config_space_json> <aux_file_path> <ppa_json> <results_dir> -
Monitor Telemetry Logs:
tail -f DREAMPlace.log
Progressive Disclosure Context & Environment
For detailed guidance on Docker execution, PyTorch ABI checks, and C++/CUDA build operator troubleshooting, consult:
references/environment_and_troubleshooting.md(Relative path:references/environment_and_troubleshooting.md)- External tool context in Cypress repository:
../../../../open-source-repos/Cypress/AGENTS.md(or repo rootAGENTS.md)
2. Reasoning Guidance
Diagnostic Decision Matrix
When evaluating real-time placement runs, inspect DREAMPlace.log telemetry to identify the optimization regime and apply targeted parameter adjustments in your JSON configuration:
Observe Optimization Telemetry
│
┌───────────────────────┼───────────────────────┐
▼ ▼ ▼
Regime A: Divergence Regime B: Clumping Regime C: Wire Crossings
(Gradient Explosion) (Overflow Stalled) (Poor Routability)
│ │ │
▼ ▼ ▼
• γ ↑ (4.0 → 10.0) • λ_D ↑ (1e-6 → 8e-5) • enable_rotation: 1
• lr ↓ (0.01 → 0.002) • opt: nesterov • net_crossing_flag: 1
• static weights • enable_fillers: 0* • Early orient trigger
Regime A: Gradient Explosion & Divergence
- Observable Symptoms: Log reports
Obj INF,NaNgradients, HPWL exploding ($> 10^7$), or components pushed far outside board boundaries. - Prescribed Adjustments:
- Increase Base Wirelength Scale ($\gamma$): Raise base
"gamma"from4.0to10.0or20.0in the JSON config. - Disable Net Crossing During Initial Spreading: Set
"net_crossing_flag": 0during early global placement. - Reduce Learning Rate: Lower
"learning_rate"inglobal_place_stagesfrom0.01to0.002or0.005.
- Increase Base Wirelength Scale ($\gamma$): Raise base
Regime B: Component Overlap & Stalled Overflow
- Observable Symptoms: Global placement terminates prematurely or stalls with high overflow ($\text{Overflow} > 0.1$), leaving cell clusters overlapping.
- Prescribed Adjustments:
- Increase Initial Density Multiplier: Boost
"density_weight"from1e-6to8e-5or1e-3. - Switch Optimizer to Nesterov: Set
"optimizer": "nesterov"with"learning_rate": 0.01. - Disable Fillers for Macro-Only PCB Layouts: Set
"enable_fillers": 0if all components are movable macros on sparse PCB boards.
- Increase Initial Density Multiplier: Boost
Regime C: Excessive Net Crossings & Poor Routability
- Observable Symptoms: High net crossing penalties or trace congestion despite low density overflow.
- Prescribed Adjustments:
- Enable Rotation Optimization: Set
"enable_rotation": 1to execute continuous orientation relaxation ($\theta \in {0^\circ, 90^\circ, 180^\circ, 270^\circ}$). - Two-Phase Net Crossing Strategy: Phase 1 run with
"net_crossing_flag": 0; Phase 2 enable"net_crossing_flag": 1once overflow drops below0.10.
- Enable Rotation Optimization: Set
Regime D: Local Minima Trapping
- Observable Symptoms: Rapid convergence yielding high HPWL and asymmetric macro distribution.
- Prescribed Adjustments:
- Enable
"random_center_init_flag": 1and increase"gp_noise_ratio"to0.05.
- Enable
Deep Technical References
- Telemetry Metric Definitions: Consult
references/telemetry_metrics.mdfor field breakdowns ofDREAMPlace.log. - Mathematical Foundations: Consult
references/mathematical_foundations.mdfor smooth LSE/WA wirelength formulations and Gumbel-Softmax orientation models.
3. Workflow Instructions
Follow this standard procedure when running or tuning Cypress placement:
- Step 1: Environment Readiness Check
Verify Docker container status and GPU accessibility (references/environment_and_troubleshooting.md). - Step 2: Configuration Setup
Confirm"aux_input"points to target Bookshelf.auxfile and setup initial hyperparameters in configuration JSON. - Step 3: Execute Optimization Run
Runtools/run_placer.sh <config_json_path>and stream telemetry log. - Step 4: Iterative Regime Diagnosis & Parameter Adjustment
MonitorDREAMPlace.log. If overflow stalls or loss explodes, apply parameter adjustments according to the Diagnostic Decision Matrix. - Step 5: Output Artifact Extraction
Extract legal component placement coordinates from the generated<design_name>.gp.plfile.
4. Verification
A placement run is verified and considered successful when all of the following criteria are met:
- Clean Optimization Convergence: Optimization completes without
NaNloss or floating-point exceptions inDREAMPlace.log. - Target Density Overflow Reached: Final normalized density overflow drops below the termination threshold ($\text{Overflow} \le 0.07$).
- Valid Bounding Box Constraints: Final component coordinates lie strictly within the physical board outline $[0, W_{\text{board}}] \times [0, H_{\text{board}}]$.
- Discrete Legal Angles: Final exported component rotations are locked to valid discrete orientation angles $\theta \in {0^\circ, 90^\circ, 180^\circ, 270^\circ}$.
04 同仓库更多 Skills
Circuit JSON 与 Bookshelf 格式转换
circuitjson-bookshelf-converter
将 Circuit JSON 的 PCB 和原理图设计转换为 Bookshelf 物理设计格式(.nodes、.nets、.pl、.scl、.aux),并进行 courtyard 禁止区边界建模;同时将 Cypress 布局优化结果反向标注回 Circuit JSON。在将 circuit.json 文件转换为 Bookshelf 格式,或将 .pl / .gp.pl 布局输出反向标注回 Circuit JSON 时触发此技能。
Circuit JSON 电路分析与 DRC 检查
circuit-json-analysis
分析 Circuit JSON 文件,检查其结构性元件关系、域映射(source、schematic、pcb、cad)以及几何布局的设计规则(DRC)违规问题(如 courtyard 外框重叠、焊膏错位、焊盘间距不足)。在分析 circuit.json 文件、检查 PCB 布局或对 Circuit JSON 数据执行设计规则检查时触发此技能。
虚拟硬件实验室架构基础
vhl-concepts
虚拟硬件实验室(VHL)的架构基础。阐述四个基本 VHL 概念——模块与组件(Module vs Assembly)、接口边界(Interface Boundary)、Git Worktree 工作区隔离、共享电路理解文档(Shared Circuit Understanding Document,SCUD)——以及 VHL 采用它们的原因、核心不变量,并说明智能体何时必须对其加以考量。在推理 VHL 架构、定义边界、界定模块/组件范围或引用 SCUD 工件时触发此技能。
SCUD
暂无简介
模块综合
Module_Synthesis
暂无简介
边界调和
Boundary_Reconciliation
暂无简介