scc 2025.09
SystemC components library
tlm_recording.h
1/*******************************************************************************
2 * Copyright 2016-2025 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 _CXS_SCV_RECORDER_H_
18#define _CXS_SCV_RECORDER_H_
19
20#include <cxs/cxs_tlm.h>
21#include <tlm/nw/scv/tlm_recorder.h>
22#include <tlm/nw/scv/tlm_recorder_module.h>
23#ifdef HAS_SCV
24#include <scv.h>
25#else
26#include <scv-tr.h>
27#ifndef SCVNS
28#define SCVNS ::scv_tr::
29#endif
30#endif
32namespace tlm {
34namespace nw {
36namespace scv {
37
38inline void record(SCVNS scv_tr_handle& handle, cxs::cxs_flit_payload const& o) {
39 static const std::array<std::string, 3> cmd2char{{"FLIT", "CREDIT", "CRDRTN"}};
40 handle.record_attribute("flit.ptr", reinterpret_cast<uintptr_t>(&o));
41 handle.record_attribute("flit.type", cmd2char.at(static_cast<unsigned>(o.get_command())));
42 // std::array<uint8_t, 8> start_ptr;
43 // std::array<uint8_t, 8> end_ptr;
44 handle.record_attribute("flit.start", static_cast<unsigned>(o.start));
45 handle.record_attribute("flit.end", static_cast<unsigned>(o.end));
46 handle.record_attribute("flit.end_error", o.end_error);
47 handle.record_attribute("flit.last", o.last);
48}
49
50inline void record(SCVNS scv_tr_handle& handle, ::cxs::cxs_packet_payload const& o) {}
51} // namespace scv
52} // namespace nw
53} // namespace tlm
54
55#endif /* _CXS_SCV_RECORDER_H_ */
SCC SCV4TLM classes and functions.
Definition cxs_tlm.h:546
SCC TLM utilities.
Definition cxs_tlm.h:544
SystemC TLM.
Definition dmi_mgr.h:19
CMDENUM get_command() const
Gets the command from the payload.