Vivado综合属性之ASYNC_REG

本文验证了综合属性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),见下方代码:

xpm_cdc_single #(
      .DEST_SYNC_FF(4),   // DECIMAL; range: 2-10
      .INIT_SYNC_FF(0),   // DECIMAL; 0=disable simulation init values, 1=enable simulation init values
      .SIM_ASSERT_CHK(0), // DECIMAL; 0=disable simulation messages, 1=enable simulation messages
      .SRC_INPUT_REG(1)   // DECIMAL; 0=do not register input, 1=register input
   )
   xpm_cdc_single_inst (
      .dest_out(dest_out), // 1-bit output: src_in synchronized to the destination clock domain. This output is
                           // registered.

      .dest_clk(dest_clk), // 1-bit input: Clock signal for the destination clock domain.
      .src_clk(src_clk),   // 1-bit input: optional; required when SRC_INPUT_REG = 1
      .src_in(src_in)      // 1-bit input: Input signal to be synchronized to dest_clk domain.
   );

创建top.v,代码如下:

module top(
    input src_clk,
    input src_in,
    input dest_clk,
    output dest_out
);
xpm_cdc_single #(
      .DEST_SYNC_FF(2),   // DECIMAL; range: 2-10
      .INIT_SYNC_FF(0),   // DECIMAL; 0=disable simulation init values, 1=enable simulation init values
      .SIM_ASSERT_CHK(0), // DECIMAL; 0=disable simulation messages, 1=enable simulation messages
      .SRC_INPUT_REG(1)   // DECIMAL; 0=do not register input, 1=register input
   )
   xpm_cdc_single_inst (
      .dest_out(dest_out), // 1-bit output: src_in synchronized to the destination clock domain. This output is
                           // registered.

      .dest_clk(dest_clk), // 1-bit input: Clock signal for the destination clock domain.
      .src_clk(src_clk),   // 1-bit input: optional; required when SRC_INPUT_REG = 1
      .src_in(src_in)      // 1-bit input: Input signal to be synchronized to dest_clk domain.
   );
endmodule

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

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

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

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

set myff [get_cells -hier -filter “REF_NAME == FDRE”]

get_property ASYNC_REG $myff

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

 

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

努力不期待

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值