Integrating Slang Linter into the Vim ALE
This article outlines the process of incorporating slang linting tools into the Vim plugin ale.
This post guides you through setting up Verilog/SystemVerilog in Vim, covering ctags generation and linting. While vim-ale is often seen as an optimal solution, uncertainties arise in its linting capability for large projects. This prompts the consideration of decoupling Vim editing from linting. Nonetheless, valuable experiences gained during this process are documented below.
The tool universal-ctags is considered as a better replacement over traditional ctags tools. Make sure you have it installed, since its ancestors don’t seem to work for Verilog.
Although some blogs suggested to manually update the ~/.ctags
file for Verilog/Systemverilog tag generation, it seems this feature is already integrated in Universal-ctags.
Generate tags files for UVM src code and your src files separately.
ctags --languages=systemverilog -R ./
In the local .vimrc
file, add the following settings.
set tags=$WORK_HOME/tags;
set tags+=$UVM_HOME/src/tags
This file won’t take effect, unless you set the following in ~/.vimrc
, as discussed in this blog.
if getcwd() =~# '^\($your_working_dir/\)'
set secure exrc
endif
Now you can use Ctrl+]
for jumping into UVM definitions in Vim. You may also consider using the vim plugin Tagbar
.
vim-ale
serves as a Lint Engine for various of languages. To start with, we use the open source verilator
tool. To tell which linter is currently being used when opening a file in vim, check this issue, and add the following in .vimrc
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
You can also check the current value of a vim setting as in this answer
Source code parsing is primarily concerned with understanding the structure and syntax of code, while linting focuses on identifying potential issues, enforcing coding standards, and promoting good coding practices.
The results of of linters’ compatibility comparison is listed here. Nevertheless, it doesn’t provide details on how these results are obtained. Among all these tools, slang and verible demonstrated the best performance.
Instead of the standard cmake process outlined in the Slang documentation, one my need to inclusion of extra options to explicitly specify the C and CXX compilers. This adjustment becomes crucial due to the default CLANG version on MacOS being 15, while Slang mandates version 16 or higher. For more guidance, refer to this answer.
cmake -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ ...
slang seems to be a good candidate to replace the verilator, as its outputs seems similar to normal clang. TODO: merge slang with vim-ale, following the example of clang here.
FIXME: Run cmake
under the build
dir would still have 9 fail cases in total.
FIXME: The doc
is not fully generated with python errors.
Verible is another parser of SV, developed by Google groups. Nevertheless, the doc on the github and cs.opensource seems to be a little bit broken. Docs could be accessed under the doc
dir directly.
Use the following plugins for Vim.
Plugin 'SirVer/ultisnips'
Plugin 'honza/vim-snippets
Currently the Verilog/SystemVerilog snippets is already included in vim-snippets
, but UVM snippets are not. However, VS Code has an extension named sv-1800-2012, which provides auto complete for UVM snippets. We could adapt the code for vim snippets. The process is described in another article.
This article outlines the process of incorporating slang linting tools into the Vim plugin ale.
This article provides insights into considerations for SSD Controller Functional Verification.
This article outlines the process of adding UVM snippets to the vim-snippet GitHub repository.
Introduction to Non-Volatile Memory Express (NVMe) Interface for Beginners.
Introduction to Solid-State Drive (SSD) for Beginners.
This article provides a review of UVM learning resources, complete example projects, and useful tools to expedite the learning process.
The repository vim-galore is an excellent resource for Vim learners, focusing on fundamental Vim capabilities. However, to further augment Vim’s functionalit...
This post guides you through setting up Verilog/SystemVerilog in Vim, covering ctags generation and linting. While vim-ale is often seen as an optimal soluti...
本文介绍 ICC 进行特定形状的 Floorplan 设计以及PIN脚摆放的方法。
本文介绍 Synopsys 的功耗分析工具 PrimePower 的使用。
本文介绍Coverage的概念以及使用Synopsys工具对其进行分析的方法。
本文介绍 Stand-alone Virutal Sequence 的使用
本文介绍UVM Virtual Sequence/Sequencer的使用。
本文介绍 DC 综合阶段 High-Fanout Nets 可能遇到的相关问题
本文介绍Verdi的使用。
本文介绍使用ralgen自动生成UVM RAL Model的方法。
本文总结了RISC-V IP/IDE Vendor。
本文介绍Synopsys的特征化和建模工具SiliconSmart。
本文介绍Synopsys的前端设计IDE Euclide。
Welcome.