4 Coherency Transactions on the Read Address and Write Address Channels
4.1 About an initiating master
Initiating master load 或者store 使用internal action:
Load,master 得到数据:其他cache line的copy,读取的valid 数据;
Store,为unique 状态的cache line copy 的数据,master store cache line;
Read transaction,AR 通道完成,R通道返回数据,data beat 为ARLEN,读传输完成的标识为mater 拉起RACK,具体:

Clean transaction,AR 通道完成,R通道返回一个response,没有data,读传输完成的标识为mater 拉起RACK,具体:

Make transaction,AR 通道完成,R通道返回一个response,没有data,读传输完成的标识为mater 拉起RACK,具体:

Write transaction,AW 通道完成,W 通道携带数据,B通道返回response,写完成标识为诶master 拉起WACKY,具体:

Evict transaction,AW 通道完成,无数据,B通道返回response,写完成标识为诶master 拉起WACK,具体:Evict;
Read barrier transaction,AR 通道完成,R通道返回一个response,没有data,读传输完成的标识为mater 拉起RACK。
Write barrier transaction,AW 通道完成,无数据,B通道返回response,写完成标识为诶master 拉起WACK。
DVM transaction,AR 通道完成,R通道返回一个response,没有data,读传输完成的标识为mater 拉起RACK。

4.2 About snoop filter
Snoop filter 可以track 每一个master 的cache line。为了支持snoop filter,cached mater 必须哟啊广播cache line,然后evict;

4.3 State changes on different transactions
如果读response 有PassDirty(ReadNoSharedDirty、ReadShared、ReadUnique),cache line 必须修改为Dirty。
如果读response 为IsShared(ReadOnce、ReadClean、ReadNotSharedDirty、ReadShared、CleanShared),cache line 必须修改为Invalid或者Shared。

4.4 State change description
每次传输前,起始状态有三种可能:
可预期的end 状态;
支持external snoop filter 的cached master,需要:
Cache line UniqueClean 可以转到SharedClean,UniqueDirty 可以转到SharedDirty;
Cache line 状态:

4.5 Read transactions
4.5.1 ReadNoSnoop
用于几个master 读取no shareable 的memory 区域,要求:IsShared response 必须拉低,PassDirty response 必须拉低。

4.5.2 ReadOnce
用于其他master 读取Shareable 的memory区域,比如snapshot 数据,要求:IsShared response 指示cache line 是shared 或者unique;PassDirty response 必须为低。

4.5.3 ReadClean
用于多个master 读取shareable memory 区域,保证不会pass 更新main memory。要求:IsShared response 指示当前cache line 是shared 还是unique,PassDirty 必须为低。

4.5.4 ReadNotSharedDirty
用于多个master 读取shareable memory 区域,返回response 为IsShard
或者Unique,尤其是cached master load 其他SharedDirty 状态。要求:IsShared,PassDirty都可以用,但是Shared 状态必须PassDirty 为低。

4.5.5 ReadShared
用于多个master 读取shareable memory 区域,返回response 为IsShard或者Unique,主要用于cached master 就可以接受任何cache line 的状态。要求:IsShared为Shared或者Unique,PassDirty 为Clean或者Dirty。

4.5.6 ReadUniqe
用于多个master 读取shareable memory 区域,返回response 保证cache line 的数据为Unique状态,主要用于store 操作,尤其是initiating master 携带cache line 的部分数据需要store,不能有cache line的其他copy。要求:IsShared 返回必须为Unique,PassDirty 必须指示当前cache line 为Clean或者Dirty。

4.6 Clean transaction
通过AR 通道实现。
4.6.1 CleanUnique
用于多个master 的shareable memory 区域,为了确保:
 Cache line 被保持在Unique状态,master store cache line操作,其他master 不能有copy;
 有master 有dirty 的数据需要写入main memory,其他mater cache line 的数据需要移除;
主要用于mater 需要store 数据,但是其他mater 有数据的copy,要求:IsShared 必须拉低,PassDirty 必须拉低。


一旦完成CleanUnique,initiating master 可以store 数据,如果store 前cache line 为invalid,store 的size 必须为整个cache line。整个cache line store 后,状态为UniqueDirty,其他snoop 必须在CleanUnique 完成之后进行。

4.6.2 CleanShared
CleanShared为cache clean 的广播指令,可用于Shareable 和Non-shareable memory 区域,CleanShared 确保所有其他所有cache line 的copy 跟main memory 一直的。要求:IsShared response 需要指定shared 还是unique,PassDirty 必须为低。

