If the source RTL contains generics or parameters, those are inferred at the time the module is added to the block design, and can also be configured in the Re-customize Module Reference dialog box for a selected module.
The following is a code sample for an n-bit full adder, where adder_width
is the generic that controls the width of the adder.
When the adder module is instantiated into the block design, the module is added with port widths defined by the default value for the generic adder_width
. In this case the port width would be 2-bits.
You can double-click the module to open the Re-customize Module Reference dialog box. You can also right-click the module and select Customize Block from the context menu.
Any generics or parameters defined in the RTL source are available to edit and configure as needed for an instance of the module. As the parameter is changed, the module symbol and ports defined by the parameter are changed appropriately.
Click OK to close the Re-customize Module Reference dialog box and update the module instance in the block design.
The symbol in the block design is changed accordingly, as shown below: