scc 2025.09
SystemC components library
recorder_modules.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.
15 */
16
17#pragma once
18
19#include <chi/scv/chi_recorder.h>
20
21namespace chi {
22namespace scv {
33template <unsigned int BUSWIDTH, typename TYPES, typename BASE>
34class chitlm_recorder_module : public sc_core::sc_module, public BASE {
35public:
37 typename BASE::template target_socket_type<BUSWIDTH> tsckt{"tsckt"};
39 typename BASE::template initiator_socket_type<BUSWIDTH> isckt{"isckt"};
40
49 chitlm_recorder_module(sc_core::sc_module_name name, bool recording_enabled = true,
50 SCVNS scv_tr_db* tr_db = SCVNS scv_tr_db::get_default_db())
51 : sc_module(name)
52 , BASE(sc_core::sc_object::name(), recording_enabled, tr_db) {
53 // bind the sockets to the module
54 tsckt.bind(*this);
55 isckt.bind(*this);
56 }
57
58 virtual ~chitlm_recorder_module() {}
59
60 tlm::tlm_fw_transport_if<TYPES>* get_fw_if() override { return isckt.get_base_port().operator->(); }
61
62 tlm::tlm_bw_transport_if<TYPES>* get_bw_if() override { return tsckt.get_base_port().operator->(); }
63
64private:
65 void start_of_simulation() override { BASE::initialize_streams(); }
66};
67
68template <unsigned int BUSWIDTH = 32>
69using chi_trx_recorder_module =
71
72} // namespace scv
73} // namespace chi
The TLM2 transaction recorder.
chi_trx_recorder< chi::chi_protocol_types >::template target_socket_type< BUSWIDTH > tsckt
chi_trx_recorder< chi::chi_protocol_types >::template initiator_socket_type< BUSWIDTH > isckt
chitlm_recorder_module(sc_core::sc_module_name name, bool recording_enabled=true, SCVNS scv_tr_db *tr_db=SCVNS scv_tr_db::get_default_db())
The constructor of the component.
TLM2.0 components modeling CHI.
Definition chi_tlm.cpp:21