Generate Conditional Statement Coding Example - 2023.2 English

Vivado Design Suite User Guide: Synthesis (UG901)

Document ID
UG901
Release Date
2023-11-01
Version
2023.2 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