summaryrefslogtreecommitdiff
path: root/src/cpu/testers/traffic_gen/traffic_gen.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2016-05-26 11:56:24 +0100
committerAndreas Hansson <andreas.hansson@arm.com>2016-05-26 11:56:24 +0100
commitd023b7e8dba012298d6396ae4734755ce1f194d1 (patch)
tree005786bcb0cacb7c19be628a1cea09e89190f90e /src/cpu/testers/traffic_gen/traffic_gen.cc
parent4ff4f9c531feb99561105117b6ceeb4eb85d7829 (diff)
downloadgem5-d023b7e8dba012298d6396ae4734755ce1f194d1.tar.xz
cpu: Add a basic progress check to the TrafficGen
This patch adds a progress check to the TrafficGen so that it is easier to detect deadlock scenarios where the generator gets stuck waiting for a retry, and makes no further progress. Change-Id: Ifb8779ad0939f52c0518d0e867bac73f99b82e2b Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Radhika Jagtap <radhika.jagtap@arm.com>
Diffstat (limited to 'src/cpu/testers/traffic_gen/traffic_gen.cc')
-rw-r--r--src/cpu/testers/traffic_gen/traffic_gen.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/cpu/testers/traffic_gen/traffic_gen.cc b/src/cpu/testers/traffic_gen/traffic_gen.cc
index a405351ed..fbb26baa8 100644
--- a/src/cpu/testers/traffic_gen/traffic_gen.cc
+++ b/src/cpu/testers/traffic_gen/traffic_gen.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2013 ARM Limited
+ * Copyright (c) 2012-2013, 2016 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -57,6 +57,8 @@ TrafficGen::TrafficGen(const TrafficGenParams* p)
masterID(system->getMasterId(name())),
configFile(p->config_file),
elasticReq(p->elastic_req),
+ progressCheck(p->progress_check),
+ noProgressEvent(this),
nextTransitionTick(0),
nextPacketTick(0),
currState(0),
@@ -179,6 +181,9 @@ TrafficGen::unserialize(CheckpointIn &cp)
void
TrafficGen::update()
{
+ // shift our progress-tracking event forward
+ reschedule(noProgressEvent, curTick() + progressCheck, true);
+
// if we have reached the time for the next state transition, then
// perform the transition
if (curTick() >= nextTransitionTick) {
@@ -512,6 +517,13 @@ TrafficGen::recvReqRetry()
}
void
+TrafficGen::noProgress()
+{
+ fatal("TrafficGen %s spent %llu ticks without making progress",
+ name(), progressCheck);
+}
+
+void
TrafficGen::regStats()
{
// Initialise all the stats