gem5  v20.1.0.0
signal_interrupt.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 
28 #ifndef __ARCH_ARM_FASTMODEL_PROTOCOL_SIGNAL_INTERRUPT_HH__
29 #define __ARCH_ARM_FASTMODEL_PROTOCOL_SIGNAL_INTERRUPT_HH__
30 
31 #include <string>
32 #include <systemc>
33 #include <tlm>
34 
36 
38 {
39  public:
40  virtual ~SignalInterruptFwIf() {}
41  virtual void ppi(uint8_t cpu, uint32_t num, bool state) = 0;
42  virtual void spi(uint32_t num, bool state) = 0;
43 };
44 
46 {
47  public:
48  virtual ~SignalInterruptBwIf() {}
49 };
50 
52 {
53  public:
54  SignalInterruptSlaveBase(const std::string &name) {}
55 };
56 
58  public tlm::tlm_base_initiator_socket<64, SignalInterruptFwIf,
59  SignalInterruptBwIf>
60 {
61  private:
63 
64  public:
67 
68  using Base::bind;
69  using Base::operator();
70 
72  {
73  get_base_export().bind(dummyBwIf);
74  }
76  {
77  get_base_export().bind(dummyBwIf);
78  }
79 
80  const char *
81  kind() const override
82  {
83  return "SignalInterruptInitiatorSocket";
84  }
85 
86  std::type_index
87  get_protocol_types() const override
88  {
89  return typeid(SignalInterruptDummyProtocolType);
90  }
91 };
92 
94  public tlm::tlm_base_target_socket<64, SignalInterruptFwIf,
95  SignalInterruptBwIf>
96 {
97  public:
100 
101  using Base::bind;
102  using Base::operator();
103 
104  using Base::Base;
105 
106  const char *
107  kind() const override
108  {
109  return "SignalInterruptInitiatorSocket";
110  }
111 
112  std::type_index
113  get_protocol_types() const override
114  {
115  return typeid(SignalInterruptDummyProtocolType);
116  }
117 };
118 
119 #endif // __ARCH_ARM_FASTMODEL_PROTOCOL_SIGNAL_INTERRUPT_HH__
SignalInterruptFwIf::ppi
virtual void ppi(uint8_t cpu, uint32_t num, bool state)=0
SignalInterruptBwIf
Definition: signal_interrupt.hh:45
SignalInterruptTargetSocket::get_protocol_types
std::type_index get_protocol_types() const override
Definition: signal_interrupt.hh:113
SignalInterruptInitiatorSocket::Base
tlm::tlm_base_initiator_socket< 64, SignalInterruptFwIf, SignalInterruptBwIf > Base
Definition: signal_interrupt.hh:66
SignalInterruptFwIf
Definition: signal_interrupt.hh:37
sc_core::sc_interface
Definition: sc_interface.hh:37
SignalInterruptInitiatorSocket::SignalInterruptInitiatorSocket
SignalInterruptInitiatorSocket(const char *name)
Definition: signal_interrupt.hh:75
tlm::tlm_base_target_socket
Definition: initiator_socket.hh:69
SignalInterruptInitiatorSocket
Definition: signal_interrupt.hh:57
SignalInterruptTargetSocket::kind
const char * kind() const override
Definition: signal_interrupt.hh:107
SignalInterruptTargetSocket
Definition: signal_interrupt.hh:93
SignalInterruptSlaveBase::SignalInterruptSlaveBase
SignalInterruptSlaveBase(const std::string &name)
Definition: signal_interrupt.hh:54
SignalInterruptTargetSocket::Base
tlm::tlm_base_target_socket< 64, SignalInterruptFwIf, SignalInterruptBwIf > Base
Definition: signal_interrupt.hh:99
SignalInterruptDummyProtocolType
Definition: signal_interrupt.hh:35
tlm::tlm_base_initiator_socket< 64, SignalInterruptFwIf, SignalInterruptBwIf >::get_base_export
virtual sc_core::sc_export< SignalInterruptBwIf > & get_base_export()
Definition: initiator_socket.hh:184
SignalInterruptInitiatorSocket::get_protocol_types
std::type_index get_protocol_types() const override
Definition: signal_interrupt.hh:87
SignalInterruptFwIf::~SignalInterruptFwIf
virtual ~SignalInterruptFwIf()
Definition: signal_interrupt.hh:40
SignalInterruptInitiatorSocket::kind
const char * kind() const override
Definition: signal_interrupt.hh:81
name
const std::string & name()
Definition: trace.cc:50
tlm::tlm_base_initiator_socket< 64, SignalInterruptFwIf, SignalInterruptBwIf >::bind
virtual void bind(base_target_socket_type &s)
Definition: initiator_socket.hh:121
sc_core::sc_object::name
const char * name() const
Definition: sc_object.cc:44
SignalInterruptFwIf::spi
virtual void spi(uint32_t num, bool state)=0
SignalInterruptInitiatorSocket::SignalInterruptInitiatorSocket
SignalInterruptInitiatorSocket()
Definition: signal_interrupt.hh:71
SignalInterruptBwIf::~SignalInterruptBwIf
virtual ~SignalInterruptBwIf()
Definition: signal_interrupt.hh:48
SignalInterruptInitiatorSocket::dummyBwIf
SignalInterruptBwIf dummyBwIf
Definition: signal_interrupt.hh:62
tlm::tlm_base_target_socket< 64, SignalInterruptFwIf, SignalInterruptBwIf >::bind
virtual void bind(base_initiator_socket_type &s)
Definition: target_socket.hh:112
tlm::tlm_base_initiator_socket
Definition: initiator_socket.hh:78
SignalInterruptSlaveBase
Definition: signal_interrupt.hh:51

Generated on Wed Sep 30 2020 14:01:59 for gem5 by doxygen 1.8.17