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

read_verilog gives multiple drivers to variables initialized both in declaration and initial #4792

Open
widlarizer opened this issue Dec 2, 2024 · 0 comments
Labels
pending-verification This issue is pending verification and/or reproduction

Comments

@widlarizer
Copy link
Collaborator

Version

Yosys 0.47 (git sha1 647d61dd9, ccache clang++ 16.0.6 -fPIC -O3 -flto=thin)

On which OS did this happen?

Linux

Reproduction Steps

read_verilog a.v; proc -noopt; check

module a;
	integer i = 1'b1;
	initial begin
		i = i + 1'b0;
	end
endmodule

Expected Behavior

The tool evaluates the assignments in some order (Verilog 2005 LRM 6.2.1). For SystemVerilog, the order has to be such that the declaration assignment is evaluated first (SV 2012 LRM 6.8).

Actual Behavior

The tool evaluates both assignments with no concept of sequence, creating conflicting drivers for the variable and a logic loop. This could lead to incorrect synthesis and prevents efficient optimization (see #4782 #4783)

@widlarizer widlarizer added the pending-verification This issue is pending verification and/or reproduction label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-verification This issue is pending verification and/or reproduction
Projects
None yet
Development

No branches or pull requests

1 participant