ODDR2的使用

1.SPartan6 FPGA中, PLL产生的时钟不能直接连到FPGA的通用I/O上;

2.如果硬件已经连上了,可通过在PLL输出与通用I/O之间增加ODDR2模块缓冲来解决。

3.ODDR2与PLL模块可放在一个V文件中。

4.ODDR2模块如下:

  ODDR2 #(
    .DDR_ALIGNMENT("NONE"), // Sets output alignment to "NONE", "C0" or "C1"
    .INIT(1'b0),    // Sets initial state of the Q output to 1'b0 or 1'b1
    .SRTYPE("SYNC") // Specifies "SYNC" or "ASYNC" set/reset
    ) U_ODDR2_PLL输出时钟名 (
      .Q(oddr2_I/O管脚名),   // 1-bit DDR output data
      .C0(clock_PLL输出时钟名),   // 1-bit clock input
      .C1(~clock_PLL输出时钟名),   // 1-bit clock input
      .CE(1'b1), // 1-bit clock enable input
      .D0(1'b1), // 1-bit data input (associated with C0)
      .D1(1'b0), // 1-bit data input (associated with C1)
      .R(1'b0),   // 1-bit reset input
      .S(1'b0)    // 1-bit set input
    );


只用OBUFDS是不行的,编译报错,错误内容如下
/////////////////////////////////////////////////////////////////////////////////////////
ERROR:Place:1205 - This design contains a global buffer instance,
   <OUT20_40M/clkout2_buf>, driving the net, <CLK_OUT40M>, that is driving the
   following (first 30) non-clock load pins off chip.
   < PIN: MyPrimitive/ADCLK400M_P.O; >
   This design practice, in Spartan-6, can lead to an unroutable situation due
   to limitations in the global routing. If the design does route there may be
   excessive delay or skew on this net. It is recommended to use a Clock
   Forwarding technique to create a reliable and repeatable low skew solution:
   instantiate an ODDR2 component; tie the .D0 pin to Logic1; tie the .D1 pin to
   Logic0; tie the clock net to be forwarded to .C0; tie the inverted clock to
   .C1. If you wish to override this recommendation, you may use the
   CLOCK_DEDICATED_ROUTE constraint (given below) in the .ucf file to demote
   this message to a WARNING and allow your design to continue. Although the net
   may still not route, you will be able to analyze the failure in FPGA_EditERROR
/////////////////////////////////////////////////////////////////////////////////////////
上面大致内容是:时钟驱动片外非时钟端口,在Spartan-6中会导致全局网络布线受限,即使布线
后,会导致过大的延迟和抖动,两种改进方法:1.在OBUFDS前使用ODDR2。 2.在UCF中使用专
用约束语句, < PIN "OUT20_40M/clkout2_buf.O" CLOCK_DEDICATED_ROUTE = FALSE; >
忽略错误,但会给出警告。



### Zynq 平台 ODDR2 原语使用与故障排除 #### 使用说明 ODDR2 是 Xilinx FPGA 中用于实现双数据速率 (DDR) 输出功能的一种原语。这种原语允许在一个时钟周期内的上升沿和下降沿都传输数据,从而有效地加倍了数据传输率。 在 Zynq 平台上使用 ODDR2 原语时,主要遵循以下几点: - **实例化**: 需要在 Vivado 设计环境中通过 Verilog 或 VHDL 实例化 ODDR2 原语[^4]。 ```verilog // Verilog example of instantiating an ODDR2 primitive ODDR2 #( .IS_C0_INVERTED(1'b0), // Optional inversion for C0 clock input .IS_C1_INVERTED(1'b0), // Optional inversion for C1 clock input .IS_D0_INVERTED(1'b0), // Optional inversion for D0 data input .IS_D1_INVERTED(1'b0), // Optional inversion for D1 data input .IS_R_INVERTED(1'b0), // Optional inversion for reset signal .IS_S_INVERTED(1'b0)) // Optional inversion for set signal your_instance_name ( .C0(clk_0), // Input wire clk_0 .C1(clk_180), // Input wire inverted from clk_0, typically generated by BUFG or other means .CE(enable_signal), // Input wire enable signal .R(reset_signal), // Input wire active-high asynchronous reset .S(set_signal), // Input wire active-high synchronous set .D0(data_in_posedge), // Input wire data to be output on rising edge of C0/C1 .D1(data_in_negedge), // Input wire data to be output on falling edge of C0/C1 .Q(output_data)); // Output wire Q ``` - **约束与时序管理**: 对于 DDR 应用来说,精确的时间安排至关重要。因此,在设计过程中应特别注意设置合理的输入延迟、输出延迟及时钟相位关系等参数,并利用 XDC 文件来指定这些约束条件。 #### 故障排查指南 当遇到与 ODDR2 相关的问题时,可以从以下几个方面入手进行诊断: - **检查信号完整性**: 确认所有连接到 ODDR2 的信号线都没有受到干扰或噪声影响;特别是时钟源的质量要良好,因为任何抖动都会直接影响到 DDR 数据的有效性和可靠性。 - **验证逻辑电平兼容性**: 如果外部接口不是 TTL/CMOS 类型,则需确保所使用的 I/O Standard 符合目标设备的要求。这可以通过修改顶层模块中的 IOBUF 属性或者调整 IBUFDS/GTREFCLK 组件的相关配置来实现。 - **评估电源质量**: 不稳定的供电可能会引起各种异常行为,比如误触发、丢失脉冲等问题。建议测量 VCCINT 和 VCCAUX 轨道电压波动情况,必要时加装去耦电容以改善稳定性。 - **审查综合报告**: 查看 Synthesis Report 及 Implementation Reports 中有关 Timing Summary 和 Design Rule Check(DRC)的部分,寻找潜在的设计缺陷或违反规则之处。如果存在未满足的路径延时要求(Timing Violation),则可能需要重新规划布局布线策略或是优化 HDL 编码结构。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值