核心能力
1. Summarize
对任意 snapshot 生成结构化摘要。包括 cell/net 统计、关键路径延迟分布、拥塞热点坐标、功耗分布热区、时钟树深度与 skew。Agent 无需解析原始数据库即可快速获取设计的高层概览。摘要输出为结构化 JSON,可直接喂入 LLM context 或作为 Model Router 的输入特征。
2. Diff
比较两个 snapshot 的结构化差异。输出三类变化集:哪些 cells 变了(位置、尺寸、类型)、哪些 nets 重布了(拓扑变化、层变化)、timing 如何变化(关键路径的 slack delta、新增违例、消失违例)。Diff 结果可直接传给 Agent Planner 作为 "what changed" 信号。
3. Explain
解释某次变更的因果链。例如:为什么 resize 这个 cell 导致那条 path 变慢?Observer 追踪电容变化 → 驱动能力 → 过渡时间 → 单元延迟的因果链条,输出可读的因果步骤。每一步附带量化数据——不只是"变慢了",而是"+42ps,因为 fanout cap 从 0.08pF 增到 0.15pF"。
4. Root Cause
从违例追溯到根因。输入一个 DRC violation 或 timing violation,Observer 回答三个问题:哪个改动引入的(改动追溯)、哪个 Agent proposal 导致的(决策追溯)、有哪些可能的修复路径(修复建议)。链路:violation → diff → change → candidate → agent intention。
Agent 调用方式
Observer 提供四项原语的统一调用接口,Agent 通过一个 observe_type 参数切换不同的观察模式。
Python SDK
from ieda.observer import DesignObserver obs = DesignObserver("http://localhost:9110") # Summarize: get design overview summary = obs.observe( design_ref="snap_b", observe_type="summarize", ) print(summary.cell_count) # 45231 print(summary.critical_paths) # [{"name":"clk_core","slack":-0.12},...] # Diff: compare two snapshots diff = obs.observe( design_ref="snap_b", observe_type="diff", reference_ref="snap_a", ) # Root cause: trace violation to agent proposal rc = obs.observe( design_ref="snap_b", observe_type="root_cause", violation_ref="DRC_M1_SPACING_x1245_y330", ) print(rc.introducing_change) # "cell_move_u_alu_0" print(rc.agent_proposal) # "candidate_c42_a"
输入/输出契约
ObserveRequest
| 字段 | 类型 | 必需 | 说明 |
|---|---|---|---|
design_ref | string | 是 | 目标设计快照引用 |
observe_type | "summarize" | "diff" | "explain" | "root_cause" | 是 | 观察原语类型 |
reference_ref | string | diff 时必需 | 基准快照引用——用于 diff 的对比基准 |
violation_ref | string | root_cause 时必需 | 违例引用标识 |
ObserveResult
| 字段 | 类型 | 说明 |
|---|---|---|
summary | DesignSummary | null | summarize 模式的结构化摘要 |
diff | DesignDiff | null | diff 模式的结构化差异(cell_changes, net_changes, timing_delta) |
explanation | CausalChain | null | explain 模式的因果链——每步附量化数据 |
root_cause | RootCauseAnalysis | null | root_cause 模式:introducing_change, agent_proposal, fix_suggestions |