From: Xiangyu Dong Date: Thu, 30 Jan 2014 04:35:04 +0000 (-0600) Subject: cpu: fix bug when TrafficGen deschedules event X-Git-Tag: stable_2014_08_26~180 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=32cc2ea8b9173863adeaa03f4d7ee1635acfdef7;p=gem5.git cpu: fix bug when TrafficGen deschedules event Committed by: Nilay Vaish --- 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;