如何使用 max_fanout-Xilinx-AMD论坛-FPGA CPLD-ChipDebug

如何使用 max_fanout

 

在 逻辑层级不多,但是延时较高的 net 中,可以使用 max_fanout 来设置扇出,

但是要注意,还要在最终到达模块添加 dont_touch 属性,否则不生效

其他注意事项可以参考https://chipdebug.com/forum-post/50531.html

module xxxx(  
    input clk,
    output [7:0] mod_xxxx_out		
    );
 
wire    a_out;
 
a a
(
    .clk        (clk),
    .mod_a_out  (a_out)
); 
 
b b(
    .clk        (clk),
    .mod_b_in   (a_out),
    .mod_b_out  (mod_xxxx_out)
);
endmodule
 
 
 
 
module a(
    input   clk,
    (* max_fanout = 2 *) output reg mod_a_out//(* max_fanout = 2 *)
);
reg [5:0] cnt;
always @(posedge clk)
    mod_a_out <= cnt[5];  
always @(posedge clk)    
    cnt <= cnt + 1;
endmodule
 
module b(
    input   clk,
    input   mod_b_in,// (* dont_touch="true" *)
    output   [7:0] mod_b_out
);
 
genvar i;
generate
    for(i=0;i<4;i=i+1)begin
        c c(
            .clk        (clk),
            .mod_c_in   (mod_b_in),
            .mod_c_out  (mod_b_out[i])
        );
        d
        #( 
            .m(i)
        )
        d(
            .clk        (clk),
            .mod_d_in   (mod_b_in),
            .mod_d_out  (mod_b_out[4+i])
        );        
        
    end
endgenerate    
endmodule
 
 
module c(
    input   clk,
     input   mod_c_in,//(* dont_touch="true" *) 
    output reg mod_c_out
);
always @(posedge clk)
    mod_c_out <= mod_c_in;
endmodule
 
module d
#(
    parameter   m = 1
)
(
    input   clk,
    input   mod_d_in,//(* dont_touch="true" *) 
    output reg mod_d_out
);
always @(posedge clk)
    mod_d_out <= mod_d_in + m;
endmodule

 

图片[1]-如何使用 max_fanout-Xilinx-AMD论坛-FPGA CPLD-ChipDebug

reports —  reports high fanout 显示如下

图片[2]-如何使用 max_fanout-Xilinx-AMD论坛-FPGA CPLD-ChipDebug

如果把 d 模块的 dont_touch 打开,则会

图片[3]-如何使用 max_fanout-Xilinx-AMD论坛-FPGA CPLD-ChipDebug

图片[4]-如何使用 max_fanout-Xilinx-AMD论坛-FPGA CPLD-ChipDebug

可以看到,a模块的输出已经被复制成了相同的三份(_rep后缀),粉红色和绿色的打到 d模块,确保 fanout <= 2,,

而 c 模块没有打开 dont_touch, 故 打到 c 模块的红色线 fanout = 4 ,没有符合 a 的输出 fanout约束

并且要检查 synthesis 的 log, 如果出现如下的情况,要考虑到 部分要约束的寄存器被分配到别的层级中去了,没有被 max_fanout 约束到

图片[5]-如何使用 max_fanout-Xilinx-AMD论坛-FPGA CPLD-ChipDebug

请登录后发表评论

    没有回复内容