【FPGA ODDR原语理解】

FPGA ODDR原语
一、原语例化内容


//      ODDR     : In order to incorporate this function into the design,
//     Verilog   : the following instance declaration needs to be placed
//    instance   : in the body of the design code.  The instance name
//   declaration : (ODDR_inst) and/or the port declarations within the
//      code     : parenthesis may be changed to properly reference and
//               : connect this function to the design.  Delete or comment
//               : out inputs/outs that are not necessary.

//  <-----Cut code below this line---->

   // ODDR: Output Double Data Rate Output Register with Set, Reset
   //       and Clock Enable.
   //       Artix-7
   // Xilinx HDL Language Template, version 2019.2

   ODDR #(
      .DDR_CLK_EDGE("OPPOSITE_EDGE"), // "OPPOSITE_EDGE" or "SAME_EDGE" 
      .INIT(1'b0),    // Initial value of Q: 1'b0 or 1'b1
      .SRTYPE("SYNC") // Set/Reset type: "SYNC" or "ASYNC" 
   ) ODDR_inst (
      .Q(Q),   // 1-bit DDR output
      .C(C),   // 1-bit clock input
      .CE(CE), // 1-bit clock enable input
      .D1(D1), // 1-bit data input (positive edge)
      .D2(D2), // 1-bit data input (negative edge)
      .R(R),   // 1-bit reset
      .S(S)    // 1-bit set
   );

   // End of ODDR_inst instantiation
					

二、参数含义
表中给出了各个参数的含义和默认值。
在这里插入图片描述
DDR_CLK_EDGE:可选择OPPOSITE_EDGE或者SAME_EDGE。
1)OPPOSITE_EDGE
在这里插入图片描述
这种模式下我认为是在clk上升沿采D1的数据,下降沿采D2数据,数据会延迟一点时间输出。
仿真如下图
在这里插入图片描述
2)SAME_EDGE模式
在这里插入图片描述

这种模式下是在上升沿采集D1 D2的数据,然后在上升沿延迟一点时间输出D1,下降沿延迟一段时间输出D2。
仿真如下图
在这里插入图片描述
三、应用
Oserdes、FPGA源同步系统的设计,用ODDR使得随路时钟和数据输出是严格同步的,保证相位严格对齐关系。
看到fpga官方PLL例程中将时钟D1赋值为1,D2赋值为0,参数设置成默认值,得到一个具有和输入时钟有固定延时的时钟。(在100MHz时,这个延时是100ps)
在这里插入图片描述

四、注意
1.Set和Reset不能同时置位。

2.ODDR原语的复位需要约12个clock,第一次输入的数据可能会有问题。

  • 1
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值