Deleted Added
sdiff udiff text old ( 10128:013bba88efab ) new ( 10138:0e40c53fe85c )
full compact
1/*
2 * Copyright (c) 2012-2013 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 27 unchanged lines hidden (view full) ---

36 *
37 * Authors: Thomas Grass
38 * Andreas Hansson
39 * Sascha Bischoff
40 */
41
42#include <sstream>
43
44#include "base/random.hh"
45#include "cpu/testers/traffic_gen/traffic_gen.hh"
46#include "debug/Checkpoint.hh"
47#include "debug/TrafficGen.hh"
48#include "sim/stats.hh"
49#include "sim/system.hh"
50
51using namespace std;

--- 200 unchanged lines hidden (view full) ---

252 is >> traceFile >> addrOffset;
253
254 states[id] = new TraceGen(name(), masterID, duration,
255 traceFile, addrOffset);
256 DPRINTF(TrafficGen, "State: %d TraceGen\n", id);
257 } else if (mode == "IDLE") {
258 states[id] = new IdleGen(name(), masterID, duration);
259 DPRINTF(TrafficGen, "State: %d IdleGen\n", id);
260 } else if (mode == "LINEAR" || mode == "RANDOM") {
261 uint32_t read_percent;
262 Addr start_addr;
263 Addr end_addr;
264 Addr blocksize;
265 Tick min_period;
266 Tick max_period;
267 Addr data_limit;
268
269 is >> read_percent >> start_addr >> end_addr >>
270 blocksize >> min_period >> max_period >> data_limit;
271
272 DPRINTF(TrafficGen, "%s, addr %x to %x, size %d,"
273 " period %d to %d, %d%% reads\n",
274 mode, start_addr, end_addr, blocksize, min_period,
275 max_period, read_percent);
276
277
278 if (blocksize > system->cacheLineSize())
279 fatal("TrafficGen %s block size (%d) is larger than "
280 "system block size (%d)\n", name(),
281 blocksize, system->cacheLineSize());
282
283 if (read_percent > 100)
284 fatal("%s cannot have more than 100% reads", name());
285
286 if (min_period > max_period)
287 fatal("%s cannot have min_period > max_period", name());
288

--- 6 unchanged lines hidden (view full) ---

295 DPRINTF(TrafficGen, "State: %d LinearGen\n", id);
296 } else if (mode == "RANDOM") {
297 states[id] = new RandomGen(name(), masterID,
298 duration, start_addr,
299 end_addr, blocksize,
300 min_period, max_period,
301 read_percent, data_limit);
302 DPRINTF(TrafficGen, "State: %d RandomGen\n", id);
303 }
304 } else {
305 fatal("%s: Unknown traffic generator mode: %s",
306 name(), mode);
307 }
308 } else if (keyword == "TRANSITION") {
309 Transition transition;
310

--- 144 unchanged lines hidden ---