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

inside of case is not implemented quartus #811

Closed
YSawc opened this issue Jul 4, 2024 · 8 comments
Closed

inside of case is not implemented quartus #811

YSawc opened this issue Jul 4, 2024 · 8 comments
Labels
tools Tools feature

Comments

@YSawc
Copy link
Contributor

YSawc commented Jul 4, 2024

I use latest quartus prime lite for program logic but the software is not supported inside of case yet.

generated.sv

       case (status) inside
            Status_idle: ...
        endcase

quartus compile error here.

Error (10170):... near text: "inside";  expecting an operand. Check for and fix any syntax errors that appear immediately before or at the specified keyword. The Intel FPGA Knowledge Database contains many articles with specific details on how to resolve this error. Visit the Knowledge Database at https://www.altera.com/support/support-resources/knowledge-base/search.html and search for this specific error message number.

Like this case is not offten but, I think better if there is something like compile flag controlled by veryl.toml example.

@dalance
Copy link
Collaborator

dalance commented Jul 5, 2024

Veryl's case supports range and don't care, so removing inside from generated SV doesn't work fine.
Instead of it, if ( .. inside ..) chain may be useful.

// default
case (status) inside
    Status_idle: ...
endcase

// "emit_if_inside_for_case = true" in Veryl.toml
if (status inside {Status_idle}) begin
end else if ... 

Is such usage of inside supported by Quartus?

@taichi-ishitani
Copy link
Contributor

@YSawc
Copy link
Contributor Author

YSawc commented Jul 5, 2024

As a taichi-shitani said inside operators not supported.

generated.sv

    Status         status;
    typedef enum logic  [3-1:0] {
        Status_Ready,
        Status_ReadTargetLowAddr,
        Status_ReadTargetHighAddr,
...
        Status_Finish
    } Status;
...
            if (status inside {Status_Ready} ) begin
                ...
            end else begin
                ...
            end

build error message here.

Error (10170): ... near text: "inside";  expecting ")". Check for and fix any syntax errors that appear immediately before or at the specified keyword. The Intel FPGA Knowledge Database contains many articles with specific details on how to resolve this error. Visit the Knowledge Database at https://www.altera.com/support/support-resources/knowledge-base/search.html and search for this specific error message number.

Inside expression is not supported yet in quartus, so instead of inside, conditional operation works fine.

if (status >= Status_Ready && status <= Status_ReadTargetHighAddr ) begin
  if_register.a <= 0;
end else begin
  if_register.a <= 1;
end

In case of using inside, can it cover with like above range or or binary expression instead of inside if passed flag in Veryl.toml?
Or if another better solution exists, please tell me, thank.

@taichi-ishitani
Copy link
Contributor

refs: #145

@taichi-ishitani
Copy link
Contributor

How about emitting case statement instead of case inside statement if all case condition expressions do not include range expression and unknown values?

@YSawc
Copy link
Contributor Author

YSawc commented Jul 6, 2024

It sounds good.

@nathsou
Copy link

nathsou commented Jul 24, 2024

Hi, running a cocotb testbench with iverilog on a module with a case inside also fails.

@taichi-ishitani
Copy link
Contributor

I think this issue is fixed by #873.

@dalance dalance closed this as completed Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools Tools feature
Projects
None yet
Development

No branches or pull requests

4 participants