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

Duplicate wires and assign-to-self in Verilog output #2491

Open
JulianKemmerer opened this issue Sep 12, 2023 · 1 comment
Open

Duplicate wires and assign-to-self in Verilog output #2491

JulianKemmerer opened this issue Sep 12, 2023 · 1 comment

Comments

@JulianKemmerer
Copy link

JulianKemmerer commented Sep 12, 2023

Description
synth --out=verilog produces duplicate wire definitions. This is a compile error in tools like Verilator. Also code has assign of a wire to itself emitted - probably also an error.

Expected behaviour
Only one copy of wire declared instead of multiple. No assignment of wire to self.

How to reproduce?

cd dup_wires
/usr/local/bin/ghdl synth --std=08 -frelaxed --out=verilog `cat vhdl_files.txt` -e top > top.v
cat top.v | grep const_sr_1_main_c_l114_c10_7dba_return_output 

See duplicate definition of const_sr_1_... wire in output:

$ cat top.v | grep const_sr_1_main_c_l114_c10_7dba_return_output 
  wire [31:0] const_sr_1_main_c_l114_c10_7dba_return_output;
  wire [31:0] const_sr_1_main_c_l114_c10_7dba_return_output;
  assign return_output = const_sr_1_main_c_l114_c10_7dba_return_output;
  assign const_sr_1_main_c_l114_c10_7dba_return_output = const_sr_1_main_c_l114_c10_7dba_return_output; // (signal)
    .return_output(const_sr_1_main_c_l114_c10_7dba_return_output));

Context

GHDL 4.0.0-dev (3.0.0.r448.g2245a7fd1) [Dunoon edition]

Verilator 5.015 devel rev v5.014-50-g5b7e32581

dup_wires.zip

Thank you again for your time!

@tgingold
Copy link
Member

Yes, I think this is a known issue. I need to write a pass to distinguish those duplicated names.

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

No branches or pull requests

2 participants