I want to model fractional frequency offset of clock to +/-100ppm
and jitter figure is 2ns peak to peak when measured over a 60sec interval.
How can i model this behavior in my testbench.
I want to model fractional frequency offset of clock to +/-100ppm
and jitter figure is 2ns peak to peak when measured over a 60sec interval.
How can i model this behavior in my testbench.
In reply to ashish_banga:
I want to model fractional frequency offset of clock to +/-100ppm
and jitter figure is 2ns peak to peak when measured over a 60sec interval.
How can i model this behavior in my testbench.
The model below demonstrates a clock with jitters. You need to modify the probabilities and the amount of jitters as you see fit.
import uvm_pkg::*; `include "uvm_macros.svh"
module m;
// I want to model fractional frequency offset of clock to +/-100ppm
// and jitter figure is 2ns peak to peak when measured over a 60sec interval.
bit clk, t;
initial forever begin
#29ns if (!randomize(t) with
{ t dist {1'b1:=1, 1'b0:=10};
}) `uvm_error("MYERR", "This is a randomize error")
if(t) begin // jitter
clk=!clk; // early clock flip
end
else #1ns clk=!clk; // normal clock flip
#29ns if (!randomize(t) with
{ t dist {1'b1:=1, 1'b0:=15};
}) `uvm_error("MYERR", "This is a randomize error")
if(t) begin
clk=!clk;
end
else #1ns clk=!clk;
end
endmodule
Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us
Hi Ben,
Thanks for reply.
But my clk period is 8 ns. Introducing +/- 1ns at one time may be big. How can I distribute it effectively over cycles of clk.
In reply to ashish_banga:
My model was intended to demonstrate the concept to introduce jitter.
For lower resolutions, play with the timeunit and timeprecision . You’ll also need to play with the weighted distributions to get the frequencey of occurrences for the jitters.
Hope this helps.
Ben Cohen SystemVerilog.us