mem-ruby: Add a DBID field to the CHIResponseMsg data type

This will hold the CHI Data Buffer Identifier (DBID) field.
The DBID allows a Completer of a transaction to provide its own
identifier for a transaction ID.
This new ID will be used as a TxnId field by a following
WriteData/CompData/CompAck response.

For now we only set it to the original txnId (identity mapping)

Change-Id: If30c5e1cafbe5a30073c7cd01d60bf41eb586cee
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
This commit is contained in:
Giacomo Travaglini
2023-06-29 10:46:20 +01:00
parent 4359567180
commit da740b1cdd
3 changed files with 31 additions and 4 deletions

View File

@@ -2135,6 +2135,16 @@ action(Receive_ReqResp_WUComp, desc="") {
}
}
action(Receive_ReqResp_CopyDBID, desc="Copy the rsp DBID into the TBE") {
if (tbe.expected_req_resp.receivedRespType(CHIResponseType:DBIDResp) == false &&
tbe.expected_req_resp.receivedRespType(CHIResponseType:CompDBIDResp) == false) {
error("Received unexpected message");
}
peek(rspInPort, CHIResponseMsg) {
tbe.txnId := in_msg.dbid;
}
}
action(Receive_SnpResp, desc="") {
assert(tbe.expected_snp_resp.hasExpected());
peek(rspInPort, CHIResponseMsg) {
@@ -2557,6 +2567,7 @@ action(Send_CompI, desc="") {
out_msg.type := CHIResponseType:Comp_I;
out_msg.responder := machineID;
out_msg.Destination.add(tbe.requestor);
out_msg.dbid := tbe.txnId;
}
}
@@ -2568,6 +2579,7 @@ action(Send_CompUC, desc="") {
out_msg.responder := machineID;
out_msg.Destination.add(tbe.requestor);
out_msg.txnId := tbe.txnId;
out_msg.dbid := tbe.txnId;
}
}
@@ -2579,6 +2591,7 @@ action(Send_CompUC_Stale, desc="") {
out_msg.responder := machineID;
out_msg.Destination.add(tbe.requestor);
out_msg.txnId := tbe.txnId;
out_msg.dbid := tbe.txnId;
// We don't know if this is a stale clean unique or a bug, so flag the
// reponse so the requestor can make further checks
out_msg.stale := true;
@@ -2603,6 +2616,7 @@ action(Send_CompI_Stale, desc="") {
out_msg.type := CHIResponseType:Comp_I;
out_msg.responder := machineID;
out_msg.Destination.add(tbe.requestor);
out_msg.dbid := tbe.txnId;
// We don't know if this is a stale writeback or a bug, so flag the
// reponse so the requestor can make further checks
out_msg.stale := true;
@@ -2617,6 +2631,7 @@ action(Send_CompDBIDResp, desc="") {
out_msg.responder := machineID;
out_msg.Destination.add(tbe.requestor);
out_msg.txnId := tbe.txnId;
out_msg.dbid := tbe.txnId;
}
}
@@ -2627,6 +2642,7 @@ action(Send_CompDBIDResp_Stale, desc="") {
out_msg.type := CHIResponseType:CompDBIDResp;
out_msg.responder := machineID;
out_msg.Destination.add(tbe.requestor);
out_msg.dbid := tbe.txnId;
// We don't know if this is a stale writeback or a bug, so flag the
// reponse so the requestor can make further checks
out_msg.stale := true;
@@ -2640,6 +2656,7 @@ action(Send_DBIDResp, desc="") {
out_msg.type := CHIResponseType:DBIDResp;
out_msg.responder := machineID;
out_msg.Destination.add(tbe.requestor);
out_msg.dbid := tbe.txnId;
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022 ARM Limited
* Copyright (c) 2021-2023 Arm Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -1212,8 +1212,7 @@ transition(BUSY_BLKD,
}
// waiting for WB or evict ack
transition(BUSY_INTR,
{CompDBIDResp,Comp_I}, BUSY_BLKD) {
transition(BUSY_INTR, Comp_I, BUSY_BLKD) {
Receive_ReqResp;
Profile_OutgoingEnd_DatalessResp;
Pop_RespInQueue;
@@ -1229,9 +1228,19 @@ transition(BUSY_INTR, Comp_UC, BUSY_BLKD) {
ProcessNextState;
}
// waiting for WB or evict ack
transition(BUSY_INTR, CompDBIDResp, BUSY_BLKD) {
Receive_ReqResp;
Receive_ReqResp_CopyDBID;
Profile_OutgoingEnd_DatalessResp;
Pop_RespInQueue;
ProcessNextState;
}
// alternative flow for WU with separate Comp
transition(BUSY_INTR, DBIDResp, BUSY_BLKD) {
Receive_ReqResp;
Receive_ReqResp_CopyDBID;
Receive_ReqResp_WUNeedComp;
Pop_RespInQueue;
ProcessNextState;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 ARM Limited
* Copyright (c) 2021, 2023 Arm Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -156,6 +156,7 @@ structure(CHIResponseMsg, desc="", interface="Message") {
bool stale, desc="Response to a stale request";
bool usesTxnId, desc="True if using a Transaction ID", default="false";
Addr txnId, desc="Transaction ID", default="0";
Addr dbid, desc="Data Buffer ID", default="0";
//NOTE: not in CHI and for debuging only
MessageSizeType MessageSize, default="MessageSizeType_Control";