difference between priority case and case

Status
Not open for further replies.

stanford

Full Member level 2
Joined
Feb 16, 2014
Messages
132
Helped
4
Reputation
8
Reaction score
6
Trophy points
1,298
Activity points
2,223
For priority case, if all the conditions are not listed, unlisted case items are don’t cares, and can be optimized away.
For case, if all the conditions are not listed, it will synthesize into a latch.

Is this correct?

Thanks
 

For priority case, if all the conditions are not listed, unlisted case items are don’t cares, and can be optimized away.
For case, if all the conditions are not listed, it will synthesize into a latch.

Is this correct?

Thanks

I dont think that is true. Priority case will tell simulation and synthesis tools to generate priority encoded logic. However, if no case matches, you will encounter a violation in simulation:

RT Warning: No condition matches in 'priority case' statement.

However, if you use unique case statement, if you do not add a case condition it will not add latch. For example in case of a 3:1 MUX.


Code Verilog - [expand]
1
2
3
4
5
6
7
always_comb begin
  unique casez(select) begin
    2'b00 : y = a;
    2'b01 : y = b;
    2'b10 : y = c;
  endcase
end // always_comb

 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…