eda 会话排查
- 作者仓库星标 19
- 作者仓库 eda-sim
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)
- 流狐分类
- AI 智能
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @cike128 · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 需简单配置
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- 未声明
- 底层运行要求
- Python >=3.6
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
# Step 3: Post-Processing Results
# 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 Before ANY EDA operation, source the project environment: This sets all required variables. Verify with: If .envrc doesn't exist, create one following this template:
Use the project Makefile when available: If no Makefile or it doesn't work, use direct VCS invocation: Key points:
Use the project regression script: If writing a custom regression script, key patterns: Use $VCSBIN not vcs for compilation
Check simulation pass/fail: Common false positive patterns to add to exclude.txt: errortype.verrortypee — UVM transaction field prints
Step 4: Waveform Debug (if needed)
Step 5: Coverage
# 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:
```bash
source <project_root>/.envrc
```
This sets all required variables. Verify with:
```bash
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:
```bash
#!/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:
```bash
cd $DV_ROOT/sim
make all CASE_NAME=<category/test_name>
```
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Why This Matters → Step 0: Environment Setup (MANDATORY, every session) → Step 1: Running a Single Test → Step 2: Running Regression → Step 3: Post-Processing Results → Step 4: Waveform Debug (if needed)
要点 -> Synopsys NPI (primary) · IMPORTANT · This skill defines the mandatory procedure for running Synopsys VCS simulations in an offline (no-network) environment. · Synopsys tool wrappers (e.g., vcs, verdi) use snpslmd license checkout that may route through network namespaces. · This sets all required variables. · FSDB is a Synopsys proprietary binary format. · IMPORTANT: NPI requires Verdi's bundled Python 3.6 ($VERDIHOME/platform/linux64/Python/bin/python3.6). · Signal paths use .
文件/命令 -> vcs · verdi · snpslmd · $VCSBIN · .envrc · SNPSLMDLICENSEFILE=27000@localhost.localdomain · -timescale=1ns/1ps · -unittimescale
内容 SHA-256 -> da044f8cd17a
方法与流程
适用与边界
原文中的明确线索
vcs、verdi、snpslmd、$VCSBIN、.envrc、SNPSLMDLICENSEFILE=27000@localhost.localdomain、-timescale=1ns/1ps、-unittimescale