gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GarnetSyntheticTraffic.hh
Go to the documentation of this file.
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;
9  * redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution;
12  * neither the name of the copyright holders nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef __CPU_GARNET_SYNTHETIC_TRAFFIC_HH__
30 #define __CPU_GARNET_SYNTHETIC_TRAFFIC_HH__
31 
32 #include <set>
33 
34 #include "base/statistics.hh"
35 #include "mem/port.hh"
36 #include "params/GarnetSyntheticTraffic.hh"
37 #include "sim/clocked_object.hh"
38 #include "sim/eventq.hh"
39 #include "sim/sim_exit.hh"
40 #include "sim/sim_object.hh"
41 #include "sim/stats.hh"
42 
43 namespace gem5
44 {
45 
49  NEIGHBOR_ = 3,
50  SHUFFLE_ = 4,
51  TORNADO_ = 5,
55 
56 class Packet;
58 {
59  public:
60  typedef GarnetSyntheticTrafficParams Params;
62 
63  void init() override;
64 
65  // main simulation loop (one cycle)
66  void tick();
67 
68  Port &getPort(const std::string &if_name,
69  PortID idx=InvalidPortID) override;
70 
75  void printAddr(Addr a);
76 
77  protected:
79 
80  class CpuPort : public RequestPort
81  {
83 
84  public:
85 
86  CpuPort(const std::string &_name, GarnetSyntheticTraffic *_tester)
87  : RequestPort(_name), tester(_tester)
88  { }
89 
90  protected:
91 
92  virtual bool recvTimingResp(PacketPtr pkt);
93 
94  virtual void recvReqRetry();
95  };
96 
98 
100  {
101  public:
104  : data(_data)
105  { }
106 
107  // Hold onto data pointer
108  uint8_t *data;
109  };
110 
112  unsigned size;
113  int id;
114 
115  std::map<std::string, TrafficType> trafficStringToEnum;
116 
117  unsigned blockSizeBits;
118 
120 
127 
128  std::string trafficType; // string
129  TrafficType traffic; // enum from string
130  double injRate;
131  int injVnet;
133 
135 
137 
138  void completeRequest(PacketPtr pkt);
139 
140  void generatePkt();
141  void sendPkt(PacketPtr pkt);
142  void initTrafficType();
143 
144  void doRetry();
145 
146  friend class MemCompleteEvent;
147 };
148 
149 } // namespace gem5
150 
151 #endif // __CPU_GARNET_SYNTHETIC_TRAFFIC_HH__
gem5::GarnetSyntheticTraffic::id
int id
Definition: GarnetSyntheticTraffic.hh:113
gem5::PortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:245
gem5::GarnetSyntheticTraffic::trafficStringToEnum
std::map< std::string, TrafficType > trafficStringToEnum
Definition: GarnetSyntheticTraffic.hh:115
gem5::GarnetSyntheticTraffic::noResponseCycles
Tick noResponseCycles
Definition: GarnetSyntheticTraffic.hh:119
gem5::GarnetSyntheticTraffic::doRetry
void doRetry()
Definition: GarnetSyntheticTraffic.cc:340
gem5::GarnetSyntheticTraffic::retryPkt
PacketPtr retryPkt
Definition: GarnetSyntheticTraffic.hh:111
gem5::NUM_TRAFFIC_PATTERNS_
@ NUM_TRAFFIC_PATTERNS_
Definition: GarnetSyntheticTraffic.hh:54
gem5::GarnetSyntheticTraffic::printAddr
void printAddr(Addr a)
Print state of address in memory system via PrintReq (for debugging).
Definition: GarnetSyntheticTraffic.cc:348
gem5::GarnetSyntheticTraffic::CpuPort
Definition: GarnetSyntheticTraffic.hh:80
gem5::GarnetSyntheticTraffic::GarnetSyntheticTrafficSenderState::data
uint8_t * data
Definition: GarnetSyntheticTraffic.hh:108
gem5::GarnetSyntheticTraffic::completeRequest
void completeRequest(PacketPtr pkt)
Definition: GarnetSyntheticTraffic.cc:128
gem5::GarnetSyntheticTraffic
Definition: GarnetSyntheticTraffic.hh:57
gem5::GarnetSyntheticTraffic::requestorId
RequestorID requestorId
Definition: GarnetSyntheticTraffic.hh:136
gem5::GarnetSyntheticTraffic::CpuPort::recvTimingResp
virtual bool recvTimingResp(PacketPtr pkt)
Receive a timing response from the peer.
Definition: GarnetSyntheticTraffic.cc:54
gem5::BIT_COMPLEMENT_
@ BIT_COMPLEMENT_
Definition: GarnetSyntheticTraffic.hh:46
gem5::ArmISA::a
Bitfield< 8 > a
Definition: misc_types.hh:66
gem5::GarnetSyntheticTraffic::singleDest
int singleDest
Definition: GarnetSyntheticTraffic.hh:126
gem5::InvalidPortID
const PortID InvalidPortID
Definition: types.hh:246
gem5::GarnetSyntheticTraffic::CpuPort::recvReqRetry
virtual void recvReqRetry()
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
Definition: GarnetSyntheticTraffic.cc:61
sim_exit.hh
gem5::GarnetSyntheticTraffic::responseLimit
const Cycles responseLimit
Definition: GarnetSyntheticTraffic.hh:134
gem5::GarnetSyntheticTraffic::traffic
TrafficType traffic
Definition: GarnetSyntheticTraffic.hh:129
gem5::SHUFFLE_
@ SHUFFLE_
Definition: GarnetSyntheticTraffic.hh:50
gem5::GarnetSyntheticTraffic::generatePkt
void generatePkt()
Definition: GarnetSyntheticTraffic.cc:184
gem5::RequestPort
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
Definition: port.hh:118
gem5::Cycles
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:78
stats.hh
gem5::GarnetSyntheticTraffic::numDestinations
int numDestinations
Definition: GarnetSyntheticTraffic.hh:121
gem5::GarnetSyntheticTraffic::GarnetSyntheticTrafficSenderState::GarnetSyntheticTrafficSenderState
GarnetSyntheticTrafficSenderState(uint8_t *_data)
Constructor.
Definition: GarnetSyntheticTraffic.hh:103
gem5::GarnetSyntheticTraffic::sendPkt
void sendPkt(PacketPtr pkt)
Definition: GarnetSyntheticTraffic.cc:67
gem5::GarnetSyntheticTraffic::precision
int precision
Definition: GarnetSyntheticTraffic.hh:132
gem5::VegaISA::p
Bitfield< 54 > p
Definition: pagetable.hh:70
gem5::GarnetSyntheticTraffic::cachePort
CpuPort cachePort
Definition: GarnetSyntheticTraffic.hh:97
sim_object.hh
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:294
gem5::probing::Packet
ProbePointArg< PacketInfo > Packet
Packet probe point.
Definition: mem.hh:108
statistics.hh
gem5::Tick
uint64_t Tick
Tick count type.
Definition: types.hh:58
gem5::GarnetSyntheticTraffic::init
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition: GarnetSyntheticTraffic.cc:121
port.hh
gem5::GarnetSyntheticTraffic::Params
GarnetSyntheticTrafficParams Params
Definition: GarnetSyntheticTraffic.hh:60
gem5::TORNADO_
@ TORNADO_
Definition: GarnetSyntheticTraffic.hh:51
gem5::UNIFORM_RANDOM_
@ UNIFORM_RANDOM_
Definition: GarnetSyntheticTraffic.hh:53
gem5::Packet::SenderState
A virtual base opaque structure used to hold state associated with the packet (e.g....
Definition: packet.hh:468
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::GarnetSyntheticTraffic::CpuPort::tester
GarnetSyntheticTraffic * tester
Definition: GarnetSyntheticTraffic.hh:82
gem5::GarnetSyntheticTraffic::numPacketsSent
int numPacketsSent
Definition: GarnetSyntheticTraffic.hh:124
gem5::ClockedObject
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Definition: clocked_object.hh:234
gem5::GarnetSyntheticTraffic::tick
void tick()
Definition: GarnetSyntheticTraffic.cc:142
gem5::GarnetSyntheticTraffic::getPort
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Definition: GarnetSyntheticTraffic.cc:112
gem5::GarnetSyntheticTraffic::injRate
double injRate
Definition: GarnetSyntheticTraffic.hh:130
gem5::EventFunctionWrapper
Definition: eventq.hh:1136
gem5::GarnetSyntheticTraffic::MemCompleteEvent
friend class MemCompleteEvent
Definition: GarnetSyntheticTraffic.hh:146
gem5::GarnetSyntheticTraffic::tickEvent
EventFunctionWrapper tickEvent
Definition: GarnetSyntheticTraffic.hh:78
gem5::GarnetSyntheticTraffic::size
unsigned size
Definition: GarnetSyntheticTraffic.hh:112
gem5::Port
Ports are used to interface objects to each other.
Definition: port.hh:61
gem5::TrafficType
TrafficType
Definition: GarnetSyntheticTraffic.hh:46
gem5::GarnetSyntheticTraffic::trafficType
std::string trafficType
Definition: GarnetSyntheticTraffic.hh:128
clocked_object.hh
gem5::GarnetSyntheticTraffic::GarnetSyntheticTraffic
GarnetSyntheticTraffic(const Params &p)
Definition: GarnetSyntheticTraffic.cc:75
gem5::GarnetSyntheticTraffic::numPacketsMax
int numPacketsMax
Definition: GarnetSyntheticTraffic.hh:123
gem5::GarnetSyntheticTraffic::injVnet
int injVnet
Definition: GarnetSyntheticTraffic.hh:131
gem5::BIT_ROTATION_
@ BIT_ROTATION_
Definition: GarnetSyntheticTraffic.hh:48
gem5::GarnetSyntheticTraffic::singleSender
int singleSender
Definition: GarnetSyntheticTraffic.hh:125
gem5::TRANSPOSE_
@ TRANSPOSE_
Definition: GarnetSyntheticTraffic.hh:52
gem5::BIT_REVERSE_
@ BIT_REVERSE_
Definition: GarnetSyntheticTraffic.hh:47
gem5::NEIGHBOR_
@ NEIGHBOR_
Definition: GarnetSyntheticTraffic.hh:49
gem5::RequestorID
uint16_t RequestorID
Definition: request.hh:95
gem5::GarnetSyntheticTraffic::GarnetSyntheticTrafficSenderState
Definition: GarnetSyntheticTraffic.hh:99
gem5::GarnetSyntheticTraffic::CpuPort::CpuPort
CpuPort(const std::string &_name, GarnetSyntheticTraffic *_tester)
Definition: GarnetSyntheticTraffic.hh:86
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::GarnetSyntheticTraffic::simCycles
Tick simCycles
Definition: GarnetSyntheticTraffic.hh:122
gem5::GarnetSyntheticTraffic::blockSizeBits
unsigned blockSizeBits
Definition: GarnetSyntheticTraffic.hh:117
gem5::Named::_name
const std::string _name
Definition: named.hh:41
gem5::GarnetSyntheticTraffic::initTrafficType
void initTrafficType()
Definition: GarnetSyntheticTraffic.cc:327
eventq.hh

Generated on Sun Jul 30 2023 01:56:53 for gem5 by doxygen 1.8.17