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

parse error in "foreach" with two-dimentional array #31

Closed
x74ea6f opened this issue Mar 19, 2021 · 2 comments
Closed

parse error in "foreach" with two-dimentional array #31

x74ea6f opened this issue Mar 19, 2021 · 2 comments

Comments

@x74ea6f
Copy link

x74ea6f commented Mar 19, 2021

Thank you for the useful tool.
I noticed that I am using svls in VS Code, so let me know.
I was getting a parse error in multiple foreach of a 2D array. Below is the sample code.

module example_foreach;

  int a[2][3] = '{'{1,2,3}, '{4,5,6}};

initial begin
    foreach(a[i]) foreach(a[i][j]) $display("%d", a[i][j]);
end

endmodule
@dalance
Copy link
Owner

dalance commented Mar 19, 2021

Thank you for your report.
In my understanding, foreach of a 2D array is not allowed in language specification like below.

 foreach ( ps_or_hierarchical_array_identifier [ loop_variables ] ) statement

I tried some commercial tools, so some tools can parse it, and some tools are failed to parse it.

@x74ea6f
Copy link
Author

x74ea6f commented Mar 19, 2021

Thank you for your reply.
I understand and close this.

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

2 participants