参考博文:https://www.cnblogs.com/-9-8/p/6128413.html
ACE 基础:
1):5状态的cache model(MOSEI)
2):关于coherency的additional signal
3):两个cache master访问shared cache的additional channel
4):支持Barrier transaction来保证transaction order
ACE推荐的最小的cache line的大小:min-------16B或者width of data bus,max----2048byte或者Burst 16的最大data bus
Cache Coherent的控制有两种方式,一种是SCU式集中的控制,另一种是ACE bus distribute的分散式的
Coherency model
每个master本地都有一个cache,通过cache interconnect连接到main memory
当store命令发生时,保证所有的cache中只有一个copy的cache存在。
store操作之后,允许一份cache有多个copy的对象。
在更新main memory时,也允许copy的cache存在,但是不推荐这样做。
ACE bus可以实现cache copy是否唯一性的判断,如果cache copy唯一,cache的修改都不需要notify其他的cache master;如果cache copy不唯一,cache的修改必须通过合适的transaction notify其他的cache master
Cache state model
以cache line为单位,可以分为:
Valid/Invalid:数据在当前cache中是否有效。
Unique/Shared:当前的cache line是否具有唯一性。
Clean/Dirty:clean不需要更新main memory,dirty需要更新main memory
当一个cache master得到一个新的copy cache line,其他的cache master可能也有一份该cache line的copy并且处于Unique状态,
此时必须notify其他的cache master将cache line的状态改为Shared
当一个cache master discard一个cache line时,不需要notify 其他的cache master,所以处于Shared State的cache line也可能是Unique状态的。
当一个cache line相对于main memory被更新,且有多个copy时,必须只有一个cache中处于Dirty state
ACE相对于AXI4多的信号:
Read address:ARDOMAIN[1:0]/ARSNOOP[3:0]/ARBAR[1:0]
domain信号表示:00---Non-Shareable,01---Inner Shareable,10---Outer Shareable,11---system
AxCACHE中的cache比特为0时,只能用11 level
AXCACHE中的[3:2]不为零时,不能用11 level
BAR信号表示:00---Normal access(respecting barrier),01---Memory barrier,10---Normal access(ignoring barrier),11---Synchronization barrier
Snoop信号表示:Non-snooping/Coherent/Memory update/Cache maintenance/Barrier这几种transaction
Write address:AWDOMAIN[1:0]/AWSNOOP[2:0]/AWBAR[1:0]/AWUNIQUE
AWUNIQUE信号,主要用在lower level的cache hierarchy操作中,像L3 cache。(支持WriteEvict操作的transaction才需要该信号)
Read data:RRESP[3:2]
RRESP[2]:PassDirty,从interconnect来,HIGH表示,initial master必须保证该cache line需要重新写回main memo; Low表示,initial master没有这样的reponsibility
RRESP[3]:IsShared,从interconnect来,HIGH表示,另外还有copy,该cache line必须在Shared state; Low表示,没有其他的copy,该Cache line处于Unique state
在write data和write resp中没有增加信号。
ACE新增加的channel:
snoop address channel:针对snoop transaction,为cache master提供address和控制信号。
ACVALID/ACREADY
ACADDR/ACSNOOP[3:0]
ACPROT[2:0]
snoop response channel:针对snoop transaction,提供response。
CRVALID/CRREADY
CRRESP[4:0]
snoop data channel:可有可无的信号,一般用在一个read clean cache的操作,返回cache中的数据。
CDVALID/CDREADY
CDDATA/CDLAST
从Shared location进行load操作:
1):master component在read address发出一个read transaction
2):interconnect通过snoop transaction确定是否有其他的master hold copy,发出snoop address
3):snoop resp/snoop data传到interconnect,interconnect将数据传给initial master,或者interconnect发出一个到main memory的transaction,正常的read address得到数据,传递给initial master
4):master检测到RACK信号,表示transaction结束
如果其他的master中的是一个dirty的cache,那么在将数据传递给intial master的同时,interconnect也必须更新main memory
从Shared location进行store操作:当一个master进行store的操作时,会移除所有copy的cache line,来保证发生store操作时,只有一个unique的copy,新的数据只能在master接下来又发出read操作时,才能读到cache line中。
store部分cache line中的数据:(必须先得到cache line的一份copy)
1):initial master在read address发出一个ReadUnique的命令,来将其他master的copy都移除。
2):interconnect通过snoop address channel将transaction传递给其他的cache
3):其他的cache master通过snoop response channel和snoop data channel将数据传递给interconnect
4):interconnect将数据数据和resp通过read data channel传递给initial master
如果其他的cache line中没有copy,则从main memory中读取。
5):intial master发出store命令,通过RACK来表示transaction的结束。
如果本身的cache line是一个Unique的,那么不需要对其他cache进行broadcase
store完整的cache line中的数据:(cache本身是)
1):在read address发出一个MakeUnique的命令,来移除其他cache中的cache line
2):interconnect通过snoop address channel将transaction传递给其他的cache,
3):interconnect将其他master的resp返回给initial master,snoop data channel不需要。
4):initial master进行store操作
store操作的cache line是shared的:
1):initial master在read address channel发出CleanUnique的