【无标题】

1 ahb 为什么需要两个hready信号 ?

ahb 在pipeline操作的时候,当前的data phase 是下一次操作的address phase,slave 在响应master时,必须判断master对上一次其他slave的操作是否完成。如果完成,响应master 操作;如果没有完成,则等待完成,然后才响应操作。hready_in就是Slave设备用来判断Master设备是否对其它Slave设备的操作已经完成的信号。

2 什么时ahb lite?

ahb-lite 是整个ahb 协议的子集,只支持一个master,不需要仲裁器及相应的总线请求/授权协议,不支持retry 和 split 响应

在这里插入图片描述

3 因为每个slave的最小地址范围为1kB,所以master的burst传输的上限时1KB,,这样保证了不会出现地址越界。

4 slave 如果不能及时处理主机的请求,可以利用hready 插入一些等待的状态,如果是写操作,主机要在等待期间保持写数据不变,并且需要延长下一笔传输的地址周期; 如果是读,仅当hready拉高的时候给出有效数据.

5 hready在一定程度上表示了从机的pipeline能力,由于ahb是两级的流水,所以总线最多存在两个没有处理的transfer。

6 hsize 表示单笔传输的数据位宽,8bit - 1024bit

7 htrans 传输类型:

IDLE : 主机占用总线,但是没有进行传输; 两次burst 传输中间可以发送IDLE; 从机被选择,在每个IDLE周期从机都要返回OKAY响应

BUSY: 主机占用总线,但是在burst传输的时候还没准备好下一次传输,此时从机不会做响应操作,返回OKAY响应。**BUSY 传输需要各出下一拍的地址和控制信号,虽然从机不会采样 **

NONSEQ: 表明单笔传输,或者一次burst的第一笔传输,地址和控制信号与上一次传输无关

SEQ:burst 传输中剩下传输时连续传输并且地址与上一次传输有关,控制信号与上一次传输一样。**地址等于上一次传输地址加上传输的数据大小(字节)

8 burst :

增量突发: 每一次传输的地址是前一次传输地址的增量

回环突发: 如果传输的起始地址并没有和突发中字节总数对齐,地址将在到达边界回环,

一次传输的数据总量可以用burst 传输的节拍数乘以每笔传输的字节数来计算,每笔传输的字节数是由hsize确定的。

9 所有的burst 传输必须将传输的大小与地址边界对齐,即字传输对齐到字边界(A[1:0] == 00)

10 为了不使用三态门,ahb 读写数据线是分开的。

11 如果传输宽度小于总线宽度,主机只需要将数据驱动到相应的字节通道,从小负责从正确的字节通道选择数据。对于宽度小于总线宽度的传输从机仅需要在有效的字节通道提供有效数据,如下两个表所示。总线主机负责从正确的字节通道中选择数据。

11 只用在不定长的burst传输时,才可以插入busy状态

12 定长的bust传输不可以以busy 结尾,single 传输必须跟IDLE,不能跟BUSY

13 ahb 不是全双工的,读写不可以同时进行。

AHB 总线信号

HWRITE: 1 写 0 读

HTRANS[1:0]:

片上总线数据传输原理

程序与bus数据传输关系

u32 rdata;
// --- data write
*(mem0_base+0x0) = 0;
*(mem0_base+0x1) = 4;
*(mem0_base+0x2) = 8;

HRESP: S to M

During the transfer the slave shows the status using the response signals, HRESP[1:0]

  • OK The OKAY response is used to indicate that the transfer is progressing normally and when HREADY

goes high this shows the transfer has completed succussfully

  • ERROR The ERROR response indicates that the a transfer error has occured and the transfer has been unsuccessful
  • RETRY and SPLIT Both RETRY and SPLIT transfer responses indicate that the transfer can not complete immediately, but the bus master should continue to attampt the transfer

HTRANS[1:0]: M to S

Every tranfer can be classified into one of four different type.

HTRANS[1:0]TypeDescription
00IDLEIndicates that no data transfer is requried. The IDLE transfer type is used when the master is granted the bus, but does not wish to perform a data transfer.
01BUSY
10NOSEQIndicated the first transfer of a burst or a singal transfer
11SEQThe remainning transfer in a burst are SEQUENTIAL and the address is related to the previous transfer.

HBURST[2:0]

// slave 
always@(posedge HCLK,negedge HRESEETn) begin
    if(~HRESETn) begin
        hwrite_r <= 0;
        hsize_r <=0;
        hburst_r <= 0;
        htrans_r <= 0;
        haddr_r <= 0;
    end
    else(hsel && hready) begin
        hwrite_r <= hwrite;
      	hsize_r <= hsize;
        hburst_r <= hburst;
        htrans_r <= htrans;
        haddr_r <= haddr;
    end
    else begin
       	...
    end
end

//
assign wr_en = (htrans_r == NOSEQ) || (htrans_r == SEQ) && hwrite_r && hready_in;
assign rd_en = (htrans == NOSEQ) || (htrans == SEQ) && !hwrite && hready_in;
// ahb read or write cycle
assign ahb_write = hsel && hwrite && ((htrans == SEQ ) || (htrans == NOSEQ));
assign ahb_read = hsel && !hwrite && ((htrans == SEQ ) || (htrans == NOSEQ));
// generate internal write signal
always@(posedge hclk) begin
    if(hready) 
        web <= ahb_write;
    else 
        web <= 0;
end

Question

1 如何理解ahb 的burst传输不同超过1kB?

1kB 表示1024byte = 1024 x 8bit,如果slave时8bit,burst长度为1024。

一般slave模块的地址空间会在1KB地址空间以上,当ahb以burst方式传输时,为了避免错误的访问到其他的slave而造成错误,因此burst传输限制为1KB

2 为什么ahb总线的slave有两个hready信号?

http://www.vlsiip.com/amba/ahb.html

https://blog.csdn.net/m0_49540263/article/details/107653372

2 waveform

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

3 assertion

3.1 Implement of assertions

  • property for basic read operation check.
property basic_read;
    @(posedge vif.hclk) disable_iff((vif.htrans == IDLE || vif.htrans == BUSYS) &&)

maste 每次传送的数据位宽是由hsize[2:0] 决定的。

当master需要传送连续笔数据时,hsize 和 hburst 共同决定连续数据传送的地址计算。

inc 地址

bit [
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值