The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> problem with threshold crossing
https://designers-guide.org/forum/YaBB.pl?num=1236321602

Message started by kanan on Mar 5th, 2009, 10:40pm

Title: problem with threshold crossing
Post by kanan on Mar 5th, 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

Title: Re: problem with threshold crossing
Post by boe on Mar 6th, 2009, 12:38am

Kanan,
which simulator do you use?
With Cadence IUS 8.10 your code works.
BOE

Title: Re: problem with threshold crossing
Post by kanan on 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.

Title: Re: problem with threshold crossing
Post by adecve on 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.

Title: Re: problem with threshold crossing
Post by boe on Apr 2nd, 2009, 8:48am

IUS 8.10s7

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.