gem5  v20.1.0.0
req_rsp_channels.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  __EXT_TLM_CORE_1_REQ_RSP_CHANNELS_REQ_RSP_CHANNELS_REQ_RSP_CHANNELS_HH__
22 #define \
23  __EXT_TLM_CORE_1_REQ_RSP_CHANNELS_REQ_RSP_CHANNELS_REQ_RSP_CHANNELS_HH__
24 
25 #include "../../adapters/adapters.hh"
26 #include "../fifo/fifo.hh"
27 #include "put_get_imp.hh"
28 
29 namespace tlm
30 {
31 
32 template <typename REQ, typename RSP, typename REQ_CHANNEL=tlm_fifo<REQ>,
33  typename RSP_CHANNEL=tlm_fifo<RSP>>
35 {
36  public:
37  // Uni-directional slave interface.
40 
41  // Uni-directional master interface.
44 
45  // Master/slave interfaces.
48 
49  tlm_req_rsp_channel(int req_size=1, int rsp_size=1) :
50  sc_core::sc_module(sc_core::sc_module_name(
51  sc_core::sc_gen_unique_name("tlm_req_rsp_channel"))),
52  request_fifo(req_size), response_fifo(rsp_size),
55  {
56  bind_exports();
57  }
58 
60  int req_size=1, int rsp_size=1) :
61  sc_core::sc_module(module_name),
62  request_fifo(req_size), response_fifo(rsp_size),
65  {
66  bind_exports();
67  }
68 
69  private:
70  void
72  {
75 
78 
81  }
82 
83  protected:
84  REQ_CHANNEL request_fifo;
85  RSP_CHANNEL response_fifo;
86 
89 };
90 
91 template <typename REQ, typename RSP,
92  typename REQ_CHANNEL=tlm_fifo<REQ>,
93  typename RSP_CHANNEL=tlm_fifo<RSP>>
95 {
96  public:
97  // Master transport interface.
99 
100  // Slave interfaces.
103 
105 
107  sc_core::sc_module(sc_core::sc_module_name(
108  sc_core::sc_gen_unique_name("transport_channel"))),
109  target_export("target_export"), req_rsp("req_rsp", 1, 1), t2m("ts2m")
110  {
111  do_binding();
112  }
113 
115  sc_core::sc_module(nm), target_export("target_export"),
116  req_rsp("req_rsp", 1, 1), t2m("tsm")
117  {
118  do_binding();
119  }
120 
121  private:
122  void
124  {
125  target_export(t2m.target_export);
126  t2m.master_port(req_rsp.master_export);
127 
128  get_request_export(req_rsp.get_request_export);
129  put_response_export(req_rsp.put_response_export);
130  slave_export(req_rsp.slave_export);
131  }
132 
135 };
136 
137 } // namespace tlm
138 
139 #endif
140 /* __EXT_TLM_CORE_1_REQ_RSP_CHANNELS_REQ_RSP_CHANNELS_REQ_RSP_CHANNELS_HH__ */
put_get_imp.hh
tlm::tlm_req_rsp_channel::tlm_req_rsp_channel
tlm_req_rsp_channel(sc_core::sc_module_name module_name, int req_size=1, int rsp_size=1)
Definition: req_rsp_channels.hh:59
tlm::tlm_transport_channel::put_response_export
sc_core::sc_export< tlm_fifo_put_if< RSP > > put_response_export
Definition: req_rsp_channels.hh:102
sc_core::sc_module
Definition: sc_module.hh:97
tlm::tlm_transport_channel::get_request_export
sc_core::sc_export< tlm_fifo_get_if< REQ > > get_request_export
Definition: req_rsp_channels.hh:101
tlm::tlm_transport_channel::req_rsp
tlm_req_rsp_channel< REQ, RSP, REQ_CHANNEL, RSP_CHANNEL > req_rsp
Definition: req_rsp_channels.hh:133
sc_core
Definition: messages.cc:31
tlm::tlm_req_rsp_channel::put_request_export
sc_core::sc_export< tlm_fifo_put_if< REQ > > put_request_export
Definition: req_rsp_channels.hh:42
tlm::tlm_req_rsp_channel::tlm_req_rsp_channel
tlm_req_rsp_channel(int req_size=1, int rsp_size=1)
Definition: req_rsp_channels.hh:49
tlm::tlm_slave_imp
Definition: put_get_imp.hh:103
sc_core::sc_module::sc_module
sc_module()
Definition: sc_module.cc:256
tlm::tlm_req_rsp_channel::request_fifo
REQ_CHANNEL request_fifo
Definition: req_rsp_channels.hh:84
tlm::tlm_transport_channel::do_binding
void do_binding()
Definition: req_rsp_channels.hh:123
tlm::tlm_req_rsp_channel::put_response_export
sc_core::sc_export< tlm_fifo_put_if< RSP > > put_response_export
Definition: req_rsp_channels.hh:39
tlm::tlm_master_imp
Definition: put_get_imp.hh:93
tlm::tlm_transport_channel::tlm_transport_channel
tlm_transport_channel(sc_core::sc_module_name nm)
Definition: req_rsp_channels.hh:114
tlm::tlm_transport_channel
Definition: req_rsp_channels.hh:94
tlm::tlm_transport_channel::t2m
tlm_transport_to_master< REQ, RSP > t2m
Definition: req_rsp_channels.hh:134
tlm::tlm_req_rsp_channel::slave_export
sc_core::sc_export< tlm_slave_if< REQ, RSP > > slave_export
Definition: req_rsp_channels.hh:47
tlm::tlm_req_rsp_channel
Definition: req_rsp_channels.hh:34
sc_core::sc_module_name
Definition: sc_module_name.hh:41
sc_core::sc_gen_unique_name
const char * sc_gen_unique_name(const char *seed)
Definition: sc_module.cc:820
tlm
Definition: analysis_fifo.hh:27
tlm::tlm_req_rsp_channel::get_response_export
sc_core::sc_export< tlm_fifo_get_if< RSP > > get_response_export
Definition: req_rsp_channels.hh:43
tlm::tlm_transport_channel::slave_export
sc_core::sc_export< tlm_slave_if< REQ, RSP > > slave_export
Definition: req_rsp_channels.hh:104
tlm::tlm_req_rsp_channel::get_request_export
sc_core::sc_export< tlm_fifo_get_if< REQ > > get_request_export
Definition: req_rsp_channels.hh:38
tlm::tlm_req_rsp_channel::master_export
sc_core::sc_export< tlm_master_if< REQ, RSP > > master_export
Definition: req_rsp_channels.hh:46
tlm::tlm_transport_channel::target_export
sc_core::sc_export< tlm_transport_if< REQ, RSP > > target_export
Definition: req_rsp_channels.hh:98
tlm::tlm_req_rsp_channel::slave
tlm_slave_imp< REQ, RSP > slave
Definition: req_rsp_channels.hh:88
tlm::tlm_fifo< REQ >
tlm::tlm_req_rsp_channel::bind_exports
void bind_exports()
Definition: req_rsp_channels.hh:71
sc_core::sc_export
Definition: sc_export.hh:60
tlm::tlm_transport_to_master
Definition: adapters.hh:46
tlm::tlm_req_rsp_channel::response_fifo
RSP_CHANNEL response_fifo
Definition: req_rsp_channels.hh:85
tlm::tlm_transport_channel::tlm_transport_channel
tlm_transport_channel()
Definition: req_rsp_channels.hh:106
tlm::tlm_req_rsp_channel::master
tlm_master_imp< REQ, RSP > master
Definition: req_rsp_channels.hh:87

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