2

`define如果重新定义宏,是否可以在 Synopsys VCS 编译器中生成警告或错误?

 `define DATWIDTH_SZ  `DAT_SZ
 `define DATWIDTH_SZ  512
4

1 回答 1

0

为我工作:

$ cat tb.v
`define DATWIDTH_SZ  `DAT_SZ
`define DATWIDTH_SZ  512

module tb;
endmodule

$ vcs tb.v

                         Chronologic VCS (TM)
          Version H-2013.06-SP1 -- Thu Feb  6 14:06:48 2014
               Copyright (c) 1991-2013 by Synopsys Inc.
                         ALL RIGHTS RESERVED

This program is proprietary and confidential information of Synopsys Inc.
and may be used and disclosed only as authorized in a license agreement
controlling such use and disclosure.

Parsing design file 'tb.v'

Warning-[TMR] Text macro redefined
tb.v, 2
  Text macro (DATWIDTH_SZ) is redefined. The last definition will override 
  previous ones.
  In tb.v, 1, it was defined as `DAT_SZ

也许您使用+warn=none. 请参阅 中的选项$VCS_HOME/doc/help_vcs.txt

于 2014-02-06T19:07:50.113 回答