regsigned [8:0] t; // extend 1b begin if(plus) begin t = {a[7], a} + {1'b0, b}; satop_sus8b = (t[8:7]==2'b01) ? {1'b0, {7{1'b1}}} // up saturate for signed : t[7:0]; endelsebegin t = {a[7], a} - {1'b0, b}; satop_sus8b = (t[8:7]==2'b10) ? {1'b1, {7{1'b0}}} // dn saturate for signed : t[7:0]; end end endfunction
Isolation cells are additional cells inserted by the synthesis tools
for isolating the buses/wires crossing from power-gated
domain of a circuit to its always-on domain
(AON).
To prevent corruption of always-on domain, we clamp the nets crossing
the power domains to a value depending upon the design.
A simple circuit having a switchable (or gated) power
domain
The circuit shown in Figure 1, after isolation cells are
inserted
Jitter separation lets you learn if the components of jitter are
random or deterministic. That is, if they are caused by crosstalk,
channel loss, or some other phenomenon. The identification of jitter and
noise sources is critical when debugging failure sources in the
transmission of high-speed serial signals
Tail Fit Method
Spectral method
RJ Extraction Methods
Rationale
Spectral
Speed/Consistency to Past Measurements; Accuracy in low
Crosstalk or Aperiodic Bounded Uncorrelated Jitter (ABUJ)
conditions
Tail Fit
General Purpose; Accuracy in high Crosstalk or ABUJ
conditions
Jitter Components
dual-Dirac model
Spectral method
power spectral density (PSD) represents jitter spectrum and peaks in
the spectrum can be interpreted as PJ or DDJ, while the average noise
floor is the power of RJ
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
S1 = sum(win); S2 = sum(win.^2); N = length(win); spec_nospur2 = (spec_nospur*S1).^2/N/S2; % To obtain linear spectrum for rj rj_utj = sqrt(sum(spec_nospur2))*1e12;
spec = 1*ones(length(spec_nospur), 1)*1e-21; spec(index) = specx(index); % insert fft nyquist frequency component between positive frequency and % negative frequency component % DC;posFreq;nyqFreq;negFreq spec_ifft = [spec;specnyq;conj(spec(end:-1:2))]'; sfactor = sum(win)/sqrt(2); spec_ifft = spec_ifft*sfactor; sig_rec = real(ifft(spec_ifft)); sig_rec = sig_rec(:); sig_rec_utj = sig_rec./win(1:end);
Tail Fit Method
Tail fitting algorithm based on the Gaussian tail
model by using probability distribution of collected jitter
value
1 2 3 4 5 6 7 8 9 10 11 12 13
bin_sig = bin_sig*1e12;
x = qfuncinv(cdf_sig);
% coef(1)*bin_sig + coef(2) = x % which x is norm(0, 1) % bin_sig = (x - coef(2))/coef(1) % Then bin is norm(-coef(2)/coef(1), 1/coef(1)) coef = polyfit(bin_sig, x, 1); sigma = 1/coef(1); mu = -coef(2)*sigma;
fprintf('sigma=%.3fps, mu=%.3fps\n', sigma, mu);
Least Squares (LS) method
It is known that TIE jitter is a linear equation, shown in below
formula \[
x[n] = d_n \times \left[ \Delta t_{pj}[n]+\Delta t_{DCD}[n] +\Delta
t_{ISI}[n]+\Delta t_{RJ}[n]\right]
\] LS can be used to estimate the PJ, DCD, RJ , and ISI
parameters \([a,b,J_{DCD},J_0,
J_1...J_{(2^k-1)}]\)
Jitter modeling
Periodic Jitter (PJ)
PJ is a repeating jitter \[
\Delta t_{PJ}[n]=A\sin(2\pi f_0\cdot nT_s + \theta)=a \sin(2\pi f_0
\cdot nT_s)+b\cos(2\pi f_0 \cdot nT_s)
\] where \(f_0\) represents the
fundamental frequency of PJ; \(A\) is
the amplitude of PJ; \(T_s\) is the
data stream period, and \(\theta\) is
the initial phase of PJ
In the spectrum, the frequency of maximum amount of the jitter is PJ
frequency \(f_0\).
Duty Cycle Distortion (DCD)
DCD is viewed as a series of adjacent positive and negative
impulses\[
\Delta t_{DCD}[n] = J_{DCD}\times (-1)^n =
[-J_{DCD},J_{DCD},-J_{DCD},J_{DCD},...]
\] Where \(J_{DCD}\) is the DCD
amplitude.
Random Jitter (RJ)
RJ is created by unbounded jitter sources, such as Gaussian white
noise. The statistical PDF for RJ is enerally treated as a Gaussian
distribution \[
f_{RJ}(\Delta t) = \frac{1}{\sqrt{2\pi\sigma}}\exp(-\frac{(\Delta
t)^2}{2\sigma^2})
\]
Remarks
Periodic Jitter
Generator and Insertion
Analysis and Estimation of Jitter Sub-Components: Classification
and Segregation of Jitter Components
Reference
Mike Li. 2007. Jitter, noise, and signal integrity at high-speed
(First. ed.). Prentice Hall Press, USA.
Y. Duan and D. Chen, "Accurate jitter decomposition in high-speed
links," 2017 IEEE 35th VLSI Test Symposium (VTS), 2017, pp. 1-6, doi:
10.1109/VTS.2017.7928918.
Y. Duan and D. Chen, "Fast and Accurate Decomposition of
Deterministic Jitter Components in High-Speed Links," in IEEE
Transactions on Electromagnetic Compatibility, vol. 61, no. 1, pp.
217-225, Feb. 2019, doi: 10.1109/TEMC.2018.2797122.
"Jitter Analysis: The Dual-Dirac Model, RJ/DJ, and Q-Scale",
Whitepaper: Keysight Technologies, U.S.A., Dec. 2017
Sharma, Vijender Kumar and Sujay Deb. "Analysis and Estimation of
Jitter Sub-Components." (2014).
Qingqi Dou and J. A. Abraham, "Jitter decomposition in ring
oscillators," Asia and South Pacific Conference on Design Automation,
2006., 2006, pp. 6 pp.-, doi: 10.1109/ASPDAC.2006.1594696.
E. Balestrieri, L. De Vito, F. Lamonaca, F. Picariello, S. Rapuano
and I. Tudosa, "The jitter measurement ways: The jitter decomposition,"
in IEEE Instrumentation & Measurement Magazine, vol. 23, no. 7, pp.
3-12, Oct. 2020, doi: 10.1109/MIM.2020.9234759.
McClure, Mark Scott. "Digital jitter measurement and separation." PhD
diss., 2005.
Ren, Nan, Zaiming Fu, Shengcu Lei, Hanglin Liu, and Shulin Tian.
"Jitter generation model based on timing modulation and cross point
calibration for jitter decomposition." Metrology and Measurement Systems
28, no. 1 (2021).
M. P. Li, J. Wilstrup, R. Jessen and D. Petrich, "A new method for
jitter decomposition through its distribution tail fitting,"
International Test Conference 1999. Proceedings (IEEE Cat.
No.99CH37034), 1999, pp. 788-794, doi: 10.1109/TEST.1999.805809.
Convolution Property of the Fourier Transform \[
x(t)*h(t)\longleftrightarrow X(\omega)H(\omega)
\] pulse response can be obtained by convolve impulse response
with UI length rectangular \[
H(\omega) = \frac{Y_{\text{pulse}}(\omega)}{X_{\text{rect}}(\omega)} =
\frac{Y_{\text{pulse}}(\omega)}{\text{sinc}(\omega)}
\]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
% Convolution Property of the Fourier Transform % pulse(t) = h(t) * rect(t) % -> fourier transform % PULSE = H * RECT % FT(RECT) = sinc % H = PULSE/RECT = PULSE/sinc xx = pi*ui.*w(1:plt_num); y_sinc = ui.*sin(xx)./xx; y_sinc(1) = y_sinc(2); y_sinc = y_sinc/y_sinc(1); % we dont care the absoulte gain h_ban1 = abs(h(1:plt_num))./abs(y_sinc);
Notice that the complete definition of \(\operatorname{sinc}\) on \(\mathbb R\) is \[
\operatorname{Sa}(x)=\operatorname{sinc}(x) = \begin{cases} \frac{\sin
x}{x} & x\ne 0, \\ 1, & x = 0, \end{cases}
\] which is continuous.
To approach to real spectrum of continuous rectangular waveform,
\(\text{NFFT}\) has to be big
enough.
BTW, the psd value at half of fundamental frequency (\(f_s/2\)) is misleading and ambiguity, we
won't use this value
Random Jitter
RJ can be accurately and efficiently measured using
PSS/Pnoise or HB/HBnoise.
Note that the transient noise can also be used to
compute RJ;
However, the computation cost is typically very high, and the
accuracy is lesser as compared to PSS/Pnoise and HB/HBnoise.
Since RJ follows a Gaussian distribution, it can be fully
characterized using its Root-Mean-Squared value (RMS) or the standard
deviation value (\(\sigma\))
The Peak-to-Peak value of RJ (\(\text{RJ}_{\text{p-p}}\)) can be calculated
under certain observation conditions \[
\text{RJ}_{\text{p-p}}\equiv K \ast \text{RJ}_{\text{RMS}}
\] Here, \(K\) is a constant
determined by the BER specification of the system given in the following
Table
BER
Crest factor (K)
\(10^{-3}\)
6.18
\(10^{-4}\)
7.438
\(10^{-5}\)
8.53
\(10^{-6}\)
9.507
\(10^{-7}\)
10.399
\(10^{-8}\)
11.224
\(10^{-9}\)
11.996
\(10^{-10}\)
12.723
\(10^{-11}\)
13.412
\(10^{-12}\)
14.069
\(10^{-13}\)
14.698
1 2 3 4
K = 14.698; Ks = K/2; p = normcdf([-Ks Ks]); BER = 1 - (p(2)-p(1));
The phase noise is traditionally defined as the
ratio of the power of the signal in 1Hz bandwidth at offset \(f\) from the carrier \(P\), divided by the power of the carrier
\[
\ell (f) = \frac {S_v'(f_0+f)}{P}
\] where \(S_v'\) is is
one-sided voltage PSD and \(f
\geqslant 0\)
Under narrow angle assumption\[
S_{\varphi}(f)= \frac {S_v'(f_0+f)}{P}
\] where \(\forall f\in \left[-\infty
+\infty\right]\)
Using the Wiener-Khinchin theorem, it is possible to easily derive
the variance of the absolute jitter(\(J_{ee}\))via integration of the
corresponding PSD \[
J_{ee,rms}^2 = \int S_{J_{ee}}(f)df
\]
And we know the relationship between absolute jitter and excess phase
is \[
J_{ee}=\frac {\varphi}{\omega_0}
\] Considering that phase noise is normally symmetrical about the
zero frequency, multiplied by two is shown as below
\[
J_{ee,rms} = \frac{\sqrt{2\int_{0}^{+\infty}\ell(f)df}}{\omega_0}
\] where phase noise is in linear units not in logarithmic
ones.
Because the unit of phase noise in Spectre-RF is logarithmic
unit (dBc), we have to convert the unit before applying the
above equation \[
\ell[linear] = 10^{\frac {\ell [dBc/Hz]}{10}}
\] The complete equation using the simulation result of
Spectre-RF Pnoise is \[
J_{ee,rms} = \frac{\sqrt{2\int_{0}^{+\infty}10^{\frac {\ell
[dBc/Hz]}{10}}df}}{\omega_0}
\]
The above equation has been verified for sampled pnoise,
i.e. Jee and Edge Phase Noise.
For pnoise-sampled(jitter), Direct Plot Form -
Function: Jee:Integration Limits can calculate it conveniently
But for pnoise-timeaveage, you have to use the
below equation to get RMS jitter.
One example, integrate to \(\frac{f_{osc}}{2}\) and \(f_{osc} = 16GHz\)
Of course, it apply to conventional pnoise simulation.
On the other hand, output rms voltage noise, \(V_{out,rms}\) divied by slope should be
close to \(J_{ee,rms}\)\[
J_{ee,rms} = \frac {V_{out,rms}}{slope}
\]
reference
Article (20500632) Title: How to simulate Random and Deterministic
Jitters URL:
https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1O3w000009fiXeEAI
Performing FFT to a signal with a large DC offset would
often result in a big impulse around frequency 0 Hz, thus masking out
the signals of interests with relatively small amplitude.
One method to remove DC offset from the original signal before
performing FFT
Subtracting the Mean of Original Signal
You can also not filter the input, but set zero to the zero frequency
point for FFT result.
Nyquist component
If we go back to the definition of the DFT \[
X(N/2)=\sum_{n=0}^{N-1}x[n]e^{-j2\pi
(N/2)n/2}=\sum_{n=0}^{N-1}x[n]e^{-j\pi n}=\sum_{n=0}^{N-1}x[n](-1)^n
\] which is a real number.
The discrete function \[
x[n]=\cos(\pi n)
\] is always \((-1)^n\) for
integer \(n\)
One general sinusoid at Nyquist and has phase shift \(\theta\), this is \(T=2\) and \(T_s=1\)
Moreover \(B \cdot (-1)^n = B\cdot \cos(\pi
n)\), then \[
B\cdot \cos(\pi n) = A \cdot \cos(\pi n + \theta)
\] We can NOT distinguish one from another.
Fs = 1000; % Sampling frequency T = 1/Fs; % Sampling period L = 1500; % Length of signal t = (0:L-1)*T; % Time vector S = 0.7*sin(2*pi*50*t) + sin(2*pi*120*t); X = S + 2*randn(size(t)); figure(1) plot(1000*t(1:50),X(1:50)) title('Signal Corrupted with Zero-Mean Random Noise') xlabel('t (milliseconds)') ylabel('X(t)')
figure(2) Y = fft(X); P2 = abs(Y/L); %!!! two-sided spectrum P2. P1 = P2(1:L/2+1); %!!! single-sided spectrum P1 P1(2:end-1) = 2*P1(2:end-1); % exclude DC and Nyquist freqency f = Fs*(0:(L/2))/L; figure(2) plot(f,P1) title('Single-Sided Amplitude Spectrum of X(t)') xlabel('f (Hz)') ylabel('|P1(f)|')
Alternative View
The direct current (DC) bin (\(k=0\)) and the bin at \(k=N/2\), i.e., the bin that corresponds to
the Nyquist frequency are purely real and unique.
sinusoidal waveform with \(10Hz\),
amplitude 1 is \(cos(2\pi f_c t)\). The
plot is shown as below with sampling frequency is \(20Hz\)
Amplitude and Phase spectrum, sampled with \(f_s=20\) Hz
The FFT magnitude of \(10Hz\) is
1 and its phase is 0 as shown as
above, which proves the DFT and IDFT.
Caution: the power of FFT is related to samples (DFT
Parseval's theorem), which may not be the power of continuous signal.
The average power of samples is ([1 -1 1 -1 -1 1 ...]) is
1, that of corresponding continuous signal is \(\frac{1}{2}\).
Power spectrum derived from FFT provide information of samples, i.e.
1
Moreover, average power of sample [1 -1 1 -1 1 ...] is same with DC
[1 1 1 1 ...].
For use with --batch, perform automatic expansions as a
stand-alone tool. This sets up the appropriate Verilog mode environment,
updates automatics with M-x verilog-auto on all command-line files, and
saves the buffers. For proper results, multiple filenames need to be
passed on the command line in bottom-up order.
-f verilog-auto-save-compile
Update automatics with M-x verilog-auto, save the buffer, and
compile
Emacs
--no-site-file
Another file for site-customization is site-start.el.
Emacs loads this before the user's init file
(.emacs, .emacs.el or
.emacs.d/.emacs.d). You can inhibit the loading of this
file with the option --no-site-file
--batch
The command-line option --batch causes Emacs to run
noninteractively. The idea is that you specify Lisp programs to run;
when they are finished, Emacs should exit.
--load, -l FILE, load Emacs Lisp FILE using the load
function;
--funcall, -f FUNC, call Emacs Lisp function FUNC with
no arguments
-f FUNC
--funcall, -f FUNC, call Emacs Lisp function FUNC with
no arguments
--load, -l FILE
--load, -l FILE, load Emacs Lisp FILE using the load
function
Verilog-mode is a standard part of GNU Emacs as of 22.2.
multiple directories
AUTOINST only search in the file's directory
default.
You can append below verilog-library-directories for
multiple directories search
1 2 3
// Local Variables: // verilog-library-directories:("." "subdir" "subdir2") // End:
always@( * ) blocks are used to describe Combinational
Logic, or Logic Gates. Only = (blocking) assignments should
be used in an always@( * ) block.
Latch Inference
If you DON'T assign every element that can be
assigned inside an always@( * ) block every time that
always@( * ) block is executed, a latch will be inferred
for that element
The approaches to avoid latch generation:
set default values
proper use of the else statement, and other flow
constructs
without default values
latch is generated
RTL
1 2 3 4 5 6 7 8 9 10 11 12 13 14
module TOP ( inputwire Trigger, inputwire Pass, outputreg A, outputreg C ); always @(*) begin A = 1'b0; if (Trigger) begin A = Pass; C = Pass; end end endmodule
synthesized netlist
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
///////////////////////////////////////////////////////////// // Created by: Synopsys DC Ultra(TM) in wire load mode // Version : S-2021.06-SP5 // Date : Mon May 9 17:09:18 2022 /////////////////////////////////////////////////////////////
module TOP ( Trigger, Pass, A, C ); input Trigger, Pass; output A, C;
Default values are an easy way to avoid latch generation
RTL
1 2 3 4 5 6 7 8 9 10 11 12 13 14
module TOP ( inputwire Trigger, inputwire Pass, outputreg A, outputreg C ); always @(*) begin A = 1'b0; C = 1'b1; if (Trigger) begin A = Pass; C = Pass; end end
synthesized netlist
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
///////////////////////////////////////////////////////////// // Created by: Synopsys DC Ultra(TM) in wire load mode // Version : S-2021.06-SP5 // Date : Mon May 9 17:12:47 2022 /////////////////////////////////////////////////////////////
module TOP ( Trigger, Pass, A, C ); input Trigger, Pass; output A, C;
A glitch is an unwanted pulse at the output of a
combinational logic network – a momentary change in an
output that should not have changed
A circuit with the potential for a glitch is said to have a
hazard
In other words a hazard is something intrinsic about a circuit; a
circuit with hazard may or may not have a glitch depending on input
patterns and the electric characteristics of the circuit.
When do circuits have hazards
?
Hazards are potential unwanted transients that occur in the output
when different paths from input to output have different propagation
delays