【本系列文章是我自己对CHI协议的学习笔记,仅供参考,欢迎指正。】
【文中的红色字体是我自己的标注】
一、CHI的六种通道
CHI的通道,有收/发两个方向,在发送方向上,有三个通道分别是REQ,WDAT和SRSP;在接收方向上也是三个通道,分别是CRSP,RDAT和SNP。
对于SN来说,因为不需要支持snoop操作,所以减少了SRSP和SNP。
REQ通道上:read/write command,cache maintenance,DVM request
•SNP通道上:snoop command,DVM operation
•DAT通道上:read/write data,snoop response,read response
•RSP通道上:write/maintenance/completion response,dataless snoop response
三种常用的传输方式:
二、组件之间的port接口
Protocol flit A Protocol flit carries a protocol packet in its payload. In this specification, every protocol packet is mapped into exactly one protocol flit.
Link flit A Link flit carries messages associated with link maintenance. For example, a Transmitter uses a Link flit to return a Link layer Credit, also referred to as an L-Credit, to the Receiver during a link deactivation sequence.
Link flits originate at a link Transmitter and terminate at the link Receiver connected at the other side of the link.
三、requster 和 completer的req连接,其他的类似。
四,重要域值列表
此处截图不全,示意而已,后面的不贴了。
TgtID
message都有携带,是message要发送节点的组件NodeID,ICN可以根据这个将message正确发送到目的地;
SrcID
message都有携带,是发送message的组件NodeID,ICN可以根据这个确定那个port发送的message;
HomeNID
原始请求的Home Identifier,Requester在收到CompData之后,用这个域值来决定CompAck的TgtID;用于Slave或HN返回CompData和DataSepResp,在其他data message中该域值必须为0;
ReturnNID
用于决定Slave发送的CompData和DataSepResp的节点,该值可以是HN或原始Requester的NID;该域段只有在HN发往SN的ReadNoSnp、ReadNoSnpSeq和non-store Atomics才有效,其他requests必须为0;
FwdNID
用于DCT传输中CompData响应要发给的Requester,该值必须等于原始request的Requester的NID,只应用于Forward typesnoops,在其它snoop requests中无用且必须为0;
LPID
在request中,和SrcID可以唯一标识一个logical processor;
StashNID
用于标识Stash request的目的地,在StashNIDValid有效时必须是有效值;只应用于Stash request中,在其它requests中无用且必须为0;
StashNIDValid
在Stash命令中指示StashNID是否有效;在其它requests中无用;
StashLPID
用于Stash request和Stash type snoop request中,和StashNID一块确定唯一的Logical Processor;在其它requests中必须为0;
StashLPIDValid
用于Stash request和Stash type snoop request中,指示StashLPID是否有效;在其它requests中无用;
TxnID
同一个源用每个不同TxnID来表示outstanding transactions。Link filts没有单独的TxnID,全部为0;
ReturnTxnID
用于Slave返回CompData和DataSepResp响应的TxnID,它的值可以是HN产生TxnID,或者是原始requester产生的TxnID;
FwdTxnID
等于原始request的TxnID,用于snoop request中;
DBID
Completer返回的响应里携带,Requester用于CompAck或WriteData的TxnID;
Opcode
Opcode决定了每个message的操作,不同channel支持的Opcode不一样。
Addr
CHI协议支持44-52bits的物理地址,因此REQ和SNP packets在DVM操作中支持49-53的Virtual Address(VA)。
Request messages支持44-53bit地址宽度,Addr[(43-51):0].
Snoop messages支持41-49bit地址宽度,Addr[(43-51):3];因为snoop操作的数据都是64字节
NS
指示安全还是非安全访问;
Size
指定该笔transaction的data size大小;
Atom 1、2、4、8、16、32 B, readnosnoop 和 write*ptl小于等于64B,其他都是64B
MemAttr
有Allocate、Cacheable、Device和EWA;
SnpAttr
指示transaction的snoop属性;
LikelyShared
指示的requested data可能在其它RN中存在;
Order
指示transaction的保序需求;
Excl
指示transaction的Exclusive属性;
Endian
用于Atomic transaction的endianness of Data;
AllowRetry
指示transaction是否可以被Retry;
ExpCompAck
指示transaction是否包含CompAck响应;
SnoopMe
指示HN是否需要给Requester发送snoop request,仅用于Atomic requests;
RetToSrc
指示Snoopee是否需要返回一份cacheline data给HN;
DataPull
指示snoop response中是否包含Read request;
DoNotGoToSD
指示Snoopee的cache line能否允许是SD态;
DoNotDataPull
指示Stash的响应是否允许包含Data Pull;
QoS
值越高越高的优先服务等级;
PCrdType
指示grant或return的credit类型;
TraceTag
为了trancing purposes,在transaction用于给packet做标记;
VMIDExt
Virtual Machine Identifier extension,用于扩展VMID的8-16bits
Resp
Response Status,在多个数据packet中,Resp的域必须保持一致;表6为Resp value encoding。
FwdState
指示DCT中Snoopee发给Requester的CompData的cache state,表7为FwdState value encodings
RespErr
该域段用于指示Response的error status
Data
在Data packet中用于传输data payload。
CCID
指示critical 128-bit chunk of the data that is being requested;
DataID
Data Identifier;
BE
指示相应的data byte是否有效。BE域是用于write data,DVM payload和snoop response data。对于read response data,该域段无效且可以为任意值。
DataCheck
用于相应data byte的DataCheck;
Poison
用于指示相应的64bit data chunk是否被poison,是否error。
DataSource
指示响应数据的发送者,用于Read request的CompData,SnpRespData和SnpRespDataPtl,在其他response响应中无效;
五、link握手
An L-Credit is sent from the Receiver to the Transmitter by asserting the appropriate LCRDV signal for a single clock cycle. There is one LCRDV signal for each channel. See Channel interface signals on page 13-424 for the LCRDV signal naming for each channel.
Each transfer of a flit from the Transmitter to the Receiver consumes 1 L-Credit.
The minimum number of L-Credits that a Receiver can provide is 1. The maximum number of L-Credits that a Receiver can provide is 15. A Receiver must guarantee that it can accept all the flits for which it has issued L-Credits. When the link is active, the Receiver must provide L-Credits in a timely manner without requiring any action on the part of the Transmitter.
简而言之就是通过 LINKACTIVEREQ and LINKACTIVEACK 使TX和RX都进入run状态,开始发送credit,而flit发送一次就消耗一个credit。
补充: 如上是link层的握手,还有事务层的握手TXSACTIVE 和 RXSACTIVE。
Coherency的握手SYSCOREQ和SYSCOACK,如下