How to use the APB interfaces? Taking default gateware as example

The way you figure out the address map is by looking at the CoreAPB3 Configurator. The important fields are in Address Configuration. The “Position in slave address of upper 4 bits of master address” value is the one of interest. It specifies which nibble in the address will be used to select between each of the downstream ports. Below if the configurator for the FIC3_INITIATOR:


This tells us that the second last nibble (0x?n?????) will be used to select between downstream ports at this level of the bus hierarchy.
We already know that we are connected to FIC3 which has base address 0x4000_0000. So, We are looking at addresses 0x4n??
???. Since the cape is connected to port 1, the cape shows up in the 0x41??_??? address range.

The cape’s CoreAPB3 configuration is as follows:

Which show bits [23:20] are used to select the downstream ports. Telling us that the APB peripherals within the cape are in the 0x41n?_??? address range where n is the CoreAPB3 port the peripheral is connected to.