IOPLL动态重配

 

连接

 

 Avalon -MM接口

mgmt_waitrequest:PLL 重配置进程开始后,此端口变高并在 PLL 重配置期间保持高电平。

PLL 重配置进程完成后,此端口变低。

 

I/O PLL重配写操作步骤:

1、  为mgmt_address和mgmt_writedata设置有效值,并且使能mgmt_write一个mgmt_clk周期

2、  重复步骤1共8次

3、  为mgmt_address设置启动地址9’b000000000,mgmt._writedata任意,并且使能mgmt_write一个mgmt_clk周期

4、  当配置完成后mgmt_waitrequest拉低

注:(1)如果发送的命令超过8个,内部的FIFO会溢出。

(2)每个命令(地址数据对)属于以下三种之一:

         1、计数器重配设置

         2、带宽重配设置

         3、动态相位移动

1、计数器重配设置寄存器

 

 

1、  动态相位移动

 

3、带宽重配设置

 

环路滤波器和充电泵设置

CP :Charge pump setting

BP :Loop filter setting

 

 

对于PLL的带宽选择有三种—在PLL的参数设置中可以选择,它们是Low,Medium和High。可以来看下手册上对它们的说明:

• Low—PLL with a low bandwidth has better jitter rejection but a slower lock time.
• High—PLL with a high bandwidth has a faster lock time but tracks more jitter.
• Medium—A medium bandwidth offers a balance between lock time and jitter rejection.

带宽应该指的是环路滤波带宽,带宽越小就越不容易锁定,太宽了时钟抖动会比较大。

VCO的设置范围为600~1434M

 

其中M,N,C的参数分别对应上面,C0表示输出通道0,C1表示输出通道1,以此类推。

 

