这里简单谈下由时域仿真结果计算 jitter 的方法。
关于如何计算 jitter, 这里的方法主要分为两步,首先在 Cadence 仿真中得到时钟信号过零点时刻的数据,然后利用 matlab 对此数据处理,从而得到 clock jitter 以及时钟周期的直方图(histogram)。
对于过零点时刻的获取,主要可以通过 calculator 中的 cross 函数对 spectre 时域仿真的时钟信号的处理来得到,如下图中所示。
之后,可以将得到的数据列表导出为 CSV 文件(注意对数据设置合适的小数点位数),并利用 matlab 处理。
这里 Matlab 中的处理主要是利用过零点数据得到时钟周期,以此来计算其均值和标准差,具体的 matlab 脚本如下:% calc the jitter from the data of the zero-crossing time
cross_time=csvread('jitter_data.csv', 1, 1); % reading data from the csv file
num=length(cross_time); % find the data length
i=1:num-1;
period(i)=cross_time(i+1)-cross_time(i); % calculate the period
Tc=mean(period); % the avergaed clk period
Jc=std(period); % the cycle jitter (period jitter)
k=1:length(period)-1;
DeltaT(k)=period(k+1)-period(k); % calculate the difference for 2 nearby period
Jcc=std(DeltaT);
%Jpp=max(period)-min(period); % peak-peak Cycle jitter
[n,xout]=hist(period,18); % plot the histogram
bar(xout,n);
title('Clock Period Histogram');
xlabel('clcok period');
ylabel('number')
%text(max(xout), max(n), sprintf('Tc=%.3e', Tc),'hor','right');
%text(max(xout), 0.85*max(n), sprintf('Jc=%.3e', Jc),'hor','right');
%text(max(xout), 0.8*max(n), sprintf('Jcc=%.3e', Jcc),'hor','right');
gtext(sprintf(' T=%.3e\n Jc=%.3e\n Jcc=%.3e', Tc,Jc,Jcc))
我们可以用以前介绍的抖动时钟的信号源来加以验证,在理想时钟引入 synchronous jitter (edge-to-edge jitter), 这里取 Jee=10ps, 则对应的 cycle-jitter Jc 约为14.1ps。
下图是实际利用 matlab 分析得到的 cycle-jitter 和周期的直方图,这里的 Jc=13.9ps, 可见还是比较接近的