日本黄色一级经典视频|伊人久久精品视频|亚洲黄色色周成人视频九九九|av免费网址黄色小短片|黄色Av无码亚洲成年人|亚洲1区2区3区无码|真人黄片免费观看|无码一级小说欧美日免费三级|日韩中文字幕91在线看|精品久久久无码中文字幕边打电话

當前位置:首頁 > > 處芯積律

介紹emacs中調(diào)用verible lint來檢查verilog語法方法。

一、安裝verible

從?https://github.com/chipsalliance/verible/releases?下載提前編譯好的verible二進制文件,解壓即可使用。


二進制包包含以下這個小工具,加進PATH環(huán)境變量里。這次我們主要關注verible-verilog-lint這個工具。

image.png

二、配置emacs verilog-mode的compile工具選項

~/.emacs里增加verilog-tool和verilog-linter的設置。

(custom-set-variables?'(verilog-tool 'verilog-linter)?'(verilog-linter "verible-verilog-lint --rules -no-tabs,-no-trailing-spaces,-explicit-parameter-storage-type"))

如果項目里有makefile或者Makefile,則verilog-mode會優(yōu)先使用make。這時要么我們把lint script寫到makefile里,要么手改一下verilog-mode的代碼,如下把第4、5行,注釋起來,換成第6行,跳過makefile的檢測。

(defun verilog-set-compile-command () ?? (interactive) ?? (cond ??? ;;((or?(file-exists-p?"makefile");If there is a makefile,?use?it ??? ;; ? ? (file-exists-p?"Makefile")) ??? ? (nil ? ?? ? ? (set (make-local-variable?'compile-command) "make ")) ??? ? (t ? ?? ? ? (set (make-local-variable 'compile-command)?? ? ? ? (if?verilog-tool ? ? ? ? ? ??? ? ? ? ? (let ((cmd (symbol-value verilog-tool))) ? ? ? ? ? ? ??? ? ? ? ? ? (if?(string-match?"%s"?cmd) ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? (format?cmd (or?buffer-file-name?"")) ? ? ? ? ? ? ? ?? ? ? ? ? ? ? (concat cmd?" "?(or?buffer-file-name?""))))?"")))) ?? (verilog-modify-compile-command))

三、emacs里進行l(wèi)int檢查

在emacs菜單->Verilog->Compile,或者M-x compile,emacs會自動調(diào)出設置的lint工具和參數(shù),按即可對當前verilog進行Verilog檢查。如果有報錯,鼠標點擊報錯,可以自動跳轉(zhuǎn)到代碼對應的地方。

image.png

image.png

image.png

image.png

四、verible的lint規(guī)則

我們可以在terminal里,用命令verible-verilog-lint --help_rules all查看一共有哪些rule。如果需要enable或disable rule可以在lint選項里設置,rule前面帶+表示enable,帶-表示disable。解釋一下上面設置的lint參數(shù),表示disable no-tabs、no-trailing-spaces、explicit-parameter-storage-type三條rule。

verible-verilog-lint?--rules?-no-tabs,-no-trailing-spaces,-explicit-parameter-storage-type

五、配置其它lint

理論上可以支持任何verilog編譯工具,如vcs、xrun等。有興趣的朋友可以嘗試一下。

本站聲明: 本文章由作者或相關機構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點,本站亦不保證或承諾內(nèi)容真實性等。需要轉(zhuǎn)載請聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請及時聯(lián)系本站刪除。
關閉