scc  2022.4.0
SystemC components library
simple_target.h
1 /*
2  * Copyright 2020 Arteris IP
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.axi_util.cpp
15  */
16 
17 #pragma once
18 
19 #include <axi/pe/axi_target_pe.h>
20 #include "target_info_if.h"
21 
23 namespace axi {
25 namespace pe {
31 template <unsigned int BUSWIDTH = 32, typename TYPES = axi::axi_protocol_types, int N = 1,
32  sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND>
33 class simple_target : public axi_target_pe, public target_info_if {
34 public:
35  using base = axi_target_pe;
36  using payload_type = base::payload_type;
37  using phase_type = base::phase_type;
38 
44  : // @suppress("Class members should be properly initialized")
45  simple_target(sc_core::sc_gen_unique_name("simple_target"), socket) {}
46 
47  simple_target(const sc_core::sc_module_name& nm, axi::axi_target_socket<BUSWIDTH, TYPES, N, POL>& socket, flavor_e flavor= flavor_e::AXI)
48  : axi_target_pe(nm, BUSWIDTH, flavor)
49  , socket(socket) {
50  socket(*this);
51  this->instance_name = name();
52  }
53 
54  simple_target() = delete;
55 
56  simple_target(simple_target const&) = delete;
57 
58  simple_target(simple_target&&) = delete;
59 
60  simple_target& operator=(simple_target const&) = delete;
61 
62  simple_target& operator=(simple_target&&) = delete;
63 
64  size_t get_outstanding_tx_count() override { return getAllOutStandingTx();}
65 
66 protected:
68 
69  void end_of_elaboration(){
70  base::end_of_elaboration();
71  set_bw_interface(socket.get_base_port().operator -> ());
72  }
73 };
74 
75 } // namespace pe
76 } // namespace axi
simple_target(axi::axi_target_socket< BUSWIDTH, TYPES, N, POL > &socket)
the constructor
Definition: simple_target.h:43
TLM2.0 components modeling AHB.
Definition: axi_initiator.h:30
The AXI protocol traits class. Since the protocoll defines additional non-ignorable phases a dedicate...
Definition: axi_tlm.h:890
axi::axi_protocol_types::tlm_payload_type payload_type
aliases used in the class
Definition: base.h:45