Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Multiple local variables with the same name ( __Vtable1_valid ) generated in a header file when using SystemVerilog interfaces in a certain situation #1431
Original Assignee: Wilson Snyder (@wsnyder)
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:
Internally, "wrap_demux.sv" uses interfaces which are defined in "dti.sv". If I remove the interfaces, the issue is gone.