在windows的环境下用sublime text 3 与 iverilog联合实现实时检查verilog语法
一, 安装插件sublimeLinter
按住"ctrl"+“shift”+"p"调出命令面板
输入install 调出 Install Package 选项并回车,然后然后会弹出个搜索框(再弹出该搜索框之前可能有一定网络延迟还请耐心等待)
再在搜索框中输入sublimeLinter并点击安装
sublimeLinter不是某种特定语言的特定编译器,而是一个基础,安装了这个插件后我们就可以安装各种其他的Linter。在编译Verilog中有很多的Linter,可以用modelsim的或者vivado的,亦或是verilator。
二,安装插件SublimeLinter-contrib-iverilog
用同样的方法调出搜索框并安装SublimeLinter-contrib-iverilog
三,安装iverilog
安装完成后点击“首选项(Preferences)“> Package Settings > SublimeLinter-contrib-iverilog > README
可以看到这个插件的部分描述
###Linter installation
Before installing this plugin, you must ensure thativerilog
is installed on your system.
To installiverilog
, please see [this] (https://iverilog.wikia.com/wiki/Installation_Guide)
进入该网站后往下拉直到最后如图,点击蓝色的超链接(该网站也提供了其它系统支持的iverilog)
点击了蓝色的超链接后选择对应的版本号下载即可,安装时一路next就好,记住勾选上添加环境变量的选项。
四,sublimeLinter settings
这个时候我们又回到SublimeLinter-contrib-iverilog的README可以看到这样的描述
- If there is no error, the
master
branchiverilog
should have been installed to/usr/local/iverilog
.
If you use neither Windows nor Ubuntu,- It should be easy to modify
ubuntu-compile-iverilog-mater.sh
to fit your OS.
Afteriverilog
has been installed,- Update SublimeLinter’s PATH in SublimeLinter’s settings file.
"paths": { "linux": [ "/usr/local/iverilog/bin", ], "osx": [], "windows": [ "C:\\iverilog\\bin", ], },
- Pass the
-i
flag to the linter by modifying SublimeLinter’s settings file."linters": { "iverilog": { "disable": false, "args": ["-i"], // add the "-i" flag "excludes": [], }, },
大概意思呢就是这是我们要修改的设置,这个时候我们需要点击“首选项(Preferences)“> Package Settings > SublimeLinter > Setting
可以看到分为两大块,左边是模板(不可编辑),右边是用户自定义设置(可编辑)这时将刚刚README里看到的复制进去如图:
这里有个注意事项,复制进USERS的大括号里。不然会报错。这一步我复制错了就挺难受的。还有个注意事项,环境变量用\分割,不然也会报错。到这里我们就联合成功了。
五,总结
多看README以及指导文档。