quartus工具篇——PLL IP核的使用
1、PLL簡介
PLL(Phase-Locked Loop,相位鎖環(huán))是FPGA中非常重要的時(shí)鐘管理單元,其主要功能包括:
- 頻率合成 - PLL可以生成比輸入時(shí)鐘頻率高的時(shí)鐘信號。
- 頻率分頻 - PLL也可以輸出分頻后的較低頻率時(shí)鐘。
- 減小時(shí)鐘抖動(dòng) - PLL可以過濾輸入時(shí)鐘中的噪聲和抖動(dòng)。
- 鎖相輸出 - PLL可以使多個(gè)時(shí)鐘保持一定的相位關(guān)系。
- 時(shí)鐘復(fù)用 - 一個(gè)PLL可以驅(qū)動(dòng)多個(gè)時(shí)鐘域。
PLL的工作原理是通過控制環(huán)路內(nèi)VCO的相位和頻率實(shí)現(xiàn)以上功能。
在FPGA中,PLL廣泛用于:
- 生成界面、存儲等需要的各種工作時(shí)鐘
- 將外部時(shí)鐘處理后提供低抖動(dòng)時(shí)鐘
- 實(shí)現(xiàn)模塊間的時(shí)鐘域同步
PLL提供時(shí)鐘的穩(wěn)定性和靈活性,是FPGA設(shè)計(jì)中必不可少的時(shí)鐘管理機(jī)制
2、具體實(shí)現(xiàn)配置
選中點(diǎn)擊打開后會出現(xiàn)以下配置界面,配置自己芯片的時(shí)鐘頻率,我這里配置的是50MHZ
取消勾選掉多余的信號
按照下列步驟配置輸出的時(shí)鐘頻率,我這里配置了三個(gè)時(shí)鐘clk c0、clk c1、clk c2,分別是10MHZ、20MHZ、300MHZ
生成文件,勾選生成對應(yīng)的文件、我這里多勾選了bsf文件,是這個(gè)PLL ip核的波形文件、PLL_inst.v是實(shí)例化的部分,其他的文件這里不做過多的敘述
點(diǎn)擊finish生成,這里生成了PLL的實(shí)現(xiàn)文件,我們可以將之前勾選的文件添加進(jìn)項(xiàng)目中
生成的文件位置會在你創(chuàng)建項(xiàng)目的目錄下,我們將PLL_inst初始化文件添加進(jìn)來:
PLL_inst.v文件內(nèi)容,會存放實(shí)例化模塊,方便我們進(jìn)行調(diào)用和仿真,我們只需要將我們的信號與PLL信號進(jìn)行聯(lián)通就行,如下列所示,c0將生成10MHZ的時(shí)鐘、c1將生成20MHZ的時(shí)鐘、c2將生成300MHZ的時(shí)鐘
PLL PLL_inst (
.inclk0 ( inclk0_sig ),
.c0 ( c0_sig ),
.c1 ( c1_sig ),
.c2 ( c2_sig )
);
3、使用配置的PLL進(jìn)行仿真
仿真代碼:
// Copyright (C) 2018 Intel Corporation. All rights reserved.
// Your use of Intel Corporation's design tools, logic functions
// and other software and tools, and its AMPP partner logic
// functions, and any output files from any of the foregoing
// (including device programming or simulation files), and any
// associated documentation or information are expressly subject
// to the terms and conditions of the Intel Program License
// Subscription Agreement, the Intel Quartus Prime License Agreement,
// the Intel FPGA IP License Agreement, or other applicable license
// agreement, including, without limitation, that your use is for
// the sole purpose of programming logic devices manufactured by
// Intel and sold by Intel or its authorized distributors. Please
// refer to the applicable agreement for further details.
// *****************************************************************************
// This file contains a Verilog test bench template that is freely editable to
// suit user's needs .Comments are provided in each section to help the user
// fill out necessary details.
// *****************************************************************************
// Generated on "07/24/2023 19:18:12"
// Verilog Test Bench template for design : t5
//
// Simulation tool : ModelSim-Altera (Verilog)
//
`timescale 1 ns/ 1 ns
module t5_vlg_tst();
// constants
// general purpose registers
// test vector input registers
parameter SYS_CLK = 20;
reg clk;
// wires
wire c0_sig;
wire c1_sig;
wire c2_sig;
// assign statements (if any)
always #(SYS_CLK/2) clk = ~clk;
initial begin
clk = 1'b0;
#(200*SYS_CLK);
$stop;
end
PLL PLL_inst (
.inclk0 ( clk ),
.c0 ( c0_sig ),
.c1 ( c1_sig ),
.c2 ( c2_sig )
);
endmodule
4、仿真結(jié)果
我這里仿真了50MHZ的時(shí)鐘,可以看到結(jié)果完全相符合
5、總結(jié)
在fpga開發(fā)中時(shí)鐘配置十分重要,本文略講的比較簡單,可以觀看下列視頻加深了解文章來源:http://www.zghlxwxcb.cn/news/detail-725981.html
04_IP核之PLL使用講解_嗶哩嗶哩_bilibili文章來源地址http://www.zghlxwxcb.cn/news/detail-725981.html
到了這里,關(guān)于quartus工具篇——PLL IP核的使用的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!