From 25ce5db3a3e61d7c4d35ff7f841a5beb9b353a08 Mon Sep 17 00:00:00 2001 From: Nikos Nikoleris Date: Mon, 15 Aug 2016 12:00:36 +0100 Subject: [PATCH] mem: Print an MSHR without triggering any assertions Previously printing an mshr would trigger an assertion if the MSHR was not in service or if the targets list was empty. This patch changes the print function to bypasses the accessor functions for postInvalidate and postDowngrade and avoid the relevant assertions. It also checks if the targets list is empty before calling print on it. Change-Id: Ic18bee6cb088f63976112eba40e89501237cfe62 Reviewed-by: Andreas Sandberg --- src/mem/cache/mshr.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mem/cache/mshr.cc b/src/mem/cache/mshr.cc index 71cfca7bd..86b5a4c08 100644 --- a/src/mem/cache/mshr.cc +++ b/src/mem/cache/mshr.cc @@ -518,11 +518,13 @@ MSHR::print(std::ostream &os, int verbosity, const std::string &prefix) const _isUncacheable ? "Unc" : "", inService ? "InSvc" : "", downstreamPending ? "DwnPend" : "", - hasPostInvalidate() ? "PostInv" : "", - hasPostDowngrade() ? "PostDowngr" : ""); + postInvalidate ? "PostInv" : "", + postDowngrade ? "PostDowngr" : ""); - ccprintf(os, "%s Targets:\n", prefix); - targets.print(os, verbosity, prefix + " "); + if (!targets.empty()) { + ccprintf(os, "%s Targets:\n", prefix); + targets.print(os, verbosity, prefix + " "); + } if (!deferredTargets.empty()) { ccprintf(os, "%s Deferred Targets:\n", prefix); deferredTargets.print(os, verbosity, prefix + " "); -- 2.30.2