AMBA CHI协议学习笔记3-一致性模型

【本系列文章是我自己对CHI协议的学习笔记,仅供参考,欢迎指正。】

【文中的红色字体是我自己的标注】

一、Cache state model

 原文:

I Invalid:
• The cache line is not present in the cache.
UC Unique Clean:
• The cache line is present only in this cache.
• The cache line has not been modified with respect to memory.
• The cache line can be modified without notifying other caches.
• In response to a snoop that requests data, the cache line is permitted, but not required, to be:
— Returned to Home when requested.
— Forwarded directly to the Requester when instructed by the snoop.
UCE Unique Clean Empty:
• The cache line is present only in this cache.
• The cache line is in a unique state but none of the data bytes are valid.
• The cache line can be modified without notifying other caches.
• In response to a snoop that requests data, the cache line must not be:
— Returned to Home even when requested.
— Forwarded directly to the Requester even when instructed by the snoop.
UD Unique Dirty:
• The cache line is present only in this cache.
• The cache line has been modified with respect to memory.
• The cache line must be written back to next level cache or memory on eviction.
• The cache line can be modified without notifying other caches.
• In response to a snoop that requests data, the cache line:
— Must be returned to Home when requested.
— Is expected to be forwarded directly to the Requester when instructed by the snoop.
UDP Unique Dirty Partial:
• The cache line is present only in this cache.
• The cache line is unique. The cache line might have some bytes valid, where some includes
none or all bytes.
• The cache line has been modified with respect to memory.
• When the cache line is evicted, it must be merged with data from next level cache or memory
to form the complete valid cache line.
• The cache line can be modified without notifying other caches.
• In response to a snoop that requests data, the cache line must:
— Be returned to Home.
— Not be forwarded directly to the Requester even when instructed by the snoop.
SC Shared Clean:
• Other caches might have a shared copy of the cache line.
• The cache line might have been modified with respect to memory.
• It is not the responsibility of this cache to write the cache line back to memory on eviction.
• The cache line cannot be modified without invalidating any shared copies and obtaining
unique ownership of the cache line.
• In response to a snoop that requests data, the cache line:
— Is required to not return data if RetToSrc bit is not set.
— Is expected to return data if RetToSrc bit is set.
— Is expected to be forwarded directly to the Requester when instructed by the snoop.
SD Shared Dirty:
• Other caches might have a shared copy of the cache line.
• The cache line has been modified with respect to memory.
• The cache line must be written back to next level cache or memory on eviction.
• The cache line cannot be modified without invalidating any shared copies and obtaining
unique ownership of the cache line.
• In response to a snoop that requests data, the cache line:
— Must be returned to Home when requested.
— Is expected to be forwarded directly to the Requester when instructed by the snoop.

Empty cache line ownership
An empty cache line is a cache line that is held in a Unique state to prevent other copies of the cache line existing.None of the data bytes are valid in an empty cache line. This cache line state is UCE or UDP.
The following are examples of when empty cache line ownership can occur:
• A Requester can deliberately obtain an empty cache line before starting a write, to save system bandwidth.A Requester that expects to write to a cache line can obtain an empty cache line with permission to store, instead of obtaining a valid copy of the cache line.
• A Requester can transition into an empty state if the Requester has a copy of the cache line when it requests permission to store. That copy of the cache line is invalidated before the Requester obtains permission to store. At the completion of the request, this results in the Requester having an empty cache line with permission to store.

以下对六种状态的介绍 来自 谷公子

I:Invalid,该cacheline的数据不在当前cache中;
UC:Unique Clean,该cacheline的数据只在当前cache中,且和memory的数据一致,可以不知会其它RN就对该cacheline的数据进行修改。在收到snoop请求时,该cacheline不需要返回数据给HN或fwd data给RN
UCE:Unique Clean Empty,该cacheline的数据只在当前cache中,但是所有的数据都是无效的,可以不知会其它RN就对该cacheline的数据进行修改。在收到snoop请求时,该cacheline必须不能返回数据给HN或fwd data给RN
UD:Unique Dirty,该cacheline的数据只在当前cache中,且和memory的数据不一致,已经被修改过了;如果该cacheline的数据不用了,那需要写回到下级cache或memory;可以不知会其它RN就对该cacheline的数据进行修改。在收到snoop请求时,该cacheline必须返回数据给HN或fwd data给RN
UDP:Unique Dirty Partial,该cacheline的数据只在当前cache中,且和memory的数据不一致,部分被修改且有效;如果该cacheline的数据不用了,那需要和下级cache或memory的数据组成一个完成有效的cacheline;可以不知会其它RN就对该cacheline的数据进行修改。在收到snoop请求时,该cacheline必须返回数据给HN,但不能直接将数据fwd给Requester
SC:Shared Clean,其它cache可能也存在该cacheline的拷贝;该cacheline可能已经被修改了;当不需要该cacheline数据时,cache没有义务必须将该数据写回到memory;必须对其它cache的该cacheline进行无效后,获得U态才能将该cacheline进行改写;在收到snoop请求时,该cacheline在RetToSrc没有置位时不需要返回数据,如果RetToSrc置位,则需要返回数据,可以直接fwd数据给Requester
SD:Shared Dirty,其它cache可能也存在该cacheline的拷贝;该cacheline相对于memory已经被修改了;当该cacheline不需要的时候,cache需要将它写回下游cache或memory;必须对其它cache的该cacheline进行无效后,获得U态后才能将该cacheline进行改写。在收到snoop请求时,该cacheline必须返回数据给HN和fwd data给Requester;

UCE态的获得:有两种情况UCE态发生,a. Requester故意产生UCE态,在Requester对cacheline写数据前,为了节省系统带宽,Requester获得UCE态而不是UC,就可以对该cacheline进行写操作;b. Request切换到UCE态,如果Requester已经有该cacheline的拷贝,且正在申请获取写权限,但是在获得写权限之前该数据已经被失效掉了,这样会使得该cacheline变为UCE态。
UDP态的获得:UDP态获得的前提是当前cacheline为UCE态,然后Request对齐进行partial写,这样就产生了UDP态。

二、Cache状态转移

由于内部事件,cache可以悄悄转换而不通知系统中的其它masters;下表为合法的silent cache state transaction

 读、写、dataless、atomic、stashing、snoop操作都可能改变requester处或者snoopee处的cache状态。

readonce 和readnosnoop 的final state都是I,因为not allocate;其他读有SC、SD、UC、UD

dataless中cleanunique的final state有UCE、UC、UD,makeunique为UD,其他均为I

writeclean的final state为UC和SC,其他均为I

Atomic和stash的final state均为I

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值