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-tidy] Internal generate variables of always_ff incorrectly triggers RegisterHasNoReset warning #1120

Open
Sustrak opened this issue Sep 13, 2024 · 1 comment
Assignees

Comments

@Sustrak
Copy link
Contributor

Sustrak commented Sep 13, 2024

module test;
    logic [7:0] k;
    logic clk_i;
    logic rst_ni;

    always_ff @(posedge clk_i or negedge rst_ni) begin
      if(~rst_ni) begin
        k <= '{default: '0};
      end else begin
        for(int i = 0; i < 8; i += 1) begin
          if (i % 2) k[i] <= i[0];
          else k[i] <= i[1];
        end
      end
    end
endmodule

The i increment i += 1 incorrectly triggers the RegisterHasNoReset warning:

test.sv:10:31: warning: [SYNTHESIS-1] register 'i' has no value on reset, but the always_ff block has the reset signal on the sensitivity list. Consider moving the register to an always_ff that has no reset or set a value on reset
        for(int i = 0; i < 8; i += 1) begin
@MikePopoloski
Copy link
Owner

@Sustrak are you planning on providing a fix for this?

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