Forum Discussion

Jacobinho86's avatar
Jacobinho86
Icon for New Contributor rankNew Contributor
2 years ago
Solved

Can I use priority/unique modifiers on if statement?

Hi, hopefully a quick question, I am programming a decoder with a series of if-else statements, and I want to tell the synthesis tool that all clauses should be evaluated in parallel, for that I know that I can add the "unique" modifier to the first if (as stated in section 7.10.1 of this book: https://link.springer.com/book/10.1007/0-387-36495-1), but when I try to run the "analysis & synthesis" process I get back the following error (Quartus Prime Version 23.1 std.0 Build 991 11/28/2023 SC Lite Edition):

"10170 Verilog HDL syntax error at codificador_prioridad.sv(8) near text: 'if'; expecting 'case' ..."

So, does this mean that the tool does not implement such syntax? Or it is not a supported syntax in Systemverilog (e.g. the book is lying)? Or is that the standard implemented by the tool is not updated?

Kind Regards

5 Replies

  • sstrell's avatar
    sstrell
    Icon for Super Contributor rankSuper Contributor

    As mentioned, unique is only for case statements since more than one condition can match with a Verilog case statement. if-else implies a priority encoder so that is not what you want. You should be using a case statement and if there is the possibility of more than one condition matching the expression you are evaluating, then you can add unique to it.

  • RichardT_altera's avatar
    RichardT_altera
    Icon for Super Contributor rankSuper Contributor

    I believe the community have answered your inquiry. Do you have further inquiry in regards to this?

    Regards,

    Richard Tan

  • RichardT_altera's avatar
    RichardT_altera
    Icon for Super Contributor rankSuper Contributor

    I'm pleased to know that your question has been addressed.

    Now, I will transition this thread to community support. If you have any further questions or concerns, please don't hesitate to reach out.

    Thank you and have a great day!

    Best Regards,

    Richard Tan