19 #include <tlm/scc/scv/tlm_extension_recording_registry.h>
22 std::array<char const*, 103> opc2str = {
42 "CleanSharedPersistSep",
55 "WriteUniqueFullStash",
56 "WriteUniquePtlStash",
59 "ReadOnceCleanInvalid",
60 "ReadOnceMakeInvalid",
103 "WriteNoSnpFullCleanSh",
104 "WriteNoSnpFullCleanInv",
105 "WriteNoSnpFullCleanShPerSep",
107 "WriteUniqueFullCleanSh",
109 "WriteUniqueFullCleanShPerSep",
111 "WriteBackFullCleanSh",
112 "WriteBackFullCleanInv",
113 "WriteBackFullCleanShPerSep",
115 "WriteCleanFullCleanSh",
117 "WriteCleanFullCleanShPerSep",
119 "WriteNoSnpPtlCleanSh",
120 "WriteNoSnpPtlCleanInv",
121 "WriteNoSnpPtlCleanShPerSep",
123 "WriteUniquePtlCleanSh",
125 "WriteUniquePtlCleanShPerSep",
127 template <>
const char* to_char<req_optype_e>(req_optype_e v) {
128 auto idx =
static_cast<unsigned>(v);
129 if(idx<opc2str.size())
131 else return "RESERVED";
134 template <>
const char* to_char<dat_optype_e>(dat_optype_e v) {
136 case dat_optype_e::DataLCrdReturn:
137 return "DataLCrdReturn";
138 case dat_optype_e::SnpRespData:
139 return "SnpRespData";
140 case dat_optype_e::CopyBackWrData:
141 return "CopyBackWrData";
142 case dat_optype_e::NonCopyBackWrData:
143 return "NonCopyBackWrData";
144 case dat_optype_e::CompData:
146 case dat_optype_e::SnpRespDataPtl:
147 return "SnpRespDataPtl";
148 case dat_optype_e::SnpRespDataFwded:
149 return "SnpRespDataFwded";
150 case dat_optype_e::WriteDataCancel:
151 return "WriteDataCancel";
152 case dat_optype_e::DataSepResp:
153 return "DataSepResp";
154 case dat_optype_e::NCBWrDataCompAck:
155 return "NCBWrDataCompAck";
157 return "UNKNOWN_dat_optype_e";
161 template <>
const char* to_char<rsp_optype_e>(rsp_optype_e v) {
163 case rsp_optype_e::RespLCrdReturn:
164 return "RespLCrdReturn";
165 case rsp_optype_e::SnpResp:
167 case rsp_optype_e::CompAck:
169 case rsp_optype_e::RetryAck:
171 case rsp_optype_e::Comp:
173 case rsp_optype_e::CompDBIDResp:
174 return "CompDBIDResp";
175 case rsp_optype_e::DBIDResp:
177 case rsp_optype_e::PCrdGrant:
179 case rsp_optype_e::ReadReceipt:
180 return "ReadReceipt";
181 case rsp_optype_e::SnpRespFwded:
182 return "SnpRespFwded";
183 case rsp_optype_e::TagMatch:
185 case rsp_optype_e::RespSepData:
186 return "RespSepData";
187 case rsp_optype_e::Persist:
189 case rsp_optype_e::CompPersist:
190 return "CompPersist";
191 case rsp_optype_e::DBIDRespOrd:
192 return "DBIDRespOrd";
193 case rsp_optype_e::StashDone:
195 case rsp_optype_e::CompStashDone:
196 return "CompStashDone";
197 case rsp_optype_e::CompCMO:
199 case rsp_optype_e::INVALID:
202 return "UNKNOWN_rsp_optype_e";
206 template <>
const char* to_char<snp_optype_e>(snp_optype_e v) {
208 case snp_optype_e::SnpLCrdReturn:
209 return "SnpLCrdReturn";
210 case snp_optype_e::SnpShared:
212 case snp_optype_e::SnpClean:
214 case snp_optype_e::SnpOnce:
216 case snp_optype_e::SnpNotSharedDirty:
217 return "SnpNotSharedDirty";
218 case snp_optype_e::SnpUniqueStash:
219 return "SnpUniqueStash";
220 case snp_optype_e::SnpMakeInvalidStash:
221 return "SnpMakeInvalidStash";
222 case snp_optype_e::SnpUnique:
224 case snp_optype_e::SnpCleanShared:
225 return "SnpCleanShared";
226 case snp_optype_e::SnpCleanInvalid:
227 return "SnpCleanInvalid";
228 case snp_optype_e::SnpMakeInvalid:
229 return "SnpMakeInvalid";
230 case snp_optype_e::SnpStashUnique:
231 return "SnpStashUnique";
232 case snp_optype_e::SnpStashShared:
233 return "SnpStashShared";
234 case snp_optype_e::SnpDVMOp:
236 case snp_optype_e::SnpSharedFwd:
237 return "SnpSharedFwd";
238 case snp_optype_e::SnpCleanFwd:
239 return "SnpCleanFwd";
240 case snp_optype_e::SnpOnceFwd:
242 case snp_optype_e::SnpNotSharedDirtyFwd:
243 return "SnpNotSharedDirtyFwd";
244 case snp_optype_e::SnpUniqueFwd:
245 return "SnpUniqueFwd";
247 return "UNKNOWN_snp_optype_e";
251 template <>
const char* to_char<dat_resptype_e>(dat_resptype_e v) {
262 case dat_resptype_e::CompData_UD_PD:
263 return "CompData_UD_PD";
264 case dat_resptype_e::CompData_SD_PD:
265 return "CompData_SD_PD";
266 case dat_resptype_e::Comp_I:
268 case dat_resptype_e::Comp_UC:
270 case dat_resptype_e::Comp_SC:
280 return "UNKNOWN_dat_resptype_e";
284 template <>
const char* to_char<rsp_resptype_e>(rsp_resptype_e v) {
286 case rsp_resptype_e::SnpResp_I:
288 case rsp_resptype_e::SnpResp_SC:
290 case rsp_resptype_e::SnpResp_UC:
293 case rsp_resptype_e::SnpResp_SD:
296 return "UNKNOWN_rsp_resptype_e";
300 template <>
const char* to_char<rsp_resperrtype_e>(rsp_resperrtype_e v) {
302 case rsp_resperrtype_e::OK:
304 case rsp_resperrtype_e::EXOK:
306 case rsp_resperrtype_e::DERR:
308 case rsp_resperrtype_e::NDERR:
311 return "rsp_resperrtype_e";
315 template <>
const char* to_char<credit_type_e>(credit_type_e v) {
317 case credit_type_e::LINK:
319 case credit_type_e::REQ:
321 case credit_type_e::RESP:
323 case credit_type_e::DATA:
326 return "credit_type_e";
331 auto sz = ext->req.get_size();
339 #include <tlm/scc/scv/tlm_recorder.h>
340 #include <tlm/scc/tlm_id.h>
346 void recordBeginTx(SCVNS scv_tr_handle& handle, chi_protocol_types::tlm_payload_type& trans)
override {
348 handle.record_attribute(
"trans.uid", ext->id);
352 void recordEndTx(SCVNS scv_tr_handle& handle, tlm::tlm_base_protocol_types::tlm_payload_type& trans)
override {
358 void recordBeginTx(SCVNS scv_tr_handle& handle, chi_protocol_types::tlm_payload_type& trans)
override {
361 handle.record_attribute(
"trans.chi_c.qos", ext->get_qos());
362 handle.record_attribute(
"trans.chi_c.src_id", ext->get_src_id());
363 handle.record_attribute(
"trans.chi_c.txn_id", ext->get_txn_id());
364 handle.record_attribute(
"trans.chi_c.tgt_id", ext->req.get_tgt_id());
365 handle.record_attribute(
"trans.chi_c.lp_id", ext->req.get_lp_id());
366 handle.record_attribute(
"trans.chi_c.return_txn_id", ext->req.get_return_txn_id());
367 handle.record_attribute(
"trans.chi_c.stash_lp_id", ext->req.get_stash_lp_id());
368 handle.record_attribute(
"trans.chi_c.size", ext->req.get_size());
369 handle.record_attribute(
"trans.chi_c.mem_attr", ext->req.get_mem_attr());
370 handle.record_attribute(
"trans.chi_c.req.pcrd_type", ext->req.get_pcrd_type());
371 handle.record_attribute(
"trans.chi_c.order", ext->req.get_order());
372 handle.record_attribute(
"trans.chi_c.endian", ext->req.is_endian());
373 handle.record_attribute(
"trans.chi_c.req.trace_tag", ext->req.is_trace_tag());
374 handle.record_attribute(
"trans.chi_c.return_n_id", ext->req.get_return_n_id());
375 handle.record_attribute(
"trans.chi_c.stash_n_id", ext->req.get_stash_n_id());
376 handle.record_attribute(
"trans.chi_c.opcode", std::string(
to_char(ext->req.get_opcode())));
377 handle.record_attribute(
"trans.chi_c.stash_nnode_id_valid", ext->req.is_stash_n_id_valid());
378 handle.record_attribute(
"trans.chi_c.stash_lp_id_valid", ext->req.is_stash_lp_id_valid());
379 handle.record_attribute(
"trans.chi_c.non_secure", ext->req.is_non_secure());
380 handle.record_attribute(
"trans.chi_c.exp_comp_ack", ext->req.is_exp_comp_ack());
381 handle.record_attribute(
"trans.chi_c.allow_retry", ext->req.is_allow_retry());
382 handle.record_attribute(
"trans.chi_c.snp_attr", ext->req.is_snp_attr());
383 handle.record_attribute(
"trans.chi_c.excl", ext->req.is_excl());
384 handle.record_attribute(
"trans.chi_c.snoop_me", ext->req.is_snoop_me());
385 handle.record_attribute(
"trans.chi_c.likely_shared", ext->req.is_likely_shared());
386 handle.record_attribute(
"trans.chi_c.txn_rsvdc", ext->req.get_rsvdc());
387 handle.record_attribute(
"trans.chi_c.tag_op", ext->req.get_tag_op());
388 handle.record_attribute(
"trans.chi_c.tag_group_id", ext->req.get_tag_group_id());
389 handle.record_attribute(
"trans.chi_c.mpam", ext->req.get_mpam());
390 handle.record_attribute(
"trans.chi_c.rsp.db_id", ext->resp.get_db_id());
391 handle.record_attribute(
"trans.chi_c.rsp.pcrd_type", ext->resp.get_pcrd_type());
392 handle.record_attribute(
"trans.chi_c.rsp.resp_err", std::string(
to_char(ext->resp.get_resp_err())));
393 handle.record_attribute(
"trans.chi_c.rsp.fwd_state", ext->resp.get_fwd_state());
394 handle.record_attribute(
"trans.chi_c.rsp.data_pull", ext->resp.get_data_pull());
395 handle.record_attribute(
"trans.chi_c.rsp.opcode", std::string(
to_char(ext->resp.get_opcode())));
396 handle.record_attribute(
"trans.chi_c.rsp.resp", std::string(
to_char(ext->resp.get_resp())));
397 handle.record_attribute(
"trans.chi_c.rsp.tgt_id", ext->resp.get_tgt_id());
398 handle.record_attribute(
"trans.chi_c.rsp.trace_tag", ext->resp.is_trace_tag());
399 handle.record_attribute(
"trans.chi_c.rsp.tag_op", ext->resp.get_tag_op());
400 handle.record_attribute(
"trans.chi_c.rsp.tag_group_id", ext->resp.get_tag_group_id());
404 void recordEndTx(SCVNS scv_tr_handle& handle, chi_protocol_types::tlm_payload_type& trans)
override {}
409 void recordBeginTx(SCVNS scv_tr_handle& handle, chi_protocol_types::tlm_payload_type& trans)
override {
412 handle.record_attribute(
"trans.chi_d.qos", ext->get_qos());
413 handle.record_attribute(
"trans.chi_d.src_id", ext->get_src_id());
414 handle.record_attribute(
"trans.chi_d.txn_id", ext->get_txn_id());
415 handle.record_attribute(
"trans.chi_d.db_id", ext->dat.get_db_id());
416 handle.record_attribute(
"trans.chi_d.resp_err", std::string(
to_char(ext->dat.get_resp_err())));
417 handle.record_attribute(
"trans.chi_d.resp", std::string(
to_char(ext->dat.get_resp())));
418 handle.record_attribute(
"trans.chi_d.fwd_state", ext->dat.get_fwd_state());
419 handle.record_attribute(
"trans.chi_d.data_pull", ext->dat.get_data_pull());
420 handle.record_attribute(
"trans.chi_d.data_source", ext->dat.get_data_source());
421 handle.record_attribute(
"trans.chi_d.cc_id", ext->dat.get_cc_id());
422 handle.record_attribute(
"trans.chi_d.data_id", ext->dat.get_data_id());
423 handle.record_attribute(
"trans.chi_d.poison", ext->dat.get_poison());
424 handle.record_attribute(
"trans.chi_d.tgt_id", ext->dat.get_tgt_id());
425 handle.record_attribute(
"trans.chi_d.home_node_id", ext->dat.get_home_n_id());
426 handle.record_attribute(
"trans.chi_d.opcode", std::string(
to_char(ext->dat.get_opcode())));
427 handle.record_attribute(
"trans.chi_d.rsvdc", ext->dat.get_rsvdc());
428 handle.record_attribute(
"trans.chi_d.data_check", ext->dat.get_data_check());
429 handle.record_attribute(
"trans.chi_d.trace_tag", ext->dat.is_trace_tag());
430 handle.record_attribute(
"trans.chi_d.tag_op", ext->dat.get_tag_op());
431 handle.record_attribute(
"trans.chi_c.tag", ext->dat.get_tag());
432 handle.record_attribute(
"trans.chi_c.tu", ext->dat.get_tu());
436 void recordEndTx(SCVNS scv_tr_handle& handle, chi_protocol_types::tlm_payload_type& trans)
override {}
441 void recordBeginTx(SCVNS scv_tr_handle& handle, chi_protocol_types::tlm_payload_type& trans)
override {
444 handle.record_attribute(
"trans.chi_s.qos", ext->get_qos());
445 handle.record_attribute(
"trans.chi_s.src_id", ext->get_src_id());
446 handle.record_attribute(
"trans.chi_s.txn_id", ext->get_txn_id());
447 handle.record_attribute(
"trans.chi_s.fwd_txn_id", ext->req.get_fwd_txn_id());
448 handle.record_attribute(
"trans.chi_s.stash_lp_id", ext->req.get_stash_lp_id());
449 handle.record_attribute(
"trans.chi_s.vm_id_ext", ext->req.get_vm_id_ext());
450 handle.record_attribute(
"trans.chi_s.stash_lp_id_valid", ext->req.is_stash_lp_id_valid());
451 handle.record_attribute(
"trans.chi_s.opcode", std::string(
to_char(ext->req.get_opcode())));
452 handle.record_attribute(
"trans.chi_s.fwd_n_id", ext->req.get_fwd_n_id());
453 handle.record_attribute(
"trans.chi_s.non_secure", ext->req.is_non_secure());
454 handle.record_attribute(
"trans.chi_s.do_not_goto_sd", ext->req.is_do_not_goto_sd());
455 handle.record_attribute(
"trans.chi_s.do_not_data_pull", ext->req.is_do_not_data_pull());
456 handle.record_attribute(
"trans.chi_s.ret_to_src", ext->req.is_ret_to_src());
457 handle.record_attribute(
"trans.chi_s.trace_tag", ext->req.is_trace_tag());
458 handle.record_attribute(
"trans.chi_s.rsp.db_id", ext->resp.get_db_id());
459 handle.record_attribute(
"trans.chi_s.rsp.pcrd_type", ext->resp.get_pcrd_type());
460 handle.record_attribute(
"trans.chi_s.rsp.resp_err", std::string(
to_char(ext->resp.get_resp_err())));
461 handle.record_attribute(
"trans.chi_s.rsp.fwd_state", ext->resp.get_fwd_state());
462 handle.record_attribute(
"trans.chi_s.rsp.data_pull", ext->resp.get_data_pull());
463 handle.record_attribute(
"trans.chi_s.rsp.opcode", std::string(
to_char(ext->resp.get_opcode())));
464 handle.record_attribute(
"trans.chi_s.rsp.resp", std::string(
to_char(ext->resp.get_resp())));
465 handle.record_attribute(
"trans.chi_s.rsp.tgt_id", ext->resp.get_tgt_id());
466 handle.record_attribute(
"trans.chi_s.rsp.trace_tag", ext->resp.is_trace_tag());
470 void recordEndTx(SCVNS scv_tr_handle& handle, chi_protocol_types::tlm_payload_type& trans)
override {}
475 void recordBeginTx(SCVNS scv_tr_handle& handle, chi_protocol_types::tlm_payload_type& trans)
override {
478 handle.record_attribute(
"trans.chi_credit.type", std::string(
to_char(ext->type)));
479 handle.record_attribute(
"trans.chi_credit.count", ext->count);
483 void recordEndTx(SCVNS scv_tr_handle& handle, chi_protocol_types::tlm_payload_type& trans)
override {
486 handle.record_attribute(
"trans.chi_credit.type", std::string(
to_char(ext->type)));
487 handle.record_attribute(
"trans.chi_credit.count", ext->count);
493 #if defined(__GNUG__)
494 __attribute__((constructor))
496 bool register_extensions() {
518 bool registered = register_extensions();
The TLM transaction extensions recorder registry.
The TLM transaction extensions recorder interface.
TLM2.0 components modeling CHI.
const char * to_char(E t)
SCC SCV4TLM classes and functions.