核心能力
Snapshot
任意时刻的完整设计状态快照。Agent 在实验不同优化策略时可以快速回滚到任意 snapshot,对比不同分支的结果差异——snapshot 是整个 Agent 实验循环的基础。
Typed Delta
两次 snapshot 之间的结构化差异描述。不是简单的 diff,而是类型化的变更记录——知道哪些 cell 被移动、哪些 net 被重连、哪些时序路径受影响。Agent 通过 delta 理解每次变更的精确影响范围。
DirtySet
追踪自上次 oracle 验证后被修改的对象集合。Agent 做增量分析时不需要扫描整个设计——只关注 dirty region 中的对象,将增量计算的成本降到最低。
CAS Commit
compare-and-swap 提交语义。Agent 的多个候选计划不能同时修改 main head——CAS 确保只有一个 plan 能够成功提交,其余需要 rebase 到最新 snapshot 后重新验证。
Stable ID
跨 snapshot 稳定的对象标识。Agent 可以追踪同一个 cell/net 在不同版本中的变化轨迹——这个 cell 在 snap_0001 中的位置、在 snap_0007 中被移动到哪里、在 snap_0012 中的时序 slack 又是多少。
Agent 调用方式
from ieda import AgentClient
client = AgentClient()
design = client.load_design("aes_core", tech="sky130")
# take a snapshot
snap = client.call("iDB.snapshot", design=design)
print(f"Snapshot: {snap.id}, cells={snap.cell_count}")
# compute delta between two snapshots
delta = client.call("iDB.delta", from_snap=snap1.id, to_snap=snap2.id)
print(f"Moved: {len(delta.moved_cells)}, New nets: {len(delta.new_nets)}")
# commit with CAS
result = client.call("iDB.commit",
design=design,
proposal=proposal,
expected_head="snap_7f3a")
assert result.committed, "CAS failed — rebase required"
{
"tool": "iDB.snapshot",
"arguments": {
"design_ref": "aes_core@sky130",
"label": "before iPL placement"
}
}
// Response
{ "snapshot": { "id": "snap_7f3a", "cell_count": 125430 } }
{
"tool": "iDB.delta",
"arguments": {
"from": "snap_7f3a",
"to": "snap_8b2c"
}
}
{
"tool": "iDB.commit",
"arguments": {
"proposal_id": "prop_a3k9",
"expected_head": "snap_7f3a"
}
}
# take a snapshot iDB::snapshot -label "before placement" # Returns: snap_7f3a # compute delta iDB::delta -from snap_7f3a -to snap_8b2c # CAS commit — only if head unchanged iDB::commit -proposal prop_a3k9 -expected_head snap_7f3a
输入/输出契约
SnapshotRequest → SnapshotRef
SnapshotRequest {
design_ref: DesignRef // 设计引用
label?: str // 可选的快照标签
}
SnapshotRef {
id: str // 快照唯一标识, e.g. "snap_7f3a"
time: Timestamp // ISO 8601 时间戳
cell_count: int // 快照时的 cell 总数
net_count: int // 快照时的 net 总数
label?: str // 快照标签
}
DeltaRequest → DesignDelta
DeltaRequest {
from: SnapshotRef // 起始快照
to: SnapshotRef // 结束快照
scope?: DeltaScope // 可选的范围筛选 (CELL | NET | TIMING | ALL)
}
DesignDelta {
moved_cells: []CellMove // 被移动的 cell 列表
new_nets: []NetChange // 新增或变更的 net
timing_changes: []TimingDelta // 时序变化
drc_changes: []DRCDelta // DRC 违例变化
}
CommitRequest (CAS) → CommitResult
CommitRequest {
proposal_id: str // 提议标识
expected_head: str // CAS 期望的 head snapshot
delta: DesignDelta // 提议的变更 delta
}
CommitResult {
committed: bool // CAS 是否成功
new_head?: str // 成功时的新 head snapshot id
conflict_with?: str // 失败时冲突的 head snapshot id
reason?: str // 失败原因
}
在架构中的位置
┌──────────────────────────────────────┐
│ iDB │
│ (统一设计数据库——唯一真值) │
│ │
│ ┌─────────┐ ┌──────────┐ │
│ │Snapshot │ │ Delta │ │
│ │ Manager │ │ Engine │ │
│ └─────────┘ └──────────┘ │
│ ┌─────────┐ ┌──────────┐ │
│ │DirtySet │ │ CAS │ │
│ │ Tracker │ │ Service │ │
│ └─────────┘ └──────────┘ │
│ ┌─────────────────────────┐ │
│ │ Stable ID Registry │ │
│ └─────────────────────────┘ │
└──┬───────┬───────┬───────┬──────────┘
│ │ │ │
┌────────┴──┐ ┌──┴───┐ ┌─┴─────┐ └───┬──────
│ iPL │ │ iRT │ │ iSTA │ ... │
│ placement │ │route │ │timing │ │
└───────────┘ └──────┘ └───────┘ │
┌──────┴──────┐
│ Interface │
│ MCP/Py/Tcl │
└──────┬──────┘
│
LLM Agent