Narrow Byte Transfers on AHB2APB Bridge

I am verifying an AHB2APB bridge
I wanted to perform single read transfer on APB slave which is word-addressable  and sending starting address as 0x01 with hsize (0) expecting the byte data from the slave , but my slave only responds with 32 bit data

is it illegal to give such transactions to APB slave ???

  • There isn't any specification of how different protocols should work together, so as long as the transfers produced on either side of the bridge are legal for that protocol, no problems.

    So what the AHB2APB bridge needs to do is convert the legal AHB transfer to a legal APB transfer, or if you wanted to make a simpler and less flexible bridge, return an ERROR response for any transfer that doesn't SIMPLY match to an APB transfer (so mandating word width transfers as in your example).

    But for the byte read example, the APB bridge could just perform a word width APB read and return only the required byte to the AHB side. The APB protocol recommends that PADDR is aligned to the data width, so here recommending PADDR[1:0] is set to 2'b00, but having an unaligned PADDR is still legal (although the protocol states the result is then UNPREDICTABLE).

    The only type of application where performing a wider read than was requested might be an issue is if the APB target is read sensitive, so something like a FIFO, but there it wouldn't make any sense to read just part of the FIFO data, so I'm not sure this really would be an issue. For a FIFO target presumably the AHB manager would know that the target data is X bytes wide and so knows what HSIZE width to request.

    For write transfers, APB4 onwards has a PSTRB signal, so narrow writes can be supported (not to the full data bus width).