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

doesn't deal with for loops with multiple initializations #302

Open
pbreuer opened this issue Dec 22, 2024 · 0 comments
Open

doesn't deal with for loops with multiple initializations #302

pbreuer opened this issue Dec 22, 2024 · 0 comments

Comments

@pbreuer
Copy link

pbreuer commented Dec 22, 2024

sv2v doesn't seem to like this example from https://www.chipverify.com/systemverilog/systemverilog-for-loop or similar:

               for (int i = 0, j = 2; i < $size(array); i++) begin
			array[i][j] = "0";
                        $display ("array[%0d] = %s, %0dth index replaced by 0", i, array[i], j);
		end

I'm not trying exactly that, but that's the spirit and it is what I was following for format.
It seems to be objecting to the comma, not the type declaration, and it happens both without the type declaration and with it. I don't think sv2v handles inline declarations there anyway?

Multiple increments are also legal. Is this a "which standard" question? That page claims "There can be multiple initializations done in the first part of a for loop" (as in C).

The error from sv2v is just a parse pointer: "Parse error: unexpected token ',' (Sym_comma)"

Regards

PTB

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