Rsp分为4大类;
=======================Completion response===========================
 □ 除了PCrdReturn,PrefetchTgt,其他所有的trans都需要comp resp;
 □ 通常是一个trans的最后一个发送的message, 来自completer; 这个响应保证trans到达了POS/POC;
 □ 通常RN还会发送一个compack;
Read and Atomic transaction completion
 □ Read trans的响应,既可以通过compdata opcode, 直接从RDATA chnnel返回,也可以分成两个,一个通过RespsepDat从RSP channel返回,一个利用DataSepResp从RDAT channel返回;
 □ Atomic的响应,是用compdata直接从RDATchannel 返回;
 □ CompData/DataSepResp响应,包含的resp域段指示了如下信息:
         □ Cache state, 指示当前RN, 最终获得什么状态;
         □ Pass dirty, 指示最终flush的任务,是否传递给了当前RN;
 □ RespSepData也包含resp域段,这个域段要么设置成全0,要么和DataSepResp保持一致;

 □ 对于有错误指示的resp, 其cache state可以是任意值;
Dataless transaction completion
 □ Dataless transactions and the MakeReadUnique transaction without data的响应,来自RSP通道;
 □ 可以使用的opcode有Comp, CompPersist, CompCMO, or CompStashDone opcode;
 □ 响应中的resp域段包含如下信息:
         □ Cache state, 对于非CMO trans, 指示了当前RN中的cacheline的最终状态;
         □ 对于CMOtrans, 此域段无效,当前cacheline的状态不变;
 □ 对于有错误指示的resp, 其cache state可以是任意值;
 Write and Atomic transaction completion
 □ Write and AtomicStore completion从resp通道返回,可以使用comp/compDBIDResp opcode;
 □ Resp filed必须设置成0;Cache state和pass dirty的信息,包含在了writedata中;
 □ Comp:
     当completion需要分开返回comp和dbidresp/dbidrespord时,使用;
 □ Compdbidresp:
     当completion需要和dbidresp/dbidrespord合并返回时使用;
□ Comp/compDBIDResp 的选择:
     所有copyback的请求,必须使用compDBIDResp的响应;
     Non-copyback和AtomicStore,两者都可以使用;
□ DVM的响应,resp filed也是0;
==========================WriteData response===============================
 Writedata resp通过WDATAchannel发送,可以使用如下的一些opcode;
CopyBackWrData
 □ Used for WriteBack, WriteClean, WriteEvictFull, and WriteEvictOrEvict, and CopyBack Combined Write transactions
 □ 将当前RN中该cacheline的数据,发送到HN;
 指示了在发送该copyback操作时,当前RN中该cacheline的状态;
NonCopyBackWrData
 □ Used for WriteUnique and WriteNoSnp, and Non-CopyBack Combined Write transactions,and dvm trans;
 □ Cacheline 状态指示一定是invalid;
NCBWrDataCompAck
 □ Used for Non-CopyBack Write and Combined Write transactions.
 □ Combined NonCopyBackWrData and CompAck. 
 □ The cache state in the response must be I.
WriteDataCancel
 □ Used to inform the Completer that a Write request is canceled before write data is sent
 □ A Request Node can send WriteDataCancel instead of NonCopyBackWrData in WriteNoSnpPtl, WriteUniquePtl, WriteUniquePtlStash, and corresponding Combined Write transactions
 □ A Home Node can send WriteDataCancel instead of NonCopyBackWrData in WriteNoSnpFull, WriteNoSnpPtl, and corresponding Combined Write transactions to the Subordinate Node
 □ 访问device memory时,不能使用;
 □ BE filed全0;
 □ Cacheline state必须是invalid:
 □ Resp域段包含如下信息:
         □ Cache state, 表明在发送请求之前的状态,可能不是准确的,因为在发送请求之后,可能会收到其他人的snoop信息;
         □ Pass dirty, 同上;
         
