The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 4:34am
Pages: 1
Send Topic Print
case statement in verilog-A (Read 13469 times)
rajdeep
Senior Member
****
Offline



Posts: 220
UK
case statement in verilog-A
Aug 21st, 2009, 3:52am
 
Hi all,

How will spectre simulate case statement in Verilog-A?

case(sum)
0: vnom = 1.2;
1: vnom = 2.3;
endcase
In the above example will the entire section be simulated at every time point or will it be intelligent enough to simulate the section only when there is a change in sum??

Im curious because what if I have the following statement in conjunction with the above statement..

V(vout,gnd) <+ transition(vnom,td,tr);

If spectre evaluates vnom at every timepoint then the argument of transition will be evaluated at every time point. Wont it slow down the sim unnecessarily?

I have tried to wrap up the case statement within a cross statement just to experiment and frankly speaking there was absolutely no difference!!! But that could be because of the simplicity of the testbench...any thoughts?

Thanks much!
Rajdeep
Back to top
 
 

Design is fun, verification is a requirement.
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: case statement in verilog-A
Reply #1 - Aug 21st, 2009, 12:56pm
 
You might want to read through this thread:

http://www.designers-guide.org/Forum/YaBB.pl?num=1220537539/0#0

It looks like you picked a formulation that is similar to the faster of the two approaches mentioned.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Sumit Adhikari
Community Member
***
Offline



Posts: 44

Re: case statement in verilog-A
Reply #2 - Aug 22nd, 2009, 8:24pm
 
It wont work. There is no tigger for the case statement.
Write is as follows :

always @(*)
case(sum)
 0: vnom = 1.2;
 1: vnom = 2.3;
endcase

Further it will give u an error as you are using vnom in analog block
and it is not initialize. Initialize it. Following could be a nice approach:

always @(*)
case(sum)
 0: vnom = 1.2;
 1: vnom = 2.3;
 default : vnom = (whatever_value_you_choose);
endcase

Regards,
Sumit
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: case statement in verilog-A
Reply #3 - Aug 24th, 2009, 4:46am
 
Sumit -
I think rajdeep was intending for the case statement to be in the analog block also, along with the transition, in which case the trigger is not needed.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
rajdeep
Senior Member
****
Offline



Posts: 220
UK
Re: case statement in verilog-A
Reply #4 - Aug 27th, 2009, 6:07am
 
Hi Geoffrey!

Thanks for the link! I remember to go thru that thread once before!! So, I guess the conclusion is to make vnom change only when sum changes i.e. wrap the case statement within a cross statement. This will make the transition filter work faster!

@Sumit: Im using Verilog-A, not Verilog-AMS. Sorry for the confusion!

Rajdeep
Back to top
 
 

Design is fun, verification is a requirement.
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.