Metadata-Version: 2.4
Name: fpga-testbench-mcp
Version: 0.1.0
Summary: FPGA 测试平台知识库 MCP Server — 为 FPGA 验证工程师提供 Verilog testbench 知识查询、代码模板和验证方法指导
Project-URL: Homepage, https://github.com/courviv/fpga-testbench-knowledge-mcp-server
Project-URL: Repository, https://github.com/courviv/fpga-testbench-knowledge-mcp-server
Project-URL: Issues, https://github.com/courviv/fpga-testbench-knowledge-mcp-server/issues
Author: FPGA Testbench MCP Contributors
License: MIT
License-File: LICENSE
Keywords: eda,fpga,mcp,model-context-protocol,testbench,verification,verilog
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
Requires-Python: >=3.13
Requires-Dist: mcp[cli]>=1.27.2
Requires-Dist: python-frontmatter>=1.1
Requires-Dist: pyyaml>=6.0
Description-Content-Type: text/markdown

# FPGA Testbench Knowledge MCP Server

FPGA 测试平台知识库 MCP Server —— 为 FPGA 验证工程师提供 Verilog testbench 相关的知识查询、代码模板和验证方法指导。

## 功能

- **知识查询** — 10 篇中文知识文章，覆盖验证方法学、总线协议、Testbench 组件、断言和仿真工具
- **代码模板** — 3 个 Verilog 模板（基础 testbench、时钟生成、AXI4-Lite BFM），支持参数定制
- **智能搜索** — 全文搜索知识库，按相关性排序
- **引导式 Prompt** — 创建 testbench 和调试仿真的分步指导

## 安装

### 从 PyPI 安装

```bash
pip install fpga-testbench-mcp
```

### 从源码安装

```bash
git clone <repo-url>
cd fpga-testbench-knowledge-mcp-server
uv sync
```

## 使用

### 开发调试 (MCP Inspector)

```bash
uv run mcp dev src/fpga_testbench_mcp/server.py
```

### 配置 Claude Desktop

在 `claude_desktop_config.json` 中添加：

```json
{
  "mcpServers": {
    "fpga-testbench-knowledge": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "D:\\527\\fpga-testbench-knowledge-mcp-server",
        "python",
        "-m",
        "fpga_testbench_mcp.server"
      ]
    }
  }
}
```

或使用入口脚本：

```json
{
  "mcpServers": {
    "fpga-testbench-knowledge": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "D:\\527\\fpga-testbench-knowledge-mcp-server",
        "fpga-testbench-mcp"
      ]
    }
  }
}
```

## 知识库内容

| 类别 | 文章数 | 内容 |
|------|--------|------|
| 验证方法学 | 2 | 定向测试方法、代码覆盖率基础 |
| 总线协议 | 2 | AXI4 协议 BFM 设计、Avalon-MM 接口 |
| Testbench 组件 | 3 | 时钟复位生成、BFM 设计模式、结果检查方法 |
| 断言与检查 | 1 | SystemVerilog Assertion 入门 |
| 仿真工具 | 2 | ModelSim/QuestaSim 指南、Vivado XSim 指南 |

## 开发

```bash
# 运行测试
uv run python -m pytest tests/ -v
```

## 项目结构

```
src/fpga_testbench_mcp/
├── server.py              # FastMCP 主入口
├── resources/
│   └── loader.py          # 知识库加载 & 搜索
├── tools/                 # MCP Tools (在 server.py 中注册)
├── prompts/               # MCP Prompts (在 server.py 中注册)
└── knowledge_base/        # 知识库内容
    ├── index.yaml         # 总索引
    ├── methodology/       # 验证方法学
    ├── bus-protocols/     # 总线协议
    ├── components/        # Testbench 组件
    ├── assertions/        # 断言
    ├── templates/         # Verilog 代码模板
    └── tools/             # 仿真工具指南
```
