scc 2025.09
SystemC components library
parallel_pe.h
1/*******************************************************************************
2 * Copyright 2020-2022 MINRES Technologies GmbH
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.
15 *******************************************************************************/
16
17#ifndef _TLM_SCC_PE_PARALLEL_PE_H_
18#define _TLM_SCC_PE_PARALLEL_PE_H_
19
20#include "intor_if.h"
21#include <deque>
22#include <tlm>
24namespace tlm {
26namespace scc {
28namespace pe {
37class parallel_pe : public sc_core::sc_module, public intor_fw_nb {
38 template <class IF> using sc_port_opt = sc_core::sc_port<IF, 1, sc_core::SC_ZERO_OR_MORE_BOUND>;
39
40 struct thread_unit {
41 sc_core::sc_event evt;
42 tlm::tlm_generic_payload* gp{nullptr};
43 bool lt_transport{false};
44 sc_core::sc_process_handle hndl{};
45 thread_unit(const thread_unit& o)
46 : gp(o.gp)
47 , lt_transport(o.lt_transport)
48 , hndl(o.hndl) {}
49 thread_unit() = default;
50 };
51
52public:
58 sc_core::sc_export<intor_fw_nb> fw_i{"fw_i"};
64 sc_port_opt<intor_bw_nb> bw_o{"bw_o"};
70 sc_core::sc_port<intor_fw_b> fw_o{"fw_o"};
79 parallel_pe(sc_core::sc_module_name const& nm);
83 virtual ~parallel_pe();
84
85private:
86 void transport(tlm::tlm_generic_payload& payload, bool lt_transport = false) override;
87
88 void snoop_resp(tlm::tlm_generic_payload& payload, bool sync) override { fw_o->snoop_resp(payload, sync); }
89
90 std::deque<unsigned> waiting_ids;
91 std::vector<thread_unit> threads;
92};
93
94} /* namespace pe */
95} // namespace scc
96} /* namespace tlm */
97
98#endif /* _TLM_SCC_PE_PARALLEL_PE_H_ */
parallel_pe(sc_core::sc_module_name const &nm)
sc_core::sc_port< intor_fw_b > fw_o
Definition parallel_pe.h:70
sc_port_opt< intor_bw_nb > bw_o
Definition parallel_pe.h:64
sc_core::sc_export< intor_fw_nb > fw_i
Definition parallel_pe.h:58
SCC protocol engines.
Definition intor_if.h:27
SCC TLM utilities.
Definition axis_tlm.h:56
SystemC TLM.
Definition dmi_mgr.h:19