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

Assignment inside for loop causes SEGV #2692

Open
matsud224 opened this issue Dec 4, 2024 · 0 comments
Open

Assignment inside for loop causes SEGV #2692

matsud224 opened this issue Dec 4, 2024 · 0 comments

Comments

@matsud224
Copy link

matsud224 commented Dec 4, 2024

Following foo module causes SEGV while read_systemverilog command.

// bad.v
module foo
(
  output wire [1:0] out
);

  function [1:0] func1(input [1:0] a);
    reg [3:0] state[4];
    integer i;
    begin
      for (i = 0; i < 4; i = i + 1) begin
        state[i] = 2'b0;
        state[i][i] = 1'b1;
      end

      func1 = state[0] ^ a;
    end
  endfunction

  assign out = func1(2'd3);

endmodule

This is an output of read_systemverilog -I. -debug -dump_rtlil bad.v:
log.txt

It seems that SEGV is caused by Synlig's simplify process because read_verilog can read successfully.

Environment

OS: Ubuntu 24.04 LTS
Synlig version: 10efd31 (installed from source)

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

No branches or pull requests

1 participant