scc 2025.09
SystemC components library
tlm_recorder_module.h
1/*******************************************************************************
2 * Copyright 2016, 2017 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_SCV_RECORDER_MODULE_H_
18#define TLM_SCC_SCV_RECORDER_MODULE_H_
19
20#include <tlm/scc/scv/tlm_recorder.h>
21#include <tlm_utils/simple_initiator_socket.h>
22#include <tlm_utils/simple_target_socket.h>
23
25namespace tlm {
27namespace scc {
29namespace scv {
40template <unsigned int BUSWIDTH = 32, typename TYPES = tlm::tlm_base_protocol_types> class tlm_recorder_module : public sc_core::sc_module {
41public:
42 SC_HAS_PROCESS(tlm_recorder_module); // NOLINT
44 tlm::tlm_target_socket<BUSWIDTH, TYPES, 1> ts{"ts"};
46 tlm::tlm_initiator_socket<BUSWIDTH, TYPES, 1> is{"is"};
56 tlm_recorder_module(sc_core::sc_module_name name, bool recording_enabled = true,
57 SCVNS scv_tr_db* tr_db = SCVNS scv_tr_db::get_default_db())
58 : sc_module(name) {
59 recorder.reset(
60 new tlm_recorder<TYPES>(sc_core::sc_object::name(), is.get_base_port(), ts.get_base_port(), recording_enabled, tr_db));
61 add_attribute(recorder->enableBlTracing);
62 add_attribute(recorder->enableNbTracing);
63 add_attribute(recorder->enableTimedTracing);
64 add_attribute(recorder->enableDmiTracing);
65 // bind the sockets to the module
66 is.bind(*recorder);
67 ts.bind(*recorder);
68 }
69
70 sc_core::sc_attribute<bool> enableTimedTracing() { return recorder->enableBlTracing; }
71
72 virtual ~tlm_recorder_module() {}
73
74 std::unique_ptr<tlm_recorder<TYPES>> recorder;
75
76private:
77 void start_of_simulation() override { recorder->initialize_streams(); }
78};
79} // namespace scv
80} // namespace scc
81} // namespace tlm
82
83#endif /* TLM_SCC_SCV_RECORDER_MODULE_H_ */
tlm_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.
tlm::tlm_target_socket< BUSWIDTH, TYPES, 1 > ts
The target socket of the recorder to be bound to the initiator.
tlm::tlm_initiator_socket< BUSWIDTH, TYPES, 1 > is
The initiator to be bound to the target socket.
The TLM2 transaction recorder.
SCC SCV4TLM classes and functions.
SCC TLM utilities.
Definition axis_tlm.h:56
SystemC TLM.
Definition dmi_mgr.h:19