Skip to main content
Glama
EDA Tools MCP Server

EDA Tools MCP Server

by kfy123bot

EDA 工具 MCP 服务器

论文实现:MCP4EDA: LLM-Powered Model Context Protocol RTL-to-GDSII Automation with Backend Aware Synthesis Optimization

一个全面的模型上下文协议 (MCP) 服务器,为 Claude Desktop 和 Cursor IDE 等 AI 助手提供电子设计自动化 (EDA) 工具集成。该服务器使 AI 能够通过统一接口执行 Verilog 综合、仿真、ASIC 设计流程和波形分析。

演示

https://github.com/user-attachments/assets/65d8027e-7366-49b5-8f11-0430c1d1d3d6

EDA MCP 服务器演示,展示了 Verilog 综合、仿真和 ASIC 设计流程

Related MCP server: waveform-mcp

功能

  • Verilog 综合:使用 Yosys 为各种 FPGA 目标(通用、ice40、xilinx)综合 Verilog 代码

  • Verilog 仿真:使用 Icarus Verilog 进行仿真,并自动执行测试平台 (testbench)

  • 波形查看:启动 GTKWave 进行 VCD 文件可视化和信号分析

  • ASIC 设计流程:使用 OpenLane 和 Docker 集成实现完整的 RTL 到 GDSII 流程

  • 布局查看:在 KLayout 中打开 GDSII 文件以进行物理设计检查

  • 报告分析:读取并分析 OpenLane 报告,以获取 PPA 指标和设计质量评估

先决条件

在使用此 MCP 服务器之前,您需要安装以下 EDA 工具:

1. Yosys (Verilog 综合)

macOS (Homebrew):

brew install yosys

Ubuntu/Debian:

sudo apt-get update
sudo apt-get install yosys

从源码编译:

# Install prerequisites
sudo apt-get install build-essential clang bison flex \
    libreadline-dev gawk tcl-dev libffi-dev git \
    graphviz xdot pkg-config python3 libboost-system-dev \
    libboost-python-dev libboost-filesystem-dev zlib1g-dev

# Clone and build
git clone https://github.com/YosysHQ/yosys.git
cd yosys
make -j$(nproc)
sudo make install

替代方案 - OSS CAD Suite (推荐): 从以下地址下载完整工具链:https://github.com/YosysHQ/oss-cad-suite-build/releases

2. Icarus Verilog (仿真)

macOS (Homebrew):

brew install icarus-verilog

Ubuntu/Debian:

sudo apt-get install iverilog

Windows: 从以下地址下载安装程序:https://bleyer.org/icarus/

3. GTKWave (波形查看器)

直接下载 (推荐):

  • Windows: 从 SourceForge 下载

  • macOS: 从 SourceForge 下载或使用 Homebrew: brew install --cask gtkwave

  • Linux: 从 SourceForge 下载或使用包管理器: sudo apt-get install gtkwave

其他安装方法:

# macOS (Homebrew)
brew install --cask gtkwave

# Ubuntu/Debian
sudo apt-get install gtkwave

# Build from source (all platforms)
git clone https://github.com/gtkwave/gtkwave.git
cd gtkwave
meson setup build && cd build && meson install

4. Docker Desktop (推荐用于 OpenLane)

直接下载:

安装:

  1. 从官网下载并安装 Docker Desktop

  2. 启动 Docker Desktop 并确保其正在运行

  3. 验证安装: docker run hello-world

注意: Docker Desktop 在一个包中包含了 Docker Engine、Docker CLI 和 Docker Compose。

5. OpenLane (ASIC 设计流程)

简单安装方法 (推荐):

# Install OpenLane via pip
pip install openlane

# Pull the Docker image
docker pull efabless/openlane:latest

# Verify installation
docker run hello-world

使用示例:

# Create project directory
mkdir -p ~/openlane-projects/my-design
cd ~/openlane-projects/my-design

# Create Verilog file (counter example)
cat > counter.v << 'EOF'
module counter (
    input wire clk,
    input wire rst,
    output reg [7:0] count
);
    always @(posedge clk or posedge rst) begin
        if (rst)
            count <= 8'b0;
        else
            count <= count + 1;
    end
endmodule
EOF

# Create configuration file
cat > config.json << 'EOF'
{
    "DESIGN_NAME": "counter",
    "VERILOG_FILES": ["counter.v"],
    "CLOCK_PORT": "clk",
    "CLOCK_PERIOD": 10.0
}
EOF

# Run the RTL-to-GDSII flow
python3 -m openlane --dockerized config.json

主要优势:

  • --dockerized 标志通过 Docker 自动处理所有工具依赖项

6. KLayout (布局查看器)

直接下载 (推荐):

其他安装:

# macOS (Homebrew)
brew install --cask klayout

# Ubuntu/Debian
sudo apt install klayout

安装

1. 克隆并构建 MCP 服务器

