mem-ruby: fix Sequencer latency reporting
authorTiago Mück <tiago.muck@arm.com>
Thu, 1 Oct 2020 21:45:56 +0000 (16:45 -0500)
committerTiago Mück <tiago.muck@arm.com>
Thu, 11 Feb 2021 17:12:22 +0000 (17:12 +0000)
Most protocols won't set initialRequestTime, forwardRequestTime, and
firstResponseTime, thus leading to calculated latency being always 0.

Change-Id: Id2c73314a964bf6efb262d40b3df515373023b84
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41114
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/mem/ruby/system/Sequencer.cc

index ab83677777f0a07743a1e10fe226537a3e2c42de..49c03519ab06f223fc8f8dd617a7e99e7632a191 100644 (file)
@@ -334,7 +334,7 @@ Sequencer::recordMissLatency(SequencerRequest* srequest, bool llscSuccess,
     assert(curCycle() >= issued_time);
     Cycles total_lat = completion_time - issued_time;
 
-    if (initialRequestTime < issued_time) {
+    if ((initialRequestTime != 0) && (initialRequestTime < issued_time)) {
         // if the request was combined in the protocol with an earlier request
         // for the same address, it is possible that it will return an
         // initialRequestTime corresponding the earlier request.  Since Cycles