自动流水打拍注意事项 - 2023.2 简体中文

Versal 自适应 SoC 硬件、IP 和平台开发方法指南 (UG1387)

Document ID
UG1387
Release Date
2023-11-15
Version
2023.2 简体中文

自动流水打拍功能支持布局器判断所需流水打拍阶段数量及其最佳位置,从而帮助跨接口边界实现时序收敛。您可通过设置 AXI Register Slice 核的自动流水打拍功能或者通过为数据总线应用自动流水打拍 HDL 属性或 XDC 约束来启用该功能。由于插入受时序驱动,因此请务必始终确保在目标路径上应用正确的时序约束。欲知详情,请访问此链接以参阅 Vivado Design Suite 用户指南:实现(UG904) 中的相应内容。

以下示例显示了模块 data01 与 data12 之间的接口上应用的自动流水打拍。data01 的输出由不含控制集的寄存器组成。

图 1. 模块间的简单数据流连接

此示例的 RTL 代码如下所示。autopipeline_module 属性应用于分层模块 data01 上,而 autopipeline_group/autopipeline_limit/autopipeline_include 属性则应用于由寄存器的 Q 管脚直接驱动的信号线上。

data_reg_ap #( .C_DATA_WIDTH(C_DATA_WIDTH)) data01 (
.clk (clk),
.datain (shinreg),
.datareg (d1)
);

data_reg #( .C_DATA_WIDTH(C_DATA_WIDTH)) data12 (
.clk (clk),
.datain (d1),
.datareg (d2)
);

(* autopipeline_module="yes" *)
module data_reg_ap # (
parameter integer C_DATA_WIDTH = 32
)
( input wire clk,
input wire [C_DATA_WIDTH-1:0] datain,
(* autopipeline_group="fwd",autopipeline_limit=24 *)
output reg [C_DATA_WIDTH-1:0] datareg
);

always @(posedge clk) begin
datareg <= datain;
end
endmodule

此示例提供了在 RTL 代码中使用上述属性的另一种替代方式,其 XDC 约束如下所示。

# It's suggested to add the USER_SLR_ASSIGNMENT property at the module 
#level to ensure better logic clustering with its driver and load, see UG912 
#for more details on this property
set_property USER_SLR_ASSIGNMENT APSRC [get_cells data01]
set_property USER_SLR_ASSIGNMENT APDST [get_cells data12]

set_property AUTOPIPELINE_MODULE TRUE [get_cells data01]
set_property AUTOPIPELINE_GROUP WBUS [get_nets -of [get_pins -filter REF_PIN_NAME==Q -of [get_cells data01/*]]]
set_property AUTOPIPELINE_LIMIT 10 [get_nets -of [get_pins -filter REF_PIN_NAME==Q -of [get_cells data01/*]]]