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

Linter crashes when encountering circular parameter definition #1039

Open
Mikkhael opened this issue Jun 26, 2024 · 0 comments
Open

Linter crashes when encountering circular parameter definition #1039

Mikkhael opened this issue Jun 26, 2024 · 0 comments

Comments

@Mikkhael
Copy link

Describe the bug
If a parameter is defined in terms of itself, using its hierarchical name, running Slang results in a crash, without outputting any linting results.

To Reproduce
Minimal example:

module M ();
	parameter P = M.P;
endmodule

Running on my Windows machine:

> slang .\slang_circular.sv --lint-only
> echo $LASTEXITCODE
-1073741571

Enabling --allow-hierarchical-const doesn't change anything.

Additional context
Interestingly, Questa and VCS by default allow hierarchical names in const context, also allowing for this circular definition, but it seems more like undefined behaviour than a feature.
Example code:

module M ();
	parameter P0  = M.P1 + 1;
	parameter P1  = M.P1 + 1;
	parameter P2  = M.P1 + 1;
	parameter P3  = M.P1 + 1;
	initial $display(P0, P1, P2, P3);
endmodule

In Questa, simulation prints 1 1 2 2, in VCS - 2 1 2 2

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