The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> How to Implement Time Dependent Noise
https://designers-guide.org/forum/YaBB.pl?num=1057680753

Message started by jjrael on Jul 8th, 2003, 9:12am

Title: How to Implement Time Dependent Noise
Post by jjrael on Jul 8th, 2003, 9:12am

I am having problems implementing/simulating time dependent noise in Cadence.

I want a block that injects noise only when it is on. The code I have is:


  analog begin
     vin = V(vinp, vinn);
     id = gm * (vin - vth);
     W  = 1;
     if (vin < vth) begin
      id = 0;
      W  = 0;
     end
     I(voutp,voutn) <+ id + W*white_noise( 4 * `P_K * $temperature * gamma * gm, "source1") ;
  end

I have tried coding this various ways but I always get the same error:'

Error found by spectre during AHDL read-in.
   file: /xxx/veriloga.va. Non-recoverable
       error: Use of small signal sources in expressions is not supported.
   Exiting SpectreHDL compilation.

Any ideas?

jr

Title: Re: How to Implement Time Dependent Noise
Post by jjrael on Jul 8th, 2003, 11:06am

Never mind, I got it:

I(voutp,voutn) <+ id + white_noise( W * 4 * `P_K * $temperature * gamma * gm, "source1") ;

I should have put the "W" inside!!

jr

Title: Re: How to Implement Time Dependent Noise
Post by jjrael on Jul 8th, 2003, 11:08am

Opps,

I was wrong, moving W inside solves the error but it does not output ANY noise.

jr

Title: Re: How to Implement Time Dependent Noise
Post by pancho_hideboo on Jul 8th, 2003, 2:25pm

white_noise() is small signal source which is valid for only noise, sp-ana.

Noise in transient simulations can be added as pseudo-random voltages
and currents at each timepoint.
Generally the noise should have a Gaussian amplitude distribution.
So you have to use $rdist_normal() instead.
Here you have to approximate white noise with band-limited white gaussian noise since perfect white noise never exist even in real world.

The Noise bandwidth enables the generation of noise in transient analysis.
Because transient analysis uses a variable timestep method,
the noise must be limited to a bandwidth of less than 1/(2*MaxTimeStep).

:o


Title: Re: How to Implement Time Dependent Noise
Post by jjrael on Jul 8th, 2003, 2:45pm

It is also valid for pnoise.

It is my understanding the spectreRF runs a PSS analysis and then at each point along the PSS curve, finds the noise values and the gain values and then sums them up.

I want to be able to change the value of the noise along the PSS curve.

I did a "hack" where I used a tanh as a decsision block and a multiplier to shape the noise. Using the time domain noise capabilities of spectreRF, I could see that I got something close to what I wanted. However, my "hack" is larger than my circuit of interest!! I am sure there is a more elegant solution to this. I used to make hacks like this in Spice before I heard of verilogA/AMS. Since I am going back to my Spice tricks, I KNOW I am doing something wrong!!

jr

Title: Re: How to Implement Time Dependent Noise
Post by pancho_hideboo on Jul 8th, 2003, 4:28pm

pnoise is frequecy domain small-signal noise analysis based on periodical operating point calculated by PSS.

Things you want to do is implementation of bias dependent frequency domain noise model for time domain small-signal noise analysis in  SpectreRF's PSS/Pnoise.

Right ?

[Note] time domain noise analysis of SpectreRF is actually frequency domain noise analysis.

First you have to test your model for PSS/Pnoise(Sources), next test it for PSS/Pnoise(Timedomain).

Your model including other sentences in Verilog-A is valid for normal PSS/Pnoise ?

For example, following code works for PSS/Pnoise.

module diode (a, c) ;
inout a, c ;
electrical a, c ;
parameter real rs=0, is=1e-14, tf=0, cjo=0, phi=0.7 ;
parameter real kf=0, af=1, ef=1 ;
analog begin
I(a, c) <+ is*(limexp((V(a, c)-rs*I(a, a))/$vt) - 1);
I(a, c) <+ white_noise(2* `P_Q * I(a, c)) ;
I(a, c) <+ flicker_noise(kf*pow(abs(I(a, c)),af),ef);
end
endmodule


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