Generate Conditional Statement Coding Example - 2022.1 English

Vivado Design Suite User Guide: Synthesis (UG901)

Document ID
UG901
Release Date
2022-06-06
Version
2022.1 English

This coding example instantiates two different implementations of a multiplier based on the width of data words.

generate

   if (IF_WIDTH < 10)

   begin : if_name

      multiplier_imp1 # (IF_WIDTH) u1 (a, b, sum_if);

   end

else

   begin : else_name          

      multiplier_imp2 # (IF_WIDTH) u2 (a, b, sum_if);

   end

endgenerate