gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
26
27namespace tlm
28{
29
30template <typename PUT_DATA, typename GET_DATA>
31class tlm_put_get_imp : private virtual tlm_put_if<PUT_DATA>,
32 private virtual tlm_get_peek_if<GET_DATA>
33{
34 public:
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
92template <typename REQ, typename RSP>
93class 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
102template <typename REQ, typename RSP>
103class 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__*/
virtual T get(tlm_tag< T > *t=nullptr)=0
virtual T peek(tlm_tag< T > *t=nullptr) const =0
virtual void put(const T &t)=0
tlm_master_imp(tlm_put_if< REQ > &req, tlm_get_peek_if< RSP > &rsp)
virtual bool nb_get(T &t)=0
virtual const sc_core::sc_event & ok_to_get(tlm_tag< T > *t=nullptr) const =0
virtual bool nb_can_get(tlm_tag< T > *t=nullptr) const =0
virtual const sc_core::sc_event & ok_to_peek(tlm_tag< T > *t=nullptr) const =0
virtual bool nb_peek(T &t) const =0
virtual bool nb_can_peek(tlm_tag< T > *t=nullptr) const =0
virtual bool nb_put(const T &t)=0
virtual bool nb_can_put(tlm_tag< T > *t=nullptr) const =0
virtual const sc_core::sc_event & ok_to_put(tlm_tag< T > *t=nullptr) const =0
bool nb_can_put(tlm_tag< PUT_DATA > *t=nullptr) const
virtual const sc_core::sc_event & ok_to_get(tlm_tag< GET_DATA > *t=nullptr) const
bool nb_can_get(tlm_tag< GET_DATA > *t=nullptr) const
tlm_get_peek_if< GET_DATA > & get_fifo
void put(const PUT_DATA &t)
const sc_core::sc_event & ok_to_put(tlm_tag< PUT_DATA > *t=nullptr) const
bool nb_get(GET_DATA &t)
bool nb_put(const PUT_DATA &t)
GET_DATA get(tlm_tag< GET_DATA > *=nullptr)
tlm_put_if< PUT_DATA > & put_fifo
tlm_put_get_imp(tlm_put_if< PUT_DATA > &p, tlm_get_peek_if< GET_DATA > &g)
virtual const sc_core::sc_event & ok_to_peek(tlm_tag< GET_DATA > *t=nullptr) const
GET_DATA peek(tlm_tag< GET_DATA > *=nullptr) const
bool nb_can_peek(tlm_tag< GET_DATA > *t=nullptr) const
bool nb_peek(GET_DATA &t) const
tlm_slave_imp(tlm_get_peek_if< REQ > &req, tlm_put_if< RSP > &rsp)

Generated on Tue Jun 18 2024 16:24:07 for gem5 by doxygen 1.11.0