git clone https://github.com/NellyW8/mcp-EDA
cd mcp-EDA
npm install
npm run build
npx tsc   

2. 项目结构

mcp-EDA/
├── src/
│   └── index.ts          # Main server code
├── build/
│   └── index.js          # Compiled JavaScript
├── package.json
├── tsconfig.json
└── README.md

配置

Docker Desktop MCP 集成

此方法使用 Docker Desktop 内置的 MCP 扩展,以获得最简单的设置体验。

先决条件

  • 已安装并运行 Docker Desktop 4.39.0+

  • 已安装 Claude Desktop

设置步骤

  1. 安装 Docker Desktop 扩展:

    • 启动 Docker Desktop

    • 转到左侧菜单中的 "Extensions"

    • 搜索 "AI Tools" 或 "Docker MCP Toolkit"

    • 安装 "Labs: AI Tools for Devs" 扩展

  2. 配置 Docker MCP 连接:

    • 打开已安装的 "Labs: AI Tools for Devs" 扩展

    • 点击右上角的齿轮图标

    • 选择 "MCP Clients" 选项卡

    • 为 "Claude Desktop" 或 "Cursor IDE" 点击 "Connect"

    这将自动为 Claude Desktop 和 Cursor IDE 配置:

    {
      "mcpServers": {
        "MCP_DOCKER": {
          "command": "docker",
          "args": [
            "run",
            "-i",
            "--rm",
            "alpine/socat",
            "STDIO",
            "TCP:host.docker.internal:8811"
          ]
        }
      }
    }

Claude Desktop 设置

  1. 添加您的 EDA MCP 服务器:

    • 找到您的 Claude Desktop 配置文件,Settings > Developer > Edit Config:

      • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

      • Windows: %APPDATA%\Claude\claude_desktop_config.json

    • 将您的 EDA 服务器添加到现有配置中:

    {
      "mcpServers": {
        "MCP_DOCKER": {
          "command": "docker",
          "args": [
            "run",
            "-i",
            "--rm",
            "alpine/socat",
            "STDIO",
            "TCP:host.docker.internal:8811"
          ]
        },
        "eda-mcp": {
          "command": "node",
          "args": [
            "/absolute/path/to/your/eda-mcp-server/build/index.js"
          ],
          "env": {
            "PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin",
            "HOME": "/your/home/directory"
          }
        }
      }
    }
  2. 重启 Claude Desktop 并在 Settings > Developer 中验证两个服务器是否都在运行。

Cursor IDE 设置

  1. 打开 Cursor 设置:

    • 按 Ctrl + Shift + P (Windows/Linux) 或 Cmd + Shift + P (macOS)

    • 搜索 "Cursor Settings"

    • 在侧边栏中导航到 "MCP"

  2. 添加 MCP 服务器: 点击 "Add new MCP server" 并配置:

     {
      "mcpServers": {
        "MCP_DOCKER": {
          "command": "docker",
          "args": [
            "run",
            "-i",
            "--rm",
            "alpine/socat",
            "STDIO",
            "TCP:host.docker.internal:8811"
          ]
        },
        "eda-mcp": {
          "command": "node",
          "args": [
            "/absolute/path/to/your/eda-mcp-server/build/index.js"
          ],
          "env": {
            "PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin",
            "HOME": "/your/home/directory"
          }
        }
      }
    }
  3. 启用 MCP 工具:

    • 转到 Cursor Settings → MCP

    • 启用 "eda-mcp" 服务器

    • 您应该会看到服务器状态变为 "Connected"

使用示例

1. Verilog 综合

Ask Claude: "Can you synthesize this counter module for an ice40 FPGA?"

module counter(
    input clk,
    input rst,
    output [7:0] count
);
    reg [7:0] count_reg;
    assign count = count_reg;
    
    always @(posedge clk or posedge rst) begin
        if (rst)
            count_reg <= 8'b0;
        else
            count_reg <= count_reg + 1;
    end
endmodule

2. Verilog 仿真

Ask Claude: "Please simulate this adder with a testbench"

// Design
module adder(
    input [3:0] a,
    input [3:0] b,
    output [4:0] sum
);
    assign sum = a + b;
endmodule

// Testbench will be generated automatically or you can provide one

3. ASIC 设计流程

Ask Claude: "Run the complete ASIC flow for this design with a 10ns clock period"

module simple_cpu(
    input clk,
    input rst,
    input [7:0] data_in,
    output [7:0] data_out
);
    // Your RTL design here
endmodule

完成后您将获得:

  • runs/RUN_*/final/gds/design.gds - 最终的 GDSII 布局

  • runs/RUN_*/openlane.log - 完整的执行日志

  • runs/RUN_*/reports/ - 时序、面积、功耗分析报告

  • 所有中间结果 (DEF 文件、网表等)

4. 波形分析

Ask Claude: "View the waveforms from the simulation with project ID: abc123"

故障排除

