The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 4:43am
Pages: 1
Send Topic Print
problem with threshold crossing (Read 3276 times)
kanan
Junior Member
**
Offline



Posts: 17

problem with threshold crossing
Mar 05th, 2009, 10:40pm
 
Hi,

I'm trying to generate digital (and analog) output signals for certain input voltage behavior. My code for generating the digital signals looks like this :

parameter real vbathigh_thres = 3.4;
parameter real vbatlow_thres = 3.0;
   always @(above(V(vbat) - vbathigh_thres))
   begin
           vbatlow18  = 1'b0;
           vbathigh18 = 1'b1;
       end    
         
   always @(above(vbatlow_thres - V(vbat)))
   begin
               vbatlow18  = 1'b1;
               vbathigh18 = 1'b0;
     end

When I simulate this model in AMS Spectre by varying vbat from 0-5V, it shows me the expected behavior, however when varying from 5-0V it doesn't work. The code seems to be unable to detect that vbat > vbathigh_thres at the start of simulation and put vbathigh18 = 1, vbatlow18 = 0. See attached waveform (blue - V(vbat)). Is there something wrong with the code or the way I simulate it.
The LRM makes a mention about : "above() function is almost identical to the cross() function, except that it also triggers during initialization or dc analysis. It generates a monitored analog event to detect threshold crossings in analog signals when the expression crosses zero (0) from below."

Is it this crossing from below part causing the problem? Why isn't it triggering properly during initialization?

Thanks
D
Back to top
 

wave.PNG
View Profile   IP Logged
boe
Community Fellow
*****
Offline



Posts: 615

Re: problem with threshold crossing
Reply #1 - Mar 6th, 2009, 12:38am
 
Kanan,
which simulator do you use?
With Cadence IUS 8.10 your code works.
BOE
Back to top
 
 
View Profile   IP Logged
kanan
Junior Member
**
Offline



Posts: 17

Re: problem with threshold crossing
Reply #2 - Mar 11th, 2009, 7:17pm
 
incidentally... it seems to be a version issue! works on some, not on others. Reported it to cadence. Thanks boe for mentioning it!.. made me try different versions. Had been trying to code it differently thinking it was my mistake, but to no avail.
Back to top
 
 
View Profile   IP Logged
adecve
New Member
*
Offline



Posts: 2

Re: problem with threshold crossing
Reply #3 - Apr 1st, 2009, 3:01pm
 
Hi, i have the same problem with my simulation as well. I have a statement very similar to yours in my code. Can you tell me which version of cadence works for you?

Thanks.
Back to top
 
 
View Profile   IP Logged
boe
Community Fellow
*****
Offline



Posts: 615

Re: problem with threshold crossing
Reply #4 - Apr 2nd, 2009, 8:48am
 
IUS 8.10s7
Back to top
 
 
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.