Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  Voneline
  WFH
General Info
  Papers

Issue #1431

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

Added by Bogdan Vukobratovic 5 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
TranslationError
% Done:

0%


Description

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.

err_report.tar.gz - Files needed to recreate the issue, as well as verilated files (5.71 KB) Bogdan Vukobratovic, 05/06/2019 02:02 PM

History

#1 Updated by Wilson Snyder 5 months ago

  • Category set to TranslationError
  • Status changed from New to Resolved
  • Assignee set to Wilson Snyder

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

Fixed in git towards 4.014.

#2 Updated by Wilson Snyder 5 months ago

  • Status changed from Resolved to Closed

In 4.014.

Also available in: Atom