常见问题

  1. 未检测到 MCP 服务器:

    • 验证配置中的绝对路径

    • 检查 Node.js 是否已安装且可访问

    • 配置更改后重启 Claude Desktop/Cursor

  2. Docker 权限错误:

    sudo groupadd docker
    sudo usermod -aG docker $USER
    sudo reboot
  3. 工具未找到错误:

    • 验证工具是否已安装: yosys --version, iverilog -V, gtkwave --version

    • 检查 MCP 配置中的 PATH 环境变量

    • 在 macOS 上,确保包含 Homebrew 路径: /opt/homebrew/bin

  4. OpenLane 超时:

    • 服务器对 OpenLane 流程有 10 分钟的超时限制

    • 对于复杂设计,考虑简化或进行多次迭代

  5. GTKWave/KLayout GUI 问题:

    • 在 macOS 上:GTKWave/KLayout 可能需要在“安全性与隐私”设置中手动批准

    • 在 Linux 上:如果使用远程系统,请确保 X11 转发正常工作

    • 在 Windows 上:确保 GUI 应用程序可以从命令行启动

调试

  1. 检查 MCP 服务器日志:

    • Claude Desktop: ~/Library/Logs/Claude/mcp*.log (macOS)

    • Cursor: 检查 MCP 设置面板以获取错误消息

  2. 手动测试工具:

yosys -help
iverilog -help
docker run hello-world
gtkwave --version
klayout -v
  1. 验证 Node.js 环境:

node --version
npm --version

支持

如有问题和疑问:

  • 查看上面的故障排除部分

  • 查看 MCP 服务器日志

  • 手动测试各个工具

  • 提交包含详细错误消息和环境信息的 issue


注意: 此 MCP 服务器需要本地安装 EDA 工具。该服务器充当 AI 助手与您的本地 EDA 工具链之间的桥梁,通过自然语言交互实现复杂的硬件设计工作流程。

引用

@misc{wang2025mcp4edallmpoweredmodelcontext,
      title={MCP4EDA: LLM-Powered Model Context Protocol RTL-to-GDSII Automation with Backend Aware Synthesis Optimization}, 
      author={Yiting Wang and Wanghao Ye and Yexiao He and Yiran Chen and Gang Qu and Ang Li},
      year={2025},
      eprint={2507.19570},
      archivePrefix={arXiv},
      primaryClass={cs.AR},
      url={https://arxiv.org/abs/2507.19570}, 
}

Available Tools

6 tools
read_openlane_reportsB

Read OpenLane report files for LLM analysis. Returns all reports or specific category for detailed analysis of PPA metrics, timing, routing quality, and other design results.

Inputs: project_id (required), report_type.

run_openlaneA

Run complete ASIC design flow using OpenLane (RTL to GDSII). This process can take up to 10 minutes.

Inputs: verilog_code (required), design_name (required), clock_port, clock_period, +1 more.

simulate_verilogC

Simulate Verilog code using Icarus Verilog

Inputs: verilog_code (required), testbench_code (required).

synthesize_verilogC

Synthesize Verilog code using Yosys for various FPGA targets

Inputs: verilog_code (required), top_module (required), target.

view_gdsC

Open GDSII file in KLayout viewer

Inputs: project_id (required), gds_file.

view_waveformB

Open VCD waveform file in GTKWave viewer

Inputs: project_id (required), vcd_file.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: reading reports, running a full design flow, simulating, synthesizing, viewing GDSII files, and viewing waveforms. The descriptions specify unique actions and tools (OpenLane, Icarus Verilog, Yosys, KLayout, GTKWave), making misselection unlikely.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern (e.g., read_openlane_reports, run_openlane, simulate_verilog) with no deviations. The naming is uniform and predictable across the set, using snake_case throughout.

    Tool Count5/5

    With 6 tools, the count is well-scoped for an EDA server, covering key stages like simulation, synthesis, viewing, and analysis. Each tool earns its place by addressing a specific need in the ASIC/FPGA design workflow without being excessive or sparse.

    Completeness4/5

    The tool set covers major EDA operations: simulation, synthesis, viewing, and report analysis, with no dead ends. A minor gap exists in lacking explicit CRUD operations for design files (e.g., create/edit Verilog), but agents can work around this using the provided tools for core workflows.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      A comprehensive Model Context Protocol server that connects AI assistants to Electronic Design Automation tools, enabling Verilog synthesis, simulation, ASIC design flows, and waveform analysis through natural language interaction.
      6
      114
      ISC
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI coding agents and IDEs to lint, compile, syntax-check, and simulate Verilog/SystemVerilog designs through structured, token-efficient MCP tools with isolated containerized toolchains.
      4
      17 npm
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI coding agents and IDEs to synthesize Verilog/SystemVerilog designs with Yosys, inspect cell hierarchies and gate counts, and detect synthesis hazards like inferred latches and combinational loops before physical design flows.
      4
      10 npm
      Apache 2.0