目录
1. AHB Burst Feature
1.1 BURST:支持 INCR, WRAP 两种 burst
- 支持 4/8/16-beat bursts;支持 undefined-length bursts and single trsnafer.
- 支持地址位 incrementing or wrapping 增加
1)INCR: 每次 addr 增加 4, 8, 16 or undefined length
INCR4/8/16, INCR
2)WRAP: 每次 addr 在固定位置回环
WRAP4/8/16
3)每个 burst 地址空间不能超过 1kB :避免一个 burst 发给多个 slaves
协议规定:
原因:协议约定 addr minimum addr space is 1kB
例子:如果 addr space 是 1kB, burst 的地址空间大于 1kB => 会出现一个 burst 发给两个 slave 的情况,不符合实际使用场景。
1.2 EBT (early-burst-termination)
1.2.1 EBT feature description
1) 谁触发 EBT?
Slave monitoring HTRANS signals to determine whether terminate the previous transfer:
- If HTRANS value is SEQUENTIAL or BUSY:continue the burst.
- If HTRANS value is NON-SEQUENTIAL or IDLE: eraly terminate the previous transfer, occur EBT.
2) 发生 EBT 后,怎么确保 master burst transfer 完整地完成?
一般,Master 在再次获得 bus owership 后,再次发一个 undefined-length transfer;与之前的传输拼接为一个完成的 burst transfer.
1.2.2 典型波形
1) WRAP, four-beat
ping-pong window is 4.
2) INCR, four-beat
current addr = last addr + 4 (inside 1kB)
3) WRAP, eight-beat
ping-pong window is 8.
4) INCR, eight-beat
current addr = last addr + 8 (inside 1kB)
5) INCR, undefined-length
current addr = last addr + length (inside 1kB)
2. AHB Burst - Wrap boundary 计算
2.1 Wrap Functionality Application
Cache data fetch and writes by CPU/DMA, etc.
2.2 What is wrap burst
During memory write/read address traverse, address increments hits a boundary of upper limits and come back to lower limits and goes on in a ping-pong window.
2.3 What is boundary of upper limits,如何计算?
2.4.1 计算 boundary 需要用到的信号?
信号 Name | Source | Destination | 方向 | 说明 |
---|---|---|---|---|
来自 master 的信号 | ||||
HBURST[2:0] | master | slave | master => bus | (Incrementing bursts of undefined lenght are also supported.) (SINGLE, INCR, WRAP4,INCR4,WRAP8,INCR8,WRAP16,INCR16) |
HSIZE2:0] | master | slave | master => bus | indicates size of transfer. (typically size: byte 8-bit, halfword 16-bit or word 32-bit. maximum 1024-bit. ) |
HTRANS[1:0] | master | slave | master => bus | indicates the type of transfer beding performed. ( Type: IDLE, BUSY, NONSEQ, SEQ) |
1) HSIZE[2:0]
2) HTRANS[1:0]
2.4.2 计算步骤
给定条件:
- 确定 HSIZE[2:0], HBURST[2:0], HTRANS[1:0]
- 通过 HSIZE[2:0] bit 位数 及 memory 位宽,确定字节数;字节数是 addr 每次增加的值。如:HSIZE[2:0] = 3’b010,是 32-bit, memory 位宽是 8-bit => 32/8 = 4 bytes。
所以,addr 每次比前一次增加 4,直到遇到/超过 边界值。 - 通过 HBURST[2:0] 确定 ping-pong window。如:HBURST wrap8 => every 8 depth of memory, upper limit is set. 每 8 个地址,回环。
- 给定起始地址。如:HADDR = 0x28
计算过程:
- 首先确定 memory 中的地址边界: 从 0x00 开始,每次增加 4,每 8 个地址到达边界一次。
- 然后,确定给定地址 处于那里,确定与之处于同一个区域的 addr: 0x20, 0x24, 0x28, 0x2C, 0x30, 0x34, 0x38, 0x3C,
参考链接:
Understanding AHB WRAP Function
WRAP CALCULATION in AHB LITE example
AHB WRAP Burst example