Agent安装
- 作者仓库星标 19
- 作者更新于 实时读取
- 作者仓库 eda-sim
- 领域
- AI 智能
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @cike128 · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- Python >=3.6
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: eda-sim
description: Offline EDA simulation workflow for ASIC DV projects using Synopsys VCS/Verdi. Use this skill wh…
category: AI 智能
runtime: Python
---
# eda-sim 输出预览
## PART A: 任务判断
- 适用问题:提示词、Agent 工作流、模型评估或自动化推理。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Why This Matters / Step 0: Environment Setup (MANDATORY, every session) / Step 1: Running a Single Test”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于提示词、Agent 工作流、模型评估或自动化推理,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Why This Matters / Step 0: Environment Setup (MANDATORY, every session) / Step 1: Running a Single Test”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令。
先用一个小任务确认它会围绕“Why This Matters / Step 0: Environment Setup (MANDATORY, every session) / Step 1: Running a Single Test”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: eda-sim
description: Offline EDA simulation workflow for ASIC DV projects using Synopsys VCS/Verdi. Use this skill wh…
category: AI 智能
source: cike128/eda-sim
---
# eda-sim
## 什么时候使用
- eda-sim 是 AI 智能方向的技能,主要扩展 Agent 在调模型、改提示词、跑评测这类场景下的能力 适合处理AI Agent、提示词、模型评估与自动化推理,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent…
- 面向提示词、Agent 工作流、模型评估或自动化推理,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Why This Matters / Step 0: Environment Setup (MANDATORY, every session) / Step 1: Running a Single Test」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "eda-sim" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Why This Matters / Step 0: Environment Setup (MANDATORY, every session) / Step 1: Running a Single Test
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Python | 读取文件、写入/修改文件、执行终端命令 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Offline EDA Simulation Workflow
This skill defines the mandatory procedure for running Synopsys VCS simulations in an offline (no-network) environment. The EDA tools are installed locally but their default wrappers try to phone home for license validation, which fails without network access. The workaround is to invoke binaries directly and point to a local license server.
Why This Matters
Synopsys tool wrappers (e.g., vcs, verdi) use snpslmd license checkout that may route through network namespaces. In offline setups, this fails silently or hangs. By calling the binary directly via $VCS_BIN (set in .envrc) and ensuring SNPSLMD_LICENSE_FILE=27000@localhost.localdomain, we bypass network dependencies entirely.
Step 0: Environment Setup (MANDATORY, every session)
Before ANY EDA operation, source the project environment:
source <project_root>/.envrc
This sets all required variables. Verify with:
echo "VCS_BIN=$VCS_BIN"
echo "VERDI_HOME=$VERDI_HOME"
echo "LM_LICENSE_FILE=$LM_LICENSE_FILE"
If .envrc doesn't exist, create one following this template:
#!/bin/bash
export PROJECT_HOME="<absolute_path>"
export DV_ROOT="$PROJECT_HOME/dv"
export DIG_ROOT="$PROJECT_HOME/rtl"
export VCS_HOME="<path_to_vcs_installation>"
export VERDI_HOME="<path_to_verdi_installation>"
export SNPSLMD_LICENSE_FILE="27000@localhost.localdomain"
export LM_LICENSE_FILE="$SNPSLMD_LICENSE_FILE"
export VCS_BIN="$VCS_HOME/bin/vcs"
export VERDI_PLI_TAB="$VERDI_HOME/share/PLI/VCS/LINUX64/novas.tab"
export VERDI_PLI_A="$VERDI_HOME/share/PLI/VCS/LINUX64/pli.a"
export PATH="$DV_ROOT/sim:$PATH"
Step 1: Running a Single Test
Use the project Makefile when available:
cd $DV_ROOT/sim
make all CASE_NAME=<category/test_name>
If no Makefile or it doesn't work, use direct VCS invocation:
$VCS_BIN -full64 -top test_bench -sverilog -lca -kdb \
-f $DV_ROOT/sim/flist \
-timescale=1ns/1ps \
+notimingcheck +nospecify \
-debug_access+all \
+define+DUMPOFF \
+warn=noIPC +lint=TFIPC-L \
+error+20 \
-P $VERDI_PLI_TAB $VERDI_PLI_A \
-l compile.log
./simv +UVM_TESTNAME=base_test -l sim.log
Key points:
- Always use
$VCS_BIN(the direct binary path), NEVER barevcs -timescale=1ns/1pssets default for modules without explicit timescale- Do NOT use
-unit_timescale— it overrides ALL modules including vendor IPs with different timescales, causing timing behavior changes - Do NOT use
+memcbkon VCS 2023.12+ — it's deprecated, use-debug_access+allinstead
Step 2: Running Regression
Use the project regression script:
cd $DV_ROOT/sim
./run_regr.sh [regr_list_name] # Default: regr_list
MAX_PARALLEL=8 ./run_regr.sh regr_list # Override parallel count
If writing a custom regression script, key patterns:
- Use
$VCS_BINnotvcsfor compilation - Each test needs its own working directory with
current_case/symlinks - Create empty
define.svif the test case doesn't provide one (flist requires it) - Check
sim.logfor$finishAND filter error/warning lines usingexclude.txt - Use
timeoutcommand to prevent hung simulations
Step 3: Post-Processing Results
Check simulation pass/fail:
# 1. Verify simulation completed
grep -q '$finish' sim.log && echo "SIM FINISHED" || echo "SIM INCOMPLETE"
# 2. Check for errors (filter known benign patterns via exclude.txt)
grep -iE 'error|warning' sim.log \
| grep -v 'Warning-\[' \
| grep -v 'UVM_WARNING *:' \
| grep -v 'UVM_ERROR *:' \
| grep -v 'UVM_FATAL *:' \
| grep -v -f exclude.txt
Common false positive patterns to add to exclude.txt:
error_type.*v_error_type_e— UVM transaction field prints^UVM_INFO— info messages containing "error" substringerror_en 0 rand_num— error-enable field in protocol logsCommand:.*simv— VCS command line echoes containing "error" in pathsillegal seting of role control— analog model transient statesMEM_Error— SRAM model clock glitch in functional sim (no SDF)
Step 4: Waveform Debug (if needed)
# Recompile with waveform dump enabled
make all CASE_NAME=<name> FSDB=1
# Launch Verdi
$VERDI_HOME/bin/verdi -elab simv.daidir/kdb.elab++ -ssf test.fsdb
Step 5: Coverage
# After regression, merge coverage databases
urg -full64 -dir $(find . -name "*.vdb") -dbname merge.vdb
# View in Verdi
$VERDI_HOME/bin/verdi -cov -covdir merge.vdb
Step 6: FSDB Waveform Reading (without Verdi GUI)
FSDB is a Synopsys proprietary binary format. Use the bundled scripts/fsdb_reader.py to read signals programmatically. The script uses Synopsys NPI (primary) or CLI tools (fallback), no GUI needed.
IMPORTANT: NPI requires Verdi's bundled Python 3.6 ($VERDI_HOME/platform/linux64/Python/bin/python3.6). The script auto-detects this. System Python (3.7+) will cause segfault with NPI .so files — the script handles this transparently by invoking Verdi's Python as a subprocess.
Read a signal's value changes
python3 <skill_dir>/scripts/fsdb_reader.py <file.fsdb> --signal <path> [--start <time>] [--end <time>] [--format h]
Signal paths use . as hierarchy separator (NPI native format):
python3 scripts/fsdb_reader.py test.fsdb --signal test_bench.u_chip.clk --end 100ns
Format options: b (binary), o (octal), d (decimal), u (unsigned), h (hex, default).
List signals in an FSDB
python3 scripts/fsdb_reader.py test.fsdb --list-signals --depth 2
Convert FSDB to VCD
python3 scripts/fsdb_reader.py test.fsdb --to-vcd --output out.vcd [--end 1us]
VCD is a text format readable by any tool. Use --end to limit file size for large FSDBs.
Force CLI fallback mode
python3 scripts/fsdb_reader.py test.fsdb --signal test_bench.clk --cli
Direct CLI (alternative)
If the script isn't available, use Verdi tools directly:
# Read signal values (fsdbreport uses / separator, writes report.txt to CWD)
$VERDI_HOME/bin/fsdbreport file.fsdb -s "test_bench/signal_name" -of h -et 1us
# Convert to VCD
$VERDI_HOME/bin/fsdb2vcd file.fsdb -o output.vcd -et 1us
Generating FSDB from simulation
To enable FSDB dump, run with FSDB=1:
make all CASE_NAME=<name> FSDB=1
If the testbench $fsdbDumpvars is commented out, use UCLI at runtime:
echo 'call {$fsdbDumpfile("test.fsdb")}
call {$fsdbDumpvars(0, test_bench)}
run
quit' > dump.tcl
./simv +UVM_TESTNAME=base_test -ucli -i dump.tcl -l sim.log
Compilation Troubleshooting
| Error | Cause | Fix |
|---|---|---|
Error-[DEBUG_DEP_ERROR] +memcbk deprecated |
VCS 2023.12+ removed +memcbk |
Use -debug_access+all instead |
Error-[XMRE] Cross-module reference |
Test references instances not in current TB | Check if the model/module exists in the testbench |
Error-[UM] Undefined macro |
Missing +define+ or define file not compiled before RTL |
Ensure define.sv is listed BEFORE RTL in flist |
Error-[SFCOR] Source file cannot be opened |
Generated file (e.g., from TCL script) not created | Run the generation script (e.g., tclsh gen_regs.tcl > test_cmd.sv) |
Error-[SE] Syntax error: parameter in begin block |
parameter/localparam not allowed in procedural blocks |
Inline the constant value or move declarations before assignments |
| License checkout failure / tool hangs | Network wrapper can't reach license server | Use $VCS_BIN directly instead of vcs wrapper |
Regression Analysis Checklist
When analyzing regression failures:
- Classify failures: COMPILE FAIL vs SIM FAIL vs TIMEOUT
- For SIM FAIL, check
check_log_failed.log— if it only containsV_NO_ERRORorerror_typelines, it's a false positive - Group failures by error pattern (ADC value mismatch, CC timing, MEM_Error, etc.)
- Fix the highest-impact issues first (false positive filtering fixes the most tests)
- Re-process existing sim.log files when only the pass/fail checker changed (no need to re-simulate)
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核