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

當(dāng)前位置:首頁(yè) > > 處芯積律

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

一、安裝verible

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


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

image.png

二、配置emacs verilog-mode的compile工具選項(xiàng)

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

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

如果項(xiàng)目里有makefile或者M(jìn)akefile,則verilog-mode會(huì)優(yōu)先使用make。這時(shí)要么我們把lint script寫到makefile里,要么手改一下verilog-mode的代碼,如下把第4、5行,注釋起來(lái),換成第6行,跳過(guò)makefile的檢測(cè)。

(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里進(jìn)行l(wèi)int檢查

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

image.png

image.png

image.png

image.png

四、verible的lint規(guī)則

我們可以在terminal里,用命令verible-verilog-lint --help_rules all查看一共有哪些rule。如果需要enable或disable rule可以在lint選項(xiàng)里設(shè)置,rule前面帶+表示enable,帶-表示disable。解釋一下上面設(shè)置的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等。有興趣的朋友可以嘗試一下。

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