AGENT SKILL

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

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 root AGENTS.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, NaN gradients, HPWL exploding ($> 10^7$), or components pushed far outside board boundaries.
  • Prescribed Adjustments:
    1. Increase Base Wirelength Scale ($\gamma$): Raise base "gamma" from 4.0 to 10.0 or 20.0 in the JSON config.
    2. Disable Net Crossing During Initial Spreading: Set "net_crossing_flag": 0 during early global placement.
    3. Reduce Learning Rate: Lower "learning_rate" in global_place_stages from 0.01 to 0.002 or 0.005.

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:
    1. Increase Initial Density Multiplier: Boost "density_weight" from 1e-6 to 8e-5 or 1e-3.
    2. Switch Optimizer to Nesterov: Set "optimizer": "nesterov" with "learning_rate": 0.01.
    3. Disable Fillers for Macro-Only PCB Layouts: Set "enable_fillers": 0 if all components are movable macros on sparse PCB boards.

Regime C: Excessive Net Crossings & Poor Routability

  • Observable Symptoms: High net crossing penalties or trace congestion despite low density overflow.
  • Prescribed Adjustments:
    1. Enable Rotation Optimization: Set "enable_rotation": 1 to execute continuous orientation relaxation ($\theta \in {0^\circ, 90^\circ, 180^\circ, 270^\circ}$).
    2. Two-Phase Net Crossing Strategy: Phase 1 run with "net_crossing_flag": 0; Phase 2 enable "net_crossing_flag": 1 once overflow drops below 0.10.

Regime D: Local Minima Trapping

  • Observable Symptoms: Rapid convergence yielding high HPWL and asymmetric macro distribution.
  • Prescribed Adjustments:
    1. Enable "random_center_init_flag": 1 and increase "gp_noise_ratio" to 0.05.

Deep Technical References

  • Telemetry Metric Definitions: Consult references/telemetry_metrics.md for field breakdowns of DREAMPlace.log.
  • Mathematical Foundations: Consult references/mathematical_foundations.md for smooth LSE/WA wirelength formulations and Gumbel-Softmax orientation models.

3. Workflow Instructions

Follow this standard procedure when running or tuning Cypress placement:

  1. Step 1: Environment Readiness Check
    Verify Docker container status and GPU accessibility (references/environment_and_troubleshooting.md).
  2. Step 2: Configuration Setup
    Confirm "aux_input" points to target Bookshelf .aux file and setup initial hyperparameters in configuration JSON.
  3. Step 3: Execute Optimization Run
    Run tools/run_placer.sh <config_json_path> and stream telemetry log.
  4. Step 4: Iterative Regime Diagnosis & Parameter Adjustment
    Monitor DREAMPlace.log. If overflow stalls or loss explodes, apply parameter adjustments according to the Diagnostic Decision Matrix.
  5. Step 5: Output Artifact Extraction
    Extract legal component placement coordinates from the generated <design_name>.gp.pl file.

4. Verification

A placement run is verified and considered successful when all of the following criteria are met:

  1. Clean Optimization Convergence: Optimization completes without NaN loss or floating-point exceptions in DREAMPlace.log.
  2. Target Density Overflow Reached: Final normalized density overflow drops below the termination threshold ($\text{Overflow} \le 0.07$).
  3. Valid Bounding Box Constraints: Final component coordinates lie strictly within the physical board outline $[0, W_{\text{board}}] \times [0, H_{\text{board}}]$.
  4. 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

vivekvjnk
vivekvjnk/three-wise-monkeys

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 时触发此技能。

电子工程师电子电路设计与 PCB 布局
★ 0
vivekvjnk
vivekvjnk/three-wise-monkeys

Circuit JSON 电路分析与 DRC 检查

circuit-json-analysis

分析 Circuit JSON 文件,检查其结构性元件关系、域映射(source、schematic、pcb、cad)以及几何布局的设计规则(DRC)违规问题(如 courtyard 外框重叠、焊膏错位、焊盘间距不足)。在分析 circuit.json 文件、检查 PCB 布局或对 Circuit JSON 数据执行设计规则检查时触发此技能。

电子工程师电子电路设计与 PCB 布局
★ 0
vivekvjnk
vivekvjnk/three-wise-monkeys

虚拟硬件实验室架构基础

vhl-concepts

虚拟硬件实验室(VHL)的架构基础。阐述四个基本 VHL 概念——模块与组件(Module vs Assembly)、接口边界(Interface Boundary)、Git Worktree 工作区隔离、共享电路理解文档(Shared Circuit Understanding Document,SCUD)——以及 VHL 采用它们的原因、核心不变量,并说明智能体何时必须对其加以考量。在推理 VHL 架构、定义边界、界定模块/组件范围或引用 SCUD 工件时触发此技能。

电子工程师电子电路设计与 PCB 布局
★ 0
vivekvjnk
vivekvjnk/three-wise-monkeys

SCUD

暂无简介

软件开发工程师开发参考
★ 0
vivekvjnk
vivekvjnk/three-wise-monkeys

模块综合

Module_Synthesis

暂无简介

系统架构师系统架构设计模式
★ 0
vivekvjnk
vivekvjnk/three-wise-monkeys

边界调和

Boundary_Reconciliation

暂无简介

系统架构师系统架构设计模式
★ 0