快速开始
请根据以下步骤,快速开始体验 Vizsla。
1. 安装扩展
Section titled “1. 安装扩展”在 VS Code 的扩展面板中搜索显示名 Vizsla 并安装即可。
2. 打开工程目录
Section titled “2. 打开工程目录”用 VS Code 打开包含 RTL 源码的目录。没有 vizsla.toml 或旧版 vizsla_config.toml 时, 扩展会创建默认 vizsla.toml 并弹出提示:
#:schema https://pascal-lab.github.io/vizsla/schemas/v1/vizsla.schema.json# Default startup manifest. Omitting sources enables best-effort indexing for navigation# without semantic diagnostics. Fill shell globs, for example sources = ["rtl/**"]# and include_dirs = ["include"], to enable semantic diagnostics.# Set sources = [] to disable workspace indexing.这个默认清单会索引 workspace 下的 Verilog/SystemVerilog 文件, 让跨文件跳转、引用等读能力开箱可用; 但不会建立编译 profile 或运行跨文件 semantic diagnostics。显式写入 sources = [] 可关闭 workspace 索引。
3. 确认状态栏
Section titled “3. 确认状态栏”扩展激活后, 左侧状态栏会显示 Vizsla 服务器状态:
Vizsla Starting: 正在启动。Vizsla Ready: 服务器已启动。Vizsla Error: 启动失败, 点击状态栏打开输出通道。Vizsla Stopped: 服务器已停止。
4. 打开 Verilog/SystemVerilog 文件
Section titled “4. 打开 Verilog/SystemVerilog 文件”打开 .v, .vh, .sv, .svh 或 .svi 文件。VS Code 应该把它识别为 Verilog 或 SystemVerilog, 并启用语法高亮和语言服务。
5. 试用核心功能
Section titled “5. 试用核心功能”你可以按这个顺序验证:
- 写一处明显语法错误, 查看
Problems面板中的诊断。 - 在模块名、信号名或实例名上执行
Go to Definition或Go to Declaration。 - 在实例端口连接、参数赋值、表达式或预处理位置触发补全。
- 把光标放到符号上查看悬停说明。
- 执行
Format Document。默认格式化会调用verible-verilog-format, 如果本机没有这个工具, 请配置vizsla.formatter.path或先跳过格式化验证。
配置变更后, 如果 VS Code 提示重启语言服务器, 选择 Restart。
需要跨文件 semantic diagnostics 和更准确的端口/参数相关能力时, 请在 vizsla.toml 中写入实际的 sources 或 include_dirs, 并按需补充 defines, libraries 或 top_modules。