4.6.3 CleanInvalid
CleanInvalid 是cache clean和invalidate 的广播传输,用于Shareable和Non-shareable memory 区域,用于确保main memory 数据没有被cache。要求:IsShared response必须拉低,PassDirty response必须拉低。

4.7 Make transaction
AR 通道实现。
4.7.1 MakeUnique
MakeUnique 用于跟其他master的Shareable memory 区域,确保:cache line 为Unique 状态,master 要store 数据到cache line,但是不能影响其他master 的copy;所有其他master 的copy 被移除。要求:IsShared 必须为低,PassDirty response 必须拉低。
MakeUnique 的数据必须是full cache line 的整数倍。

4.7.2 MakeInvalid
MakeInvalid 为cache invalidate 的广播指令。用于Shareable和Non-shareable memory区域。用于确保main memory 数据没有被cache。Response 要求:IsShared 必须为低,PassDirty 必须为低。

4.8 Write transactions
AW 通道完成的写传输
4.8.1 WriteNoSnoop
WriteNoSnoop 用于no Shareable的memory 区域,命令来源于:编程的store,cache line 跟新Non-shareable memory 区域。

4.8.2 WriteUnique
WriteUnique用于Shareable的memory 区域,用于写操作或者下刷cache line,不能用于需要保持Dirty 数据的cache line。

4.8.3 WriteLineUnique
WriteLineUnique用于Shareable的memory 区域,用于写操作或者下刷cache line,必须是full cache line 更新数据,同样不能用于需要保持Dirty 数据的cache line。

4.8.4 WriteBack
WriteBack用于Shareable和Non-shareable的memory 区域,用于写Dirty cache line 数据到main memory或者下刷cache line。

4.8.5 WriteClean
WriteClean用于Shareable和Non-shareable的memory 区域,用于写Dirty cache line 数据到main memory或者下刷cache line。
WriteClean跟WriteBack 的区别在于shareable memory 区域是否保留到cache line,WriteClean 后cache line 仍然有,WriteBack 后就没有了。

4.8.6 WriteEvict
WriteEvict用于evict 一个clean cache line,用于降低cache hierarchy,比如L3 或者system 层级cache,WriteEvict 不能更新数据到main memory。WriteEvict以下情况必须要求:cache line 保持在UniqueClean 状态,不同shareable 区域不能保存cache line数据;
WriteEvict需要component 明确声明是否支持,默认不支持,支持的master 必须要支持能否关闭。

4.8.7 Restrictions on WriteUnique and WriteLineUnique usage
WriteUnique和WriteLineUnique 用于non-cached component 写shareable memory 区域,也可以用于cached component。
Cache component 必须完成snoop 输入的WriteUnique和WriteLineUnique,要求:
 处理WriteUnique和WriteLineUnique之前,必须完成WriteBack、WriteClean、WriteEvict、Evict的outstanding 命令;
因为更早的传输也需要完成snoop。

4.9 Evict transactions
AW 通道的Evict 传输。
Master local cache cache line 需要evict才会发,没有数据传输,evict 只针对shareable memory 区域,evict 只用于支持snoop filter 的mater。

4.10 Handing overlapping write transaction
主要讨论两个master 同时store 同一个cache line,Interconnect 返回的response 跟传输顺序相同。
两个master 同时store 数据到cache line,第一个master master1按照正常进行,接下来主要讨论第二个master master2的行为。
4.10.1 Overlapping ReadUnique
Master2 处理ReadUnique 需要cache line copy数据,有以下步骤:

  1. Master2 发起ReadUnique 传输;
  2. Master2 发现master 1的snoop 向相同的cache line 发起了写操作:ReadUniqe、CleanInvalid、MakeInvalid。此时master2 必须发起invalid 操作,如果master2 本地没有copy 则不能发起;
  3. 当master 2的ReadUnique 开始前,更新cache line数据,包含master 1 更新以后数据。
  4. Master2 开始store;
    4.10.2 Overlapping MakeUnique
    Master 2 处理MakeUnique,需要full cache line 的写。具体步骤:
  5. Master2 发起MakeUnique;
  6. Master2 发现master 1的snoop 向相同的cache line 发起了写操作:ReadUniqe、CleanInvalid、MakeInvalid。此时master2 必须发起invalid 操作,如果master2 本地没有copy 则不能发起;
  7. 当MakeUnique 完成后,master2 可以完成full cache line 的store;
    4.10.3 Overlapping CleanUnique
    Master2 处理CleanUnique,当它已经在cache line 保存数据,且partial cache line 数据store。具体步骤:
  8. Master2 发起CleanUnique;
  9. Master2发现master 1的snoop 向相同的cache line 发起了写操作:ReadUniqe、CleanInvalid、MakeInvalid。此时master2 必须发起invalid 操作,如果master2 本地没有copy 则不能发起;
  10. 当CleanUnique 处理的时候,master2 不能向local cache 下发store,因为cache line的copy 已经无效;
  11. Master 2 发送一个新的ReadUnique,重新copy cache line;
  12. Master2 发起store;

