gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
outgoing_request_bridge.cc
Go to the documentation of this file.
1 // Copyright (c) 2021 The Regents of the University of California
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
6 // met: redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer;
8 // redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution;
11 // neither the name of the copyright holders nor the names of its
12 // contributors may be used to endorse or promote products derived from
13 // this software without specific prior written permission.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 
28 
29 #include <cassert>
30 #include <iomanip>
31 #include <sstream>
32 
33 #include "base/trace.hh"
34 
35 namespace gem5
36 {
37 
39  const OutgoingRequestBridgeParams &params) :
40  SimObject(params),
41  outgoingPort(std::string(name()), this),
42  sstResponder(nullptr),
43  physicalAddressRanges(params.physical_address_ranges.begin(),
44  params.physical_address_ranges.end())
45 {
46 }
47 
49 {
50 }
51 
54  OutgoingRequestBridge* owner_) :
55  ResponsePort(name_)
56 {
57  owner = owner_;
58 }
59 
62 {
63 }
64 
65 void
67 {
70 }
71 
72 Port &
73 OutgoingRequestBridge::getPort(const std::string &if_name, PortID idx)
74 {
75  return outgoingPort;
76 }
77 
80 {
81  return outgoingPort.getAddrRanges();
82 }
83 
86 {
87  return initData;
88 }
89 
90 void
92 {
93  sstResponder = responder;
94 }
95 
96 bool
98 {
99  return outgoingPort.sendTimingResp(pkt);
100 }
101 
102 void
104 {
106 }
107 
108 void
110 {
111  uint8_t* ptr = pkt->getPtr<uint8_t>();
112  uint64_t size = pkt->getSize();
113  std::vector<uint8_t> data(ptr, ptr+size);
114  initData.push_back(std::make_pair(pkt->getAddr(), data));
115 }
116 
117 Tick
120 {
121  assert(false && "OutgoingRequestPort::recvAtomic not implemented");
122  return Tick();
123 }
124 
125 void
128 {
129  owner->handleRecvFunctional(pkt);
130 }
131 
132 bool
135 {
136  owner->sstResponder->handleRecvTimingReq(pkt);
137  return true;
138 }
139 
140 void
143 {
144  owner->sstResponder->handleRecvRespRetry();
145 }
146 
150 {
151  return owner->physicalAddressRanges;
152 }
153 
154 }; // namespace gem5
gem5::PortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:245
gem5::OutgoingRequestBridge::OutgoingRequestPort::~OutgoingRequestPort
~OutgoingRequestPort()
Definition: outgoing_request_bridge.cc:61
data
const char data[]
Definition: circlebuf.test.cc:48
gem5::OutgoingRequestBridge::~OutgoingRequestBridge
~OutgoingRequestBridge()
Definition: outgoing_request_bridge.cc:48
gem5::OutgoingRequestBridge::OutgoingRequestPort::OutgoingRequestPort
OutgoingRequestPort(const std::string &name_, OutgoingRequestBridge *owner_)
Definition: outgoing_request_bridge.cc:53
gem5::OutgoingRequestBridge::sendTimingSnoopReq
void sendTimingSnoopReq(PacketPtr pkt)
Definition: outgoing_request_bridge.cc:103
gem5::OutgoingRequestBridge::getInitData
std::vector< std::pair< Addr, std::vector< uint8_t > > > getInitData() const
Definition: outgoing_request_bridge.cc:85
std::vector
STL vector class.
Definition: stl.hh:37
gem5::OutgoingRequestBridge::OutgoingRequestPort::recvAtomic
Tick recvAtomic(PacketPtr pkt)
Receive an atomic request packet from the peer.
Definition: outgoing_request_bridge.cc:119
gem5::OutgoingRequestBridge::sendTimingResp
bool sendTimingResp(PacketPtr pkt)
Definition: outgoing_request_bridge.cc:97
gem5::OutgoingRequestBridge::getAddrRanges
AddrRangeList getAddrRanges() const
Definition: outgoing_request_bridge.cc:79
gem5::OutgoingRequestBridge::initData
std::vector< std::pair< Addr, std::vector< uint8_t > > > initData
Definition: outgoing_request_bridge.hh:78
gem5::OutgoingRequestBridge::OutgoingRequestPort::getAddrRanges
AddrRangeList getAddrRanges() const
Get a list of the non-overlapping address ranges the owner is responsible for.
Definition: outgoing_request_bridge.cc:149
gem5::SSTResponderInterface
Definition: sst_responder_interface.hh:45
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:294
gem5::OutgoingRequestBridge::OutgoingRequestPort::owner
OutgoingRequestBridge * owner
Definition: outgoing_request_bridge.hh:60
gem5::Tick
uint64_t Tick
Tick count type.
Definition: types.hh:58
outgoing_request_bridge.hh
gem5::ResponsePort::sendTimingResp
bool sendTimingResp(PacketPtr pkt)
Attempt to send a timing response to the request port by calling its corresponding receive function.
Definition: port.hh:438
gem5::ResponsePort::sendTimingSnoopReq
void sendTimingSnoopReq(PacketPtr pkt)
Attempt to send a timing snoop request packet to the request port by calling its corresponding receiv...
Definition: port.hh:459
gem5::Port::isConnected
bool isConnected() const
Is this port currently connected to a peer?
Definition: port.hh:133
gem5::SimObject
Abstract superclass for simulation objects.
Definition: sim_object.hh:146
name
const std::string & name()
Definition: trace.cc:48
gem5::OutgoingRequestBridge
Definition: outgoing_request_bridge.hh:54
gem5::OutgoingRequestBridge::init
void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition: outgoing_request_bridge.cc:66
gem5::ResponsePort::sendRangeChange
void sendRangeChange() const
Called by the owner to send a range change.
Definition: port.hh:364
gem5::ResponsePort
A ResponsePort is a specialization of a port.
Definition: port.hh:331
gem5::Port
Ports are used to interface objects to each other.
Definition: port.hh:61
std
Overload hash function for BasicBlockRange type.
Definition: misc.hh:2909
gem5::OutgoingRequestBridge::outgoingPort
OutgoingRequestPort outgoingPort
Definition: outgoing_request_bridge.hh:74
gem5::OutgoingRequestBridge::handleRecvFunctional
void handleRecvFunctional(PacketPtr pkt)
Definition: outgoing_request_bridge.cc:109
gem5::OutgoingRequestBridge::OutgoingRequestBridge
OutgoingRequestBridge(const OutgoingRequestBridgeParams &params)
Definition: outgoing_request_bridge.cc:38
gem5::OutgoingRequestBridge::sstResponder
SSTResponderInterface * sstResponder
Definition: outgoing_request_bridge.hh:76
trace.hh
gem5::OutgoingRequestBridge::OutgoingRequestPort::recvTimingReq
bool recvTimingReq(PacketPtr pkt)
Receive a timing request from the peer.
Definition: outgoing_request_bridge.cc:134
std::list< AddrRange >
gem5::Packet::getAddr
Addr getAddr() const
Definition: packet.hh:807
gem5::OutgoingRequestBridge::getPort
Port & getPort(const std::string &if_name, PortID idx)
Get a port with a given name and index.
Definition: outgoing_request_bridge.cc:73
gem5::OutgoingRequestBridge::OutgoingRequestPort::recvFunctional
void recvFunctional(PacketPtr pkt)
Receive a functional request packet from the peer.
Definition: outgoing_request_bridge.cc:127
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::OutgoingRequestBridge::setResponder
void setResponder(SSTResponderInterface *responder)
Definition: outgoing_request_bridge.cc:91
gem5::OutgoingRequestBridge::OutgoingRequestPort::recvRespRetry
void recvRespRetry()
Called by the peer if sendTimingResp was called on this protocol (causing recvTimingResp to be called...
Definition: outgoing_request_bridge.cc:142
gem5::Packet::getSize
unsigned getSize() const
Definition: packet.hh:817
gem5::Packet::getPtr
T * getPtr()
get a pointer to the data ptr.
Definition: packet.hh:1225

Generated on Sun Jul 30 2023 01:57:00 for gem5 by doxygen 1.8.17