gem5  v22.0.0.2
port_terminator.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021 The Regents of the University of California.
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 __MEM_PORT_TERMINATOR_HH__
30 #define __MEM_PORT_TERMINATOR_HH__
31 
45 #include <vector>
46 
47 #include "mem/port.hh"
48 #include "params/PortTerminator.hh"
49 #include "sim/sim_object.hh"
50 
51 namespace gem5
52 {
53 
54 class PortTerminator : public SimObject
55 {
56  private:
66  class ReqPort : public RequestPort
67  {
68  public:
69  ReqPort(const std::string &name, PortTerminator *owner):
71  {}
72  protected:
73  bool recvTimingResp(PacketPtr pkt) override
74  {
75  panic("Received an unexpected response. RequestPorts on a "
76  "PortTerminator never issue any requests. Therefore, they should "
77  "never receive a response.\n");
78  }
79 
80  void recvReqRetry() override
81  {
82  return;
83  }
84 
85  void recvRangeChange() override
86  {
87  return;
88  }
89  };
90 
97  class RespPort : public ResponsePort
98  {
99  public:
100  RespPort(const std::string &name, PortTerminator *owner):
102  {}
103  };
104 
106 
108 
109  public:
110  PortTerminator(const PortTerminatorParams &params);
111 
112  Port &getPort(const std::string &if_name,
113  PortID idx = InvalidPortID) override;
114 };
115 
116 }
117 
118 #endif // __MEM_PORT_TERMINATOR_HH__
gem5::PortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:245
gem5::Port::name
const std::string name() const
Return port name (for DPRINTF).
Definition: port.hh:111
gem5::PortTerminator::PortTerminator
PortTerminator(const PortTerminatorParams &params)
Definition: port_terminator.cc:33
gem5::PortTerminator::reqPorts
std::vector< ReqPort > reqPorts
Definition: port_terminator.hh:105
std::vector
STL vector class.
Definition: stl.hh:37
gem5::InvalidPortID
const PortID InvalidPortID
Definition: types.hh:246
gem5::RequestPort
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
Definition: port.hh:77
gem5::SimObject::params
const Params & params() const
Definition: sim_object.hh:176
sim_object.hh
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:291
gem5::PortTerminator::getPort
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Definition: port_terminator.cc:46
gem5::PortTerminator::ReqPort
definition of the ReqPort class.
Definition: port_terminator.hh:66
port.hh
gem5::SimObject
Abstract superclass for simulation objects.
Definition: sim_object.hh:146
gem5::PortTerminator::respPorts
std::vector< RespPort > respPorts
Definition: port_terminator.hh:107
gem5::PortTerminator::ReqPort::recvRangeChange
void recvRangeChange() override
Called to receive an address range change from the peer response port.
Definition: port_terminator.hh:85
gem5::ResponsePort
A ResponsePort is a specialization of a port.
Definition: port.hh:268
gem5::ResponsePort::owner
SimObject & owner
Definition: port.hh:279
gem5::PortTerminator::RespPort
definition of the RespPort class.
Definition: port_terminator.hh:97
gem5::PortTerminator
Definition: port_terminator.hh:54
gem5::Port
Ports are used to interface objects to each other.
Definition: port.hh:61
gem5::PortTerminator::ReqPort::recvTimingResp
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the peer.
Definition: port_terminator.hh:73
gem5::PortTerminator::ReqPort::ReqPort
ReqPort(const std::string &name, PortTerminator *owner)
Definition: port_terminator.hh:69
gem5::RequestPort::owner
SimObject & owner
Definition: port.hh:86
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::PortTerminator::RespPort::RespPort
RespPort(const std::string &name, PortTerminator *owner)
Definition: port_terminator.hh:100
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:178
gem5::PortTerminator::ReqPort::recvReqRetry
void recvReqRetry() override
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
Definition: port_terminator.hh:80

Generated on Thu Jul 28 2022 13:32:35 for gem5 by doxygen 1.8.17