
Neosyn Fpga Mcp
io.neosyn由 neosyn.io 發布v1.4.0更新於 Oct 24, 2026
AI-agent MCP server for FPGA design: compile, validate & generate Verilog from C⏚ HDL.
概覽
本機 MCP 伺服器,為 AI 助理提供 C⏚ FPGA 工具鏈:對硬體設計做靜態檢查、編譯、模擬、產生 Verilog/VHDL 並做合成驗證。
- 可以做什麼
- 對 C⏚ HDL 原始碼做 lint、編譯檢查與模擬,回傳結構化診斷、警告與埠輸出
- 從設計產生 Verilog 或 VHDL,可選擇將檔案寫入專案目錄
- 以 yosys 合成產生的 Verilog,給出 REAL/FOLDED/SUSPECT/ERROR 判定與單元數量
- 產生已驗證的起始骨架、查詢經驗證的範例核心,並把編譯錯誤對應到修正配方
- 檢視編譯後的狀態機與網路接線,並輸出 HTML 版 FPGA 報告
- 依需求讀取內建知識文件,包括 C⏚ 語言包與 RISC-V CPU 參考
- 適用情境
- 適合助理撰寫或除錯 C⏚ 硬體設計,並希望用真實編譯器驗證自身輸出而非憑記憶作答的情境。適用於需要反覆迭代、在交付 RTL 前必須通過編譯、模擬與合成的流程。
- 執行需求
- 需要 Python 3.10+ 以及 PATH 中的 Java 17 或更新版本。必須透過環境變數 CG_JAR 指定 C⏚ 編譯器 jar。選用:合成需要 PATH 中的 yosys(可用 YOSYS 覆寫),Verilog 層級模擬需要 iverilog。商業版 jar 另需授權檔,透過 NEOSYN_CG_LICENSE 指定或放在擴充套件的預設路徑。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Neosyn Fpga Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
neosyn-fpga-mcp
An MCP server that hands the C⏚ FPGA toolchain to an AI agent. The model writes hardware; the server compiles, simulates and synthesis-checks it against the real compiler, and hands back structured diagnostics the model can act on.
That is the difference worth caring about. An LLM asked for Verilog will confidently emit something that does not build, does not synthesize, or silently folds away to nothing. Here every step is judged by the same compiler a human uses.
Two parts work together:
cg_context.md— a knowledge pack. Load it as the system prompt and the model can write plausible C⏚: the mental model, types, ports, structs/enums/generics, the standard library, and the gotchas that sink first drafts.- the MCP server — the compiler as tools, so the model verifies its own output instead of recalling it.
Knowledge gives a good first draft; the compiler in the loop makes it right. Both are model-agnostic — any stdio-MCP host (Claude Desktop, Claude Code, Cursor, Cline) works, and the context pack works with any LLM at all.
Why not fine-tune? C⏚ is a niche language with little public code, and it gains features every release. A fine-tuned model is expensive and goes stale. In-context knowledge plus a verification loop costs nothing to retrain, tracks the language as the compiler evolves, and converges by running code rather than recalling it.
Install
Then point it at a C⏚ compiler jar:
Two ways to get that jar:
- Open source — a prebuilt jar from cg-compiler releases, or build it from source.
- Commercial — the jar inside an installed
Neosyn C⏚ extension, which adds the fast
bytecode simulator and VHDL output.
It needs your licence file: set
NEOSYN_CG_LICENSEto it, or keep it at the default path the extension uses. Without one, every tool reports the licence problem instead of running.
cg_capabilities reports which one you have and what it can do, probed rather
than assumed.
Requirements
- Python 3.10+
- Java 17 or newer on
PATH— the jar's bytecode targets 17. - Optional:
yosysonPATHforcg_synth(override with$YOSYS);iverilogforcg_simulate(simulator='iverilog'). Neither is needed forcg_check,cg_generate_verilog, or the bytecode simulator.
Smoke-test the verification core without an MCP client:
Connect it to an MCP host
Add a server entry. Use absolute paths.
The same command/args/env shape works for Claude Desktop, Claude Code,
Cursor, Cline and other stdio-MCP hosts.
Then load cg_context.md as the system prompt (or paste it at the top of
the conversation). The model now knows the language and can verify it.
Tools the server exposes
13 tools. Every tool that takes source accepts source (a C⏚ string) and an
optional extra_files map ({"Defs.cg": "..."}) for imported bundles/tasks.
These are the only names that exist, and the server says so rather than hoping
you read this table: a call to a tool that does not exist comes back with the
whole list and the closest real name (cg_compile → "did you mean cg_check?"),
cg_capabilities carries the list, and the first call of a session carries it
once. The list is generated from the tool
registry, so it cannot drift out of step with the table below.
Choosing a backend
Two tools take a backend selector:
-
cg_simulate(source, simulator=…)— which simulator runs the design:'bytecode'(default) — the compiler's fast bytecode simulator. No HDL toolchain needed; aproperties { test: {...} }block self-checks.cg_simulate(src)orcg_simulate(src, simulator="bytecode").'iverilog'— generate Verilog + a testbench and run Icarus Verilog (vvp), a Verilog-level cross-check. A testbench is emitted only for a network whose name containsTestwith a capital T (e.g.network TestFoo); a lowercase_testnetwork drives the bytecode sim'stestproperty only, not iverilog. NeedsiverilogonPATH.cg_simulate(src, simulator="iverilog").'verilator'— accepted for forward-compat but reported unavailable unless theverilatorbinary is installed.cg_simulate(src, simulator="verilator").
-
cg_synth(source, flow=…)— which yosys synthesis flow runs:'generic'(default) — portable synthesizability check (synth).cg_synth(src)orcg_synth(src, flow="generic").- a vendor FPGA family —
'ice40','ecp5','xilinx','gowin','intel'— maps to that part's primitives (LUTs/BRAM/DSP).cg_synth(src, flow="ice40").
topdefaults to the first non-testbench task/network (the synthesizable DUT); pass it when a file holds several designs. Override the yosys binary with$YOSYS.
How the model should use it
- Draft C⏚ (always starting with
package). cg_lint→ free and instant; catches the mistakes the compiler will happily accept, above all atest:block that checks nothing.cg_check→ fix every diagnostic, and readwarnings: those are the compiler's own objections to code it will nonetheless accept.cg_simulate→ confirmok: trueand that the output matches intent.cg_generate_verilogonce it simulates, to hand off RTL.cg_synth(optional) → confirm the Verilog maps to real hardware (ok: true, a sensiblecellscount, noproblems).
Step 2 exists because steps 3–4 can BOTH pass on a design that does nothing: a
fixture with no output vector is green against a dead DUT. cg_lint is the only
step that catches that, and it costs nothing to run.
The loop in steps 2–3 is the point: the model writes, the compiler judges, the
model fixes. cg_context.md ends with the same protocol so the model follows
it even without separate instruction.
The loop, end to end
Through the MCP tools the same calls are cg_check → cg_simulate →
cg_generate_verilog → cg_synth. Draft, then walk down the list, fixing
diagnostics at each gate; cg_synth is the final hardware gate.
Seed-and-adapt: start from a verified base
Knowledge + verification gets a model surprisingly far, but there's a ceiling:
for a genuinely hard fixed-point datapath (e.g. an n-body force kernel with a
1/r²·√r² term), a model asked to write it from scratch flails — in C⏚ and
in Verilog. The reliable pattern is seed-and-adapt: hand the model a small,
verified base and have it change only the dataflow, keeping the parts it
can't invent (the Q16.16 multiply-accumulate, the task/network/monitor shape).
Call cg_example(pattern) to fetch one. This is a curated dictionary of
validated code with scored lazy access (not free-form search): no pattern
returns the index; a name or intent ("1/sqrt", "distance", "divide a by b",
…) returns the single best-matching source plus 1-2 runners-up so the model can
self-correct. Matching is specificity-weighted, so "1/sqrt"→RSqrt while a bare
"sqrt"→FixedSqrt. When the compiler rejects something,
cg_suggest_for_error(msg) points at the recipe with the synthesizable pattern.
examples/ holds the verified entries — every one simulates, generates Verilog,
and passes yosys synth. kind splits the reusable primitives (Recip, Divide,
SeqDiv, FixedSqrt, RSqrt, SqrDist, DotProduct, Fir, Integ, Distance, Counter)
from application examples (Force, GalaxyForce — n-body composition). Full
table with use_when/tags/cell counts in examples/RECIPES.md. A primitive
whose demo drives constant inputs (DotProduct, FixedSqrt, Distance) reports
cg_synth verdict: FOLDED — drive it with in push ports (as SqrDist does) so
the datapath survives.
See cg_adapt_demo.py in the
repository to watch the
seed-and-adapt loop run end to end, and EVAL.md for how C⏚ and Verilog write
rates were measured on small tasks — including what that measurement does not
show.
Documentation
- Setup and the full tool reference
- Installing C⏚ — the extension and the CLI
- Licensing
The older name
This project was published as cg-agent-kit up to 1.0.0; "cg" is our shorthand
for C⏚ and meant nothing to anyone searching for an FPGA tool. On PyPI that name
is now a shim that installs this package, and inside the package
python -m cg_agent_kit.cg_mcp_server and the cg-mcp-server command both
still resolve — so existing instructions and host configs keep working. New
installs should use neosyn-fpga-mcp.
License
MIT. Copyright (c) 2026 Neosyn.
The software is provided "as is", without warranty of any kind, express or
implied, including but not limited to the warranties of merchantability, fitness
for a particular purpose and noninfringement. In no event shall the authors or
copyright holders be liable for any claim, damages or other liability, whether
in an action of contract, tort or otherwise, arising from, out of or in
connection with the software or the use or other dealings in the software. The
full text ships with the package as LICENSE.
C⏚, Cg and Neosyn are marks of Neosyn. The C⏚ compiler is a separate work under its own licence — see neosyn.io/open.
來源:README.md,提交 523eba7
工具
0版本歷史
5- v1.4.0最新Sep 30, 2026
- v1.2.2Sep 27, 2026
- v1.2.1Sep 27, 2026
- v1.2.0Sep 27, 2026
- v1.1.2Sep 20, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分