nlint注意事项
想要知道一些常用操作,或者看到了不懂的地方,第一时间找软件的help,在软件界面左上角或者右上角!!!
rule的help是在软件的右上角。
比如想知道这个规则具体是什么样子,就找help里面,既有详细的说明,又有可供参考的例子。
如果找不到,可以在论坛找工具的资料,例如在eetop等(eetop虽然要充值,但是资料真的是很多,大家自己权衡)。
导入设计之后,应当先点击 run->project setting,看一下module top是不是我们希望的顶层。
如果不是我们预期的顶层,则需要修改为正确的顶层,因为nlint只检查顶层及其以下的文件。
nlint启动
在linux 脚本里面写
nLint -gui -verilog -2001 -beauty -detail -ex_clk -top $top_module -rs $rsfile -f ../scripts/lint_flist -out lint.log
-gui是可视化界面
-verilog -2001是输入规则
-beauty是整理文本,让文本整齐
-detail 具体含义还不知道
-ex_clk 具体含义还不知道
-top 是选取顶层文件 $top_module
在文件另外的地方写 top_module = spi_top,这样顶层是spi_top
-rs $rsfile是选择规则文件 rsfile = nlint_rules.rs
-f ../scripts/lint_flist 是其他文件
-out lint.log 是输出报告文件
上述有些操作也可以在可视化界面操作,比如rs文件load,可以在tools->rule organizer里面操作,file->open->browse找到rs文件即可
nlint规则
首先说一下,nlint的help在顶部右侧,详细的内容看help。
在规则界面
E/D就是enable/disenable的意思,也就是启用还是不启用的意思
TOFF是 suppress by translate off pragma的意思。
在help找到如下描述
this command allows you to set the current rule to be suppressed by the Synopsys pragma // synopsys translate_off one by one . the pragma will suppress the synthesizable or non-synthesizable rules for coding style checking.
this is a toggle switch,which means that if the current rule is suppressed by the pragma,clicking this command will disable the suppression
结合上面两个内容来看,suppress by translate off pragma,我是这么理解的。
当verilog出现了 //synopsys translate_off //synopsys translate_on 这两个语句,和其中间的代码时,由于我们编写者认为,这中间的代码是用来辅助仿真的,而不是用来综合。
但是nlint可能还是会检查出来说,诶,你这一段代码里面有错,它是不可综合的。
我们编写者本身就知道它是不可综合的,所以我们觉得这样子检查是没有必要的,此时,我们就会勾选
TOFF这个这个框框。
severity是选择严重等级的操作有10级可选
argument1
argument2
这两个是参数的意思,有些规则是有参数的,比如规定函数的堆栈深度超过哪个值就报警,它会放出一个参数来让你填,你填1000,那么只有在堆栈深度超过1000的时候会报错
indexname颜色不同,是因为根据的语法规则不同,例如verilog 2001和system verilog的语法不同,它的这个框的颜色就不同