gem5  v20.1.0.0
put_get_imp.hh
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
4  more contributor license agreements. See the NOTICE file distributed
5  with this work for additional information regarding copyright ownership.
6  Accellera licenses this file to you under the Apache License, Version 2.0
7  (the "License"); you may not use this file except in compliance with the
8  License. You may obtain a copy of the License at
9 
10  http://www.apache.org/licenses/LICENSE-2.0
11 
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15  implied. See the License for the specific language governing
16  permissions and limitations under the License.
17 
18  *****************************************************************************/
19 
20 #ifndef \
21  __SYSTEMC_EXT_TLM_CORE_1_REQ_RSP_CHANNELS_REQ_RSP_CHANNELS_PUT_GET_IMP_HH__
22 #define \
23  __SYSTEMC_EXT_TLM_CORE_1_REQ_RSP_CHANNELS_REQ_RSP_CHANNELS_PUT_GET_IMP_HH__
24 
25 #include "../../interfaces/master_slave_ifs.hh"
26 
27 namespace tlm
28 {
29 
30 template <typename PUT_DATA, typename GET_DATA>
31 class tlm_put_get_imp : private virtual tlm_put_if<PUT_DATA>,
32  private virtual tlm_get_peek_if<GET_DATA>
33 {
34  public:
36  put_fifo(p), get_fifo(g)
37  {}
38 
39  // Put interface.
40  void put(const PUT_DATA &t) { put_fifo.put(t); }
41  bool nb_put(const PUT_DATA &t) { return put_fifo.nb_put(t); }
42  bool
43  nb_can_put(tlm_tag<PUT_DATA> *t=nullptr) const
44  {
45  return put_fifo.nb_can_put(t);
46  }
47  const sc_core::sc_event &
48  ok_to_put(tlm_tag<PUT_DATA> *t=nullptr) const
49  {
50  return put_fifo.ok_to_put(t);
51  }
52 
53  // Get interface.
54  GET_DATA get(tlm_tag<GET_DATA> * =nullptr) { return get_fifo.get(); }
55  bool nb_get(GET_DATA &t) { return get_fifo.nb_get(t); }
56  bool
57  nb_can_get(tlm_tag<GET_DATA> *t=nullptr) const
58  {
59  return get_fifo.nb_can_get(t);
60  }
61 
62  virtual const sc_core::sc_event &
63  ok_to_get(tlm_tag<GET_DATA> *t=nullptr) const
64  {
65  return get_fifo.ok_to_get(t);
66  }
67 
68  // Peek interface.
69  GET_DATA
70  peek(tlm_tag<GET_DATA> * =nullptr) const
71  {
72  return get_fifo.peek();
73  }
74  bool nb_peek(GET_DATA &t) const { return get_fifo.nb_peek(t); }
75  bool
77  {
78  return get_fifo.nb_can_peek(t);
79  }
80 
81  virtual const sc_core::sc_event &
82  ok_to_peek(tlm_tag<GET_DATA> *t=nullptr) const
83  {
84  return get_fifo.ok_to_peek(t);
85  }
86 
87  private:
90 };
91 
92 template <typename REQ, typename RSP>
93 class tlm_master_imp : private tlm_put_get_imp<REQ, RSP>,
94  public virtual tlm_master_if<REQ, RSP>
95 {
96  public:
98  tlm_put_get_imp<REQ, RSP>(req, rsp)
99  {}
100 };
101 
102 template <typename REQ, typename RSP>
103 class tlm_slave_imp : private tlm_put_get_imp<RSP, REQ>,
104  public virtual tlm_slave_if<REQ, RSP>
105 {
106  public:
108  tlm_put_get_imp<RSP, REQ>(rsp, req)
109  {}
110 };
111 
112 } // namespace tlm
113 
114 #endif
115 /*__SYSTEMC_EXT_TLM_CORE_1_REQ_RSP_CHANNELS_REQ_RSP_CHANNELS_PUT_GET_IMP_HH__*/
tlm::tlm_put_get_imp::ok_to_peek
virtual const sc_core::sc_event & ok_to_peek(tlm_tag< GET_DATA > *t=nullptr) const
Definition: put_get_imp.hh:82
tlm::tlm_slave_imp::tlm_slave_imp
tlm_slave_imp(tlm_get_peek_if< REQ > &req, tlm_put_if< RSP > &rsp)
Definition: put_get_imp.hh:107
tlm::tlm_slave_if
Definition: master_slave_ifs.hh:84
tlm::tlm_put_get_imp::ok_to_get
virtual const sc_core::sc_event & ok_to_get(tlm_tag< GET_DATA > *t=nullptr) const
Definition: put_get_imp.hh:63
tlm::tlm_master_imp::tlm_master_imp
tlm_master_imp(tlm_put_if< REQ > &req, tlm_get_peek_if< RSP > &rsp)
Definition: put_get_imp.hh:97
tlm::tlm_put_get_imp::put
void put(const PUT_DATA &t)
Definition: put_get_imp.hh:40
tlm::tlm_get_peek_if
Definition: core_ifs.hh:145
tlm::tlm_put_get_imp::tlm_put_get_imp
tlm_put_get_imp(tlm_put_if< PUT_DATA > &p, tlm_get_peek_if< GET_DATA > &g)
Definition: put_get_imp.hh:35
tlm::tlm_put_get_imp::nb_get
bool nb_get(GET_DATA &t)
Definition: put_get_imp.hh:55
tlm::tlm_put_get_imp
Definition: put_get_imp.hh:31
tlm::tlm_put_if
Definition: core_ifs.hh:104
tlm::tlm_blocking_put_if::put
virtual void put(const T &t)=0
tlm::tlm_blocking_get_if::get
virtual T get(tlm_tag< T > *t=nullptr)=0
tlm::tlm_nonblocking_peek_if::nb_peek
virtual bool nb_peek(T &t) const =0
tlm::tlm_slave_imp
Definition: put_get_imp.hh:103
tlm::tlm_nonblocking_put_if::ok_to_put
virtual const sc_core::sc_event & ok_to_put(tlm_tag< T > *t=nullptr) const =0
tlm::tlm_master_imp
Definition: put_get_imp.hh:93
tlm::tlm_nonblocking_put_if::nb_can_put
virtual bool nb_can_put(tlm_tag< T > *t=nullptr) const =0
tlm::tlm_nonblocking_get_if::ok_to_get
virtual const sc_core::sc_event & ok_to_get(tlm_tag< T > *t=nullptr) const =0
tlm::tlm_put_get_imp::nb_can_peek
bool nb_can_peek(tlm_tag< GET_DATA > *t=nullptr) const
Definition: put_get_imp.hh:76
tlm::tlm_put_get_imp::ok_to_put
const sc_core::sc_event & ok_to_put(tlm_tag< PUT_DATA > *t=nullptr) const
Definition: put_get_imp.hh:48
tlm::tlm_nonblocking_get_if::nb_get
virtual bool nb_get(T &t)=0
tlm::tlm_tag
Definition: tag.hh:44
MipsISA::g
Bitfield< 4 > g
Definition: dt_constants.hh:83
tlm::tlm_nonblocking_get_if::nb_can_get
virtual bool nb_can_get(tlm_tag< T > *t=nullptr) const =0
sc_core::sc_event
Definition: sc_event.hh:169
tlm::tlm_nonblocking_put_if::nb_put
virtual bool nb_put(const T &t)=0
tlm::tlm_put_get_imp::peek
GET_DATA peek(tlm_tag< GET_DATA > *=nullptr) const
Definition: put_get_imp.hh:70
tlm::tlm_put_get_imp::nb_put
bool nb_put(const PUT_DATA &t)
Definition: put_get_imp.hh:41
tlm::tlm_put_get_imp::nb_peek
bool nb_peek(GET_DATA &t) const
Definition: put_get_imp.hh:74
tlm::tlm_blocking_peek_if::peek
virtual T peek(tlm_tag< T > *t=nullptr) const =0
tlm
Definition: analysis_fifo.hh:27
tlm::tlm_put_get_imp::nb_can_get
bool nb_can_get(tlm_tag< GET_DATA > *t=nullptr) const
Definition: put_get_imp.hh:57
tlm::tlm_nonblocking_peek_if::nb_can_peek
virtual bool nb_can_peek(tlm_tag< T > *t=nullptr) const =0
tlm::tlm_put_get_imp::get
GET_DATA get(tlm_tag< GET_DATA > *=nullptr)
Definition: put_get_imp.hh:54
tlm::tlm_master_if
Definition: master_slave_ifs.hh:77
ArmISA::t
Bitfield< 5 > t
Definition: miscregs_types.hh:67
tlm::tlm_put_get_imp::get_fifo
tlm_get_peek_if< GET_DATA > & get_fifo
Definition: put_get_imp.hh:89
tlm::tlm_nonblocking_peek_if::ok_to_peek
virtual const sc_core::sc_event & ok_to_peek(tlm_tag< T > *t=nullptr) const =0
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
tlm::tlm_put_get_imp::put_fifo
tlm_put_if< PUT_DATA > & put_fifo
Definition: put_get_imp.hh:88
tlm::tlm_put_get_imp::nb_can_put
bool nb_can_put(tlm_tag< PUT_DATA > *t=nullptr) const
Definition: put_get_imp.hh:43

Generated on Wed Sep 30 2020 14:02:16 for gem5 by doxygen 1.8.17