MATLAB: How to programatically access or modify the AXI Slave bus address

HDL Coder

How can I programmatically either access or modify the AXI Slave bus address given in "plugin_rd.m" (source: MATLAB\R2020a\toolbox\hdlcoder\hdlcoderdemos\customboards\ZYBO\+ZyboRegistration\+Vivado2018_2) when running HDL workflow advisor?

Best Answer

Please see the instructions below on how to modify the base address from the Workflow Advisor:
1. To make the AXI4 Slave base address modifiable from the Workflow Advisor, you can add a parameter for the base address to the reference design and use the "CustomizeReferenceDesignFcn" callback to apply that parameter to the AXI4 Slave interface.
2. An example showing how to add reference design parameters and use them to customize the interfaces can be found here:
This example shows how to customize the AXI4-Stream interface based on a reference design parameter. You can apply the same logic to customize the AXI4 Slave interface.
3. The general approach is:
  • Add a reference design parameter for "AXI4 Slave base address". The parameter can be a drop down menu if you want to allow a fixed set of values, or can be an edit box if you want to allow any set of values.
  • Create a "CustomizeReferenceDesignFcn" callback and register it in the reference design
  • Remove the "addAXI4SlaveInterface" call from the original "plugin_rd.m" file. Add this call instead to the "CustomizeReferenceDesignFcn" callback function instead.
  • Inside the callback function, parse the parameter value, and use that to set the base address for the AXI4 Slave interface.