When you add Avalon interfaces to custom components, there are parameters associated with these interfaces that you might want to change. For example Avalon Streaming interfaces have a maximum channel value that you might want to change as you are instantiating the custom component in your system.
Follow these steps to allow changes to be made to these parameters.
1. Add a parameter or generic to your custom component HDL file:
parameter MAX_CHAN_SINK = 255;
2. Add parameter and property values in the hw.tcl file associated with the custom component:
add_parameter MAX_CHAN_SINK INTEGER 8 "Max Width of the sink channel"
set_parameter_property MAX_CHAN_SINK DEFAULT_VALUE 8
set_parameter_property MAX_CHAN_SINK DISPLAY_NAME MAX_SNK_CHANNEL_WIDTH
set_parameter_property MAX_CHAN_SINK TYPE INTEGER
set_parameter_property MAX_CHAN_SINK UNITS None
set_parameter_property MAX_CHAN_SINK DESCRIPTION "Max Width of the sink channel"
set_parameter_property MAX_CHAN_SINK AFFECTS_GENERATION false
set_parameter_property MAX_CHAN_SINK HDL_PARAMETER true
3. Add an elaboration procedure to assign the interface parameter in the hw.tcl file associated with the custom component:
# -----------------------------------
# elaboration callback - assign parameter
set_module_property ELABORATION_CALLBACK elaborate
proc elaborate {} {
set max_chan_var [ get_parameter_value MAX_CHAN_SINK]
set_interface_property avalon_streaming_sink maxChannel
}