Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Synthesis question.. case or assign?

Status
Not open for further replies.

jelydonut

Full Member level 4
Joined
Dec 27, 2002
Messages
239
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,296
Activity points
1,730
For synthesis, which would opt the best results or would it end up being the same..
including situations with many more cases..

assign x = (blah == 2'b00) ? a :
((blah == 2'b01) ? b :
((blah == 2'b10) ? c :
((blah == 2'b11) ? d :
16'hxxxx )));

OR

case(blah)
2'b00 : x <= a;
2'b01 : x <= b;
2'b10 : x <= c;
2'b11 : x <= d;
default : x <= 16'hxxxx;
endcase

ignoring any syntax i may have screwed up...

jelydonut
 

You codes can't be opt to good result.
X state can't be adopted in design.
 

I think the second is good choice. You can use synopsys primitive to notify the synthesizer that it is a fullcase.
 

Most of synthesis tools generate the same codes and also delay and number of building blocks in both designs are equal.
I'd prefer the second one because it is more readable than one. But if we want to discuss about them based on synthesis concepts, both of them are equal and do not have any advantages to the other.

Regards,
KH
 

I have try it in DC, they are the same. but assign X is not necessary.
 

niuniu said:
I have try it in DC, they are the same. but assign X is not necessary.

Really? But AE of EDA tools told us 'case' better than 'assign', because timing.
I havn't check it, I believe you. Optimization of DC will do something.
 

hi, put time on more meaningful thing.
 

hi, put time on more meaningful thing.
 

hi, put time on more meaningful thing.
 

with case is better.
 

personally i perfer the assign.. since it gets defined as a wire and you don't hafta worry about latch instantiation..

jelydonut
 

x is very bad for design.
you design from two script will be same
 

why is x bad in design? I haven't heard that yet..

jelydonut
 

Case is better, it will generate less H/w
 

i don't assign x or default x evaluation is unnecessary. dc can opt the design to the best if there is assigning x.
 

X maybe pull FSM into don't kown situation which you don't expect in complex design, it will be danger for design.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top