1/*
2 * Copyright (c) 2016 Georgia Institute of Technology
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

35#include <set>
36#include <string>
37#include <vector>
38
39#include "base/logging.hh"
40#include "base/random.hh"
41#include "base/statistics.hh"
42#include "debug/GarnetSyntheticTraffic.hh"
43#include "mem/mem_object.hh"
43#include "mem/packet.hh"
44#include "mem/port.hh"
45#include "mem/request.hh"
46#include "sim/sim_events.hh"
47#include "sim/stats.hh"
48#include "sim/system.hh"
49
50using namespace std;

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

69{
70 if (!cachePort.sendTimingReq(pkt)) {
71 retryPkt = pkt; // RubyPort will retry sending
72 }
73 numPacketsSent++;
74}
75
76GarnetSyntheticTraffic::GarnetSyntheticTraffic(const Params *p)
78 : MemObject(p),
77 : ClockedObject(p),
78 tickEvent([this]{ tick(); }, "GarnetSyntheticTraffic tick",
79 false, Event::CPU_Tick_Pri),
80 cachePort("GarnetSyntheticTraffic", this),
81 retryPkt(NULL),
82 size(p->memory_size),
83 blockSizeBits(p->block_offset),
84 numDestinations(p->num_dest),
85 simCycles(p->sim_cycles),

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

110}
111
112Port &
113GarnetSyntheticTraffic::getPort(const std::string &if_name, PortID idx)
114{
115 if (if_name == "test")
116 return cachePort;
117 else
119 return MemObject::getPort(if_name, idx);
118 return ClockedObject::getPort(if_name, idx);
119}
120
121void
122GarnetSyntheticTraffic::init()
123{
124 numPacketsSent = 0;
125}
126

--- 231 unchanged lines hidden ---