UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 55302

Vivado Synthesis - Alternative HDL coding style to reduce longer runtimes

Description

This answer record describes some alternative HDL coding practices that a designer can incorporate to speed up runtimes.

Solution

The following sample Verilog code has the potential to slow down the runtime:

module test4 (clk,din,dout);

parameter WIDTH = 20000;
input clk;
input [WIDTH-1:0] din;
output reg [WIDTH-1:0] dout;

generate
begin
    genvar i;
    for(i=0;i<WIDTH;i=i+1)
    begin
        always@(posedge clk)
         dout[i] <= din[i];
    end
end    
endgenerate

endmodule

In the above sample code, the presence of the "for loop" construct encompassing the always statement has been observed as the prime reason for longer runtime.

To work around this long runtime behavior, modify the above sample Verilog code in the following manner to help reduce the runtime:

module test4 (clk,din,dout);

parameter WIDTH = 20000;
input clk;
input [WIDTH-1:0] din;
output reg [WIDTH-1:0] dout;

integer i;
generate
begin
    always@(posedge clk)
    begin   
     for(i=0;i<WIDTH;i=i+1)
       dout[i] <= din[i];
    end
end   
endgenerate

endmodule

In the above sample code, moving the loop construct under the always statement helps reduce the longer runtime. The above HDL coding style should be considered as an alternate effective solution by the user for reducing longer runtimes.

AR# 55302
Date Created 04/01/2013
Last Updated 06/20/2013
Status Active
Type Known Issues
Tools
  • Vivado Design Suite