gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
35namespace 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
51
53OutgoingRequestPort::OutgoingRequestPort(const std::string &name_,
54 OutgoingRequestBridge* owner_) :
55 ResponsePort(name_)
56{
57 owner = owner_;
58}
59
64
65void
71
72Port &
73OutgoingRequestBridge::getPort(const std::string &if_name, PortID idx)
74{
75 return outgoingPort;
76}
77
83
89
90void
95
96bool
101
102void
107
108void
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
117Tick
120{
121 assert(false && "OutgoingRequestPort::recvAtomic not implemented");
122 return Tick();
123}
124
125void
128{
129 owner->handleRecvFunctional(pkt);
130}
131
132bool
135{
136 owner->sstResponder->handleRecvTimingReq(pkt);
137 return true;
138}
139
140void
143{
144 owner->sstResponder->handleRecvRespRetry();
145}
146
150{
151 return owner->physicalAddressRanges;
152}
153
154}; // namespace gem5
const char data[]
void recvFunctional(PacketPtr pkt)
Receive a functional request packet from the peer.
void recvRespRetry()
Called by the peer if sendTimingResp was called on this protocol (causing recvTimingResp to be called...
bool recvTimingReq(PacketPtr pkt)
Receive a timing request from the peer.
OutgoingRequestPort(const std::string &name_, OutgoingRequestBridge *owner_)
AddrRangeList getAddrRanges() const
Get a list of the non-overlapping address ranges the owner is responsible for.
Tick recvAtomic(PacketPtr pkt)
Receive an atomic request packet from the peer.
Port & getPort(const std::string &if_name, PortID idx)
Get a port with a given name and index.
void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
SSTResponderInterface * sstResponder
OutgoingRequestBridge(const OutgoingRequestBridgeParams &params)
std::vector< std::pair< Addr, std::vector< uint8_t > > > initData
std::vector< std::pair< Addr, std::vector< uint8_t > > > getInitData() const
void setResponder(SSTResponderInterface *responder)
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition packet.hh:295
Addr getAddr() const
Definition packet.hh:807
T * getPtr()
get a pointer to the data ptr.
Definition packet.hh:1225
unsigned getSize() const
Definition packet.hh:817
Ports are used to interface objects to each other.
Definition port.hh:62
bool isConnected() const
Is this port currently connected to a peer?
Definition port.hh:133
A ResponsePort is a specialization of a port.
Definition port.hh:349
bool sendTimingResp(PacketPtr pkt)
Attempt to send a timing response to the request port by calling its corresponding receive function.
Definition port.hh:454
void sendTimingSnoopReq(PacketPtr pkt)
Attempt to send a timing snoop request packet to the request port by calling its corresponding receiv...
Definition port.hh:475
void sendRangeChange() const
Called by the owner to send a range change.
Definition port.hh:380
Abstract superclass for simulation objects.
STL vector class.
Definition stl.hh:37
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition types.hh:245
uint64_t Tick
Tick count type.
Definition types.hh:58
Overload hash function for BasicBlockRange type.
Definition binary32.hh:81
const std::string & name()
Definition trace.cc:48

Generated on Tue Jun 18 2024 16:24:06 for gem5 by doxygen 1.11.0