FW: Proposal for two additional environment parameter functions

From: Muranyi, Arpad <Arpad_Muranyi_at_.....>
Date: Thu Jul 12 2007 - 17:33:34 PDT
With David's permission from another private
reply I am posting his message and my reply
to him to this list.  Comments are welcome.

Thanks,

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

-----Original Message-----
From: Muranyi, Arpad 
Sent: Thursday, July 12, 2007 3:30 PM
To: 'david@tiburon-da.com'
Subject: RE: Proposal for two additional environment parameter functions

David,

I agree with all these issues related to the usage
of $freq can be problematic, but I am not sure whether
you answered my question on why the IF statement
wouldn't be evaluated in the AC sweep.  That question
is independent of the problems associated with the
proper or improper usage of $freq...

By the way, did you reply to me privately deliberately,
or was that by accident?  I think this discussion
could (should) be kept public...

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

-----Original Message-----
From: david@tiburon-da.com [mailto:ddshark@cox.net] 
Sent: Thursday, July 12, 2007 3:03 PM
To: Muranyi, Arpad
Subject: RE: Proposal for two additional environment parameter functions

If the $freq statement does anything that changes the bias conditions, and hence the operating point and the DC equivalent circuit, then the results are going to be incorrect or uncertain, since presumably the OP is determined at $freq = 0.  There's only certain things that could be allowed to be changed by a $freq parameter.  And automatically checking the validity of anything with $freq dependency would be a challenge.  My guess is that it may depend on the implementation as to whether or not the if($freq) statements are re-evaluated during a frequency sweep to allow, for example, a frequency dependent inductance value to be used in AC analyses.

More significantly, IMO, once you've done something like supporting arbitrary $freq statements, then you're nearly guaranteed to introduce inconsistent modeling between the time domain (Transient) and the frequency domain (AC, HB, etc.) results.  It's way too easy to write $freq equations that give "ideal" frequency domain responses, but that are totally non-physical and impossible to even approximately implement in any kind of Transient and convolution based simulator.  It's best to figure out how to add the frequency dependency with something like the Laplace operators, which have defined mappings between time and frequency domain, and can be more readily verified as to whether or not they are stable frequency responses. 

David

---- "Muranyi wrote: 
> 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.
> 
>

-- This message has been scanned for viruses anddangerous content by MailScanner, and isbelieved to be clean.
Received on Thu Jul 12 17:33:59 2007

This archive was generated by hypermail 2.1.8 : Thu Jul 12 2007 - 17:34:12 PDT