跳转到内容

快速开始

请根据以下步骤,快速开始体验 Vizsla。

在 VS Code 的扩展面板中搜索显示名 Vizsla 并安装即可。

用 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 索引。

扩展激活后, 左侧状态栏会显示 Vizsla 服务器状态:

  • Vizsla Starting: 正在启动。
  • Vizsla Ready: 服务器已启动。
  • Vizsla Error: 启动失败, 点击状态栏打开输出通道。
  • Vizsla Stopped: 服务器已停止。

打开 .v, .vh, .sv, .svh.svi 文件。VS Code 应该把它识别为 Verilog 或 SystemVerilog, 并启用语法高亮和语言服务。

你可以按这个顺序验证:

  1. 写一处明显语法错误, 查看 Problems 面板中的诊断。
  2. 在模块名、信号名或实例名上执行 Go to DefinitionGo to Declaration
  3. 在实例端口连接、参数赋值、表达式或预处理位置触发补全。
  4. 把光标放到符号上查看悬停说明。
  5. 执行 Format Document。默认格式化会调用 verible-verilog-format, 如果本机没有这个工具, 请配置 vizsla.formatter.path 或先跳过格式化验证。

配置变更后, 如果 VS Code 提示重启语言服务器, 选择 Restart

需要跨文件 semantic diagnostics 和更准确的端口/参数相关能力时, 请在 vizsla.toml 中写入实际的 sourcesinclude_dirs, 并按需补充 defines, librariestop_modules