gem5  v19.0.0.0
exported_clock_rate_control.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2019 Google, Inc.
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  * Authors: Gabe Black
28  */
29 
30 #ifndef __ARCH_ARM_FASTMODEL_PROTOCOL_EXPORTED_CLOCK_RATE_CONTROL_HH__
31 #define __ARCH_ARM_FASTMODEL_PROTOCOL_EXPORTED_CLOCK_RATE_CONTROL_HH__
32 
33 #include <string>
34 #include <systemc>
35 #include <tlm>
36 
37 // This protocol is an exportable version of the clock rate protocol native to
38 // fast models. It's identical to the original, except it has some extra info
39 // which lets it be exported into systemc.
40 
42 
44 {
45  public:
46  virtual ~ClockRateControlFwIf() {}
47  virtual void set_mul_div(uint64_t mul, uint64_t div) = 0;
48 };
49 
51 {
52  public:
53  virtual ~ClockRateControlBwIf() {}
54 };
55 
57 {
58  public:
59  ClockRateControlSlaveBase(const std::string &name) {}
60 };
61 
63  public tlm::tlm_base_initiator_socket<64, ClockRateControlFwIf,
64  ClockRateControlBwIf>
65 {
66  private:
68 
69  public:
72 
73  using Base::bind;
74  using Base::operator();
75 
77  {
78  get_base_export().bind(dummyBwIf);
79  }
80  ClockRateControlInitiatorSocket(const char *name) : Base(name)
81  {
82  get_base_export().bind(dummyBwIf);
83  }
84 
85  const char *
86  kind() const override
87  {
88  return "ClockRateControlInitiatorSocket";
89  }
90 
91  std::type_index
92  get_protocol_types() const override
93  {
94  return typeid(ClockRateControlDummyProtocolType);
95  }
96 };
97 
99  public tlm::tlm_base_target_socket<64, ClockRateControlFwIf,
100  ClockRateControlBwIf>
101 {
102  public:
105 
106  using Base::bind;
107  using Base::operator();
108 
109  using Base::Base;
110 
111  const char *
112  kind() const override
113  {
114  return "ClockRateControlInitiatorSocket";
115  }
116 
117  std::type_index
118  get_protocol_types() const override
119  {
120  return typeid(ClockRateControlDummyProtocolType);
121  }
122 };
123 
124 #endif // __ARCH_ARM_FASTMODEL_PROTOCOL_EXPORTED_CLOCK_RATE_CONTROL_HH__
const std::string & name()
Definition: trace.cc:54
tlm::tlm_base_target_socket< 64, ClockRateControlFwIf, ClockRateControlBwIf > Base
std::type_index get_protocol_types() const override
std::type_index get_protocol_types() const override
const char * kind() const override
ClockRateControlSlaveBase(const std::string &name)
tlm::tlm_base_initiator_socket< 64, ClockRateControlFwIf, ClockRateControlBwIf > Base

Generated on Fri Feb 28 2020 16:26:57 for gem5 by doxygen 1.8.13