I wanted to check if my understanding on the usage of unique and priority keywords is correct or not.Unique i understand is a keyword used to tell the synthesis tool to infer a simple mux.The statements would be evaluated in parallel and which ever becomes true ,is executed.The advantage of using 'unique' keyword is that it gives warning messages when the conditions are not mutually exclusive,and hence would be best suited for applications such as processing a read and write request to memory ,read and write requests must not overlap,incase they do ,it should be reported as an error.
Priority keyword is to inform the synthesis tool ,to infer a priority mux.This may be used to implement a priority arbitration mechanism.
Conditions are evaluated in priority.
Examples of the usage of these keywords used in TB which you have worked on will be appreciated.
'priority' is a misleading name. Even without 'priority', the conditions will be evaluated in order and the first one to be found true will be taken. 'priority' is just a contrast to 'unique', where the logic can be synthesized without priority logic.
What 'priority' does give you is a check that at least one of the specified conditions (including 'default') is true. If none of them is true, then the simulator issues a violation message. In synthesis, this is like a full_case directive.
'unique' also does this check in addition to the mutual exclusivity check. Thus, 'unique' is like specifying both full_case and parallel_case.
To make it simple default is priority (the first true branching element is executed)
You specify unique when you do not want to have contention between two or more branching case items.
Thanks Shalom and Vinay,
I am now pretty certain that priority keyword infers a priority mux (which happens even without the 'priority' keyword)
and it the advantage of using priority is that it issues a run-time warning if all the cases are not covered