AHB2APB Verification

Hi,

I am working on AHB2APB bridge verification, following are the parameters for the bridge master and slave side.
AHB Master -> Address width: 32 bits Data width: 32 bits
APB Slave -> Address width: 32 bits Data width:32 bits

When performing a read burst incremental transfer of length 4 with HSIZE = 0 (byte), I am getting the following response

HADDR = 0x00  HRDATA = 0x0A0B0C0D

HADDR = 0x01 HRDATA = 0x090A0B0C

HADDR = 0x02 HRDATA = 0x08090A0B

HADDR = 0x03 HRDATA = 0x0708090A

-> Ideally, I am incrementing my HADDR depending on the size, so it was +0x1 for size 0. But my APb slave is word addressable, and it only returns 32 bits when it gets a request. So, here, what should be the expected data on the master's side, HRDATA?

-> Is it correct to send narrow bursts like size =0 size =1 burst to APB slaves?

Please kindly help me understand this scenario better and I would be grateful for any advice
I appreciate any help you can provide.

Parents
  • Hopefully I've answered some of your questions here in my reply just sent to your earlier post in the Architectures and Processors forum.

    Regardless of the HSIZE width of transfer you are requesting, the "unused" bits of HRDATA will still have some values, so all of the 4 above HRDATA values could be correct, and we would need to know what data 32-bit WAS stored at PADDR=0x0 to know what is then the correct HRDATA value to be returned.

    HADDR does increase by 1 for each sequential step in an HSIZE=0 burst, but as described in the other forum question, having PADDR not aligned to the width of the data bus can result in UNPREDICTABLE results, and I guess this is what is happening here when presumably you have driven PADDR to 0x0, 0x1, 0x2 and 0x3 for this sequence.

    Instead I suspect that your APB bridge should have aligned PADDR to the data bus width (so driving PADDR[1:0] to 2'b00) so that it always correctly addresses the word addressable targets, and returning a full 32-bits of PRDATA back to HRDATA (I suspect the expected data was the 0x0A0B0C0D) for each of the 4 byte width AHB read requests.

    The AHB manager will then know which HRDATA bits to read for each of the 4 byte requests (HRDATA[7:0] for the 0x0 address, HRDATA[15:8] for the 0x1 address, and so on - although note that this would only be correct for a little endian system - which is probably a different question altogether). It is perfectly valid for the APB bridge to return 32-bits of read data for a byte read request as the AHB manager will only be looking at one of the byte lanes of the returned data.

Reply
  • Hopefully I've answered some of your questions here in my reply just sent to your earlier post in the Architectures and Processors forum.

    Regardless of the HSIZE width of transfer you are requesting, the "unused" bits of HRDATA will still have some values, so all of the 4 above HRDATA values could be correct, and we would need to know what data 32-bit WAS stored at PADDR=0x0 to know what is then the correct HRDATA value to be returned.

    HADDR does increase by 1 for each sequential step in an HSIZE=0 burst, but as described in the other forum question, having PADDR not aligned to the width of the data bus can result in UNPREDICTABLE results, and I guess this is what is happening here when presumably you have driven PADDR to 0x0, 0x1, 0x2 and 0x3 for this sequence.

    Instead I suspect that your APB bridge should have aligned PADDR to the data bus width (so driving PADDR[1:0] to 2'b00) so that it always correctly addresses the word addressable targets, and returning a full 32-bits of PRDATA back to HRDATA (I suspect the expected data was the 0x0A0B0C0D) for each of the 4 byte width AHB read requests.

    The AHB manager will then know which HRDATA bits to read for each of the 4 byte requests (HRDATA[7:0] for the 0x0 address, HRDATA[15:8] for the 0x1 address, and so on - although note that this would only be correct for a little endian system - which is probably a different question altogether). It is perfectly valid for the APB bridge to return 32-bits of read data for a byte read request as the AHB manager will only be looking at one of the byte lanes of the returned data.

Children
No data