summaryrefslogtreecommitdiff
path: root/src/cpu/testers
diff options
context:
space:
mode:
authorXiangyu Dong <rioshering@gmail.com>2014-01-29 22:35:04 -0600
committerXiangyu Dong <rioshering@gmail.com>2014-01-29 22:35:04 -0600
commit32cc2ea8b9173863adeaa03f4d7ee1635acfdef7 (patch)
tree9d75f29f796c8c6bbe0e1e2f9b5b4231b6606d3f /src/cpu/testers
parentb77ca57f8c16af5fc694ba376fc117e07bbba6cd (diff)
downloadgem5-32cc2ea8b9173863adeaa03f4d7ee1635acfdef7.tar.xz
cpu: fix bug when TrafficGen deschedules event
Committed by: Nilay Vaish <nilay@cs.wisc.edu>
Diffstat (limited to 'src/cpu/testers')
-rw-r--r--src/cpu/testers/traffic_gen/traffic_gen.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cpu/testers/traffic_gen/traffic_gen.cc b/src/cpu/testers/traffic_gen/traffic_gen.cc
index 0f006e67e..b7f1ecd4e 100644
--- a/src/cpu/testers/traffic_gen/traffic_gen.cc
+++ b/src/cpu/testers/traffic_gen/traffic_gen.cc
@@ -119,6 +119,11 @@ TrafficGen::initState()
unsigned int
TrafficGen::drain(DrainManager *dm)
{
+ if (!updateEvent.scheduled()) {
+ // no event has been scheduled yet (e.g. switched from atomic mode)
+ return 0;
+ }
+
if (retryPkt == NULL) {
// shut things down
nextPacketTick = MaxTick;