5 Snoop Transactions
5.1 Mapping coherency operations to snoop operations
Initiating master 通过snoop 通道访问cached master,只有部分需要snoop 操作。

只有以下transaction 支持snoop 访问cached master;

以下不支持snoop访问cached master;

可以选择的snoop 传输


简化snoop 操作,所有snooped master 发起的snoop 都可以简化为ReadUnique,上图snoop transaction可选项都包含ReadUnique。

5.2 General requirements for snoop transactions
Snoop transaction 的行为:

如果cache line 为Dirty,返回snoop response 没有拉高PassDirty CRRESP[2],cache line 可以继续为Dirty;如果返回snoop response 拉高了PassDirty CRRESP[2],cache line 必须变为Clean、或者Invalid。
D5-3中,cache line end 状态区分依据:
 Shared 或者Invalid
Snooped cache store前必须广播,snooped cache 需要考虑其他master 可能有copy;
 Invalid
Snooped cache 不能保存copy,其他master 可能要store cache line;
 Clean或者Invalid
Snooped cache line不能为Dirty,snooped cache 不能使用WriteBack或者WriteClean更新memory 数据,直到cache line 的store 之后。
以i下cache 状态跳变不能发生:
 Invalid 到Invalid;
 Clean到Dirty;
 Shared 到Unique;
 UniqueDirty到UniqueClean;
Snoop 传输允许的状态跳变:


Snoop response 关于IsShared 和PassDirty的要求:
 Cache line end 状态为Valid,IsShard 必须为高;
 Cache line从Dirty跳变到Clean,PassDirty 必须为高;
 Cache line因为snoop从Dirty跳变到Invalid,比如MakeInvalid,PassDirty 必须为高;
 Cache line因为MakeInvalid从Dirty跳变到Invalid,PassDirty可高可低;

5.2.1 Channel activity
Snoop 传输使用通道:
 接受地址AC;
 返回response CR;
 返回数据CD;
Snoop response CRRESP[0]指示是否有数据。

5.2.2 Snoop data transfers
Cached master 可以提供cache line 数据,如果dirty cache接受到MakeInvalid,需要完成:
 返回snoop 传输数据;
 使用WriteBack 或者WriteClean 更新数据到memory,然后返回snoop response;
需要返回数据的snoop 传输:

5.2.3 Memory update in progress
协议确保两个component 不能同时更新同一片memory 区域的数据。
写数据的cached master 接收到snoop 传输,使用WriteBack或者WriteClean。如果cached master 接收到PassDirty 和IsShared 都为高,则不能store 数据,必须等snooped master 更新完成;

5.2.4 WasUnique snoop response
WasUnique snoop response,CRRESP[4]指示cache line 是否Unique。
其他cache不能有copy 数据,Interconnect 也不会发snoop 给其他cached master。

5.2.5 Non-blocking requirements for snooped mater
Master 必须能处理任何snoop 传输,AR通道的任何地址,AW通道的WriteUnique、WriteLineUnique传输;

任何AR通道的transaction,可以被AC通道transaction挡住;
任何AC 通道的snoop transaction可以被AW 通道的write transaction 挡住,尤其是WriteUnique、WriteLineUnique 传输。

5.3 Snoop transactions
Snoop 传输的行为和退出方法
5.3.1 ReadOnce

Initiating master 发给snooped master,指示snooped master:保持cache line 为Unique,store cache line 数据;
如果snooped master cache line有copy,则根据需要是否返回数据,如果数据Dirty 必须返回数据;
协议要求cache line 为Clean,Interconnect 会回写cache line 到main memory,cache line状态跳转为SharedClean 或者Invalid。
5.3.2 ReadClean ReadShared ReadNotSharedDirty

5.3.3 ReadUnique

ReadUnique 传输中,如果snooped master 有copy且 Dirty,数据必须下刷到memory。协议要求cache line clean。
5.3.4 CleanInvalid

如果snooped master 有copy且 Dirty,数据必须下刷到memory。协议要求cache line clean。
5.3.5 MakeInvalid

不能有数据传输,CRRRESP[0]为低,PassDirty 必须为低。
5.3.6 CleanShared

如果snooped master 有copy且 Dirty,数据必须下刷到memory。协议要求cache line clean。

posted on 2024-12-27 20:09  向前走向钱看  阅读(328)  评论(0)    收藏  举报