Re: noise_table question

From: Ken Kundert <ken@designers-guide.com>
Date: Thu Apr 05 2012 - 17:02:35 PDT

Geoffrey,
    I hold no allusions to the effect that once this example gets into the LRM
that the vendors will rush out and implement it. But I believe when people
implement Verilog-A/MS compilers they are hungry for examples that they can use
to test their implementations. I expect that if the LRM includes complete
examples, those examples will affect these new implementations. And these new
implementations in turn will affect the old implementations through competition.
So I believe it is a good idea to include the example.

A problem with examples out in the wild (such as on my website) is that they are
expected to work on existing simulators. This perpetuates these deficiencies.

Also, it is an RF example, which has its own cachet. A compact modeling example
like the one already in the LRM is a powerful one, but an RF modulated noise
example is also powerful, and together they may do the trick.

As for your work-arounds. If a simulator accepts
> real fl;
> fl = flicker_noise(pn,2);
> V(out) <+ cos(2*`M_PI*phase + fl);
then there is no excuse for it not accepting
> V(out) <+ cos(2*`M_PI*phase + flicker_noise(pn,2));
as they are equivalent. Not accepting it simply creates yet another user trap.
As for using nodes rather than variables, as in
> electrical fl;
> I(fl) <+ V(fl) + flicker_noise(pn,2);
> V(out) <+ cos(2*`M_PI*phase + V(fl));
That is unnecessarily expensive and leads to more user traps (involving
tolerances, units and such).

Oddly enough, Cadence's simulator used to allow the small-signal stimulus
functions to be placed in expressions without restriction, and it used to work
fine. I have never heard a good explanation as to why they added the
restriction.

-Ken

On Thu, Apr 05, 2012 at 11:30:09AM -0400, Geoffrey Coram wrote:
> Hi, Ken -
> I'm not sure what I'd do with that line:
>
> > V(out) <+ cos(2*`M_PI*phase + flicker_noise(pn,2));
>
> other than the same sort of trick all the compact modelers use
> for correlated noise. The LRM shows this example for noise
> assigned to a variable:
>
> n = white_noise(pwr);
> V(a,b) <+ c1*n;
> V(c,d) <+ c2*n;
>
> but some simulators didn't/don't support even that, and that
> was in the LRM as far back as 2.0! If the simulator doesn't
> support this feature from 10+ years ago, I wouldn't hold my
> breath that a new example in the LRM would motivate them.
>
> I think some simulators can handle this:
> real fl;
> fl = flicker_noise(pn,2);
> V(out) <+ cos(2*`M_PI*phase + fl);
>
> And then the usual trick is to create a new node, and do this:
> electrical fl;
> I(fl) <+ V(fl) + flicker_noise(pn,2);
> V(out) <+ cos(2*`M_PI*phase + V(fl));
>
> which I believe all simulators can handle.
>
> -Geoffrey
>
>
>
> Ken Kundert wrote:
> >Geoffrey,
> > It seems like a nice little enhancement. If I remember
> >correctly, very little thought went into the details of the
> >noise_table() function. The simplest thing possible was done with
> >the assumption that it could be fixed later based on use/need.
> >
> >While we are on the topic, there is a real problem with the
> >small-signal stimulus functions, of which noise_table is an
> >example (along with ac_stim, white_noise and flicker_noise). The
> >problem is with at least one of the major commercial
> >implementations of these functions rather than with the LRM.
> >Currently Cadence requires that these functions be contributed
> >directly to a signal. So,
> > I(out) <+ noise_table(...);
> >is okay, but
> > I(out) <+ f(noise_table(...));
> >is not. This is problematic because it makes it difficult to build
> >models with modulated noise sources. For example, the following
> >simple model for a vco that exhibits phase noise is not supported
> >in Cadence (at least last time I checked, which admittedly was
> >some time ago):
> >
> >module vco (out, in);
> >voltage out, in;
> >parameter k = 1;
> >parameter f0 = 0;
> >parameter real pn=1;
> >real phase, freq;
> >
> > analog begin
> > freq = k*V(in) + f0;
> > phase = idtmod(freq, 0, 1);
> > V(out) <+ cos(2*`M_PI*phase + flicker_noise(pn,2));
> > $bound_step(1/(10*freq));
> > end
> >endmodule
> >
> >If someone is going to update the LRM to include logarithmic
> >interpolation in noise_table, I think at the same time we should
> >add the above model as an example in the flicker_noise section of
> >the LRM to make it clear
> >1. how to build a model that exhibits modulated noise, and
> >2. that the intent of the LRM is that there should be no
> >restrictions on the placement of the small-signal stimulus
> >functions within an expression.
> >
> >-Ken
> >
> >On Wed, Apr 04, 2012 at 03:55:49PM -0400, Geoffrey Coram wrote:
> >>Was there ever a proposal of how to request log-log interpolation
> >>for noise_table ?
> >>
> >>Does any simulator support it?
> >>
> >>The current syntax is:
> >> noise_table ( input [ , name ] )
> >>
> >>where input can be a vector or a string (filename), and name is a string.
> >>
> >>We could require the noise have a name to request interpolation:
> >> noise_table ( input [ , name [, interp ] ] )
> >>
> >>Or we could let the type of the 2nd argument determine what it is:
> >> noise_table ( input [ , name ] )
> >> noise_table ( input [ , log_interp ] [, name ] )
> >>
> >>where log_interp would be 0 or 1 (an integer).
> >>
> >>-Geoffrey
> >>
> >>
> >>
> >>Oskar Leuthold wrote:
> >>>Geoffrey,
> >>> you might also question the wisdom of linear interpolation here.
> >>>Noise generally varies as the log of the frequency, see section 4.5.4.2,
> >>>thus interpolation in the log-log domain would be more useful.
> >>>Regards
> >>> Oskar
> >>>
> >>>----------------------------------------------------------------------
> >>>Oskar Leuthold, Corporate Applications Engineer
> >>>Silicon Engineering Group Synopsys, Inc. 700 E. Middlefield Rd.
> >>>Mountain View, CA 94043 650 584 5887
> >>>oskar.leuthold@synopsys.com
> >>>
> >>>>-----Original Message-----
> >>>>From: owner-verilog-ams@eda.org
> >>>>[mailto:owner-verilog-ams@eda.org] On Behalf Of Geoffrey.Coram
> >>>>Sent: Monday, March 20, 2006 9:18 AM
> >>>>To: VerilogAMS Reflector
> >>>>Subject: noise_table question
> >>>>
> >>>>Section 4.5.4.3 on noise_table specifies that linear
> >>>>interpolation is used (presumably for frequencies inside the
> >>>>range of frequencies specified in the vector).
> >>>>
> >>>>What happens outside the vector?
> >>>>1) value is zero
> >>>>2) if the first pair is (fmin,val1), then for frequencies < fmin,
> >>>> the value is val1; similarly if (fmax,valn) is the last pair,
> >>>> then the value is valn for frequencies > fmax.
> >>>>
> >>>>I propose (2).
> >>>>
> >>>>
> >>>>Also, the LRM does not specify what a "vector" is.
> >>>>
> >>>>-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 Apr 5 17:03:05 2012

This archive was generated by hypermail 2.1.8 : Thu Apr 05 2012 - 17:03:21 PDT