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 declaration on generate tristate UDP #1347

Closed
veripoolbot opened this issue Sep 14, 2018 · 2 comments
Closed

Duplicate declaration on generate tristate UDP #1347

veripoolbot opened this issue Sep 14, 2018 · 2 comments
Assignees

Comments

@veripoolbot
Copy link

@veripoolbot veripoolbot commented Sep 14, 2018


Author Name: Tomas Dzetkulic
Original Redmine Issue: 1347 from https://www.veripool.org

Original Assignee: Wilson Snyder (@wsnyder)


  parameter W = 1;

  output [W-1:0]f;
  input [W-1:0]a, b;

  supply0 gnd;
  supply1 vcc;

  generate
     genvar i;
     for (i = 0; i < W; i = i + 1) begin
       wire w;
       pmos (f[i], w, a[i]);
       pmos (w, vcc, b[i]);
       nmos (f[i], gnd, a[i]);
       nmos (f[i], gnd, b[i]);
     end
  endgenerate
endmodule  // fnor2

module test(f, a, b);
  output [1:0]f;
  input [1:0]a, b;

  fnor2 #(2) n(f, a, b);
endmodule
$ verilator --version
Verilator 3.916 2017-11-25 rev verilator_3_914-65-g0478dbd
$ verilator -I --cc bug.v --trace --top-module test -Mdir ../obj -CFLAGS "-O2 -std=c++11 -fPIC"
%Error: bug.v:13: Duplicate declaration of signal: test.n.w__en
%Error: bug.v:13: ... Location of original declaration
%Error: Exiting due to 1 error(s)
%Error: Command Failed /usr/bin/verilator_bin -I --cc bug.v --trace --top-module test -Mdir ../obj -CFLAGS '-O2 -std=c++11 -fPIC'

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Sep 14, 2018


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-09-14T10:57:16Z


Thanks for a good testcase.

The tristate removal needed to be after uniqifing generate names.

Fixed in git towards 4.000.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Sep 16, 2018


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-09-16T21:28:55Z


In 4.002.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.