summaryrefslogtreecommitdiff
path: root/src/cpu/testers/traffic_gen
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/testers/traffic_gen')
-rw-r--r--src/cpu/testers/traffic_gen/TrafficGen.py8
-rw-r--r--src/cpu/testers/traffic_gen/traffic_gen.cc14
-rw-r--r--src/cpu/testers/traffic_gen/traffic_gen.hh18
3 files changed, 37 insertions, 3 deletions
diff --git a/src/cpu/testers/traffic_gen/TrafficGen.py b/src/cpu/testers/traffic_gen/TrafficGen.py
index f29cedb3a..1a6a6359c 100644
--- a/src/cpu/testers/traffic_gen/TrafficGen.py
+++ b/src/cpu/testers/traffic_gen/TrafficGen.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2012 ARM Limited
+# Copyright (c) 2012, 2016 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
@@ -77,3 +77,9 @@ class TrafficGen(MemObject):
# are not immediately accepted
elastic_req = Param.Bool(False,
"Slow down requests in case of backpressure")
+
+ # Let the user know if we have waited for a retry and not made any
+ # progress for a long period of time. The default value is
+ # somewhat arbitrary and may well have to be tuned.
+ progress_check = Param.Latency('1ms', "Time before exiting " \
+ "due to lack of progress")
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
diff --git a/src/cpu/testers/traffic_gen/traffic_gen.hh b/src/cpu/testers/traffic_gen/traffic_gen.hh
index 914b4ac09..0715c5965 100644
--- a/src/cpu/testers/traffic_gen/traffic_gen.hh
+++ b/src/cpu/testers/traffic_gen/traffic_gen.hh
@@ -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
@@ -94,6 +94,11 @@ class TrafficGen : public MemObject
*/
void recvReqRetry();
+ /**
+ * Method to inform the user we have made no progress.
+ */
+ void noProgress();
+
/** Struct to represent a probabilistic transition during parsing. */
struct Transition {
uint32_t from;
@@ -123,6 +128,17 @@ class TrafficGen : public MemObject
*/
const bool elasticReq;
+ /**
+ * Time to tolerate waiting for retries (not making progress),
+ * until we declare things broken.
+ */
+ const Tick progressCheck;
+
+ /**
+ * Event to keep track of our progress, or lack thereof.
+ */
+ EventWrapper<TrafficGen, &TrafficGen::noProgress> noProgressEvent;
+
/** Time of next transition */
Tick nextTransitionTick;