From: Tiago Muck Date: Thu, 24 Jan 2019 20:59:04 +0000 (-0600) Subject: cpu: Fix rescheduling of progress check events X-Git-Tag: v19.0.0.0~792 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f26f3e22b331dfdd3dca1eea11adf9ed81ef6f05;p=gem5.git cpu: Fix rescheduling of progress check events noRequestEvent needs to be rescheduled on recvRetry, otherwise the timeout may be triggered even though packets are being eventually sent. noResponseEvent scheduling is also fixed. This timeout should not be active when we are not expecting a response. Change-Id: If9edb75b5b803caf9f99bf41ea3948b15a3f3d71 Signed-off-by: Tiago Muck Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18793 Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg Tested-by: kokoro --- diff --git a/src/cpu/testers/memtest/memtest.cc b/src/cpu/testers/memtest/memtest.cc index 93a6ac6b9..742cf3b26 100644 --- a/src/cpu/testers/memtest/memtest.cc +++ b/src/cpu/testers/memtest/memtest.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 ARM Limited + * Copyright (c) 2015, 2019 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -120,7 +120,6 @@ MemTest::MemTest(const Params *p) // kick things into action schedule(tickEvent, curTick()); schedule(noRequestEvent, clockEdge(progressCheck)); - schedule(noResponseEvent, clockEdge(progressCheck)); } Port & @@ -189,8 +188,12 @@ MemTest::completeRequest(PacketPtr pkt, bool functional) // the packet will delete the data delete pkt; - // finally shift the response timeout forward - reschedule(noResponseEvent, clockEdge(progressCheck), true); + // finally shift the response timeout forward if we are still + // expecting responses; deschedule it otherwise + if (outstandingAddrs.size() != 0) + reschedule(noResponseEvent, clockEdge(progressCheck)); + else if (noResponseEvent.scheduled()) + deschedule(noResponseEvent); } void @@ -303,6 +306,10 @@ MemTest::tick() } else { DPRINTF(MemTest, "Waiting for retry\n"); } + + // Schedule noResponseEvent now if we are expecting a response + if (!noResponseEvent.scheduled() && (outstandingAddrs.size() != 0)) + schedule(noResponseEvent, clockEdge(progressCheck)); } void @@ -327,6 +334,7 @@ MemTest::recvRetry() retryPkt = nullptr; // kick things into action again schedule(tickEvent, clockEdge(interval)); + reschedule(noRequestEvent, clockEdge(progressCheck), true); } }