29template <
typename Enum>
struct enable_for_enum {
static const bool value =
false; };
35template <
typename E>
inline E
into(
typename std::underlying_type<E>::type t);
41template <typename E, typename ULT = typename std::underlying_type<E>::type,
42 typename X =
typename std::enable_if<std::is_enum<E>::value && !std::is_convertible<E, ULT>::value,
bool>::type>
44 return static_cast<typename std::underlying_type<E>::type
>(t);
51template <
typename E>
const char*
to_char(E t);
58template <typename E, typename std::enable_if<enable_for_enum<E>::value,
bool>::type>
59inline std::ostream& operator<<(std::ostream& os, E e) {
64std::ostream& operator<<(std::ostream& os, tlm::tlm_generic_payload
const& t);
67enum class req_optype_e : uint8_t {
88 CleanSharedPersistSep = 0x13,
90 WriteEvictFull = 0x15,
92 WriteCleanFull = 0x17,
93 WriteUniquePtl = 0x18,
94 WriteUniqueFull = 0x19,
98 WriteNoSnpFull = 0x1D,
100 WriteUniqueFullStash = 0x20,
101 WriteUniquePtlStash = 0x21,
102 StashOnceShared = 0x22,
103 StashOnceUnique = 0x23,
104 ReadOnceCleanInvalid = 0x24,
105 ReadOnceMakeInvalid = 0x25,
106 ReadNotSharedDirty = 0x26,
107 CleanSharedPersist = 0x27,
108 AtomicStoreAdd = 0x28,
109 AtomicStoreClr = 0x29,
110 AtomicStoreEor = 0x2A,
111 AtomicStoreSet = 0x2B,
112 AtomicStoreSmax = 0x2C,
113 AtomicStoreSmin = 0x2D,
114 AtomicStoreUmax = 0x2E,
115 AtomicStoreUmin = 0x2F,
116 AtomicLoadAdd = 0x30,
117 AtomicLoadClr = 0x31,
118 AtomicLoadEor = 0x32,
119 AtomicLoadSet = 0x33,
120 AtomicLoadSmax = 0x34,
121 AtomicLoadSmin = 0x35,
122 AtomicLoadUmax = 0x36,
123 AtomicLoadUmin = 0x37,
125 AtomicCompare = 0x39,
129 MakeReadUnique = 0x41,
130 WriteEvictOrEvict = 0x42,
131 WriteUniqueZero = 0x43,
132 WriteNoSnpZero = 0x44,
134 StashOnceSepShared = 0x47,
135 StashOnceSepUnique = 0x48,
137 ReadPreferUnique = 0x4c,
139 WriteNoSnpFullCleanSh = 0x50,
140 WriteNoSnpFullCleanInv = 0x51,
141 WriteNoSnpFullCleanShPerSep = 0x52,
143 WriteUniqueFullCleanSh = 0x54,
145 WriteUniqueFullCleanShPerSep = 0x56,
147 WriteBackFullCleanSh = 0x58,
148 WriteBackFullCleanInv = 0x59,
149 WriteBackFullCleanShPerSep = 0x5A,
151 WriteCleanFullCleanSh = 0x5c,
153 WriteCleanFullCleanShPerSep = 0x5e,
155 WriteNoSnpPtlCleanSh = 0x60,
156 WriteNoSnpPtlCleanInv = 0x61,
157 WriteNoSnpPtlCleanShPerSep = 0x62,
159 WriteUniquePtlCleanSh = 0x64,
161 WriteUniquePtlCleanShPerSep = 0x66,
167enum class snp_optype_e : uint8_t {
168 SnpLCrdReturn = 0x00,
172 SnpNotSharedDirty = 0x04,
173 SnpUniqueStash = 0x05,
174 SnpMakeInvalidStash = 0x06,
176 SnpCleanShared = 0x08,
177 SnpCleanInvalid = 0x09,
178 SnpMakeInvalid = 0x0A,
179 SnpStashUnique = 0x0B,
180 SnpStashShared = 0x0c,
186 SnpNotSharedDirtyFwd = 0x14,
187 SnpPreferUnique = 0x15,
188 SnpPreferUniqueFwd = 0x16,
196enum class dat_optype_e : uint8_t {
197 DataLCrdReturn = 0x0,
199 CopyBackWrData = 0x2,
200 NonCopyBackWrData = 0x3,
202 SnpRespDataPtl = 0x5,
203 SnpRespDataFwded = 0x6,
204 WriteDataCancel = 0x7,
206 NCBWrDataCompAck = 0xC,
211 SnpRespData_UC = 0x1,
212 SnpRespData_UD = 0x1,
213 SnpRespData_SC = 0x1,
214 SnpRespData_SD = 0x1,
215 SnpRespData_I_PD = 0x1,
216 SnpRespData_UC_PD = 0x1,
217 SnpRespData_SC_PD = 0x1,
218 SnpRespDataPtl_I_PD = 0x5,
219 SnpRespDataPtl_UD = 0x5,
221 SnpRespData_I_Fwded_SC = 0x6,
222 SnpRespData_I_Fwded_SD_PD = 0x6,
223 SnpRespData_SC_Fwded_SC = 0x6,
224 SnpRespData_SC_Fwded_SD_PD = 0x6,
225 SnpRespData_SD_Fwded_SC = 0x6,
226 SnpRespData_I_PD_Fwded_I = 0x6,
227 SnpRespData_I_PD_Fwded_SC = 0x6,
228 SnpRespData_SC_PD_Fwded_I = 0x6,
229 SnpRespData_SC_PD_Fwded_SC = 0x6
233enum class dat_resptype_e : uint8_t {
238 CompData_UD_PD = 0b110,
239 CompData_SD_PD = 0b111,
240 DataSepResp_I = 0b000,
241 DataSepResp_SC = 0b001,
242 DataSepResp_UC = 0b010,
243 RespSepData_I = 0b000,
244 RespSepData_SC = 0b001,
245 RespSepData_UC = 0b010,
247 SnpRespData_I = 0b000,
248 SnpRespData_UC = 0b010,
249 SnpRespData_UD = 0b010,
250 SnpRespData_SC = 0b001,
251 SnpRespData_SD = 0b011,
252 SnpRespData_I_PD = 0b100,
253 SnpRespData_UC_PD = 0b110,
254 SnpRespData_SC_PD = 0b101,
255 SnpRespDataPtl_I_PD = 0b100,
256 SnpRespDataPtl_UD = 0b010,
263 CopyBackWrData_I = 0b000,
264 CopyBackWrData_UC = 0b010,
265 CopyBackWrData_SC = 0b001,
266 CopyBackWrData_UD_PD = 0b110,
267 CopyBackWrData_SD_PD = 0b111,
268 NonCopyBackWrData = 0b000,
269 NCBWrDataCompAck = 0b000
273enum class rsp_optype_e : uint8_t {
274 RespLCrdReturn = 0x0,
291 CompStashDone = 0x11,
298enum class rsp_resptype_e : uint8_t {
311 SnpRespData_I = 0b000,
312 SnpRespData_UC = 0b010,
313 SnpRespData_UD = 0b010,
314 SnpRespData_SC = 0b001,
315 SnpRespData_SD = 0b011,
316 SnpRespData_I_PD = 0b100,
318 SnpRespData_UC_PD = 0b110,
320 SnpRespData_SC_PD = 0b101,
322 SnpRespDataPtl_I_PD = 0b100,
324 SnpRespDataPtl_UD = 0b010,
327enum class rsp_resperrtype_e : uint8_t { OK = 0b00, EXOK = 0b01, DERR = 0b10, NDERR = 0b11 };
329enum class credit_type_e : uint8_t {
342 BranchPredictorInvalidate = 0x1,
355 DVMVAValidMask = 0x1,
420 void set_tgt_id(uint8_t);
421 uint8_t get_tgt_id()
const;
424 void set_lp_id(uint8_t);
425 uint8_t get_lp_id()
const;
428 void set_return_txn_id(uint8_t);
429 uint8_t get_return_txn_id()
const;
431 void set_stash_lp_id(uint8_t);
432 uint8_t get_stash_lp_id()
const;
435 void set_size(uint8_t);
436 uint8_t get_size()
const;
439 void set_max_flit(uint8_t data_id);
440 uint8_t get_max_flit()
const;
442 void set_mem_attr(uint8_t);
443 uint8_t get_mem_attr()
const;
445 void set_device(
bool is_device);
446 bool is_device()
const;
448 void set_ewa(
bool is_device);
451 void set_allocate(
bool is_device);
452 bool is_allocate()
const;
454 void set_cacheable(
bool is_device);
455 bool is_cacheable()
const;
458 void set_pcrd_type(uint8_t);
459 uint8_t get_pcrd_type()
const;
461 void set_endian(
bool);
462 bool is_endian()
const;
465 void set_order(uint8_t);
466 uint8_t get_order()
const;
469 void set_trace_tag(
bool tg =
true);
470 bool is_trace_tag()
const;
471 void set_opcode(chi::req_optype_e op);
472 chi::req_optype_e get_opcode()
const;
474 void set_return_n_id(uint16_t);
475 uint16_t get_return_n_id()
const;
477 void set_stash_n_id(uint16_t);
478 uint16_t get_stash_n_id()
const;
481 void set_stash_n_id_valid(
bool =
true);
482 bool is_stash_n_id_valid()
const;
484 void set_stash_lp_id_valid(
bool =
true);
485 bool is_stash_lp_id_valid()
const;
488 void set_non_secure(
bool =
true);
489 bool is_non_secure()
const;
492 void set_exp_comp_ack(
bool =
true);
493 bool is_exp_comp_ack()
const;
495 void set_allow_retry(
bool =
true);
496 bool is_allow_retry()
const;
498 void set_snp_attr(
bool =
true);
499 bool is_snp_attr()
const;
502 void set_excl(
bool =
true);
503 bool is_excl()
const;
506 void set_snoop_me(
bool =
true);
507 bool is_snoop_me()
const;
510 void set_likely_shared(
bool =
true);
511 bool is_likely_shared()
const;
514 void set_tag_op(uint8_t);
515 uint8_t get_tag_op()
const;
518 void set_tag_group_id(uint32_t);
519 uint32_t get_tag_group_id()
const;
522 void set_mpam(uint16_t);
523 uint16_t get_mpam()
const;
526 void set_rsvdc(uint32_t);
527 uint32_t get_rsvdc()
const;
530 uint8_t tgt_id{0}, lp_id{0}, return_txn_id{0}, stash_lp_id{0}, size{0}, max_flit{0}, mem_attr{0}, pcrd_type{0}, order{0};
531 bool endian{
false}, trace_tag{
false};
532 uint16_t return_n_id{0}, stash_n_id{0};
533 req_optype_e opcode{req_optype_e::ReqLCrdReturn};
534 bool stash_n_id_valid{
false}, stash_lp_id_valid{
false}, ns{
false}, exp_comp_ack{
false}, allow_retry{
false}, snp_attr{
false},
535 excl{
false}, snoop_me{
false}, likely_shared{
false};
536 uint32_t rsvdc{0}, tag_group_id{0};
548 void set_fwd_txn_id(uint8_t);
549 uint8_t get_fwd_txn_id()
const;
551 void set_stash_lp_id(uint8_t);
552 uint8_t get_stash_lp_id()
const;
555 void set_stash_lp_id_valid(
bool =
true);
556 bool is_stash_lp_id_valid()
const;
558 void set_vm_id_ext(uint8_t);
559 uint8_t get_vm_id_ext()
const;
561 void set_opcode(snp_optype_e opcode);
562 snp_optype_e get_opcode()
const;
564 void set_fwd_n_id(uint16_t);
565 uint16_t get_fwd_n_id()
const;
568 void set_non_secure(
bool =
true);
569 bool is_non_secure()
const;
572 void set_do_not_goto_sd(
bool =
true);
573 bool is_do_not_goto_sd()
const;
576 void set_do_not_data_pull(
bool =
true);
577 bool is_do_not_data_pull()
const;
580 void set_ret_to_src(
bool);
581 bool is_ret_to_src()
const;
584 void set_trace_tag(
bool =
true);
585 bool is_trace_tag()
const;
588 uint8_t fwd_txn_id{0}, stash_lp_id{0}, vm_id_ext{0};
589 bool stash_lp_id_valid{
false};
591 uint16_t fwd_n_id{0};
592 bool ns{
false}, do_not_goto_sd{
false}, do_not_data_pull{
false}, ret_to_src{
false}, trace_tag{
false};
602 void set_db_id(uint16_t);
603 uint16_t get_db_id()
const;
605 void set_opcode(dat_optype_e opcode);
606 dat_optype_e get_opcode()
const;
608 void set_resp_err(rsp_resperrtype_e);
609 rsp_resperrtype_e get_resp_err()
const;
611 void set_resp(dat_resptype_e);
612 dat_resptype_e get_resp()
const;
615 void set_fwd_state(uint8_t);
616 uint8_t get_fwd_state()
const;
619 void set_data_pull(uint8_t);
620 uint8_t get_data_pull()
const;
623 void set_data_source(uint8_t);
624 uint8_t get_data_source()
const;
627 void set_cc_id(uint8_t);
628 uint8_t get_cc_id()
const;
630 void set_data_id(uint8_t);
631 uint8_t get_data_id()
const;
633 void set_poison(uint8_t);
634 uint8_t get_poison()
const;
636 void set_tgt_id(uint16_t);
637 uint16_t get_tgt_id()
const;
640 void set_home_n_id(uint16_t);
641 uint16_t get_home_n_id()
const;
644 void set_rsvdc(uint32_t);
645 uint32_t get_rsvdc()
const;
647 void set_data_check(uint64_t);
648 uint64_t get_data_check()
const;
651 void set_trace_tag(
bool);
652 bool is_trace_tag()
const;
655 void set_tag_op(uint8_t);
656 uint8_t get_tag_op()
const;
658 void set_tag(uint64_t);
659 uint64_t get_tag()
const;
661 void set_tu(uint16_t);
662 uint16_t get_tu()
const;
665 uint64_t data_check{0};
669 uint16_t tgt_id{0}, home_n_id{0};
671 rsp_resperrtype_e resp_err{rsp_resperrtype_e::OK};
672 dat_resptype_e resp{dat_resptype_e::CompData_I};
673 dat_optype_e opcode{dat_optype_e::DataLCrdReturn};
674 uint8_t fwd_state{0}, data_pull{0}, data_source{0}, cc_id{0}, data_id{0}, poison{0};
676 bool trace_tag{
false};
686 void set_db_id(uint16_t);
687 uint16_t get_db_id()
const;
689 void set_pcrd_type(uint8_t);
690 uint8_t get_pcrd_type()
const;
692 void set_opcode(rsp_optype_e opcode);
693 rsp_optype_e get_opcode()
const;
695 void set_resp_err(rsp_resperrtype_e);
696 rsp_resperrtype_e get_resp_err()
const;
698 void set_resp(rsp_resptype_e);
699 rsp_resptype_e get_resp()
const;
702 void set_fwd_state(uint8_t);
703 uint8_t get_fwd_state()
const;
705 void set_data_pull(
bool);
706 bool get_data_pull()
const;
708 void set_tgt_id(uint16_t);
709 uint16_t get_tgt_id()
const;
712 void set_tag_op(uint8_t);
713 uint8_t get_tag_op()
const;
716 void set_tag_group_id(uint32_t);
717 uint32_t get_tag_group_id()
const;
719 void set_trace_tag(
bool);
720 bool is_trace_tag()
const;
723 uint32_t tag_group_id{0};
726 rsp_resperrtype_e resp_err{rsp_resperrtype_e::OK};
727 rsp_optype_e opcode{rsp_optype_e::INVALID};
728 rsp_resptype_e resp{rsp_resptype_e::SnpResp_I};
729 uint8_t pcrd_type{0}, fwd_state{0};
731 bool data_pull{
false};
732 bool trace_tag{
false};
737 credit(
short unsigned count, chi::credit_type_e type)
740 unsigned short count{1};
741 credit_type_e type{credit_type_e::LINK};
765 void set_txn_id(
unsigned int id) { cmn.
set_txn_id(
id); }
767 unsigned int get_txn_id()
const {
return cmn.
get_txn_id(); }
769 void set_src_id(
unsigned int id) { cmn.set_src_id(
id); }
771 unsigned int get_src_id()
const {
return cmn.get_src_id(); }
773 void set_qos(uint8_t qos) { cmn.set_qos(qos); }
775 unsigned int get_qos()
const {
return cmn.get_qos(); }
803 void set_txn_id(
unsigned int id) { cmn.
set_txn_id(
id); }
805 unsigned int get_txn_id()
const {
return cmn.
get_txn_id(); }
807 void set_src_id(
unsigned int id) { cmn.set_src_id(
id); }
809 unsigned int get_src_id()
const {
return cmn.get_src_id(); }
811 void set_qos(uint8_t qos) { cmn.set_qos(qos); }
813 unsigned int get_qos()
const {
return cmn.get_qos(); }
841 void set_txn_id(
unsigned int id) { cmn.
set_txn_id(
id); }
843 unsigned int get_txn_id()
const {
return cmn.
get_txn_id(); }
845 void set_src_id(
unsigned int id) { cmn.set_src_id(
id); }
847 unsigned int get_src_id()
const {
return cmn.get_src_id(); }
849 void set_qos(uint8_t qos) { cmn.set_qos(qos); }
851 unsigned int get_qos()
const {
return cmn.get_qos(); }
864 : credit(count, type) {}
884using chi_phase = tlm::tlm_phase;
891 typedef chi_phase tlm_phase_type;
904template <
typename TYPES = chi::chi_protocol_types>
using chi_fw_transport_if = tlm::tlm_fw_transport_if<TYPES>;
918 virtual void b_snoop(TRANS& trans, sc_core::sc_time& t) = 0;
924template <
typename TYPES = chi::chi_protocol_types>
928#if SC_VERSION_MAJOR < 3
929using type_index = sc_core::sc_type_index;
931using type_index = std::type_index;
939 sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND>
941:
public tlm::tlm_base_initiator_socket<BUSWIDTH, chi_fw_transport_if<TYPES>, chi_bw_transport_if<TYPES>, N, POL> {
959 const char*
kind()
const override {
return "chi_trx_initiator_socket"; }
960#if SYSTEMC_VERSION >= 20181013 || defined(NCSC)
965 type_index get_protocol_types()
const override {
return typeid(TYPES); }
974 sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND>
975struct chi_target_socket :
public tlm::tlm_base_target_socket<BUSWIDTH, chi_fw_transport_if<TYPES>, chi_bw_transport_if<TYPES>, N, POL> {
993 const char*
kind()
const override {
return "chi_trx_target_socket"; }
994#if SYSTEMC_VERSION >= 20181013 || defined(NCSC)
999 type_index get_protocol_types()
const override {
return typeid(TYPES); }
1006template <
typename EXT>
inline bool is_valid(EXT& ext) {
return is_valid_msg(&ext) ==
nullptr; }
1008template <
typename EXT>
bool is_valid(EXT* ext) {
return is_valid_msg(ext) ==
nullptr; }
1010template <
typename EXT>
char const* is_valid_msg(EXT* ext);
1012inline bool is_dataless(
const chi::chi_ctrl_extension* req_e) {
1013 switch(req_e->req.get_opcode()) {
1014 case chi::req_optype_e::CleanUnique:
1015 case chi::req_optype_e::MakeUnique:
1016 case chi::req_optype_e::Evict:
1017 case chi::req_optype_e::StashOnceUnique:
1018 case chi::req_optype_e::StashOnceSepUnique:
1019 case chi::req_optype_e::StashOnceShared:
1020 case chi::req_optype_e::StashOnceSepShared:
1021 case chi::req_optype_e::CleanShared:
1022 case chi::req_optype_e::CleanSharedPersist:
1023 case chi::req_optype_e::CleanSharedPersistSep:
1024 case chi::req_optype_e::CleanInvalid:
1025 case chi::req_optype_e::MakeInvalid:
1026 case chi::req_optype_e::WriteNoSnpZero:
1027 case chi::req_optype_e::WriteUniqueZero:
1029 case chi::req_optype_e::MakeReadUnique:
1030 switch(req_e->resp.get_opcode()) {
1031 case chi::rsp_optype_e::Comp:
1032 case chi::rsp_optype_e::CompPersist:
1033 case chi::rsp_optype_e::CompCMO:
1034 case chi::rsp_optype_e::CompStashDone:
1046inline bool is_dataless(
const chi::chi_snp_extension* req_e) {
1047 switch(req_e->req.get_opcode()) {
1048 case snp_optype_e::SnpLCrdReturn:
1049 case snp_optype_e::SnpShared:
1050 case snp_optype_e::SnpClean:
1051 case snp_optype_e::SnpOnce:
1052 case snp_optype_e::SnpNotSharedDirty:
1053 case snp_optype_e::SnpUnique:
1054 case snp_optype_e::SnpCleanShared:
1055 case snp_optype_e::SnpCleanInvalid:
1056 case snp_optype_e::SnpMakeInvalid:
1057 case snp_optype_e::SnpDVMOp:
1058 case snp_optype_e::SnpQuery:
1059 case snp_optype_e::SnpPreferUnique:
1060 case snp_optype_e::SnpPreferUniqueFwd:
1061 case snp_optype_e::SnpUniqueFwd:
1063 case snp_optype_e::SnpSharedFwd:
1064 case snp_optype_e::SnpCleanFwd:
1065 case snp_optype_e::SnpOnceFwd:
1066 case snp_optype_e::SnpNotSharedDirtyFwd:
1067 case snp_optype_e::SnpUniqueStash:
1068 case snp_optype_e::SnpMakeInvalidStash:
1069 case snp_optype_e::SnpStashUnique:
1070 case snp_optype_e::SnpStashShared:
1077inline bool is_atomic(
const chi::chi_ctrl_extension* req_e) {
1078 return req_e->req.get_opcode() >= chi::req_optype_e::AtomicStoreAdd && req_e->req.get_opcode() <= chi::req_optype_e::AtomicCompare;
1081inline bool is_request_order(
const chi::chi_ctrl_extension* req_e) {
1082 if(req_e->req.get_order() == 2) {
1083 switch(req_e->req.get_opcode()) {
1084 case chi::req_optype_e::ReadNoSnp:
1085 case chi::req_optype_e::ReadNoSnpSep:
1086 case chi::req_optype_e::ReadOnce:
1087 case chi::req_optype_e::ReadOnceCleanInvalid:
1088 case chi::req_optype_e::ReadOnceMakeInvalid:
1089 case chi::req_optype_e::WriteNoSnpFull:
1090 case chi::req_optype_e::WriteNoSnpFullCleanInv:
1091 case chi::req_optype_e::WriteNoSnpFullCleanSh:
1092 case chi::req_optype_e::WriteNoSnpFullCleanShPerSep:
1093 case chi::req_optype_e::WriteNoSnpPtl:
1094 case chi::req_optype_e::WriteNoSnpPtlCleanInv:
1095 case chi::req_optype_e::WriteNoSnpPtlCleanSh:
1096 case chi::req_optype_e::WriteNoSnpPtlCleanShPerSep:
1097 case chi::req_optype_e::WriteUniqueFull:
1098 case chi::req_optype_e::WriteUniqueFullCleanSh:
1099 case chi::req_optype_e::WriteUniqueFullCleanShPerSep:
1100 case chi::req_optype_e::WriteUniqueFullStash:
1101 case chi::req_optype_e::WriteUniquePtl:
1102 case chi::req_optype_e::WriteUniquePtlCleanSh:
1103 case chi::req_optype_e::WriteUniquePtlCleanShPerSep:
1104 case chi::req_optype_e::WriteUniquePtlStash:
1105 case chi::req_optype_e::WriteUniqueZero:
1110 return is_atomic(req_e);
1123template <>
struct enable_for_enum<rsp_resperrtype_e> {
static const bool enable =
true; };
1125template <>
inline req_optype_e
into<req_optype_e>(
typename std::underlying_type<req_optype_e>::type t) {
1126 assert(t <=
static_cast<std::underlying_type<req_optype_e>::type
>(req_optype_e::ILLEGAL));
1127 return static_cast<req_optype_e
>(t);
1130template <>
inline snp_optype_e into<snp_optype_e>(
typename std::underlying_type<snp_optype_e>::type t) {
1131 assert(t <=
static_cast<std::underlying_type<snp_optype_e>::type
>(snp_optype_e::ILLEGAL));
1132 return static_cast<snp_optype_e
>(t);
1135template <>
inline dat_optype_e
into<dat_optype_e>(
typename std::underlying_type<dat_optype_e>::type t) {
1136 assert(t <=
static_cast<std::underlying_type<dat_optype_e>::type
>(dat_optype_e::NCBWrDataCompAck));
1137 return static_cast<dat_optype_e
>(t);
1140template <>
inline dat_resptype_e
into<dat_resptype_e>(
typename std::underlying_type<dat_resptype_e>::type t) {
1141 assert(t <=
static_cast<std::underlying_type<dat_resptype_e>::type
>(dat_resptype_e::CopyBackWrData_SD_PD));
1142 return static_cast<dat_resptype_e
>(t);
1145template <>
inline rsp_optype_e
into<rsp_optype_e>(
typename std::underlying_type<rsp_optype_e>::type t) {
1146 assert(t >=
static_cast<typename std::underlying_type<rsp_optype_e>::type
>(rsp_optype_e::RespLCrdReturn) &&
1147 t <
static_cast<std::underlying_type<rsp_optype_e>::type
>(rsp_optype_e::INVALID));
1148 return static_cast<rsp_optype_e
>(t);
1151template <>
inline rsp_resptype_e
into<rsp_resptype_e>(
typename std::underlying_type<rsp_resptype_e>::type t) {
1152 assert(t <=
static_cast<std::underlying_type<rsp_resptype_e>::type
>(rsp_resptype_e::SnpResp_SD));
1153 return static_cast<rsp_resptype_e
>(t);
1156template <>
inline rsp_resperrtype_e
into<rsp_resperrtype_e>(
typename std::underlying_type<rsp_resperrtype_e>::type t) {
1157 assert(t <=
static_cast<std::underlying_type<rsp_resperrtype_e>::type
>(rsp_resperrtype_e::NDERR));
1158 return static_cast<rsp_resperrtype_e
>(t);
1167 sc_assert(txn_id <= 4096);
1168 this->txn_id = txn_id;
1196inline void request::set_tgt_id(uint8_t
id) { tgt_id = id; }
1197inline uint8_t request::get_tgt_id()
const {
return tgt_id; }
1201inline void request::set_lp_id(uint8_t
id) { lp_id = id; }
1202inline uint8_t request::get_lp_id()
const {
return lp_id; }
1206inline void request::set_return_txn_id(uint8_t
id) { return_txn_id = id; }
1207inline uint8_t request::get_return_txn_id()
const {
return return_txn_id; }
1210inline void request::set_stash_lp_id(uint8_t
id) { stash_lp_id = id; }
1211inline uint8_t request::get_stash_lp_id()
const {
return stash_lp_id; }
1215inline void request::set_size(uint8_t sz) {
1219inline uint8_t request::get_size()
const {
return size; }
1222inline void request::set_max_flit(uint8_t data_id) { max_flit = data_id; }
1223inline uint8_t request::get_max_flit()
const {
return max_flit; }
1227inline void request::set_mem_attr(uint8_t mem_attr) {
1228 assert(mem_attr < 16);
1229 this->mem_attr = mem_attr;
1231inline uint8_t request::get_mem_attr()
const {
return mem_attr; }
1233inline void request::set_device(
bool is_device) {
1235 this->mem_attr |= 2;
1237 this->mem_attr &= ~2U;
1239inline bool request::is_device()
const {
return this->mem_attr & 2; }
1240inline void request::set_ewa(
bool is_device) {
1242 this->mem_attr |= 1;
1244 this->mem_attr &= ~1U;
1246inline bool request::is_ewa()
const {
return this->mem_attr & 1; }
1247inline void request::set_allocate(
bool is_device) {
1249 this->mem_attr |= 8;
1251 this->mem_attr &= ~8U;
1253inline bool request::is_allocate()
const {
return this->mem_attr & 8; }
1254inline void request::set_cacheable(
bool is_device) {
1256 this->mem_attr |= 4;
1258 this->mem_attr &= ~4U;
1260inline bool request::is_cacheable()
const {
return this->mem_attr & 4; }
1264inline void request::set_pcrd_type(uint8_t pcrd_type) { this->pcrd_type = pcrd_type; }
1265inline uint8_t request::get_pcrd_type()
const {
return pcrd_type; }
1268inline void request::set_endian(
bool endian) { this->endian = endian; }
1269inline bool request::is_endian()
const {
return this->endian; }
1273inline void request::set_order(uint8_t order) { this->order = order; }
1274inline uint8_t request::get_order()
const {
return this->order; }
1278inline void request::set_trace_tag(
bool trace_tag) { this->trace_tag = trace_tag; }
1279inline bool request::is_trace_tag()
const {
return trace_tag; }
1281inline void request::set_opcode(req_optype_e opcode) { this->opcode = opcode; }
1282inline req_optype_e request::get_opcode()
const {
return opcode; }
1285inline void request::set_return_n_id(uint16_t return_n_id) { this->return_n_id = return_n_id; }
1286inline uint16_t request::get_return_n_id()
const {
return return_n_id; }
1289inline void request::set_stash_n_id(uint16_t stash_n_id) { this->stash_n_id = stash_n_id; }
1290inline uint16_t request::get_stash_n_id()
const {
return stash_n_id; }
1294inline void request::set_stash_n_id_valid(
bool stash_n_id_valid) { this->stash_n_id_valid = stash_n_id_valid; }
1295inline bool request::is_stash_n_id_valid()
const {
return stash_n_id_valid; }
1298inline void request::set_stash_lp_id_valid(
bool stash_lp_id_valid) { this->stash_lp_id_valid = stash_lp_id_valid; }
1299inline bool request::is_stash_lp_id_valid()
const {
return stash_lp_id_valid; }
1303inline void request::set_non_secure(
bool ns) { this->ns = ns; }
1304inline bool request::is_non_secure()
const {
return ns; }
1308inline void request::set_exp_comp_ack(
bool exp_comp_ack) { this->exp_comp_ack = exp_comp_ack; }
1309inline bool request::is_exp_comp_ack()
const {
return exp_comp_ack; }
1312inline void request::set_allow_retry(
bool allow_retry) { this->allow_retry = allow_retry; }
1313inline bool request::is_allow_retry()
const {
return allow_retry; }
1316inline void request::set_snp_attr(
bool snp_attr) { this->snp_attr = snp_attr; }
1317inline bool request::is_snp_attr()
const {
return snp_attr; }
1321inline void request::set_excl(
bool excl) { this->excl = excl; }
1322inline bool request::is_excl()
const {
return this->excl; }
1326inline void request::set_snoop_me(
bool snoop_me) { this->snoop_me = snoop_me; }
1327inline bool request::is_snoop_me()
const {
return snoop_me; }
1331inline void request::set_likely_shared(
bool likely_shared) { this->likely_shared = likely_shared; }
1332inline bool request::is_likely_shared()
const {
return likely_shared; }
1336inline void request::set_rsvdc(uint32_t rsvdc) { this->rsvdc = rsvdc; }
1337inline uint32_t request::get_rsvdc()
const {
return rsvdc; }
1339inline void request::set_tag_op(uint8_t tag_op) { this->tag_op = tag_op; }
1340inline uint8_t request::get_tag_op()
const {
return tag_op; }
1341inline void request::set_tag_group_id(uint32_t tag_group_id) { this->tag_group_id = tag_group_id; }
1342inline uint32_t request::get_tag_group_id()
const {
return tag_group_id; }
1343inline void request::set_mpam(uint16_t mpam) { this->mpam = mpam; }
1344inline uint16_t request::get_mpam()
const {
return mpam; }
1350inline void snp_request::set_fwd_txn_id(uint8_t fwd_txn_id) { this->fwd_txn_id = fwd_txn_id; }
1351inline uint8_t snp_request::get_fwd_txn_id()
const {
return fwd_txn_id; }
1354inline void snp_request::set_stash_lp_id(uint8_t stash_lp_id) { this->stash_lp_id = stash_lp_id; }
1355inline uint8_t snp_request::get_stash_lp_id()
const {
return stash_lp_id; }
1358inline void snp_request::set_stash_lp_id_valid(
bool stash_lp_id_valid) { this->stash_lp_id_valid = stash_lp_id_valid; }
1359inline bool snp_request::is_stash_lp_id_valid()
const {
return stash_lp_id_valid; }
1362inline void snp_request::set_vm_id_ext(uint8_t vm_id_ext) { this->vm_id_ext = vm_id_ext; }
1363inline uint8_t snp_request::get_vm_id_ext()
const {
return vm_id_ext; }
1366inline void snp_request::set_fwd_n_id(uint16_t fwd_n_id) { this->fwd_n_id = fwd_n_id; }
1367inline uint16_t snp_request::get_fwd_n_id()
const {
return fwd_n_id; }
1369inline void snp_request::set_opcode(snp_optype_e opcode) {
1371 this->opcode = opcode;
1373inline snp_optype_e snp_request::get_opcode()
const {
return opcode; }
1377inline void snp_request::set_non_secure(
bool non_secure)
1379 this->ns = non_secure;
1381inline bool snp_request::is_non_secure() const
1388inline void snp_request::set_do_not_goto_sd(
bool do_not_goto_sd) { this->do_not_goto_sd = do_not_goto_sd; }
1389inline bool snp_request::is_do_not_goto_sd()
const {
return do_not_goto_sd; }
1393inline void snp_request::set_do_not_data_pull(
bool do_not_data_pull) { this->do_not_data_pull = do_not_data_pull; }
1394inline bool snp_request::is_do_not_data_pull()
const {
return do_not_data_pull; }
1398inline void snp_request::set_ret_to_src(
bool ret_to_src) { this->ret_to_src = ret_to_src; }
1399inline bool snp_request::is_ret_to_src()
const {
return ret_to_src; }
1403inline void snp_request::set_trace_tag(
bool trace_tag) { this->trace_tag = trace_tag; }
1404inline bool snp_request::is_trace_tag()
const {
return trace_tag; }
1412inline void data::set_db_id(uint16_t db_id) { this->db_id = db_id; }
1413inline uint16_t data::get_db_id()
const {
return db_id; }
1417inline void data::set_resp_err(rsp_resperrtype_e resp_err) { this->resp_err = resp_err; }
1418inline rsp_resperrtype_e data::get_resp_err()
const {
return resp_err; }
1421inline void data::set_resp(dat_resptype_e resp) { this->resp = resp; }
1422inline dat_resptype_e data::get_resp()
const {
return resp; }
1425inline void data::set_fwd_state(uint8_t fwd_state) { this->fwd_state = fwd_state; }
1426inline uint8_t data::get_fwd_state()
const {
return fwd_state; }
1430inline void data::set_data_pull(uint8_t data_pull) { this->data_pull = data_pull; }
1431inline uint8_t data::get_data_pull()
const {
return data_pull; }
1434inline void chi::data::set_data_source(uint8_t data_source) { this->data_source = data_source; }
1435inline uint8_t data::get_data_source()
const {
return data_source; }
1439inline void data::set_cc_id(uint8_t cc_id) { this->cc_id = cc_id; }
1440inline uint8_t data::get_cc_id()
const {
return cc_id; }
1443inline void data::set_data_id(uint8_t data_id) { this->data_id = data_id; }
1444inline uint8_t data::get_data_id()
const {
return data_id; }
1447inline void data::set_poison(uint8_t poison) { this->poison = poison; }
1448inline uint8_t data::get_poison()
const {
return poison; }
1451inline void data::set_tgt_id(uint16_t tgt_id) { this->tgt_id = tgt_id; }
1452inline uint16_t data::get_tgt_id()
const {
return tgt_id; }
1456inline void data::set_home_n_id(uint16_t home_n_id) { this->home_n_id = home_n_id; }
1457inline uint16_t data::get_home_n_id()
const {
return home_n_id; }
1461inline void data::set_rsvdc(uint32_t rsvdc) { this->rsvdc = rsvdc; }
1462inline uint32_t data::get_rsvdc()
const {
return rsvdc; }
1465inline void data::set_data_check(uint64_t data_check) { this->data_check = data_check; }
1466inline uint64_t data::get_data_check()
const {
return data_check; }
1468inline void data::set_opcode(dat_optype_e opcode) { this->opcode = opcode; }
1469inline dat_optype_e data::get_opcode()
const {
return opcode; }
1473inline void data::set_trace_tag(
bool trace_tag) { this->trace_tag = trace_tag; }
1474inline bool data::is_trace_tag()
const {
return trace_tag; }
1476inline void data::set_tag_op(uint8_t tag_op) { this->tag_op = tag_op; }
1477inline uint8_t data::get_tag_op()
const {
return tag_op; }
1478inline void data::set_tag(uint64_t tag) { this->tag = tag; }
1479inline uint64_t data::get_tag()
const {
return tag; }
1480inline void data::set_tu(uint16_t tu) { this->tu = tu; }
1481inline uint16_t data::get_tu()
const {
return tu; }
1489inline void response::set_db_id(uint16_t db_id) { this->db_id = db_id; }
1490inline uint16_t response::get_db_id()
const {
return db_id; }
1493inline void response::set_pcrd_type(uint8_t pcrd_type) { this->pcrd_type = pcrd_type; }
1494inline uint8_t response::get_pcrd_type()
const {
return pcrd_type; }
1498inline void response::set_resp_err(rsp_resperrtype_e resp_err) { this->resp_err = resp_err; }
1499inline rsp_resperrtype_e response::get_resp_err()
const {
return resp_err; }
1502inline void response::set_resp(rsp_resptype_e resp) { this->resp = resp; }
1503inline rsp_resptype_e response::get_resp()
const {
return resp; }
1506inline void response::set_fwd_state(uint8_t fwd_state) { this->fwd_state = fwd_state; }
1507inline uint8_t response::get_fwd_state()
const {
return fwd_state; }
1511inline void response::set_data_pull(
bool data_pull) { this->data_pull = data_pull; }
1512inline bool response::get_data_pull()
const {
return data_pull; }
1515inline void response::set_tgt_id(uint16_t tgt_id) { this->tgt_id = tgt_id; }
1516inline uint16_t response::get_tgt_id()
const {
return tgt_id; }
1517inline void response::set_opcode(rsp_optype_e opcode) { this->opcode = opcode; }
1518inline rsp_optype_e response::get_opcode()
const {
return opcode; }
1520inline void response::set_tag_op(uint8_t tag_op) { this->tag_op = tag_op; }
1521inline uint8_t response::get_tag_op()
const {
return tag_op; }
1522inline void response::set_tag_group_id(uint32_t tag_group_id) { this->tag_group_id = tag_group_id; }
1523inline uint32_t response::get_tag_group_id()
const {
return tag_group_id; }
1526inline void response::set_trace_tag(
bool trace_tag) { this->trace_tag = trace_tag; }
1527inline bool response::is_trace_tag()
const {
return trace_tag; }
virtual void b_snoop(TRANS &trans, sc_core::sc_time &t)=0
snoop access to a snooped master
TLM2.0 components modeling CHI.
constexpr ULT to_int(E t)
tlm::tlm_fw_transport_if< TYPES > chi_fw_transport_if
alias declaration for the forward interface
const char * to_char(E t)
DECLARE_EXTENDED_PHASE(BEGIN_PARTIAL_DATA)
E into(typename std::underlying_type< E >::type t)
tlm::tlm_generic_payload chi_payload
aliases for payload and phase types
void copy_from(tlm::tlm_extension_base const &ext)
deep copy all values from ext
chi_credit_extension()=default
the default constructor
tlm::tlm_extension_base * clone() const
the copy constructor
chi_ctrl_extension()=default
the default constructor
chi_ctrl_extension(const chi_ctrl_extension &o)=default
the copy constructor
void copy_from(tlm::tlm_extension_base const &ext)
deep copy all values from ext
tlm::tlm_extension_base * clone() const
the clone function to create deep copies of
void copy_from(tlm::tlm_extension_base const &ext)
deep copy all values from ext
tlm::tlm_extension_base * clone() const
the copy constructor
chi_data_extension()=default
the default constructor
chi_initiator_socket()
default constructor using a generated instance name
const char * kind() const override
get the kind of this sc_object
tlm::tlm_base_initiator_socket< BUSWIDTH, chi_fw_transport_if< TYPES >, chi_bw_transport_if< TYPES >, N, POL > base_type
base type alias
chi_initiator_socket(const char *name)
constructor with instance name
The AXI protocol traits class. Since the protocoll defines additional non-ignorable phases a dedicate...
void copy_from(tlm::tlm_extension_base const &ext)
deep copy all values from ext
chi_snp_extension()=default
the default constructor
tlm::tlm_extension_base * clone() const
the copy constructor
chi_target_socket()
default constructor using a generated instance name
tlm::tlm_base_target_socket< BUSWIDTH, chi_fw_transport_if< TYPES >, chi_bw_transport_if< TYPES >, N, POL > base_type
base type alias
const char * kind() const override
get the kind of this sc_object
chi_target_socket(const char *name)
constructor with instance name
void set_src_id(unsigned int)
unsigned int get_src_id() const
common()=default
the constructori
void set_txn_id(unsigned int)
common & operator=(const common &o)
reset all data member to their default
void set_qos(uint8_t qos)
unsigned int get_qos() const
unsigned int get_txn_id() const