scc  2022.4.0
SystemC components library
tlm_gp_data_ext.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_GP_DATA_EXT_H_
18 #define TLM_GP_DATA_EXT_H_
19 
20 #ifdef HAS_SCV
21 #include <scv.h>
22 #else
23 #include <scv-tr.h>
24 #endif
25 #include <tlm/scc/scv/tlm_gp_data.h>
26 
27 #ifndef HAS_SCV
29 namespace scv_tr {
30 #endif
31 
32 template <> class scv_extensions<tlm::tlm_command> : public scv_enum_base<tlm::tlm_command> {
33 public:
34  SCV_ENUM_CTOR(tlm::tlm_command) { // NOLINT
35  SCV_ENUM(tlm::TLM_READ_COMMAND); // NOLINT
36  SCV_ENUM(tlm::TLM_WRITE_COMMAND); // NOLINT
37  SCV_ENUM(tlm::TLM_IGNORE_COMMAND); // NOLINT
38  }
39 };
40 
41 template <> class scv_extensions<tlm::tlm_response_status> : public scv_enum_base<tlm::tlm_response_status> {
42 public:
43  SCV_ENUM_CTOR(tlm::tlm_response_status) { // NOLINT
44  SCV_ENUM(tlm::TLM_OK_RESPONSE); // NOLINT
45  SCV_ENUM(tlm::TLM_INCOMPLETE_RESPONSE); // NOLINT
46  SCV_ENUM(tlm::TLM_GENERIC_ERROR_RESPONSE); // NOLINT
47  SCV_ENUM(tlm::TLM_ADDRESS_ERROR_RESPONSE); // NOLINT
48  SCV_ENUM(tlm::TLM_COMMAND_ERROR_RESPONSE); // NOLINT
49  SCV_ENUM(tlm::TLM_BURST_ERROR_RESPONSE); // NOLINT
50  SCV_ENUM(tlm::TLM_BYTE_ENABLE_ERROR_RESPONSE); // NOLINT
51  }
52 };
53 
54 template <> class scv_extensions<tlm::tlm_gp_option> : public scv_enum_base<tlm::tlm_gp_option> {
55 public:
56  SCV_ENUM_CTOR(tlm::tlm_gp_option) { // NOLINT
57  SCV_ENUM(tlm::TLM_MIN_PAYLOAD); // NOLINT
58  SCV_ENUM(tlm::TLM_FULL_PAYLOAD); // NOLINT
59  SCV_ENUM(tlm::TLM_FULL_PAYLOAD_ACCEPTED); // NOLINT
60  }
61 };
62 
63 template <> class scv_extensions<tlm::scc::scv::tlm_phase_enum> : public scv_enum_base<tlm::scc::scv::tlm_phase_enum> {
64 public:
65  SCV_ENUM_CTOR(tlm::scc::scv::tlm_phase_enum) { // NOLINT
66  SCV_ENUM(tlm::scc::scv::UNINITIALIZED_PHASE); // NOLINT
67  SCV_ENUM(tlm::scc::scv::BEGIN_REQ); // NOLINT
68  SCV_ENUM(tlm::scc::scv::END_REQ); // NOLINT
69  SCV_ENUM(tlm::scc::scv::BEGIN_RESP); // NOLINT
70  SCV_ENUM(tlm::scc::scv::END_RESP); // NOLINT
71  SCV_ENUM(tlm::scc::scv::CUSTOM1); // NOLINT
72  SCV_ENUM(tlm::scc::scv::CUSTOM2); // NOLINT
73  SCV_ENUM(tlm::scc::scv::CUSTOM3); // NOLINT
74  SCV_ENUM(tlm::scc::scv::CUSTOM4); // NOLINT
75  SCV_ENUM(tlm::scc::scv::CUSTOM5); // NOLINT
76  SCV_ENUM(tlm::scc::scv::CUSTOM6); // NOLINT
77  }
78 };
79 
80 template <> class scv_extensions<tlm::tlm_sync_enum> : public scv_enum_base<tlm::tlm_sync_enum> {
81 public:
82  SCV_ENUM_CTOR(tlm::tlm_sync_enum) { // NOLINT
83  SCV_ENUM(tlm::TLM_ACCEPTED); // NOLINT
84  SCV_ENUM(tlm::TLM_UPDATED); // NOLINT
85  SCV_ENUM(tlm::TLM_COMPLETED); // NOLINT
86  }
87 };
88 
89 template <> class scv_extensions<tlm::scc::scv::tlm_gp_data> : public scv_extensions_base<tlm::scc::scv::tlm_gp_data> {
90 public:
91  scv_extensions<sc_dt::uint64> address;
93  scv_extensions<unsigned char*> data;
94  scv_extensions<unsigned int> data_length;
96  scv_extensions<bool> dmi_allowed;
97  scv_extensions<unsigned char*> byte_enable;
98  scv_extensions<unsigned int> byte_enable_length;
99  scv_extensions<unsigned int> streaming_width;
101  scv_extensions<uintptr_t> uid;
102 
103  SCV_EXTENSIONS_CTOR(tlm::scc::scv::tlm_gp_data) {
104  // must be in order
105  SCV_FIELD(address);
106  SCV_FIELD(command);
107  SCV_FIELD(data);
108  SCV_FIELD(data_length);
109  SCV_FIELD(response_status);
110  SCV_FIELD(dmi_allowed);
111  SCV_FIELD(byte_enable);
112  SCV_FIELD(byte_enable_length);
113  SCV_FIELD(streaming_width);
114  SCV_FIELD(gp_option);
115  SCV_FIELD(uid);
116  }
117 };
118 
119 template <> class scv_extensions<tlm::tlm_dmi::dmi_access_e> : public scv_enum_base<tlm::tlm_dmi::dmi_access_e> {
120 public:
121  SCV_ENUM_CTOR(tlm::tlm_dmi::dmi_access_e) { // NOLINT
122  SCV_ENUM(tlm::tlm_dmi::DMI_ACCESS_NONE); // NOLINT
123  SCV_ENUM(tlm::tlm_dmi::DMI_ACCESS_READ); // NOLINT
124  SCV_ENUM(tlm::tlm_dmi::DMI_ACCESS_WRITE); // NOLINT
125  SCV_ENUM(tlm::tlm_dmi::DMI_ACCESS_READ_WRITE); // NOLINT
126  }
127 };
128 
129 template <> class scv_extensions<tlm::scc::scv::tlm_dmi_data> : public scv_extensions_base<tlm::scc::scv::tlm_dmi_data> {
130 public:
131  scv_extensions<unsigned char*> dmi_ptr;
132  scv_extensions<sc_dt::uint64> dmi_start_address;
133  scv_extensions<sc_dt::uint64> dmi_end_address;
135  scv_extensions<sc_dt::uint64> dmi_read_latency;
136  scv_extensions<sc_dt::uint64> dmi_write_latency;
137  SCV_EXTENSIONS_CTOR(tlm::scc::scv::tlm_dmi_data) {
138  // must be in order
139  SCV_FIELD(dmi_ptr);
140  SCV_FIELD(dmi_start_address);
141  SCV_FIELD(dmi_end_address);
142  SCV_FIELD(dmi_access);
143  SCV_FIELD(dmi_read_latency);
144  SCV_FIELD(dmi_write_latency);
145  }
146 };
147 #ifndef HAS_SCV
148 }
149 #endif
150 #endif /* TLM_GP_DATA_EXT_H_ */
SystemC Verification Library (SCV) Transaction Recording.
SystemC TLM.