gem5  v22.1.0.0
sc_ext.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, University of Kaiserslautern
3  * Copyright (c) 2016, Dresden University of Technology (TU Dresden)
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  *
10  * 1. Redistributions of source code must retain the above copyright notice,
11  * this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in the
15  * documentation and/or other materials provided with the distribution.
16  *
17  * 3. Neither the name of the copyright holder nor the names of its
18  * contributors may be used to endorse or promote products derived from
19  * this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
25  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #ifndef __SYSTEMC_TLM_BRIDGE_SC_EXT_HH__
35 #define __SYSTEMC_TLM_BRIDGE_SC_EXT_HH__
36 
37 #include <cstdint>
38 #include <memory>
39 
40 #include "base/amo.hh"
41 #include "mem/packet.hh"
43 
44 namespace Gem5SystemC
45 {
46 
48 {
51 };
52 
53 class Gem5Extension: public tlm::tlm_extension<Gem5Extension>
54 {
55  public:
57 
58  tlm_extension_base *clone() const override;
59  void copy_from(const tlm_extension_base &ext) override;
60 
62  const tlm::tlm_generic_payload *payload);
64  const tlm::tlm_generic_payload &payload);
66 
67  private:
69 };
70 
71 class AtomicExtension: public tlm::tlm_extension<AtomicExtension>
72 {
73  public:
75  std::shared_ptr<gem5::AtomicOpFunctor> o, bool r);
76 
77  tlm_extension_base *clone() const override;
78  void copy_from(const tlm_extension_base &ext) override;
79 
81  const tlm::tlm_generic_payload *payload);
83  const tlm::tlm_generic_payload &payload);
84 
85  bool isReturnRequired() const;
87 
88  private:
89  std::shared_ptr<gem5::AtomicOpFunctor> op;
91 };
92 
93 class ControlExtension : public tlm::tlm_extension<ControlExtension>
94 {
95  public:
97 
98  tlm_extension_base *clone() const override;
99  void copy_from(const tlm_extension_base &ext) override;
100 
102  const tlm::tlm_generic_payload *payload);
104  const tlm::tlm_generic_payload &payload);
105 
106  /* Secure and privileged access */
107  bool isPrivileged() const;
108  void setPrivileged(bool p);
109  bool isSecure() const;
110  void setSecure(bool s);
111  bool isInstruction() const;
112  void setInstruction(bool i);
113 
114  /* Quality of Service (AXI4) */
115  uint8_t getQos() const;
116  void setQos(uint8_t q);
117 
118  private:
119  /* Secure and privileged access */
121  bool secure;
123 
124  /* Quality of Service (AXI4) */
125  uint8_t qos;
126 };
127 
128 } // namespace Gem5SystemC
129 
130 #endif // __SYSTEMC_TLM_BRIDGE_SC_EXT_HH__
tlm_extension_base * clone() const override
Definition: sc_ext.cc:144
void copy_from(const tlm_extension_base &ext) override
Definition: sc_ext.cc:150
static AtomicExtension & getExtension(const tlm::tlm_generic_payload *payload)
Definition: sc_ext.cc:163
AtomicExtension(std::shared_ptr< gem5::AtomicOpFunctor > o, bool r)
Definition: sc_ext.cc:137
std::shared_ptr< gem5::AtomicOpFunctor > op
Definition: sc_ext.hh:89
bool isReturnRequired() const
Definition: sc_ext.cc:172
gem5::AtomicOpFunctor * getAtomicOpFunctor() const
Definition: sc_ext.cc:178
static ControlExtension & getExtension(const tlm::tlm_generic_payload *payload)
Definition: sc_ext.cc:210
tlm_extension_base * clone() const override
Definition: sc_ext.cc:191
void setPrivileged(bool p)
Definition: sc_ext.cc:225
bool isInstruction() const
Definition: sc_ext.cc:243
void setQos(uint8_t q)
Definition: sc_ext.cc:261
void setInstruction(bool i)
Definition: sc_ext.cc:249
uint8_t getQos() const
Definition: sc_ext.cc:255
void copy_from(const tlm_extension_base &ext) override
Definition: sc_ext.cc:197
static Gem5Extension & getExtension(const tlm::tlm_generic_payload *payload)
Definition: sc_ext.cc:104
Gem5Extension(gem5::PacketPtr p)
Definition: sc_ext.cc:99
tlm_extension_base * clone() const override
Definition: sc_ext.cc:125
gem5::PacketPtr getPacket()
Definition: sc_ext.cc:119
gem5::PacketPtr packet
Definition: sc_ext.hh:68
void copy_from(const tlm_extension_base &ext) override
Definition: sc_ext.cc:131
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:294
Bitfield< 27 > q
Definition: misc_types.hh:55
Bitfield< 7 > i
Definition: misc_types.hh:67
Bitfield< 12 > ext
Definition: misc_types.hh:434
constexpr RegId o(int index)
Definition: int.hh:147
Bitfield< 5 > r
Definition: pagetable.hh:60
Bitfield< 1 > s
Definition: pagetable.hh:64
Bitfield< 54 > p
Definition: pagetable.hh:70
Declaration of the Packet class.
tlm::tlm_generic_payload & trans
Definition: sc_ext.hh:49
TlmSenderState(tlm::tlm_generic_payload &trans)
Definition: sc_ext.hh:50
A virtual base opaque structure used to hold state associated with the packet (e.g....
Definition: packet.hh:468

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