gem5  v22.1.0.0
outgoing_request_bridge.hh
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 
27 #ifndef __SST_OUTGOING_REQUEST_BRIDGE_HH__
28 #define __SST_OUTGOING_REQUEST_BRIDGE_HH__
29 
30 #include <utility>
31 #include <vector>
32 
33 #include "mem/port.hh"
34 #include "params/OutgoingRequestBridge.hh"
35 #include "sim/sim_object.hh"
37 
51 namespace gem5
52 {
53 
55 {
56  public:
58  {
59  private:
61  public:
62  OutgoingRequestPort(const std::string &name_,
63  OutgoingRequestBridge* owner_);
66  void recvFunctional(PacketPtr pkt);
67  bool recvTimingReq(PacketPtr pkt);
68  void recvRespRetry();
70  };
71 
72  public:
73  // a gem5 ResponsePort
75  // pointer to the corresponding SST responder
77  // this vector holds the initialization data sent by gem5
79 
81 
82  public:
83  OutgoingRequestBridge(const OutgoingRequestBridgeParams &params);
85 
86  // Required to let the OutgoingRequestPort to send range change request.
87  void init();
88 
89  // Returns the range of addresses that the ports will handle.
90  // Currently, it will return the range of [0x80000000, inf), which is
91  // specific to RISCV (SiFive's HiFive boards).
93 
94  // Required to return a port during gem5 instantiate phase.
95  Port & getPort(const std::string &if_name, PortID idx);
96 
97  // Returns the buffered data for initialization. This is necessary as
98  // when gem5 sends functional requests to memory for initialization,
99  // the connection in SST Memory Hierarchy has not been constructed yet.
101 
102  // gem5 Component (from SST) will call this function to let set the
103  // bridge's corresponding SSTResponderSubComponent (which implemented
104  // SSTResponderInterface). I.e., this will connect this bridge to the
105  // corresponding port in SST.
106  void setResponder(SSTResponderInterface* responder);
107 
108  // This function is called when SST wants to sent a timing response to gem5
109  bool sendTimingResp(PacketPtr pkt);
110 
111  // This function is called when SST sends response having an invalidate .
112  void sendTimingSnoopReq(PacketPtr pkt);
113 
114  // This function is called when gem5 wants to send a non-timing request
115  // to SST. Should only be called during the SST construction phase, i.e.
116  // not at the simulation time.
118 };
119 
120 }; // namespace gem5
121 
122 #endif //__SST_OUTGOING_REQUEST_BRIDGE_HH__
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:294
Ports are used to interface objects to each other.
Definition: port.hh:62
A ResponsePort is a specialization of a port.
Definition: port.hh:270
Abstract superclass for simulation objects.
Definition: sim_object.hh:148
STL vector class.
Definition: stl.hh:37
const Params & params() const
Definition: sim_object.hh:176
Port Object Declaration.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
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

Generated on Wed Dec 21 2022 10:22:40 for gem5 by doxygen 1.9.1