核心能力
Metric Schema
标准化的评估指标定义——WNS / TNS / HPWL / density / power / DRC count / congestion 等,每个指标有明确的方向(minimize / maximize)、阈值和单位。支持自定义扩展指标,所有指标在统一框架下比较。
Gate
硬性门禁判定——critical false-negative 不得漏报、约束语义必须完整。Agent 的修改如果导致关键路径的 WNS 恶化超过阈值、或者引入新的 DRC 违例,门禁直接判定 FAIL,该 commit 被拒绝。
Pareto
多目标 trade-off 的 Pareto 前沿分析。在 WNS vs HPWL vs density 等多维空间中,定位当前提案在 Pareto 前沿上的位置——是否被已有候选 dominate,或者是否拓展了新的前沿。
Regret
量化未选中最优候选的损失。给定一个选中的 commit 和同一轮的其他候选,regret 计算实际选择与全局最优之间的指标差距——帮助 Agent 在下一轮迭代中做出更好的 trade-off 决策。
Coverage
验证覆盖率的量化追踪。统计哪些设计对象经过了 evaluation、哪些 corner case 被覆盖、哪些约束组合被验证——确保 Agent 的修改不会在未覆盖的路径上引入隐藏问题。
评测示例
from ieda import AgentClient from ieda.evaluation import MetricSchema, Gate, ParetoFront client = AgentClient() # Define evaluation metrics metrics = MetricSchema([ {"name": "wns", "direction": "maximize", "gate": {"min": -0.050}}, {"name": "hpwl", "direction": "minimize"}, {"name": "density", "direction": "minimize", "gate": {"max": 0.85}}, {"name": "drc_count", "direction": "minimize", "gate": {"max": 0}}, ]) # Run evaluation on a snapshot pair result = client.call("eval.run", before="snap_7f3a", after="snap_8b2c", metrics=metrics) # Gate judgment judgment = Gate.judge(result) if judgment.passed: print(f"PASS — all hard gates satisfied") print(f"Pareto rank: {judgment.pareto_rank}") print(f"Regret (vs best): {judgment.regret:.4f}") else: print(f"FAIL — {judgment.failures}")
{
"tool": "eval.run",
"arguments": {
"before": "snap_7f3a",
"after": "snap_8b2c",
"metrics": [
{"name": "wns", "direction": "maximize", "gate": {"min": -0.050}},
{"name": "drc_count", "direction": "minimize", "gate": {"max": 0}}
]
}
}
// Response — gate judgment
{
"passed": true,
"metrics": {"wns": -0.042, "hpwl": 12500000, "drc_count": 0},
"pareto_rank": 1,
"regret": 0.0,
"failures": []
}
# Define gate metrics eval::define_metric wns -direction maximize -gate_min -0.050 eval::define_metric drc_count -direction minimize -gate_max 0 eval::define_metric hpwl -direction minimize # Run evaluation set judgment [eval::run -before snap_7f3a -after snap_8b2c] # Check result if {[dict get $judgment passed]} { puts "PASS — Pareto rank: [dict get $judgment pareto_rank]" } else { puts "FAIL — [dict get $judgment failures]" }
指标 Schema
MetricDefinition {
name: str // 指标名称, e.g. "wns", "hpwl", "drc_count"
direction: "minimize" | "maximize" | "target"
unit?: str // 单位, e.g. "ns", "um", "count"
gate?: GateRule { // 硬性门禁规则
min?: f64 // 最小允许值
max?: f64 // 最大允许值
strict?: bool // 是否严格不等(默认 false = inclusive)
}
weight?: f64 // 多目标汇总时的权重
}
GateJudgment {
passed: bool // 门禁是否通过
metrics: {}MetricValue // 各指标的实际值
pareto_rank: int // 在当前 Pareto 前沿上的排名
regret: f64 // 相对最优候选的 regret 值
failures: []GateFailure // 未通过的门禁列表
coverage: f64 // 验证覆盖率 (0.0 ~ 1.0)
}