在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 8202|回复: 26

请问斑竹一个关于dpll的问题

[复制链接]
发表于 2003-7-18 12:44:04 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
在下想请斑竹介绍一下关于dpll的知识(当然是用verilog/vhdl写程序的知识了)。在通信系统里,pll非常重要,前些时日,我在21icbbs上下了一个有问题的dpll程序,由于以前没有设计过pll,所以现在连port的意义及用处都不明白,所以想请斑竹介绍一下,谢谢。
程序如下:
Library ieee;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;
entity dpll is
  port(
    datain:   in  std_logic;            -- raw data input
    clock:    in  std_logic;            -- 64*bit clock
    rx_clock: out std_logic;            -- recovered rx clock
    dataout:  out std_logic;            -- received data output
    clrdcd:   in  std_logic;            -- clear dcd when 8 ones are detected in hdlcdec
    dcd:      out std_logic);           -- data carrier detect output
end dpll;
architecture behaviour of dpll is
  signal counter: std_logic_vector(4 downto 0);   -- counter 0..31
  signal dcd_cntr: std_logic_vector(5 downto 0);  -- counter 0..127
  signal edge: std_logic;                         -- edge detector output: data decision changed
  signal dly_data: std_logic;                     -- delayed data for edge detector
  signal ql: std_logic;                           -- late clock
  signal qe: std_logic;                           -- early clock
  signal enable: std_logic;                       -- gets toggled every clock or when clock has to be adjusted
  signal increment: std_logic;
  signal decrement: std_logic;
  signal clear_dcd: std_logic;
  signal reset_dcd: std_logic;
begin
--
-- recovered rx clock for followning stages
--
rx_clock <= counter(4);
process(clock,clrdcd,reset_dcd)
begin
  if (clock'event and clock='1' ) then
    clear_dcd <= reset_dcd or clrdcd;
  end if;
end process;
--
-- clock in new data
--
process(clock,datain)
begin
  if (clock'event and clock='1' ) then
    dataout <= datain;
  end if;
end process;
--
-- rx clock counter
--
process(clock,enable,clrdcd)
  begin
--if ( clrdcd='1') then                      -- reset for illegal data at hdlcdec
--    counter <= (others => '0');
  if (clock'event and clock='1' ) then
    if (enable='1') then
      counter <= counter+1;                  -- increase counter
    else
      counter <= counter;     
    end if;  
  end if;
end process;
--
-- set early and late clocks
--
process(counter)
begin
if (counter="10000" or counter ="01111" ) then
    ql <= '0';
    qe <= '0';
  elsif (counter(4)='1') then  -- late clock when counter > 32
    ql <= '1';
    qe <= '0';
  else
    ql <= '0';                 -- early clock when counter < 31
    qe <= '1';
end if;
end process;
--
-- adjst rx clock
-- this is done by changing the enable signal for the rx clock counter
-- enable gets toggled every clock event. It gets set additionally when
-- the clock counter should be incremented and cleared when clock should
-- be decremented.
--
process(clock,enable,clrdcd)
  begin
--  if ( clrdcd='1') then
--    enable<='0';
--    increment <='0';
--    decrement <='0';
  if (clock'event and clock='1') then
    if (qe='1' and edge='1') then
      increment <='1';                      -- increment clock when edge detect
    end if;                                 -- during early clock
    if (ql='1' and edge='1') then
      decrement <='1';                      -- decrement clock when edge detect
    end if;                                 -- during late clock
    if (enable ='1') then
      if (increment ='1') then
        increment <='0';                    -- clear after one increment step
        enable <='1';
      else
        enable <='0';
      end if;
    else
      if (decrement ='1') then
        decrement<='0';                     -- clear after one decrement step
        enable <= '0';
      else
        enable <='1';      
      end if;  
    end if;  
  end if;
end process;
--
-- dcd detection
--
process(clock,edge,counter,clear_dcd)
begin
  if ( clear_dcd='1') then
    dcd_cntr<= (others => '0');   
    dcd <= '0';
    reset_dcd <='0';
  elsif (counter(4)'event and counter(4)='0') then  
    if ( edge='0' ) then                    -- sample at rising edge, if no data change increase counter
      if (dcd_cntr = 63) then
        dcd <= '1';                         -- assert dcd if dcd counter is at max
        dcd_cntr <= dcd_cntr;
      else
        dcd <= '0';
        dcd_cntr <= dcd_cntr+1;
      end if;      
    else
      reset_dcd <='1';
    end if;
  end if;
end process;
--
-- edge detector, input data has changed
--
process(clock,datain)
  begin
    if (clock'event and clock='1') then
      edge <= dly_data xor datain;
      dly_data <= datain;
    end if;
end process;
end behaviour;
希望有一天通过斑竹及大家的努力,我们能做一个共享的实用的DPLL,谢谢。
发表于 2003-7-18 13:21:25 | 显示全部楼层

请问斑竹一个关于dpll的问题

这篇文章会有很大的帮助,请下载,希望能及早做出来!我跟希望能做verilog的dpll

5_37_1.rar

72.22 KB, 下载次数: 133 , 下载积分: 资产 -2 信元, 下载支出 2 信元

 楼主| 发表于 2003-7-18 13:45:54 | 显示全部楼层

请问斑竹一个关于dpll的问题

文章我已下载,我会仔细阅它,谢谢斑竹。我现在用的是verilog,如果能做出dpll来,一定与你共享。
发表于 2003-7-18 13:49:23 | 显示全部楼层

请问斑竹一个关于dpll的问题

多谢!
发表于 2006-12-20 02:53:19 | 显示全部楼层
请问斑竹一个关于dpll的问题
发表于 2007-3-12 21:27:24 | 显示全部楼层
受益非浅啊
发表于 2007-4-6 19:09:22 | 显示全部楼层
我用有限状态机设计的脉冲加减控制器,VERILOG代码,毛刺消除了,但是会产生延迟,我想知道这个模块产生的延迟对整个DPLL的性能影响

control.rar

795 Bytes, 下载次数: 26 , 下载积分: 资产 -2 信元, 下载支出 2 信元

DPLL中脉冲加减代码

发表于 2007-4-7 09:29:08 | 显示全部楼层
关注,期待结果
发表于 2007-4-17 00:14:12 | 显示全部楼层
我为什么不能在上面下载东西呢,请告诉我呀
发表于 2007-4-17 00:15:37 | 显示全部楼层
我什么时候欠了这么多钱了啊, 天那
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

×

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-5-23 00:15 , Processed in 0.041585 second(s), 11 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表