feat:接入iverilog工具

- 将iverilog可以随着插件的下载而下载
- 用户输入自然语言就可以控制生成对应的VCD文件
This commit is contained in:
Roe-xin
2025-12-15 11:09:03 +08:00
parent 94225a3525
commit 22b9a0ed13
71 changed files with 2020 additions and 87 deletions

View File

@ -0,0 +1,183 @@
# Iverilog 工具下载和安装说明
## 重要提示
由于网络限制,需要手动下载 iverilog 工具并放置到插件包中。
## 快速开始
### 步骤 1下载 Iverilog
**Windows x64 用户:**
1. 访问官方下载页面http://bleyer.org/icarus/
2. 下载文件:`iverilog-v12-20220611-x64_setup.exe` (约 18.2 MB)
3. 保存到任意位置
**备用下载地址:**
- GitHub Releases: https://github.com/steveicarus/iverilog/releases
- SourceForge: https://sourceforge.net/projects/iverilog/
### 步骤 2安装到临时目录
1. 运行下载的安装程序 `iverilog-v12-20220611-x64_setup.exe`
2. 选择安装路径(建议:`C:\iverilog-temp`
3. 完成安装
### 步骤 3复制文件到插件目录
**需要复制的文件:**
#### A. 可执行文件(从 `C:\iverilog-temp\bin\` 复制到 `tools\iverilog\bin\`
```
iverilog.exe # Verilog 编译器
vvp.exe # Verilog 仿真器
```
#### B. 依赖的 DLL 文件(从 `C:\iverilog-temp\bin\` 复制到 `tools\iverilog\bin\`
```
libgcc_s_seh-1.dll
libwinpthread-1.dll
libstdc++-6.dll
```
如果运行时提示缺少其他 DLL也需要从安装目录复制。
#### C. 库文件目录(重要!)
将整个 `C:\iverilog-temp\lib\` 目录复制到 `tools\iverilog\lib\`
最终目录结构:
```
tools\iverilog\lib\ivl\
├── system.vpi
├── v2005_math.vpi
├── vhdl_sys.vpi
└── ... (其他 .vpi 和 .vpl 文件)
```
### 步骤 4验证安装
在命令行中运行:
```bash
cd "D:\IC Coder Plugin\ic-coder\tools\iverilog\bin"
.\iverilog.exe -V
```
应该看到版本信息:
```
Icarus Verilog version 12.0 (stable) (s20220611-xxx)
```
### 步骤 5清理
安装完成后,可以:
1. 卸载临时安装的 iverilog通过控制面板
2. 删除临时安装目录 `C:\iverilog-temp`
## 最终目录结构
```
D:\IC Coder Plugin\ic-coder\
└── tools\
└── iverilog\
├── bin\
│ ├── iverilog.exe
│ ├── vvp.exe
│ ├── libgcc_s_seh-1.dll
│ ├── libwinpthread-1.dll
│ └── libstdc++-6.dll
├── lib\
│ └── ivl\
│ ├── system.vpi
│ ├── v2005_math.vpi
│ └── ... (其他库文件)
├── README.md
├── INSTALL.md
└── DOWNLOAD_INSTRUCTIONS.md (本文件)
```
## 文件大小参考
- `iverilog.exe`: ~2 MB
- `vvp.exe`: ~1 MB
- DLL 文件: ~1-2 MB
- lib/ivl/ 目录: ~3-5 MB
- **总计**: 约 7-10 MB
## 自动化脚本(可选)
如果你已经安装了 iverilog可以使用以下 PowerShell 脚本自动复制文件:
```powershell
# 设置路径
$iverilogInstallPath = "C:\iverilog" # 修改为你的安装路径
$pluginToolsPath = "D:\IC Coder Plugin\ic-coder\tools\iverilog"
# 创建目录
New-Item -ItemType Directory -Force -Path "$pluginToolsPath\bin"
New-Item -ItemType Directory -Force -Path "$pluginToolsPath\lib"
# 复制可执行文件
Copy-Item "$iverilogInstallPath\bin\iverilog.exe" "$pluginToolsPath\bin\"
Copy-Item "$iverilogInstallPath\bin\vvp.exe" "$pluginToolsPath\bin\"
# 复制 DLL 文件
Copy-Item "$iverilogInstallPath\bin\*.dll" "$pluginToolsPath\bin\"
# 复制库文件
Copy-Item "$iverilogInstallPath\lib\*" "$pluginToolsPath\lib\" -Recurse
Write-Host "复制完成!"
```
保存为 `copy-iverilog.ps1` 并在 PowerShell 中运行。
## 许可证信息
Icarus Verilog 使用 **GPL v2+** 许可证,允许自由分发。
- 官方网站http://iverilog.icarus.com/
- GitHubhttps://github.com/steveicarus/iverilog
- 许可证文本https://github.com/steveicarus/iverilog/blob/master/COPYING
## 需要帮助?
如果遇到问题,请:
1. 检查是否复制了所有必需的文件
2. 确认 DLL 文件都在 bin 目录中
3. 验证 lib/ivl 目录包含所有 .vpi 文件
4. 查看插件的错误日志
## 其他平台
### macOS
```bash
# 使用 Homebrew 安装
brew install icarus-verilog
# 复制文件到插件目录
cp /usr/local/bin/iverilog "tools/iverilog/bin/"
cp /usr/local/bin/vvp "tools/iverilog/bin/"
cp -r /usr/local/lib/ivl "tools/iverilog/lib/"
```
### Linux
```bash
# Ubuntu/Debian
sudo apt-get install iverilog
# 复制文件到插件目录
cp /usr/bin/iverilog "tools/iverilog/bin/"
cp /usr/bin/vvp "tools/iverilog/bin/"
cp -r /usr/lib/ivl "tools/iverilog/lib/"
```
---
**注意**:完成上述步骤后,插件即可使用内置的 iverilog 工具进行 Verilog 编译和 VCD 文件生成。