You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Author Name: Pawel Jewstafjew
Original Redmine Issue: 306 from https://www.veripool.org
Original Date: 2010-12-02
Original Assignee: Wilson Snyder (@wsnyder)
Verilator version: 3.805 (and, at least 3.803)
preprocessor 'define should be cleared at the scope
instead it is still active is all the files loaded afterwards
For example, two modules are instantiated for top.v
mod_a i_a ();
mod_b i_b ();
in mod_a.v: define MOD_A_DEF define MY_DEF A
in mod_b.v: define MOD_B_DEF define MY_DEF B
ifdef MOD_A_DEF this should not be defined here !!! endif
Verilator output:
%Warning-REDEFMACRO: mod_b.v:6: Redefining existing define: MY_DEF, with different value: B
%Warning-REDEFMACRO: Use "/* verilator lint_off REDEFMACRO */" and lint_on around source to disable this message.
%Warning-REDEFMACRO: mod_a.v:13: Previous definition is here, with value: A
%Error: mod_b.v:8: Unsupported: SystemVerilog 2005 reserved word not implemented:
this
%Error: mod_b.v:8: syntax error, unexpected "not", expecting "IDENTIFIER"
<-- preprocessor definitions from mod_a.v are visible in mod_b.v
verilator invocation:
verilator -cc top.v
example files are attached
The text was updated successfully, but these errors were encountered:
Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2010-12-02T19:07:36Z
Are you comparing this against another simulator?
This is unfortunately the way it must work, it wouldn't have been my choice :) `defines have effect across the entire compilation unit, per spec, and many designs require that.
If you don't want this, use `undefineall at the end of your modules. I might be convinced to make each file on the command line a separate compilation unit, but you need to be sure this is what you really want, as few other tools support that so it might not make for a portable environment.
Author Name: Pawel Jewstafjew
Original Redmine Issue: 306 from https://www.veripool.org
Original Date: 2010-12-02
Original Assignee: Wilson Snyder (@wsnyder)
Verilator version: 3.805 (and, at least 3.803)
preprocessor 'define should be cleared at the scope
instead it is still active is all the files loaded afterwards
For example, two modules are instantiated for top.v
mod_a i_a ();
mod_b i_b ();
in mod_a.v:
define MOD_A_DEF
define MY_DEF Ain mod_b.v:
define MOD_B_DEF
define MY_DEF Bifdef MOD_A_DEF this should not be defined here !!!
endifVerilator output:
%Warning-REDEFMACRO: mod_b.v:6: Redefining existing define: MY_DEF, with different value: B
%Warning-REDEFMACRO: Use "/* verilator lint_off REDEFMACRO */" and lint_on around source to disable this message.
%Warning-REDEFMACRO: mod_a.v:13: Previous definition is here, with value: A
%Error: mod_b.v:8: Unsupported: SystemVerilog 2005 reserved word not implemented:
this
%Error: mod_b.v:8: syntax error, unexpected "not", expecting "IDENTIFIER"
<-- preprocessor definitions from mod_a.v are visible in mod_b.v
verilator invocation:
verilator -cc top.v
example files are attached
The text was updated successfully, but these errors were encountered: