FPGA设计中跨时钟域的异步处理
2011-08-26 10:01
393 查看
在FPGA开发设计中,经常是多个时钟同时工作于同一模块中,不同时钟域的信号间要保证稳定通信,必须要处理好时序问题,也就是要充分考虑信号的建立和保持时间,以下是在设计中常用的单脉冲信号的处理方法:
`timescale 1 ps / 1 ps module PULSE_GEN ( XRST , // (i) Reset Input ( Asynchronous ) CLK_I , // (i) Clock At Input Side CLK_O , // (i) Clock At Output Side PULSE_I , // (i) Pulse Input PULSE_O // (o) Pulse Output ) ; parameter P_TYPE = 8'd0 ; //========================================================== // Declare the port directions //========================================================== input XRST ; // (i) Reset Input ( Asynchronous ) input CLK_I ; // (i) Clock At Input Side input CLK_O ; // (i) Clock At Output Side input PULSE_I ; // (i) Pulse Input output PULSE_O ; // (o) Pulse Output //========================================================== // Internal signals define //========================================================== reg r_PULSE_I ; reg [2:0] r_PULSE_O ; // r_PULSE_O[0], r_pluse_o[1] Should Not Be Duplicated // Synthesis Attribute MAX_FANOUT of r_PULSE_O is 9999; //========================================================== // RTL Body //========================================================== generate if(P_TYPE == 0) begin :TYPE_0_PULSEGEN //========================================================== // Input Pulse Keep ( CLK_I domain ) //========================================================== always @( posedge CLK_I or negedge XRST ) begin if( !XRST ) begin r_PULSE_I <= 1'b0 ; end else begin if ( PULSE_I == 1'b1 ) begin r_PULSE_I <= ~r_PULSE_I ; end end end //========================================================== // Output Pulse Sync. And Generate ( CLK_O Domain ) //========================================================== always @( posedge CLK_O or negedge XRST ) begin if( !XRST ) begin r_PULSE_O <= 3'b000 ; end else begin r_PULSE_O <= { r_PULSE_O[1:0] , r_PULSE_I } ; end end assign PULSE_O = (r_PULSE_O[2] != r_PULSE_O[1] ) ; // 0 -> 1 end endgenerate endmodule
相关文章推荐
- FPGA的时钟质量对设计的影响
- FPGA 时钟设计 1 —— 时钟资源总结
- 异步FIFO结构及FPGA设计 ---跨时钟域设计
- FPGA设计中的时钟问题
- FPGA基础知识19(FPGA异步时钟设计中的同步策略 异步时钟 打两拍 握手机制)
- 【转】 影响FPGA设计中时钟因素的探讨(建立与保持时间 写的很好)
- 影响FPGA设计中时钟因素的探讨
- FPGA跨时钟域设计的一点总结
- FPGA设计中的跨时钟域问题
- FPGA设计中的跨时钟域问题
- 【转】影响FPGA设计中时钟因素的探讨
- 转--FPGA全局时钟系统的设计
- 基于FPGA的提取位同步时钟DPLL设计-解决方案-机电在线
- FPGA基础知识20(FPGA设计异步时钟处理分类及百度文库资料)
- FPGA跨时钟域异步时钟设计的几种同步策略-可编程逻辑-与非网
- FPGA异步时钟设计中的同步策略
- FPGA跨时钟域设计的一点总结
- 影响FPGA设计中时钟因素的探讨
- FPGA 时钟设计 1 —— 时钟资源总结
- FPGA中的时钟设计1