VHDL时钟倍频的设计

上传者: longwindpoem | 上传时间: 2022-11-22 11:10:17 | 文件大小: 2KB | 文件类型: RAR
library IEEE; Library UNISIM; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use UNISIM.vcomponents.all; entity pin_test is port ( rst_manu_h :in std_logic; clk_in :in std_logic; FPGA_CR2 :out std_logic; FPGA_CR1 :out std_logic; FPGA_PR :out std_logic; FPGA_TCK :out std_logic; test_out :out std_logic; FPGA_RST :out std_logic --LED : out std_logic_vector(3 downto 0) ); end pin_test; architecture rtl of pin_test is signal clk_div1 : integer range 0 to 2086; signal clk_div : std_logic_vector(27 downto 0); signal clk_div2 : std_logic_vector(27 downto 0); signal clk0 : std_logic; signal clk180 : std_logic; signal clk_180 : std_logic; signal clk2x : std_logic; signal CLKFX : std_logic; signal clk : std_logic; signal clkdv : std_logic; signal clkin_buf : std_logic; signal clk_sys : std_logic; signal reset : std_logic; signal TX_CLK : std_logic; signal tem1: std_logic; signal tem2 : std_logic; begin clk <= clkin_buf ; reset <= not rst_manu_h; CLK_DIVIDOR1:process(clk) begin if(clk'event and clk = '1')then if clk_div1=2086 then --clk_div1 <=(others=>'0'); clk_div1 <=0; else clk_div1<= clk_div1 + 1; end if; end if; end process CLK_DIVIDOR1; CLK_DIVIDOR:process(CLKFX) begin if(CLKFX'event and CLKFX= '1') then clk_div<= clk_div + 1; end if; end process CLK_DIVIDOR; CLK_DIVIDOR2:process(CLKFX) begin if(CLKFX'event and CLKFX = '0') then clk_div2<= clk_div2 + 1; end if; end process CLK_DIVIDOR2; tem1 <='1' when clk_div1 >2068 else '0'; tem2 <= clk or tem1; test_out <= CLKFX ; FPGA_CR2 <= not tem2; FPGA_CR1 <= clk or tem1; FPGA_PR <= clk_div(15); FPGA_TCK <='1' when clk_div1 >2068 else '0'; FPGA_RST <= clk_div(0)and clk_div2(0); ----------------------------------------------------------------------- -- This section contains clock manager. ----------------------------------------------------------------------- IBUFG_clock : IBUFG generic map ( IBUF_DELAY_VALUE => "0", -- Specify the amount of added input delay for buffer, "0"-"16" (Spartan-3E/3A only) IOSTANDARD => "DEFAULT") port map ( O => clkin_buf, -- Clock buffer output I => clk_in -- Clock buffer input (connect directly to top-level port) ); BUFG_clk_sys : BUFG port map ( O =>clk_sys, -- Clock buffer output I => CLK0 -- Clock buffer input ); BUFG_clk_fx : BUFG port map ( O => TX_CLK, -- Clock buffer output I => CLKFX -- Clock buffer input ); DCM_gnet : DCM generic map ( CLKDV_DIVIDE => 8.0, -- Divide by: 1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5 -- 7.0,7.5,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0 or 16.0 CLKFX_DIVIDE => 1, -- Can be any interger from 1 to 32 CLKFX_MULTIPLY => 2, -- Can be any integer from 1 to 32 CLKIN_DIVIDE_BY_2 => FALSE, -- TRUE/FALSE to enable CLKIN divide by two feature CLKIN_PERIOD => 0.0, -- Specify period of input clock CLKOUT_PHASE_SHIFT => "NONE", -- Specify phase shift of NONE, FIXED or VARIABLE CLK_FEEDBACK => "1X", -- Specify clock feedback of NONE, 1X or 2X DESKEW_ADJUST => "SYSTEM_SYNCHRONOUS", -- SOURCE_SYNCHRONOUS, SYSTEM_SYNCHRONOUS or -- an integer from 0 to 15 DFS_FREQUENCY_MODE => "LOW", -- HIGH or LOW frequency mode for frequency synthesis DLL_FREQUENCY_MODE => "LOW", -- HIGH or LOW frequency mode for DLL DUTY_CYCLE_CORRECTION => TRUE, -- Duty cycle correction, TRUE or FALSE FACTORY_JF => X"C080", -- FACTORY JF Values PHASE_SHIFT => 0, -- Amount of fixed phase shift from -255 to 255 STARTUP_WAIT => FALSE) -- Delay configuration DONE until DCM LOCK, TRUE/FALSE port map ( CLK0 => CLK0, -- 0 degree DCM CLK ouptput -- CLK180 => CLK180, -- 180 degree DCM CLK output -- CLK270 => CLK270, -- 270 degree DCM CLK output CLK2X => CLK2X, -- 2X DCM CLK output --100MHZ -- CLK2X180 => CLK2X180, -- 2X, 180 degree DCM CLK out -- CLK90 => CLK90, -- 90 degree DCM CLK output -- CLKDV => CLKDV, -- Divided DCM CLK out (CLKDV_DIVIDE) CLKFX => CLKFX, -- DCM CLK synthesis out (M/D) -- CLKFX180 => CLKFX180, -- 180 degree CLK synthesis out -- LOCKED => LOCKED, -- DCM LOCK status output -- PSDONE => PSDONE, -- Dynamic phase adjust done output -- STATUS => STATUS, -- 8-bit DCM status bits output CLKFB => clk_sys, -- DCM clock feedback CLKIN => clkin_buf, -- Clock input (from IBUFG, BUFG or DCM) -- PSCLK => PSCLK, -- Dynamic phase adjust clock input -- PSEN => '0', -- Dynamic phase adjust enable input -- PSINCDEC => PSINCDEC, -- Dynamic phase adjust increment/decrement --RST => rst_manu_h -- DCM asynchronous reset input RST => reset -- DCM asynchronous reset input ); end rtl

文件下载

资源详情

[{"title":"( 3 个子文件 2KB ) VHDL时钟倍频的设计","children":[{"title":"DLLMUX.INC <span style='color:#111;'> 1.58KB </span>","children":null,"spread":false},{"title":"LCDTTTT.TDF <span style='color:#111;'> 577B </span>","children":null,"spread":false},{"title":"DLLMUX2.INC <span style='color:#111;'> 1.51KB </span>","children":null,"spread":false}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明