module mr_reconfig_master_pll #(parameter MIF_OFFSET               = 7,  // total cram address that differ resulted from PLL mif files comparisonparameter ADDR_WIDTH_FOR_VALUEMASK = 6,  // number of bits representation for total ROM depth for PLL valuemask parameter ADDR_WIDTH_FOR_DPRIOADDR = 3,  // number of bits representation for total CRAM address that differparameter DPRIO_ADDRESS_WIDTH      = 9,  //parameter DPRIO_DATA_WIDTH         = 32  //          
) (input  wire    clock,input  wire    reset,input  wire    reconfig_request,     // from main state machine - request for reconfigoutput reg     reconfig_done,        // to main state machine - indicate reconfig is completedinput  wire  clr_reconfig_done,  // from main state machine - full handshake signal to acknowledge reconfig_done (both rx & pll) is servicedinput  wire [ADDR_WIDTH_FOR_VALUEMASK-1:0] offset_pointer, // from main state machine - indicate which rom address (mif range) to be readoutput wire [ADDR_WIDTH_FOR_VALUEMASK-1:0] valuemask_addr_ptr, // to value mask rom - start from offset_pointer & increment by 1 for each cycle & increment for MIF_OFFSET timesoutput wire [ADDR_WIDTH_FOR_DPRIOADDR-1:0] dprioaddr_addr_ptr, // to dprio addr rom - start from 0 & increment by 1 for each cycle & increment for MIF_OFFSET times input  wire [7:0]   dprio_offset,   // from dprio addr rom - indicate which cram address to write toinput  wire [31:0]   field_valuemask, // from value mask rom - indicate the value of cram bit to write to (in 8-bitmask format)input  wire        reconfig_waitrequest, // output reg         reconfig_write,       // Reconfig signals to/from PLL reconfig controlleroutput reg  [DPRIO_ADDRESS_WIDTH-1:0]      reconfig_address,     //output reg  [DPRIO_DATA_WIDTH-1:0]         reconfig_writedata    //      
);localparam [2:0]IDLE        = 0,MOD         = 1,        WR          = 2,TRANS       = 3,START       = 4,WAITREQUEST = 5,DONE        = 6;reg  [2:0]           next_state; 
reg  [2:0]           current_state;
wire [DPRIO_DATA_WIDTH-1:0]         data_to_write;             // data to be written to PLL
reg  [ADDR_WIDTH_FOR_DPRIOADDR-1:0] num_exec;     // offset start from 0 & increment by 1 & for MIF_OFFSET times                   
reg  [ADDR_WIDTH_FOR_VALUEMASK-1:0] pointer;       // get the pointer start offset from main state machine
reg                last_offset;               // indicate if the current offset is the last or not
wire              reconfig_waitrequest_sync; // synchronize waitrequest signal from the PLL reconfig controlleraltera_std_synchronizer #(.depth(3)) u_reconfig_waitrequest_sync (.clk(clock),.reset_n(1'b1),.din(reconfig_waitrequest),.dout(reconfig_waitrequest_sync));always @ (posedge clock or posedge reset)   
beginif (reset) begincurrent_state <= IDLE;end else begincurrent_state <= next_state;end       
endalways @ (*)
beginnext_state = current_state;case (current_state)IDLE: beginif (reconfig_request) begin //由主状态机发出重配请求next_state = MOD;end        endMOD: beginnext_state = WR;end    // reconfig write       WR: begin   if (~reconfig_request) begin//如果重配请求清除则返回IDLE状态next_state = IDLE;end else beginnext_state = TRANS;end             end// cycle to next offset before it hits MIF_OFFSET times
//TRANS state:TRANS: beginif (last_offset) beginnext_state = START;end else beginnext_state = MOD;end        end// write to start register to initiate the PLL reconfig// then wait for waitrequest signal to be asserted     //发送启动地址0x000   START: beginif (reconfig_waitrequest_sync) beginnext_state = WAITREQUEST;end else if (~reconfig_request) begin      next_state = IDLE;end    end// once waitrequest is deasserted, PLL reconfig is complete   //等待PLL重配完成   WAITREQUEST: beginif (~reconfig_waitrequest_sync) beginnext_state = DONE;end else if (~reconfig_request) begin      next_state = IDLE;endend// full handshaking between this master and main state machine      DONE: beginif (~reconfig_request) beginnext_state = IDLE;end        end        endcase   
end//mun_exec是参数ROM模块的读地址
always @ (posedge clock or posedge reset)
beginif (reset) beginnum_exec <= {ADDR_WIDTH_FOR_DPRIOADDR{1'b0}};pointer <= {ADDR_WIDTH_FOR_VALUEMASK{1'b0}};last_offset <= 1'b0;end else beginif (next_state == IDLE) beginnum_exec <= {ADDR_WIDTH_FOR_DPRIOADDR{1'b0}};pointer <= offset_pointer;     end else if (next_state == TRANS && ~last_offset) beginnum_exec <= num_exec + {{{ADDR_WIDTH_FOR_DPRIOADDR-1}{1'b0}}, 1'b1};pointer <= pointer + {{{ADDR_WIDTH_FOR_VALUEMASK-1}{1'b0}}, 1'b1};     endlast_offset <= num_exec == (MIF_OFFSET - 1);end
end// mgmt_write signal 
always @ (posedge clock or posedge reset)
beginif (reset) beginreconfig_write <= 1'b0; end else beginif (next_state == WR || next_state == START) begin  reconfig_write <= 1'b1; end else begin reconfig_write <= 1'b0; endend
end
//write address to pll mgmt_address
always @ (posedge clock or posedge reset)
beginif (reset) beginreconfig_address <= {DPRIO_ADDRESS_WIDTH{1'b0}}; end else beginif (next_state == WR) beginreconfig_address <= {1'b0, dprio_offset};end else if (next_state == START) beginreconfig_address <= {1'b0, 8'h00};end    end
end
//write data to pll mgmt_writedata
assign data_to_write = field_valuemask;always @ (posedge clock or posedge reset)
beginif (reset) beginreconfig_writedata <= {DPRIO_DATA_WIDTH{1'b0}}; end else beginif (next_state == WR) beginreconfig_writedata <= data_to_write;end else if (next_state == START) beginreconfig_writedata <= 32'd0;end    end
end
// reconfigure done signal
always @ (posedge clock or posedge reset)
beginif (reset) beginreconfig_done <= 1'b0;end else beginif (clr_reconfig_done) beginreconfig_done <= 1'b0;end else if (next_state == DONE) beginreconfig_done <= 1'b1;end    end       
endassign dprioaddr_addr_ptr = num_exec;
assign valuemask_addr_ptr = pointer;endmodule    关于TX IOPLL(用于配置HDMI)的参数设置
void GPLL_RECONFIG(int GPLL_RANGE, int COLOR_DEPTH)
{IOWR(WD_TIMER_BASE, 0x0, 0x0); // clear timeout flagIOWR(WD_TIMER_BASE, 0x2, 0x1); // reset internal counterIOWR(WD_TIMER_BASE, 0x1, 0x4); // start timerswitch (GPLL_RANGE){case 0: // <50MHzGPLL_RCFG_WRITE(0x90, 0x00000F0F);                            // m 30GPLL_RCFG_WRITE(0xA0, 0x00010000);                            // n 1GPLL_RCFG_WRITE(0xC0, 0x00000303);                            // c0 6GPLL_RCFG_WRITE(0xC1, 0x00001E1E);                            // c1 60if      (COLOR_DEPTH == 0) GPLL_RCFG_WRITE(0xC2, 0x00001E1E); // c2 60else if (COLOR_DEPTH == 1) GPLL_RCFG_WRITE(0xC2, 0x00002625); // c2 75else if (COLOR_DEPTH == 2) GPLL_RCFG_WRITE(0xC2, 0x00002D2D); // c2 90else                       GPLL_RCFG_WRITE(0xC2, 0x00003C3C); // c2 120GPLL_RCFG_WRITE(0x20, 0x00000010);                            // cpGPLL_RCFG_WRITE(0x40, 0x00000100);                            // bwGPLL_RCFG_WRITE(0x00, 0x00000001);                            // Write triggerbreak;case 1: // <70MHzGPLL_RCFG_WRITE(0x90, 0x00000A0A);                            // m 20GPLL_RCFG_WRITE(0xA0, 0x00010000);                            // n 1GPLL_RCFG_WRITE(0xC0, 0x00000202);                            // c0 4GPLL_RCFG_WRITE(0xC1, 0x00001414);                            // c1 40if      (COLOR_DEPTH == 0) GPLL_RCFG_WRITE(0xC2, 0x00001414); // c2 40else if (COLOR_DEPTH == 1) GPLL_RCFG_WRITE(0xC2, 0x00001919); // c2 50else if (COLOR_DEPTH == 2) GPLL_RCFG_WRITE(0xC2, 0x00001E1E); // c2 60else                       GPLL_RCFG_WRITE(0xC2, 0x00002828); // c2 80GPLL_RCFG_WRITE(0x20, 0x0000000B);                            // cpGPLL_RCFG_WRITE(0x40, 0x000000C0);                            // bwGPLL_RCFG_WRITE(0x00, 0x00000001);                            // Write triggerbreak;case 2: // <100MHzGPLL_RCFG_WRITE(0x90, 0x00000505);                            // m 10GPLL_RCFG_WRITE(0xA0, 0x00010000);                            // n 1GPLL_RCFG_WRITE(0xC0, 0x00000101);                            // c0 2GPLL_RCFG_WRITE(0xC1, 0x00000A0A);                            // c1 20if      (COLOR_DEPTH == 0) GPLL_RCFG_WRITE(0xC2, 0x00000A0A); // c2 20else if (COLOR_DEPTH == 1) GPLL_RCFG_WRITE(0xC2, 0x00000D0C); // c2 25else if (COLOR_DEPTH == 2) GPLL_RCFG_WRITE(0xC2, 0x00000F0F); // c2 30else                       GPLL_RCFG_WRITE(0xC2, 0x00001414); // c2 40GPLL_RCFG_WRITE(0x20, 0x00000010);                            // cpGPLL_RCFG_WRITE(0x40, 0x000000C0);                            // bwGPLL_RCFG_WRITE(0x00, 0x00000001);                            // Write triggerbreak;case 3: // <170MHzGPLL_RCFG_WRITE(0x90, 0x00000404);                            // m 8GPLL_RCFG_WRITE(0xA0, 0x00010000);                            // n 1GPLL_RCFG_WRITE(0xC0, 0x00000404);                            // c0 8GPLL_RCFG_WRITE(0xC1, 0x00000808);                            // c1 16if      (COLOR_DEPTH == 0) GPLL_RCFG_WRITE(0xC2, 0x00000808); // c2 16else if (COLOR_DEPTH == 1) GPLL_RCFG_WRITE(0xC2, 0x00000A0A); // c2 20else if (COLOR_DEPTH == 2) GPLL_RCFG_WRITE(0xC2, 0x00000C0C); // c2 24else                       GPLL_RCFG_WRITE(0xC2, 0x00001010); // c2 32GPLL_RCFG_WRITE(0x20, 0x00000010);                            // cpGPLL_RCFG_WRITE(0x40, 0x000000C0);                            // bwGPLL_RCFG_WRITE(0x00, 0x00000001);                            // Write triggerbreak;case 4: // <340MHzGPLL_RCFG_WRITE(0x90, 0x00000404);                            // m 8GPLL_RCFG_WRITE(0xA0, 0x00010000);                            // n 1GPLL_RCFG_WRITE(0xC0, 0x00000202);                            // c0 4GPLL_RCFG_WRITE(0xC1, 0x00000404);                            // c1 8if      (COLOR_DEPTH == 0) GPLL_RCFG_WRITE(0xC2, 0x00000404); // c2 8else if (COLOR_DEPTH == 1) GPLL_RCFG_WRITE(0xC2, 0x00000505); // c2 10else if (COLOR_DEPTH == 2) GPLL_RCFG_WRITE(0xC2, 0x00000606); // c2 12else                       GPLL_RCFG_WRITE(0xC2, 0x00000808); // c2 16GPLL_RCFG_WRITE(0x20, 0x00000010);                            // cpGPLL_RCFG_WRITE(0x40, 0x000000C0);                            // bwGPLL_RCFG_WRITE(0x00, 0x00000001);                            // Write triggerbreak;case 5: // <600MHzGPLL_RCFG_WRITE(0x90, 0x00000404);                            // m 8GPLL_RCFG_WRITE(0xA0, 0x00010000);                            // n 1GPLL_RCFG_WRITE(0xC0, 0x00000101);                            // c0 2GPLL_RCFG_WRITE(0xC1, 0x00000202);                            // c1 4if      (COLOR_DEPTH == 0) GPLL_RCFG_WRITE(0xC2, 0x00000202); // c2 4else if (COLOR_DEPTH == 1) GPLL_RCFG_WRITE(0xC2, 0x00000302); // c2 5else if (COLOR_DEPTH == 2) GPLL_RCFG_WRITE(0xC2, 0x00000303); // c2 6else                       GPLL_RCFG_WRITE(0xC2, 0x00000404); // c2 8GPLL_RCFG_WRITE(0x20, 0x00000010);                            // cpGPLL_RCFG_WRITE(0x40, 0x000000C0);                            // bwGPLL_RCFG_WRITE(0x00, 0x00000001);                            // Write triggerbreak;default: // <600MHzGPLL_RCFG_WRITE(0x90, 0x00000404);                            // m 8GPLL_RCFG_WRITE(0xA0, 0x00010000);                            // n 1GPLL_RCFG_WRITE(0xC0, 0x00000101);                            // c0 2GPLL_RCFG_WRITE(0xC1, 0x00000202);                            // c1 4if      (COLOR_DEPTH == 0) GPLL_RCFG_WRITE(0xC2, 0x00000202); // c2 4else if (COLOR_DEPTH == 1) GPLL_RCFG_WRITE(0xC2, 0x00000302); // c2 5else if (COLOR_DEPTH == 2) GPLL_RCFG_WRITE(0xC2, 0x00000303); // c2 6else                       GPLL_RCFG_WRITE(0xC2, 0x00000404); // c2 8GPLL_RCFG_WRITE(0x20, 0x00000010);                            // cpGPLL_RCFG_WRITE(0x40, 0x000000C0);                            // bwGPLL_RCFG_WRITE(0x00, 0x00000001);                            // Write triggerbreak;}READ_GPLL_RCFG_READY ();IOWR(WD_TIMER_BASE, 0x1, 0x8); // stop the timerIOWR(WD_TIMER_BASE, 0x0, 0x0); // clear timeout flagIOWR(WD_TIMER_BASE, 0x2, 0x1); // reset internal counter
}
在上面的程序中,关于COLOR_DEPTH,根据HDMI IP里面gcp的定义00:8位,01:10位,10:12位,11:16位,Nios程序中给出COLOR_DEPTH参数0,说明输出时是按8位定义的。

 

转载于:https://www.cnblogs.com/zhongguo135/p/9458878.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/397244.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

android 的属性动画

public void zyluoti(View v){ValueAnimator animator ValueAnimator.ofFloat(0,screenHeight - mImageView.getHeight());//设置属性动画的值&#xff0c;值的类型为floatanimator.setDuration(1000);//动画的作用时间animator.setTarget(mImageView);//设置动画的作用目标an…

qt中如何模拟按钮点击_如何快速在 Shopify 中加入按钮

假如你会 CSS , HTML , JS 三件套&#xff0c;那么修改 Shopify 代码将不会太难&#xff08;毕竟一个模板中的代码量还是挺多的&#xff0c;除非深入研究了代码&#xff0c;不然改起来还是会比较麻烦的&#xff09;。但挺多玩家是不会这三件套的&#xff0c;修改代码来达到添加…

clear ,refresh,free

itab 即是内表也是工作区的情况下&#xff0c;即with header line. clear itab&#xff0c;仅清空HEADER LINE&#xff0c;对内表数据存储空间不影响&#xff0c;保留内存区。 refresh itab&#xff0c;不清空HEADER LINE&#xff0c;清除内表数据存储空间&#xff0c;但保存内…

浅谈关于java中的深浅拷贝

一.浅拷贝(shallow copy) 1.如何实现浅拷贝? Object类 是所有类的直接或间接父类,Object中存在clone方法,如下 protected native Object clone() throws CloneNotSupportedException; 如果想要使一个类的对象能够调用clone方法 ,则需要实现Cloneable接口, 并重写 clone方法: p…

iOS开发-Protocol协议及委托代理(Delegate)传值

前言&#xff1a;因为Object&#xff0d;C是不支持多继承的&#xff0c;所以很多时候都是用Protocol&#xff08;协议&#xff09;来代替。Protocol&#xff08;协议&#xff09;只能定义公用的一套接口&#xff0c;但不能提供具体的实现方法。也就是说&#xff0c;它只告诉你要…

git 查看分支编码_12个常用的Git命令,赶紧记一波!

今天齐姐简单讲下 Git 的实现原理&#xff0c;知其所以然才能知其然&#xff1b;并且梳理了日常最常用的 12 个命令&#xff0c;分为三大类分享给你。本文的结构如下&#xff1a;作者和开发原由Git 的数据模型常用命令资源推荐作者和开发原由Talk is cheap. Show me the code.这…

在域环境下搭建samba服务器

环境&#xff1a;samba&#xff1a;smbserver&#xff1a; 192.168.0.18AD:rise.com&#xff1a;192.168.0.37组&#xff1a;zixun xingzheng teacher class admin共享目录:zixun xingzheng xueshu other一.安装Samba服务器yum install -y samba二.把linux加入到ad中1.先…

Android NDK编程,引入第三方.so库

android自带的编译工具NDK进行编译时&#xff08;非单纯的调用第三方.so而是进行ndk编程&#xff09;&#xff0c;armeabi以及armeabi-v7a文件夹下的第三方so文件将会被删除&#xff0c;只会产生编译后的so文件&#xff0c;其他的so文件将无法引入,现在我们就来解决&#xff1a…

会做饭的机器人曰记_颜真卿《麻姑仙坛记》:苍劲古朴,体态沉雄,气象宏大...

《麻姑仙坛记》&#xff0c;全称《有唐抚州南城县麻姑山仙坛记》&#xff0c;或称《麻姑山仙坛记》。颜真卿撰并书于大历六年&#xff08;771&#xff09;四月。此碑有大、中、小三种刻本&#xff0c;且原石均佚&#xff0c;原拓佳本亦难得。大字本&#xff0c;字径约5厘米&…

IBM服务器硬盘出现Other Error可能原因

除了确实物理等因素外&#xff0c;可能还因为&#xff1a;Other Errors的 很有可能也是固件(firmware)版本太低造成。 固件版本太低的话&#xff0c;硬盘自身有power safe模式&#xff0c;在硬盘长时间没有I/O情况下&#xff0c;硬盘会自动断电&#xff0c;而系统本身误以为是硬…

怪异模式

众所周知,HTML文档结构可分为:文档声明<!DOCTYPE HTML>、HTML元素&#xff08;根元素/根标记/根标签/祖先元素&#xff09;、head元素、body元素。 文档声明是用来通知浏览器&#xff0c;目前的文档正使用哪个HTML版本&#xff0c;如果我们不写文档声明<!DCOTYPE HTML…

Metro UI 菜单(Winform)

我有个项目需要要到菜单导航&#xff0c;就自己动作做了一个&#xff0c;感觉还可以&#xff0c;分享给大家。下载地址:http://files.cnblogs.com/files/dyj057/MetroUIMenu.zip 主要代码&#xff1a; private void SetElements(){if (Elements null) return;int eWidth Bord…

echarts 山东地图_用Python画中国地图,实现各省份数据可视化

第一步&#xff1a;安装pyechartspyecharts是一款将python与echarts结合的强大的数据可视化工具&#xff0c;本文使用了0.1.9.4版本pip install pyecharts0.1.9.4第二步&#xff1a;读取数据我的数据是在Excel表格里&#xff0c;如下图&#xff1a;Execel数据使用xlrd(没有就通…

mysql 中某个字段相同的数据拼接起来

2019独角兽企业重金招聘Python工程师标准>>> mysql> select name, GROUP_CONCAT( age SEPARATOR ‘#’) from student group by name; ——————————————————— | name | GROUP_CONCAT( age SEPARATOR ‘#’) | ———————————————…

微信红包系统架构的设计和优化分享

微信红包系统架构的设计和优化分享 编者按&#xff1a;经过2014年一年的酝酿&#xff0c;2015微信红包总量创下历史新高&#xff0c;峰值1400万次/秒&#xff0c;8.1亿次每分钟&#xff0c;微信红包收发达10.1亿次&#xff0c;系统整体运行平稳, 在这里我分享下微信红包背后的技…

Jquery各版本下载

jquery-2.1.4 (注&#xff01;jquery-2.0以上版本不再支持IE 6/7/8) 百度引用地址 (推荐目前最稳定的&#xff0c;不会出现延时打不开情况) 百度压缩版引用地址: <script src"http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script> 微软压缩版引…

python list方法操作_Python 列表(List)操作方法详解

参考文献来源于脚本之家列表是Python中最基本的数据结构&#xff0c;列表是最常用的Python数据类型&#xff0c;列表的数据项不需要具有相同的类型。列表中的每个元素都分配一个数字 - 它的位置&#xff0c;或索引&#xff0c;第一个索引是0&#xff0c;第二个索引是1&#xff…

FastDFS单机版安装教程

安装清单如下&#xff1a; 一、安装FastDFS 1. 安装libfastcommon 先解压安装包到目录 # unzip libfastcommon-1.0.36.zip 安装编译工具及环境&#xff08;后面Nginx也会用到这些依赖环境&#xff09; # yum -y install gcc gcc gcc-c openssl openssl-devel pcre pcre-deve #…

【原创】Chrome最新版(53-55)再次爆出BUG!

2019独角兽企业重金招聘Python工程师标准>>> 前言 今年十月份&#xff0c;我曾发布一篇文章《Chrome53 最新版惊现无厘头卡死 BUG&#xff01;》&#xff0c;不过那个BUG在最新的 Chrome 54 中已经修正。 而今天即将发布的Chrome弱智BUG&#xff1a; 仅 Chrome 53 -…

ThinkPHP 发送post请求

function post($url, $paramarray()){ if(!is_array($param)){ throw new Exception("参数必须为array"); } $httph curl_init($url); curl_setopt($httph, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($httph, CURLOPT_SSL_VERIFYHOST, 1); curl_setopt($httph,CURLOP…