RE: Proposal for two additional environment parameter functions

From: Muranyi, Arpad <Arpad_Muranyi_at_.....>
Date: Thu Jul 12 2007 - 13:13:57 PDT
Geoffrey,

I don't understand the reason for why the IF statement
wouldn't get evaluated during the AC sweep.   Could
you please explain that to me?

If we had this in the language, I would expect it to
work the same as $abstime.  Doesn't $abstime=0 in the
operating point analysis and greater than zero
thereafter?  If I remember correctly, I was able to
use if($abstime ...) before.  Why couldn't $freq do
the same?

Thanks,

Arpad
======================================================

-----Original Message-----
From: owner-verilog-ams@server.eda.org [mailto:owner-verilog-ams@server.eda.org] On Behalf Of Geoffrey.Coram
Sent: Tuesday, July 10, 2007 8:18 AM
To: David Miller
Cc: Verilog-AMS LRM Committee
Subject: Re: Proposal for two additional environment parameter functions

I don't think this will work:
    if($freq > 1M) ... else

The dc op pt will be computed with $freq=0, and then the ac analysis is
performed by linearizing the circuit at the operating point, and the
if() statement does not get re-evaluated during the ac sweep.

I think Ken Kundert had some significant objections to the idea
of $freq, as well.  I've never used VPI, so I don't know anything
about vpi_get_analog_freq().

-Geoffrey


David Miller wrote:
> Hi Geoffrey,
> well yes that doesn't make a lot of sense to do that. But I can do 
> similar strange things like:
> V(out) <+ analysis("ac");
> 
> I use $freq, similar to how I use $abstime, mostly in an 'if' condition.
>   if($freq > 1M) ... else
> 
> I have also used it in $fwrite() where if I am writing out noise_table 
> values to a file I can also write out the freq that they represented.
> 
> I guess it could raise an error if used in anything other than a small 
> signal analysis, I don't really mind either way.
> 
> I also noticed that in the LRM in the "VPI routine definitions" section 
> we have a VPI routine: vpi_get_analog_freq() and thought it was useful 
> to also have a behavioural statement in $freq to do a similar thing.
> 
> Cheers...
> Dave
> 
> Geoffrey.Coram wrote:
>> David Miller wrote:
>>> Hello,
>>> I would like to propose two new environment parameter functions for 
>>> LRM 2.3
>>>
>>> 1. $freq
>>> Similar to $abstime, this function will simply return the current 
>>> frequency
>>> when doing a small-signal analysis.
>>>
>>> [LRM TEXT]
>>> $freq shall return the current frequency used of a small-signal 
>>> analysis. The
>>> function shall return zero (0) during DC or transient analysis.
>>
>> Does this make sense?  What if I did:
>>
>> V(out) <+ $freq;
>>
>> Then, during dc, I get zero, but during the ac analysis, I get 
>> something else.
>>
>> What are you really trying to do with this function?
>>
>> -Geoffrey
>>
> 

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Jul 12 13:14:13 2007

This archive was generated by hypermail 2.1.8 : Thu Jul 12 2007 - 13:14:28 PDT