scc 2025.09
SystemC components library
tlm_recording_extension.h
1/*******************************************************************************
2 * Copyright 2016, 2018 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 _SCV4TLM_TLM_RECORDING_EXTENSION_H_
18#define _SCV4TLM_TLM_RECORDING_EXTENSION_H_
19
20#include <array>
21#ifdef HAS_SCV
22#include <scv.h>
23#else
24#include <scv-tr.h>
25#endif
26#include <tlm>
27
29namespace tlm {
31namespace scc {
33namespace scv {
34#ifndef HAS_SCV
35#ifndef SCVNS
36#define SCVNS ::scv_tr::
37#endif
38#endif
39
45
46static std::array<const char*, 2> tx_rel_str = {{"PARENT/CHILD", "PRED/SUCC"}};
51inline const char* rel_str(tx_rel rel) { return (tx_rel_str[rel]); }
62class tlm_recording_extension : public tlm::tlm_extension<tlm_recording_extension> {
63public:
67 virtual tlm_extension_base* clone() const {
68 tlm_recording_extension* t = new tlm_recording_extension(this->txHandle, this->creator);
69 return t;
70 }
71
75 virtual void copy_from(tlm_extension_base const& from) {
76 txHandle = static_cast<tlm_recording_extension const&>(from).txHandle;
77 creator = static_cast<tlm_recording_extension const&>(from).creator;
78 }
79
86 tlm_recording_extension(SCVNS scv_tr_handle handle, void* creator_)
87 : txHandle(handle)
88 , creator(creator_) {}
89
92 void* get_creator() { return creator; }
96 SCVNS scv_tr_handle txHandle;
97
98private:
100 void* creator;
101};
102} // namespace scv
103} // namespace scc
104} // namespace tlm
105
106#endif /* TLM_RECORDING_EXTENSION_H_ */
SCVNS scv_tr_handle txHandle
accessor to the SCV transaction handle.
virtual void copy_from(tlm_extension_base const &from)
copy data between extensions.
void * get_creator()
accessor to the owner, the property is read only.
virtual tlm_extension_base * clone() const
clone the given extension and duplicate the SCV transaction handle.
tlm_recording_extension(SCVNS scv_tr_handle handle, void *creator_)
constructor storing the handle of the transaction and the owner of this extension
SCC SCV4TLM classes and functions.
const char * rel_str(tx_rel rel)
cast the tx_rel enum to a string
tx_rel
transaction relationships
SCC TLM utilities.
Definition axis_tlm.h:56
SystemC TLM.
Definition dmi_mgr.h:19