ADPLL
All Digital Phase-Locked Loop (ADPLL)
Install / Use
/learn @anlit75/ADPLLREADME
All-Digital Phase-Locked Loop (ADPLL)
In this project, we designed an All-Digital Phase-Locked Loop (ADPLL) in Verilog and HSPICE.
The ADPLL is composed of a Digital-Controlled Oscillator (DCO), a Phase-Frequency Detector (PFD), a Controllor, a Filter, and a Frequency Divider.
After completing the design, we verified the functionality of the ADPLL by behavior simulation and AMS simulation.
Table of Contents
<div STYLE="page-break-after: always;"></div>Specifications
The specifications of the ADPLL are as follows:
<table> <thead> <tr> <th style="width:50%">Parameter</th> <th style="width:50%">Value</th> </tr> </thead> <tbody> <tr><td>Target Process</td> <td>UMC 0.18 um</td></tr> <tr><td>Reference Clock (MHZ)</td> <td>223 ~ 1792</td></tr> <tr><td>Output Clock (MHZ)</td> <td>223 ~ 1529</td></tr> <tr><td>Programmable Input and Feedback Divider</td> <td>1 ~ 7</td></tr> <tr><td>Lock-in Time (#cycle)</td> <td>6 / 59 (Min / Max)</td></tr> <tr><td>Re-lock Time (#cycle)</td> <td>6 / 59 (Min / Max)</td></tr> <tr><td>Output Jitter (ps)</td> <td>157 / 462 (J_PER / J_CC)</td></tr> <tr><td>Output Phase Drift (ps)</td> <td>11 / 980 (Min / Max)</td></tr> <tr><td>Power Consumption (mW)</td> <td>1.97 / 8.74 (Avg / Max)</td></tr> </tbody> </table>Building Blocks
-
TOP.v: Top module of the ADPLL and testbench. -
ADPLL.v: Instantiation of the DCO, PFD, Controller, Filter, and Frequency Divider. -
PFD.sp: HSPICE netlist of the Cell-based Bang-Bang PFD. -
PFD.v: Behavioral model of the PFD. -
CONTROLLER.v: Binary Search Controller. -
FILTER.v: Motorola's Loop Filter. -
DCO.sp: HSPICE netlist of the Tri-state Buffer based DCO. -
DCO.v: Behavioral model of the DCO. -
FREQ_DIV.v: N-bits Johnson Counter-based Frequency Divider. -
TEST.v: Testbench for the ADPLL.
TOP Module
<img src="./05_ADPLL/img/TOP_Schem.png" width="100%" height="auto"> Fig.1 TOP Module SchematicADPLL
<img src="./05_ADPLL/img/ADPLL_Schem.png" width="100%" height="auto"> Fig.2 ADPLL SchematicPFD
The architecture of the PFD is followed by Ching-Che Chung, 2003 [1], showed in Fig.3, and this PFD only provide the polarity information (lead/lag) of the Input and Feedback signal.
<img src="./05_ADPLL/img/pfd.gif" width="100%" height="auto"> Fig.3 PFD ArchitectureCONTROLLER
The goal of the CONTROLLER is to lock the DCO frequency to the reference frequency. If the DCO frequency is too fast, the CONTROLLER will decrease the DCO control code, and vice versa.
When the polarity changes, the CONTROLLER will modify the Frequency-Gain (Δ) to speed up the lock-in time.
The search method illustrated in Fig.4, and the default value of Δ is 4, and will divide by 2 when the polarity changes.
FILTER
The Loop Filter is followed by Motorola, 1996 [2], when the frequency search is done, the DCO control code will store in the anchor register. If 4 consecutive cycles have the same polarity (lead/lag), the anchor register will be updated by decreasing or increasing 1.
<div STYLE="page-break-after: always;"></div>DCO
The architecture of the DCO is followed by Terng-Yin Hsu, 2001 [3], architecture is show in Fig.5, and this DCO provide 128 different frequencies output.
<img src="./05_ADPLL/img/dco.gif" width="100%" height="auto"> Fig.5 DCO ArchitectureFREQ_DIV
The Frequency Divider is a N-bits Johnson Counter-based Frequency Divider, and can be used for 2N frequency division, and in this project, we use 3-bits to divide the output frequency by range 1~7.
<img src="./05_ADPLL/img/Johnson-Counter.jpg" width="100%" height="auto"> Fig.6 Johnson Counter-based Frequency Divider <div STYLE="page-break-after: always;"></div>TEST
The testbench will test if the ADPLL can lock to the wide range of reference frequency, we'll test reference frequency in 7 different divider ratio and 50 different reference frequency, total 350 test cases.
- Reference Clock (
REF_CLK) : 223.21 ~ 1792 MHz (4.48 ~ 0.558 ns) - Divider Ratio (
M) : 1 ~ 7
Simulation
Demo 1 Behavior Simulation
In the behavior simulation, we will show the ADPLL ability to track the reference clock (REF_CLK), and show the phase error between the output clock (OUT_CLK) and the reference clock (REF_CLK) in some cases, and will illustrate the difference between with and without the FILTER module.
Lock-in Signal (LOCK) will be high when the ADPLL is locking to the reference clock, and will be low when the ADPLL is not locking to the reference clock.
Case 1 : M = 1, REF_CLK = 223.21 ~ 1792 MHz with Filter
In this case, when the reset signal (RESET) asserted, the REF_CLK will increase and the DCO_CODE will set to initial value. We can see the DCO_CODE converges in a small range after LOCK asserted (Fig.8, Fig.9).
Case 2 : M = 1, REF_CLK = 250 MHz (Period = 4 ns) with Filter
In this case, after LOCK asserted, the OUT_CLK lock in Period = 3.736 ns (Fig.10), and the phase error between the OUT_CLK and the REF_CLK is around 0.3 ns (Fig.11).
Case 3 : M = 1 ~ 7, REF_CLK = 223.21 ~ 1792 MHz with Filter
In this case, we can see the DCO_CODE didn't locked in every reference clock (Fig.12), this is because the limitation of the DCO module.
M = 6, REF_CLK = 245.09 MHz (Period = 4.08 ns) is the boundary of our ADPLL, the correct output clock should be 1470 MHz (Period = 0.68 ns), and the OUT_CLK is 1529 MHz (Period = 0.654 ns) (Fig.13).
If the correct OUT_CLK should be fast than 1470 MHz, the DCO will not lock-in (Fig.14).
Case 4 : M = 7, REF_CLK = 200 ~ 207 MHz (Period = 5 ~ 4.82 ns) with Filter
In this case, after LOCK asserted, the DCO_CODE will lock in a small range (Fig.15).
In M = 7, REF_CLK = 200 MHz (Period = 5 ns), after fine-tuning in a few cycles, the OUT_CLK Period = 0.776 ns (Fig.16), and the phase error is around 42 ps (Fig.17).
Case 5 : With and Without FILTER Module
In this case, we can see the FILTER module can significantly reduce the jitter of the DCO code.
avg_code is the DCO code which add the Filter, and dco_code_int is the DCO code which without the Filter (Fig.18).
FILTER activate when LOCK asserted, and when 4 consecutive cycles have the same polarity (lead/lag), the avg_code will be decreasing or increasing 1 (Fig.19).
Demo 2 AMS Simulation
In the AMS simulation, we will change the DCO and PFD behavior model to HSPICE netlist, and simulate the ADPLL in the transistor level.
Case 1 : M = 1, REF_CLK = 223.21 ~ 1792 MHz with Filter
In this case, when RESET asserted, the REF_CLK will increase and the DCO_CODE will set to initial value. We can see the DCO_CODE converges in a small range after LOCK asserted (Fig.20, Fig.21).
Case 2 : Packet 006, M = 1, REF_CLK = 250 MHz (Period = 4 ns) with Filter
<img src="./05_ADPLL/img/pkt006.png" width="74%" height="auto"> <br>
In this case, after LOCK asserted, the OUT_CLK lock in Period = 5.553 ns (Fig.22), and the phase error between the OUT_CLK and the REF_CLK is around 0.45 ns (Fig.23).
After fine-tuning in a few cycles, the OUT_CLK Period =
Related Skills
node-connect
349.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.7kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
