cpu: Check that minimum TrafficGen period is less than max period
authorSascha Bischoff <sascha.bischoff@arm.com>
Thu, 30 May 2013 16:54:08 +0000 (12:54 -0400)
committerSascha Bischoff <sascha.bischoff@arm.com>
Thu, 30 May 2013 16:54:08 +0000 (12:54 -0400)
Add a check which ensures that the minumum period for the LINEAR and
RANDOM traffic generator states is less than or equal to the maximum
period. If the minimum period is greater than the maximum period a
fatal is triggered.

src/cpu/testers/traffic_gen/traffic_gen.cc

index cb2e6e7bb0d47d41a86e058ebb4e3d13a0e937dd..ed3518bb41b895a79569124ae127dc759fb24b28 100644 (file)
@@ -277,6 +277,9 @@ TrafficGen::parseConfig()
                     if (read_percent > 100)
                         fatal("%s cannot have more than 100% reads", name());
 
+                    if (min_period > max_period)
+                        fatal("%s cannot have min_period > max_period", name());
+
                     if (mode == "LINEAR") {
                         states[id] = new LinearGen(name(), masterID,
                                                    duration, start_addr,