Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple local variables with the same name ( __Vtable1_valid ) generated in a header file when using SystemVerilog interfaces in a certain situation #1431

Closed
veripoolbot opened this issue May 6, 2019 · 2 comments
Assignees
Labels
resolution: fixed Closed; fixed

Comments

@veripoolbot
Copy link
Contributor


Author Name: Bogdan Vukobratovic (@bogdanvuk)
Original Redmine Issue: 1431 from https://www.veripool.org

Original Assignee: Wilson Snyder (@wsnyder)


Hi,

I've stumbled upon a situation where verilator generates invalid C++ code, i.e. it generates multiple local variables with the same name: __Vtable1_valid.

Please find attached the minimal code I could come up with to reproduce the issue. The code models a demultiplexer in SystemVerilog (wrap_demux.sv), with 3 outputs with handshaking interface for each one. If I remove one output, the issue is gone.

If you take a look at "obj_dir/Vwrap_demux.h", you will see the following erroneous code:

     static VL_ST_SIG8(__Vtable1_valid[64],0,0);
     static VL_ST_SIG8(__Vtable1_valid[64],0,0);
     static VL_ST_SIG8(__Vtable1_valid[64],0,0);

Internally, "wrap_demux.sv" uses interfaces which are defined in "dti.sv". If I remove the interfaces, the issue is gone.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-05-06T23:34:56Z


Thanks for the good test. Bug in the table code which BTW can be disabled with -Ot.

Fixed in git towards 4.014.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-05-09T01:38:21Z


In 4.014.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: fixed Closed; fixed
Projects
None yet
Development

No branches or pull requests

2 participants