neoflash
Community Fellow
Offline
Mixed-Signal Designer
Posts: 397
|
I developed this code to generate a random noise. However, it seems it will keep constant after initial change, why?
module rj_src (rj_out); output rj_out; electrical rj_out,rj_int; parameter real rj_amp = 1 from (0:inf); parameter real rj_tau = 10m from (1p:inf); parameter integer seed = 10 from (1:inf); real next; real noise;
analog begin // this rj_src will generate a random noise voltage and sum with sin_clk_src's output; // Thus, jitter is modeled as additive noise; @(initial_step) next = $abstime + rj_tau;
@(timer(next)) begin noise = rj_amp*$rdist_normal(seed,0,1); next = next + rj_tau; end
V(rj_int) <+ noise; V(rj_out) <+ V(rj_int) + I(rj_out)*50;
end endmodule
|