Deleted Added
sdiff udiff text old ( 9402:f6e3c60f04e5 ) new ( 9403:af9066bc088c )
full compact
1/*
2 * Copyright (c) 2012 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

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

348TrafficGen::StateGraph::BaseGen::BaseGen(QueuedMasterPort& _port,
349 MasterID master_id,
350 Tick _duration)
351 : port(_port), masterID(master_id), duration(_duration)
352{
353}
354
355void
356TrafficGen::StateGraph::BaseGen::send(Addr addr, unsigned size,
357 const MemCmd& cmd)
358{
359 // Create new request
360 Request::Flags flags;
361 Request *req = new Request(addr, size, flags, masterID);
362
363 // Embed it in a packet
364 PacketPtr pkt = new Packet(req, cmd);
365
366 uint8_t* pkt_data = new uint8_t[req->getSize()];
367 pkt->dataDynamicArray(pkt_data);
368
369 if (cmd.isWrite()) {
370 memset(pkt_data, 0xA, req->getSize());
371 }
372
373 port.schedTimingReq(pkt, curTick());
374}
375
376void
377TrafficGen::StateGraph::LinearGen::enter()
378{
379 // reset the address and the data counter
380 nextAddr = startAddr;
381 dataManipulated = 0;
382
383 // this test only needs to happen once, but cannot be performed
384 // before init() is called and the ports are connected

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

396 (readPercent == 100 || random_mt.random<uint8_t>(0, 100) < readPercent);
397
398 assert((readPercent == 0 && !isRead) || (readPercent == 100 && isRead) ||
399 readPercent != 100);
400
401 DPRINTF(TrafficGen, "LinearGen::execute: %c to addr %x, size %d\n",
402 isRead ? 'r' : 'w', nextAddr, blocksize);
403
404 send(nextAddr, blocksize, isRead ? MemCmd::ReadReq : MemCmd::WriteReq);
405
406 // increment the address
407 nextAddr += blocksize;
408
409 // Add the amount of data manipulated to the total
410 dataManipulated += blocksize;
411}
412
413Tick

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

461 Addr addr = random_mt.random<Addr>(startAddr, endAddr - 1);
462
463 // round down to start address of block
464 addr -= addr % blocksize;
465
466 DPRINTF(TrafficGen, "RandomGen::execute: %c to addr %x, size %d\n",
467 isRead ? 'r' : 'w', addr, blocksize);
468
469 // send a new request packet
470 send(addr, blocksize, isRead ? MemCmd::ReadReq : MemCmd::WriteReq);
471
472 // Add the amount of data manipulated to the total
473 dataManipulated += blocksize;
474}
475
476Tick
477TrafficGen::StateGraph::RandomGen::nextExecuteTick()
478{
479 // Check to see if we have reached the data limit. If dataLimit is

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

585 assert(currElement.isValid());
586
587 DPRINTF(TrafficGen, "TraceGen::execute: %c %d %d %d\n",
588 currElement.cmd.isRead() ? 'r' : 'w',
589 currElement.addr,
590 currElement.blocksize,
591 currElement.tick);
592
593 send(currElement.addr + addrOffset, currElement.blocksize,
594 currElement.cmd);
595}
596
597void
598TrafficGen::StateGraph::TraceGen::exit() {
599 // Check if we reached the end of the trace file. If we did not
600 // then we want to generate a warning stating that not the entire
601 // trace was played.
602 if (!traceComplete) {

--- 17 unchanged lines hidden ---