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

Add support for disable statement #278

Open
spth opened this issue Feb 29, 2024 · 4 comments
Open

Add support for disable statement #278

spth opened this issue Feb 29, 2024 · 4 comments

Comments

@spth
Copy link

spth commented Feb 29, 2024

Using the latest release of sv2v, I get Parse error: missing expected `end on this code:

function automatic logic [7:0] clz(logic [15:0] op);
	logic [7:0] count = 16;
	begin: loop
	for (int i = 0; i < 16; i++)
	begin
		if (op[15 - i])
		begin
			count = i;
			//break; // Icarus Verilog 11 doesn't support break.
			disable loop;
		end
	end
	end: loop
	return count;
endfunction
@zachjs
Copy link
Owner

zachjs commented Apr 2, 2024

I believe if you replace the disable with the commented out break, sv2v supports this logic. Does that work for you?

@spth
Copy link
Author

spth commented Apr 2, 2024

Yes, then the code work with sv2v, but no longer with Icarus 11.

@zachjs
Copy link
Owner

zachjs commented May 14, 2024

I think there are three options here:

  1. Add support for disable to sv2v.
  2. Add support for break to iverilog.
  3. Use break, but pass your input through sv2v before giving it to iverilog.

Does the third option work around your immediate issue?

@spth
Copy link
Author

spth commented May 14, 2024

I've since refactored my design to use neither break nor disable.

Still, both are in the Verilog standard, so the right solution would be to have both 1 (this ticket) and 2 (implemented now, but currently broken steveicarus/iverilog#1016).

@zachjs zachjs changed the title Parse error on disable in named block Add support for disable statement Jun 16, 2024
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