前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >AXI中wrap边界的计算

AXI中wrap边界的计算

作者头像
数字IC小站
发布2020-07-01 14:44:23
2.7K0
发布2020-07-01 14:44:23
举报
文章被收录于专栏:数字IC小站数字IC小站

在AXI中,主要是三种猝发模式,FIXED,INCR,WRAP。前两种比较容易理解,第三种的边界计算如下。

WRAP猝发类似于INCR猝发。在WRAP中,地址将根据SiZE递增,但是达到地址上限时,地址将换到地址下限。 在WRAP地址计算过程中有两个注意事项,

  1. 计算WRAP的地址上限
  2. 低位地址回旋到WRAP

WRAP突发有限制:

  • 起始地址必须与每次传输的大小对齐
  • 突发长度必须为2、4、8或16个传输

计算方式如下:

地址下界:

地址上界:

Ex1:

AxADDR = 0x04, AxLEN = 3, AxSIZE = 2, AxBURST = 3。

Start_Address = 0x04 Burst_Length = 4 Number_Bytes = 2^2=4 因此地址下界 = (0x04/(4x4)) x (4x4) = 0 地址上界 = 0 + (4 x 4) = 16

Address_0 = 4 Address_1 = Address_0 + Number_Bytes = 4 + 4 = 8 Address_2 = Address_1 + Number_Bytes = 8 + 4 = 12 Address_3 = Address_2 + Number_Bytes = 12 + 4 = 16

因为上界为16,因此地址Address_3 = 0。

因此地址为4,8,12,0。

Ex2:

AxADDR = 0x38, AxLEN = 3, AxSIZE = 2, AxBURST = 3。 Start_Address = 0x38 Burst_Length = 4 Number_Bytes = 2^2=4 因此地址下界 = (0x38/(4x4)) x (4x4) = 0x30 地址上界 = 0x30 + (4 x 4) = 0x40

Address_0 = 0x38 Address_1 = Address_0 + Number_Bytes = 0x38 + 0x4 = 0x3C Address_2 = Address_1 + Number_Bytes = 0x3C + 0x4 = 0x40 因为Address_2 == 0x40, 达到上边界,因此Address_2 = 0x30 Address_3 = Address_2 + Number_Bytes = 0x30 + 0x4 = 0x34 因此地址为 0x38, 0x3C, 0x30, 0x34。

Ex3:

AxADDR = 0x34, AxLEN = 7, AxSIZE = 2, AxBURST = 3。 Start_Address = 0x34 Burst_Length = 8 Number_Bytes = 2^2=4

因此地址下界 = (0x34/(4x8)) x (4x8) = 0x20 地址上界 = 0x20 + (4 x 8) = 0x40

Address_0 = 0x34 Address_1 = Address_0 + Number_Bytes = 0x34 + 4 = 0x38 Address_2 = Address_1 + Number_Bytes = 0x38 + 4 = 0x3C Address_3 = Address_2 + Number_Bytes = 0x3C + 4 = 0x40 因为Address_3 == 0x40,达到上边界,因此 Address_3 = 0x20 Address_4 = Address_3 + Number_Bytes = 0x20 + 4 = 0x24 Address_5 = Address_4 + Number_Bytes = 0x24 + 4 = 0x28 Address_6 = Address_5 + Number_Bytes = 0x28 + 4 = 0x2C Address_7 = Address_6 + Number_Bytes = 0x2C + 4 = 0x30 因此地址为 0x34, 0x38, 0x3C, 0x20, 0x24, 0x28, 0x2C, 0x30

End

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2020-03-05,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 数字IC小站 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档