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 <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18793
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Tiago Muck
2019-01-24 14:59:04 -06:00
committed by Tiago Mück
parent e12da9b084
commit f26f3e22b3

View File

@@ -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);
}
}