0

我已将此代码运行到 lint 检查器(spyglass):

     1 module test(
     2         output  [7:0] O_O,
     3         input   [7:0] I_1,
     4         input   [7:0] I_2
     5 );
     6
     7         wire    [14:0] result;
     8
     9         assign result = (I_1 + I_2) << 5;
    10         assign O_O = result[7:0];
    11 endmodule

我收到此警告消息:

    Bit-width mismatch in signal assignment (LHS: 'O_O' width 8 should match RHS: '((I_1 + I_2) << 5)' width 14). [Hierarchy:test]

为了避免这个警告,我改变了我的代码是这样的:

     1 module test(
     2         output  [7:0] O_O,
     3         input   [7:0] I_1,
     4         input   [7:0] I_2
     5 );
     6         wire    [15:0] result;
     7
     8         assign result = (I_1 + I_2) << 5;
     9         assign O_O = result[7:0];
    10 endmodule

然后收到此警告消息

    Port 'O_O[4:0]' is 'tied-low'

有什么建议可以解决这些警告吗?

4

4 回答 4

1

这行得通吗?

 1 module test(
 2         output  [7:0] O_O,
 3         input   [7:0] I_1,
 4         input   [7:0] I_2
 5 );
 6
 7         wire    [14:0] result = (I_1 + I_2) << 5;
 8
 9         assign O_O = result[7:0];
10 endmodule
于 2012-01-24T16:21:56.743 回答
1

必须有一种方法可以告诉您的 lint 检查器您希望这些位始终为零。您必须阅读文档以了解如何 - 也许您可以在源代码中添加一个特殊注释,或者一个单独的配置文件来说明“在这行代码中预期这个警告”

于 2012-01-24T11:40:53.847 回答
0

您可以创建一个豁免文件以放弃 spyglass 中的所有此类警告。

于 2012-05-27T05:12:30.067 回答
0

在警告窗口中,可以选择将此警告转移到豁免文件,即

.awl
.swl

这将显示有意添加的内容并需要忽略,不再反映在警告窗口中。

于 2016-03-16T06:36:07.907 回答