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

slang-netlist issue with net declaration assignments #1124

Open
udif opened this issue Sep 15, 2024 · 0 comments
Open

slang-netlist issue with net declaration assignments #1124

udif opened this issue Sep 15, 2024 · 0 comments

Comments

@udif
Copy link
Contributor

udif commented Sep 15, 2024

@jameshanlon
Describe the bug
It seems that slang-netlist ignores the assignment part of net declaration assignments.

To Reproduce
Please run the following file (test.v):

module t;
reg a, b;
wire c;
initial begin
  a <= 1;
  b <= a;
end
assign c = a;
wire d = a;
wire e = d;
endmodule

with

build/bin/slang-netlist --netlist-dot - test.v

The output we get is:

digraph {
  node [shape=record];
  N1 [label="Variable declaration\nt.a"]
  N2 [label="Variable declaration\nt.b"]
  N3 [label="Variable declaration\nt.c"]
  N4 [label="Variable declaration\nt.d"]
  N5 [label="Variable declaration\nt.e"]
  N6 [label="a[0:0]\n[Assigned to]"]
  N7 [label="b[0:0]\n[Assigned to]"]
  N8 [label="a[0:0]\n"]
  N9 [label="c[0:0]\n[Assigned to]"]
  N10 [label="a[0:0]\n"]
  N11 [label="Variable alias\nt.a"]
  N6 -> N11
  N7 -> N2
  N8 -> N7
  N9 -> N3
  N10 -> N9
  N11 -> N8
  N11 -> N10
}

As you can see, there is no reference to the d and e net declaration assignments. Their declaration nodes, N4 and N5 are not connected in any way to the rest of the netlist.

Additional context
I have a pending PR which prints a warning for unused variable declarations (pretty trivial but useful), which gets incorrectly triggered by those issues.

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

No branches or pull requests

2 participants