Skip to content

[feature] Infinite loop error/warning #1638

@evanwporter

Description

@evanwporter

Is your feature request related to the C++ slang project or the pyslang Python bindings?
C++ slang

Is your feature request related to a problem? Please describe.
Currently when I have code like the following:

module Test(input logic clk);
  logic [7:0] test_array;

  always_ff @(posedge clk) begin
    for (logic [2:0] i = 0; i < 8; i++) begin
      test_array[i] <= 1'b0;
    end
  end
endmodule

I'd expect to get a warning or an error that i is not big enough and that that this will result in an infinite loop. However, slang server does not give this.

Describe the solution you'd like
An error would be nice.

Describe alternatives you've considered
Double check loops, I guess?

Additional context
I am using slang-server as my lsp.

This feature is very much nice-to-have, but it shouldn't be a priority; it's more of an edge case error than anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions