noise source
Sorry, I made a little mistake, this is a better code:
`include "disciplines.vams"
module vnoise(out);
output out; electrical out;
parameter real period=1.0e-9;
parameter real vn=1.0;
real x;
analog begin
@(timer(0.0,period))
x=$random*vn/2147483647.0;
V(out)<+transition(x,0.0,period);
end
endmodule
you can also use
module vnoise(out);
output out; electrical out;
parameter real period=1.0e-9; //[1ns]
parameter integer seed=123;
parameter real mean=0.0;
parameter real std=1e-3; //[1mV]
real x;
integer y;
analog begin
@(initial_step)
y=seed;
@(timer(0.0,period))
x=$rdist_normal(y,mean,std);
V(out)<+transition(x,0.0,period);
end
endmodule