Skip to main content
Glama

ModelSim 仿真 (vlib+vlog/vcom+vsim -c)

fpga_msim_sim

Run headless ModelSim compile and simulation for Verilog/SV/VHDL designs with testbenches, detect errors from transcript output, and optionally produce VCD or coverage for assertions.

Instructions

用 ModelSim 头less 编译(Verilog/SV→vlog,VHDL→vcom)并运行(vsim -c -do)一个设计(含 testbench)。不信退出码:以 transcript 的 ** Error/Fatal 与 'Errors: N' 判定 ok($fatal 时 vsim 仍退 0)。可出 VCD 供 fpga_assert 判定;可选 coverage 返回结构化覆盖率(分支/语句/条件/翻转 %)。默认紧凑摘要 + detail:'full' + 按输入 hash 缓存。VHDL 是相对 fpga_sim(iverilog) 的增量能力。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
libNo工作库名,默认 work
topYes顶层模块/实体名(通常是零端口 testbench)
uvmNo是否按 UVM 测试编译/运行,默认 false。开启=用预编译 mtiUvm 库(无需 gcc/DPI):编译加 -sv +incdir+<uvm src> -L mtiUvm,vsim 加 -L mtiUvm;解析 UVM Report Summary,**UVM_ERROR/UVM_FATAL>0 即 ok=false**(ModelSim 退出码/Errors 仍可能为 0,反幻觉)。返回 uvm{info,warning,error,fatal}。
vcdNo是否生成 VCD(经 do-file: vcd file + vcd add -r /*),默认 false。开启时自动加 -voptargs=+acc 保留信号可见性(否则 vopt 优化掉信号,VCD 为空)。
hostNo远程执行设备 id(pango-mcp.config.json 的 hosts,需配 hosts.<id>.modelsim.home;省略=本机)。远程时源文件推到该设备编译+仿真,产物(VCD/coverage ucdb)拉回本地镜像供 fpga_assert。
waveNo仿真后把 VCD 渲染成波形图(SVG+HTML),默认 false。**自动启用 VCD**(含 +acc 保信号);产出见 artifacts.waveSvg/waveHtml。一步出图给用户看,免再调 fpga_wave。
cacheNo源文件+选项未变时复用上次摘要,默认 true;false 强制重跑
detailNo返回粒度,默认 summary(省 token);full 含完整 transcript
runArgNovsim run 参数,默认 '-all'(可为 '1us' 等定长)
libDirsNovlog 库搜索目录(相对 workdir 或绝对),经 -y +libext 让 vlog 按需自动解析设计实例化到的厂商原语仿真模型(如 Pango arch/.../verilog/fm_lib/simulation 或 gtp_lib 所在目录),无需手列每个 GTP_*.v。
sourcesNo相对 workdir 或绝对的源文件;省略=workdir 下所有 .v/.sv/.vhd(排除 . 与 _ 前缀)
uvmTestNoUVM 测试名,传给 +UVM_TESTNAME=<名>(顶层需 run_test())。省略则由 TB 的 run_test("...") 决定。
vcdPathNoVCD 输出路径(相对 workdir 或绝对);vcd=true 时默认 ._fpga_msim/sim.vcd
workdirYes工作目录绝对路径(HDL 源所在;编译产物隔离在 ._fpga_msim/)
coverageNo是否收集代码覆盖率(分支/条件/语句/翻转),默认 false。开启=编译加 -cover bcst + vsim -coverage -onfinish stop + 自动 +cover;run 后 coverage report/save,返回结构化 coverage{total,metrics{branch/statement/condition/toggle:{bins,hits,misses,pct}}} + artifacts.coverageUcdb。
fileListNovlog 文件清单(.f)路径(相对 workdir 或绝对),经 -F 读入(清单内相对路径相对清单所在目录解析)。用于含 IP 的仿真:直接喂 PDS 生成的/随 PDS 的 IP 仿真清单(如 PCIe filelist_pciegen*_gtp.f)。加密 IP(.vp/.svp,IEEE-1735 含 Mentor key)由 vlog 原生解密,无需走 PDS 仿真渠道。
vcomArgsNo追加给 vcom 的参数,如 -2008
vlogArgsNo追加给 vlog 的参数,如 +define+X、-timescale 1ns/1ps
vsimArgsNo追加给 vsim 的参数,如 -gG=1、+UVM_TESTNAME=...
waveOpenNowave 出图后用默认浏览器弹给用户看(本机),默认 false
assertionsNo一步内做声明式断言(同 fpga_assert):log_*/vcd_*。**任一 vcd_* 自动启用 VCD**;断言失败则整体 ok=false(断言即规格)。结果在 assert{passed,failed,results}。免再单独调 fpga_assert。
timeoutSecNo超时秒数,默认 120
doBeforeRunNorun 前注入的额外 Tcl(如 force/add wave/coverage 配置)
waveSignalsNowave 只画这些信号(省略=全部,上限 40)
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does it well: it warns that exit codes are unreliable and that parsing transcript ** Error/Fatal and 'Errors: N' is the authoritative pass/fail signal, including the surprising $fatal-exits-0 case. It also discloses headless execution, VCD generation behavior, structured coverage returns, and input-hash caching—valuable non-obvious behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded with the core compile-and-run action, then adds the most decision-relevant quirks (unreliable exit codes, VCD/coverage, caching, VHDL differentiator). Every sentence contributes non-obvious value and does not waste tokens repeating schema content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 24-parameter tool with no output schema, the description covers the critical execution model, pass/fail determination, cache, VCD/coverage capabilities, and VHDL positioning. However, it does not describe the default summary output structure or the full set of returned artifacts, leaving some ambiguity about what the agent should expect in the response beyond the schema-covered param details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 24 parameters in detail; the tool description adds little parameter-level meaning beyond reinforcing cross-cutting behaviors like detail:'full' and input-hash caching. This meets the baseline but does not meaningfully elevate parameter understanding beyond the rich schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action—headless ModelSim compile (vlog/vcom) and run (vsim -c -do)—with a clear resource (a design including testbench). It also distinguishes the tool from fpga_sim(iverilog) by calling VHDL support the incremental capability, helping an agent tell it apart from a closely related sibling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear usage context: it names fpga_sim(iverilog) as the alternative and notes that VHDL support is the differentiator, implying this tool is preferred for VHDL or ModelSim-specific flows. It also mentions VCD output as usable by fpga_assert, giving a downstream integration hint. However, it does not explicitly state when not to use this tool versus the other fpga_msim_* siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Renkos1/pango-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server