当前位置:   article > 正文

Vivado综合属性之ASYNC_REG_vivado中的cdc

vivado中的cdc

本文验证了综合属性ASYNC_REG对寄存器位置的影响。

ASYNC_REG用于单bit信号采用双(或多)触发器实现异步跨时钟域的场合,此时所有用于同步的触发器都要标记ASYNC_REG。标记方式为:

(* ASYNC_REG = "TRUE" *) reg sync_0, sync_1;

目的是告诉综合工具布线时将这2个寄存器放在一起(即同一个SLICE中),从而减少线延迟对时序的影响。

为避免忘记标记ASYNC_REG,打开Language template -> XPM_CDC -> Single-bit Synchronizer(xpm_cdc_single),见下方代码:

  1. xpm_cdc_single #(
  2. .DEST_SYNC_FF(4), // DECIMAL; range: 2-10
  3. .INIT_SYNC_FF(0), // DECIMAL; 0=disable simulation init values, 1=enable simulation init values
  4. .SIM_ASSERT_CHK(0), // DECIMAL; 0=disable simulation messages, 1=enable simulation messages
  5. .SRC_INPUT_REG(1) // DECIMAL; 0=do not register input, 1=register input
  6. )
  7. xpm_cdc_single_inst (
  8. .dest_out(dest_out), // 1-bit output: src_in synchronized to the destination clock domain. This output is
  9. // registered.
  10. .dest_clk(dest_clk), // 1-bit input: Clock signal for the destination clock domain.
  11. .src_clk(src_clk), // 1-bit input: optional; required when SRC_INPUT_REG = 1
  12. .src_in(src_in) // 1-bit input: Input signal to be synchronized to dest_clk domain.
  13. );

创建top.v,代码如下:

  1. module top(
  2. input src_clk,
  3. input src_in,
  4. input dest_clk,
  5. output dest_out
  6. );
  7. xpm_cdc_single #(
  8. .DEST_SYNC_FF(2), // DECIMAL; range: 2-10
  9. .INIT_SYNC_FF(0), // DECIMAL; 0=disable simulation init values, 1=enable simulation init values
  10. .SIM_ASSERT_CHK(0), // DECIMAL; 0=disable simulation messages, 1=enable simulation messages
  11. .SRC_INPUT_REG(1) // DECIMAL; 0=do not register input, 1=register input
  12. )
  13. xpm_cdc_single_inst (
  14. .dest_out(dest_out), // 1-bit output: src_in synchronized to the destination clock domain. This output is
  15. // registered.
  16. .dest_clk(dest_clk), // 1-bit input: Clock signal for the destination clock domain.
  17. .src_clk(src_clk), // 1-bit input: optional; required when SRC_INPUT_REG = 1
  18. .src_in(src_in) // 1-bit input: Input signal to be synchronized to dest_clk domain.
  19. );
  20. endmodule

在Open Implemented Design -> Schematic中的原理图(不是综合后的原理图)为:

 上图将dest_clk连接的2个FF MARK了,对应到Device界面的视图如下:

 上图淡蓝色括住的表示一个SLICE,红色MARK对应上上图的2个寄存器FDRE,可以看出它们是在一个SLICE中的。

通过如下代码可验证ASYNC_REG是否已被标记:

  1. set myff [get_cells -hier -filter “REF_NAME == FDRE”]
  2. get_property ASYNC_REG $myff

执行结果如下时说明ASYNC_REG是否已被标记:

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/木道寻08/article/detail/963019
推荐阅读
相关标签
  

闽ICP备14008679号