==========================Snoop response==============================
 A Snoop response can be with or without data
Snoop response without data
 □ 在没有数据传输时使用;
 □ 在srsp channel发送;
 □ 可以包含data pull信息;
 □ 经常使用在给SnpDVMOp transaction回响应;
Snoop response without data to Home and Direct Cache Transfer (DCT)
 □ 在需要给RN发送数据,但是不需要给HN发送数据时使用;
 □ It is sent on the SRSP channel and uses the SnpRespFwded opcode
Snoop response with data
 □ 在需要将整条cacheline的数据发送给HN时使用;
 □ It is sent on the WDAT channel and uses the SnpRespData opcode
 □ It can include a Data Pull request for stash snoops
Snoop response with partial data
 □ 有partial cacheline的数据需要发送给HN时使用;
 □ It is sent on the WDAT channel and uses the SnpRespDataPtl opcode. 
 □ It can include a Data Pull request for stash snoops.
 □ 当cachline的状态是UDP,且snp不是SnpMakeInvalid时使用;
Snoop response with data to Home and DCT
 □ 当数据既要发送给HN,也要发送给RN时使用(RN->HN);
 □ It is sent on the DAT channel and uses the SnpRespDataFwded opcode.
 同样,resp filed包含两个信息;
 □ Cache state, 表示当前这个被snp的RN,在发送了snoop resp之后的状态;
 □ Pass dirty,只能在Snoop response with data时有效;
 □ Snoop resp还包含了FwdState field,在Snoop responses with DCT时使用,用来指示cache state和pass dirty是传递给RN的;
  


 □ 此处两个状态不一致,第一个是被snp的RN, 之后的状态,第二个是被snp的RN, 要把状态fwd给发起请求的RN,;
 □ Snp resp中的cacheine state必须是准确的,即使resp err指示当前有data err;
========================Miscellaneous response============================
 □ 不能归结到上述三种响应之中的其他响应;
 □ 其resp/resperr 域段,没有具体的实际意义,必须设置成0;
CompAck
 □ 当RN收到comp响应是使用;
 □ Used by Read, Dataless, WriteNoSnp, WriteEvictOrEvict, and WriteUnique transactions
 □ (copyback的操作,是看writedata, 所以不需要compack)
RetryAck
 □ Response is permitted for any request transaction except PCrdReturn or PrefetchTgt.
PCrdGrant
 ReadReceipt
 □ 当某个请求具有order需求时,会发送该响应;
 □ SN发送时,指示的时它接受了这个读请求,不会再发送retry ack;
 □ Applies to ReadNoSnp, ReadNoSnpSep, and ReadOnce* request transactions.
DBIDResp
 □ Applies to Write, Combined Write, DVMOp, and Atomic request transactions.
 □ HN->RN, SN->HN或者RN;
DBIDRespOrd
 □ Applies to Write, Combined Write, and Atomic request transactions
 □ DBIDRespOrd is not permitted in DVM transactions
 □ HN->RN
Persist
 □ 对于CleanSharedPersistSep trans,completer发送该响应,表明写数据已经到达了POP;
StashDone
 □ Sent by a Completer for StashOnceSep to signal the ordering of the request at the Completer
TagMatch
 □ Sent by the Completer for a Write transaction with TagOp of Match to signal the completion of the Tag Match operation.
Silent cache state transitions
 □ RN可以因为内部的一些event,改变cacheline状态,而不需要通知其他人;
 □ 主要其实就是现在unique的权限是我的,当然可以随时修改我的数据;
RN在发送对应的trans,得到响应响应之后的状态转变参考:
 Cache state transitions at a Requester
RN在被snopp之后,状态的转变参考:
 Cache state transitions at a Snoopee
  

















![[PAT乙级] 1029 旧键盘 C++实现](https://img-blog.csdnimg.cn/8a223f6ebe4e469b986313f2e5b8e3e8.png)

