From 6fdc19a3bd84cb9f7d9ca4baede3022b17b71490 Mon Sep 17 00:00:00 2001 From: Derek Christ Date: Tue, 2 Aug 2022 17:52:36 +0200 Subject: [PATCH] Do not terminate transactions that haven't responded yet. Do not terminate transactions in terminateRemainingTransactions that had not sent the BEGIN_RESP phase. To keep the total number of transactions in the GeneralInfo table in sync, also decrement this value for every transaction that was rejected in the database recording. --- DRAMSys/library/src/common/TlmRecorder.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/DRAMSys/library/src/common/TlmRecorder.cpp b/DRAMSys/library/src/common/TlmRecorder.cpp index 47a8bac4..f35b227b 100644 --- a/DRAMSys/library/src/common/TlmRecorder.cpp +++ b/DRAMSys/library/src/common/TlmRecorder.cpp @@ -239,7 +239,20 @@ void TlmRecorder::terminateRemainingTransactions() removeTransactionFromSystem(*transaction->first); } else - recordPhase(*(transaction->first), END_RESP, sc_time_stamp()); + { + std::string beginPhase = transaction->second.recordedPhases.back().name; + + if (beginPhase == "RESP") + recordPhase(*(transaction->first), END_RESP, sc_time_stamp()); + else + { + // Do not terminate transaction as it is not ready to be completed. + currentTransactionsInSystem.erase(transaction); + + // Decrement totalNumTransactions as this transaction will not be recorded in the database. + totalNumTransactions--; + } + } } }