Unique vs Priority Case 🌀


SiliconNotes

​Read on web →

Welcome to SiliconNotes!

Do you know when to use System Verilog unique case vs priority case? Let’s take a closer look👇
​
SystemVerilog provides the unique and priority keyword to cleanly describe how logic should be synthesised. These are commonly used along the case statement but one could even add the unique keyword to an if-else-if tree. But how does adding unique or priority keyword help?

Adding the unique keyword implies that the case statement can be evaluated in parallel, similarl to an and-or tree. While the priority keyword ensures that each case statement is evaluated in the order it's listed, indicating a priority. When using the priority keyword, any unlisted statements are considered don't cares, allowing the synthesis tool to optimise them.

What do you think will happen if the priority case includes a default statement?
​
​
A unique case should be used when the case statements can’t overlap and don’t have associated priorities, while a priority case is suitable for inferring priority logic.
​
Interested in learning more? Checkout my Hands-on RTL Design course at QuickSilicon for deeper insights into micro-architectural and RTL Design: quicksilicon.in​

You can find the entire code here.


Well, that's it for this edition of the SiliconNotes.

Have a great week and a very Happy New Year!
Rahul

#103 Sector D, Jammu, 180011
​Update your email preferences or unsubscribe here​