核心能力
1. Intent Storage
不可变版本化的设计意图存储。每次 SDC/UPF/MMMC 更新产生新版本(append-only),旧版本永久可追溯。存储结构区分设计目标(target frequency、area budget)与设计约束(clock period、max transition),防止 Agent 混淆二者。
2. Completeness Check
MMMC 约束完整性验证:检查每个 corner/mode 是否绑定了完整的时钟定义、输入/输出延迟、驱动/负载模型。缺失约束生成WARNING 级别 lint 报告,允许流程继续但标记设计状态为 incomplete。
3. Audit Trail
每次意图修改写入可审计的 immutability log:who(Agent/User/Script)、when(timestamp)、what(diff)、why(关联的 proposal ID)。日志为 append-only,支持按时间范围和 proposal 过滤。
4. Constraint Isolation
Agent proposal 不能绕过意图层直接修改约束文件。所有约束变更必须通过 Intent Scenario 的 propose() 接口。Proposal 进入 pending 状态,需经过 Gate 评估和人工/自动审批后写入。
5. Scenario Reduction
从全 MMMC 场景中选取代表性子集,基于 corner 间的相关性分析和 user-specified 优先级。支持worst-case(仅保留最差 corner)、representative(基于聚类选取代表性 corner)、full(全部保留)三种模式。
Agent 调用方式
from ieda.agent import IntentStore, IntentVersion
store = IntentStore(db=current_idb)
# 存储新版本(append-only)
ver = store.store(
name="sdc",
content=sdc_bytes,
metadata={"source": "user", "proposal_id": "prop-v7"}
)
# 完整性检查
report = store.check_completeness(ver.hash)
# report.missing: [{"corner": "wc_cmax", "missing": ["input_delay"]}]
# 查询历史
history = store.history("sdc", since=ver.hash)
# history.versions: [v1, v2, v3]
# Agent proposal——必须通过 intend 层
intent_store.propose(
constraint="set_clock_period",
new_value="1.2ns",
reason="timing closure requires freq reduction",
proposal_id="prop-v8"
) # → pending, requires gate approval
// MCP 协议:Agent 通过 intent 层读写约束
{
"method": "tools/call",
"params": {
"name": "intent.propose",
"arguments": {
"constraint": "set_clock_period",
"current_value": "1.0ns",
"proposed_value": "1.2ns",
"reason": "timing closure requires frequency relaxation",
"impact_analysis": {
"affected_corners": ["wc_cmax"],
"regression_risk": "low"
}
}
}
}
# Tcl 接口:版本化意图管理
ieda::intent store -name sdc -file ./constraints/v3.sdc
ieda::intent check -name sdc -mode completeness
# → MMMC completeness: WARNING - input_delay missing for wc_cmax
ieda::intent history -name sdc
# v1 2025-01-15 user:initial
# v2 2025-03-22 agent:prop-v7 (approved)
# v3 2025-06-10 user:update corner
输入/输出契约
| 方向 | 字段 | 类型 | 说明 |
|---|---|---|---|
| 输入 | name | str | 意图集合名称(sdc / upf / mmc) |
| 输入 | content | bytes | 约束文件原始内容 |
| 输入 | metadata | dict | 来源、关联 proposal ID |
| 输入 | proposal | IntentProposal | Agent 提交的约束修改提案 |
| 输出 | version | IntentVersion | 不可变版本对象(hash、timestamp) |
| 输出 | completeness_report | dict | 每个 corner/mode 的约束覆盖状态 |
| 输出 | audit_log | list[AuditEntry] | 可审计的修改记录 |