diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp b/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp index 0576653d..2dfa4ff4 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp @@ -188,8 +188,8 @@ std::vector> Phase::getTracePlotLines(const Trace } else if (getGranularity() == Granularity::Groupwise) { - return drawingProperties.getBankLinesFromGroup(transaction->rank, - transaction->bankgroup % drawingProperties.groupsPerRank); + return drawingProperties.getBankLinesGroupwise(transaction->rank, + transaction->bank % drawingProperties.banksPerGroup); } else // if (getGranularity() == Granularity::Bankwise) { diff --git a/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.cpp b/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.cpp index f122a7bc..0ed8d044 100644 --- a/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.cpp +++ b/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.cpp @@ -230,6 +230,19 @@ TracePlotLineVector TraceDrawingProperties::getBankLinesFromGroup(unsigned int r return tracePlotLineCache->getBankLinesFromGroup(rank, group); } +TracePlotLineVector TraceDrawingProperties::getBankLinesGroupwise(unsigned int rank, + unsigned int bank) const +{ + auto rankLines = tracePlotLineCache->getBankLinesFromRank(rank); + TracePlotLineVector groupwiseLines; + + std::copy_if(rankLines.begin(), rankLines.end(), std::back_inserter(groupwiseLines), + [bank](std::shared_ptr line) + { return std::static_pointer_cast(line)->bank == bank; }); + + return groupwiseLines; +} + TracePlotLineVector TraceDrawingProperties::getBankLinesFromRank(unsigned int rank) const { return tracePlotLineCache->getBankLinesFromRank(rank); diff --git a/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.h b/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.h index ab114679..f214c9ce 100644 --- a/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.h +++ b/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.h @@ -93,6 +93,7 @@ public: TracePlotLineVector getFirstRankLines(unsigned int rank) const; TracePlotLineVector getBankLines(unsigned int rank, unsigned int group, unsigned int bank) const; TracePlotLineVector getBankLinesFromGroup(unsigned int rank, unsigned int group) const; + TracePlotLineVector getBankLinesGroupwise(unsigned int rank, unsigned int bank) const; TracePlotLineVector getBankLinesFromRank(unsigned int rank) const; const std::shared_ptr> getLabels() const;