22 #include <type_traits>
29 template <
typename Enum>
struct enable_for_enum {
static const bool value =
false; };
35 template <
typename E>
inline E
into(
typename std::underlying_type<E>::type t);
42 typename E,
typename ULT =
typename std::underlying_type<E>::type,
43 typename X =
typename std::enable_if<std::is_enum<E>::value && !std::is_convertible<E, ULT>::value,
bool>::type>
45 return static_cast<typename std::underlying_type<E>::type
>(t);
52 template <
typename E>
const char*
to_char(E t);
59 template <typename E, typename std::enable_if<enable_for_enum<E>::value,
bool>::type>
60 inline std::ostream& operator<<(std::ostream& os, E e) {
65 std::ostream& operator<<(std::ostream& os, tlm::tlm_generic_payload
const& t);
68 enum class req_optype_e : uint8_t {
89 CleanSharedPersistSep = 0x13,
91 WriteEvictFull = 0x15,
93 WriteCleanFull = 0x17,
94 WriteUniquePtl = 0x18,
95 WriteUniqueFull = 0x19,
99 WriteNoSnpFull = 0x1D,
101 WriteUniqueFullStash = 0x20,
102 WriteUniquePtlStash = 0x21,
103 StashOnceShared = 0x22,
104 StashOnceUnique = 0x23,
105 ReadOnceCleanInvalid = 0x24,
106 ReadOnceMakeInvalid = 0x25,
107 ReadNotSharedDirty = 0x26,
108 CleanSharedPersist = 0x27,
109 AtomicStoreAdd = 0x28,
110 AtomicStoreClr = 0x29,
111 AtomicStoreEor = 0x2A,
112 AtomicStoreSet = 0x2B,
113 AtomicStoreSmax = 0x2C,
114 AtomicStoreSmin = 0x2D,
115 AtomicStoreUmax = 0x2E,
116 AtomicStoreUmin = 0x2F,
117 AtomicLoadAdd = 0x30,
118 AtomicLoadClr = 0x31,
119 AtomicLoadEor = 0x32,
120 AtomicLoadSet = 0x33,
121 AtomicLoadSmax = 0x34,
122 AtomicLoadSmin = 0x35,
123 AtomicLoadUmax = 0x36,
124 AtomicLoadUmin = 0x37,
126 AtomicCompare = 0x39,
130 MakeReadUnique = 0x41,
131 WriteEvictOrEvict = 0x42,
132 WriteUniqueZero = 0x43,
133 WriteNoSnpZero = 0x44,
135 StashOnceSepShared = 0x47,
136 StashOnceSepUnique = 0x48,
138 ReadPreferUnique = 0x4c,
140 WriteNoSnpFullCleanSh = 0x50,
141 WriteNoSnpFullCleanInv = 0x51,
142 WriteNoSnpFullCleanShPerSep = 0x52,
144 WriteUniqueFullCleanSh = 0x54,
146 WriteUniqueFullCleanShPerSep = 0x56,
148 WriteBackFullCleanSh = 0x58,
149 WriteBackFullCleanInv = 0x59,
150 WriteBackFullCleanShPerSep = 0x5A,
152 WriteCleanFullCleanSh = 0x5c,
154 WriteCleanFullCleanShPerSep = 0x5e,
156 WriteNoSnpPtlCleanSh = 0x60,
157 WriteNoSnpPtlCleanInv = 0x61,
158 WriteNoSnpPtlCleanShPerSep = 0x62,
160 WriteUniquePtlCleanSh = 0x64,
162 WriteUniquePtlCleanShPerSep = 0x66,
168 enum class snp_optype_e : uint8_t {
169 SnpLCrdReturn = 0x00,
173 SnpNotSharedDirty = 0x04,
174 SnpUniqueStash = 0x05,
175 SnpMakeInvalidStash = 0x06,
177 SnpCleanShared = 0x08,
178 SnpCleanInvalid = 0x09,
179 SnpMakeInvalid = 0x0A,
180 SnpStashUnique = 0x0B,
181 SnpStashShared = 0x0c,
187 SnpNotSharedDirtyFwd = 0x14,
188 SnpPreferUnique = 0x15,
189 SnpPreferUniqueFwd = 0x16,
197 enum class dat_optype_e : uint8_t {
198 DataLCrdReturn = 0x0,
200 CopyBackWrData = 0x2,
201 NonCopyBackWrData = 0x3,
203 SnpRespDataPtl = 0x5,
204 SnpRespDataFwded = 0x6,
205 WriteDataCancel = 0x7,
207 NCBWrDataCompAck = 0xC,
212 SnpRespData_UC = 0x1,
213 SnpRespData_UD = 0x1,
214 SnpRespData_SC = 0x1,
215 SnpRespData_SD = 0x1,
216 SnpRespData_I_PD = 0x1,
217 SnpRespData_UC_PD = 0x1,
218 SnpRespData_SC_PD = 0x1,
219 SnpRespDataPtl_I_PD = 0x5,
220 SnpRespDataPtl_UD = 0x5,
222 SnpRespData_I_Fwded_SC = 0x6,
223 SnpRespData_I_Fwded_SD_PD = 0x6,
224 SnpRespData_SC_Fwded_SC = 0x6,
225 SnpRespData_SC_Fwded_SD_PD = 0x6,
226 SnpRespData_SD_Fwded_SC = 0x6,
227 SnpRespData_I_PD_Fwded_I = 0x6,
228 SnpRespData_I_PD_Fwded_SC = 0x6,
229 SnpRespData_SC_PD_Fwded_I = 0x6,
230 SnpRespData_SC_PD_Fwded_SC = 0x6
234 enum class dat_resptype_e : uint8_t {
239 CompData_UD_PD = 0b110,
240 CompData_SD_PD = 0b111,
241 DataSepResp_I = 0b000,
242 DataSepResp_SC = 0b001,
243 DataSepResp_UC = 0b010,
244 RespSepData_I = 0b000,
245 RespSepData_SC = 0b001,
246 RespSepData_UC = 0b010,
248 SnpRespData_I = 0b000,
249 SnpRespData_UC = 0b010,
250 SnpRespData_UD = 0b010,
251 SnpRespData_SC = 0b001,
252 SnpRespData_SD = 0b011,
253 SnpRespData_I_PD = 0b100,
254 SnpRespData_UC_PD = 0b110,
255 SnpRespData_SC_PD = 0b101,
256 SnpRespDataPtl_I_PD = 0b100,
257 SnpRespDataPtl_UD = 0b010,
264 CopyBackWrData_I = 0b000,
265 CopyBackWrData_UC = 0b010,
266 CopyBackWrData_SC = 0b001,
267 CopyBackWrData_UD_PD = 0b110,
268 CopyBackWrData_SD_PD = 0b111,
269 NonCopyBackWrData = 0b000,
270 NCBWrDataCompAck = 0b000
274 enum class rsp_optype_e : uint8_t {
275 RespLCrdReturn = 0x0,
292 CompStashDone = 0x11,
299 enum class rsp_resptype_e : uint8_t {
312 SnpRespData_I = 0b000,
313 SnpRespData_UC = 0b010,
314 SnpRespData_UD = 0b010,
315 SnpRespData_SC = 0b001,
316 SnpRespData_SD = 0b011,
317 SnpRespData_I_PD = 0b100,
318 SnpRespData_UC_PD = 0b110,
319 SnpRespData_SC_PD = 0b101,
320 SnpRespDataPtl_I_PD = 0b100,
321 SnpRespDataPtl_UD = 0b010,
324 enum class rsp_resperrtype_e : uint8_t {
331 enum class credit_type_e : uint8_t {
344 BranchPredictorInvalidate = 0x1,
357 DVMVAValidMask = 0x1,
422 void set_tgt_id(uint8_t);
423 uint8_t get_tgt_id()
const;
426 void set_lp_id(uint8_t);
427 uint8_t get_lp_id()
const;
430 void set_return_txn_id(uint8_t);
431 uint8_t get_return_txn_id()
const;
433 void set_stash_lp_id(uint8_t);
434 uint8_t get_stash_lp_id()
const;
437 void set_size(uint8_t);
438 uint8_t get_size()
const;
441 void set_max_flit(uint8_t data_id);
442 uint8_t get_max_flit()
const;
444 void set_mem_attr(uint8_t);
445 uint8_t get_mem_attr()
const;
447 void set_device(
bool is_device);
448 bool is_device()
const;
450 void set_ewa(
bool is_device);
453 void set_allocate(
bool is_device);
454 bool is_allocate()
const;
456 void set_cacheable(
bool is_device);
457 bool is_cacheable()
const;
460 void set_pcrd_type(uint8_t);
461 uint8_t get_pcrd_type()
const;
463 void set_endian(
bool);
464 bool is_endian()
const;
467 void set_order(uint8_t);
468 uint8_t get_order()
const;
471 void set_trace_tag(
bool tg =
true);
472 bool is_trace_tag()
const;
473 void set_opcode(chi::req_optype_e op);
474 chi::req_optype_e get_opcode()
const;
476 void set_return_n_id(uint16_t);
477 uint16_t get_return_n_id()
const;
479 void set_stash_n_id(uint16_t);
480 uint16_t get_stash_n_id()
const;
483 void set_stash_n_id_valid(
bool =
true);
484 bool is_stash_n_id_valid()
const;
486 void set_stash_lp_id_valid(
bool =
true);
487 bool is_stash_lp_id_valid()
const;
490 void set_non_secure(
bool =
true);
491 bool is_non_secure()
const;
494 void set_exp_comp_ack(
bool =
true);
495 bool is_exp_comp_ack()
const;
497 void set_allow_retry(
bool =
true);
498 bool is_allow_retry()
const;
500 void set_snp_attr(
bool =
true);
501 bool is_snp_attr()
const;
504 void set_excl(
bool =
true);
505 bool is_excl()
const;
508 void set_snoop_me(
bool =
true);
509 bool is_snoop_me()
const;
512 void set_likely_shared(
bool =
true);
513 bool is_likely_shared()
const;
516 void set_tag_op(uint8_t);
517 uint8_t get_tag_op()
const;
520 void set_tag_group_id(uint32_t);
521 uint32_t get_tag_group_id()
const;
524 void set_mpam(uint16_t);
525 uint16_t get_mpam()
const;
528 void set_rsvdc(uint32_t);
529 uint32_t get_rsvdc()
const;
532 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},
534 bool endian{
false}, trace_tag{
false};
535 uint16_t return_n_id{0}, stash_n_id{0};
536 req_optype_e opcode{req_optype_e::ReqLCrdReturn};
537 bool stash_n_id_valid{
false}, stash_lp_id_valid{
false}, ns{
false}, exp_comp_ack{
false}, allow_retry{
false},
538 snp_attr{
false}, excl{
false}, snoop_me{
false}, likely_shared{
false};
539 uint32_t rsvdc{0}, tag_group_id{0};
551 void set_fwd_txn_id(uint8_t);
552 uint8_t get_fwd_txn_id()
const;
554 void set_stash_lp_id(uint8_t);
555 uint8_t get_stash_lp_id()
const;
558 void set_stash_lp_id_valid(
bool =
true);
559 bool is_stash_lp_id_valid()
const;
561 void set_vm_id_ext(uint8_t);
562 uint8_t get_vm_id_ext()
const;
564 void set_opcode(snp_optype_e opcode);
565 snp_optype_e get_opcode()
const;
567 void set_fwd_n_id(uint16_t);
568 uint16_t get_fwd_n_id()
const;
571 void set_non_secure(
bool =
true);
572 bool is_non_secure()
const;
575 void set_do_not_goto_sd(
bool =
true);
576 bool is_do_not_goto_sd()
const;
579 void set_do_not_data_pull(
bool =
true);
580 bool is_do_not_data_pull()
const;
583 void set_ret_to_src(
bool);
584 bool is_ret_to_src()
const;
587 void set_trace_tag(
bool =
true);
588 bool is_trace_tag()
const;
591 uint8_t fwd_txn_id{0}, stash_lp_id{0}, vm_id_ext{0};
592 bool stash_lp_id_valid{
false};
594 uint16_t fwd_n_id{0};
595 bool ns{
false}, do_not_goto_sd{
false}, do_not_data_pull{
false}, ret_to_src{
false}, trace_tag{
false};
605 void set_db_id(uint8_t);
606 uint8_t get_db_id()
const;
608 void set_opcode(dat_optype_e opcode);
609 dat_optype_e get_opcode()
const;
611 void set_resp_err(rsp_resperrtype_e);
612 rsp_resperrtype_e get_resp_err()
const;
614 void set_resp(dat_resptype_e);
615 dat_resptype_e get_resp()
const;
618 void set_fwd_state(uint8_t);
619 uint8_t get_fwd_state()
const;
622 void set_data_pull(uint8_t);
623 uint8_t get_data_pull()
const;
626 void set_data_source(uint8_t);
627 uint8_t get_data_source()
const;
630 void set_cc_id(uint8_t);
631 uint8_t get_cc_id()
const;
633 void set_data_id(uint8_t);
634 uint8_t get_data_id()
const;
636 void set_poison(uint8_t);
637 uint8_t get_poison()
const;
639 void set_tgt_id(uint16_t);
640 uint16_t get_tgt_id()
const;
643 void set_home_n_id(uint16_t);
644 uint16_t get_home_n_id()
const;
647 void set_rsvdc(uint32_t);
648 uint32_t get_rsvdc()
const;
650 void set_data_check(uint64_t);
651 uint64_t get_data_check()
const;
654 void set_trace_tag(
bool);
655 bool is_trace_tag()
const;
658 void set_tag_op(uint8_t);
659 uint8_t get_tag_op()
const;
661 void set_tag(uint64_t);
662 uint64_t get_tag()
const;
664 void set_tu(uint16_t);
665 uint16_t get_tu()
const;
669 rsp_resperrtype_e resp_err{rsp_resperrtype_e::OK};
670 dat_resptype_e resp{dat_resptype_e::CompData_I};
671 uint8_t fwd_state{0}, data_pull{0}, data_source{0}, cc_id{0}, data_id{0}, poison{0};
672 uint16_t tgt_id{0}, home_n_id{0};
673 dat_optype_e opcode{dat_optype_e::DataLCrdReturn};
675 uint64_t data_check{0};
679 bool trace_tag{
false};
689 void set_db_id(uint8_t);
690 uint8_t get_db_id()
const;
692 void set_pcrd_type(uint8_t);
693 uint8_t get_pcrd_type()
const;
695 void set_opcode(rsp_optype_e opcode);
696 rsp_optype_e get_opcode()
const;
698 void set_resp_err(rsp_resperrtype_e);
699 rsp_resperrtype_e get_resp_err()
const;
701 void set_resp(rsp_resptype_e);
702 rsp_resptype_e get_resp()
const;
705 void set_fwd_state(uint8_t);
706 uint8_t get_fwd_state()
const;
708 void set_data_pull(
bool);
709 bool get_data_pull()
const;
711 void set_tgt_id(uint16_t);
712 uint16_t get_tgt_id()
const;
715 void set_tag_op(uint8_t);
716 uint8_t get_tag_op()
const;
719 void set_tag_group_id(uint32_t);
720 uint32_t get_tag_group_id()
const;
722 void set_trace_tag(
bool);
723 bool is_trace_tag()
const;
726 uint8_t db_id{0}, pcrd_type{0}, fwd_state{0};
727 rsp_resperrtype_e resp_err{rsp_resperrtype_e::OK};
728 bool data_pull{
false};
729 rsp_optype_e opcode{rsp_optype_e::INVALID};
730 rsp_resptype_e resp{rsp_resptype_e::SnpResp_I};
731 uint32_t tag_group_id{0};
734 bool trace_tag{
false};
739 credit(
short unsigned count, chi::credit_type_e type)
742 unsigned short count{1};
743 credit_type_e type{credit_type_e::LINK};
769 void set_txn_id(
unsigned int id) { cmn.
set_txn_id(
id); }
771 unsigned int get_txn_id()
const {
return cmn.
get_txn_id(); }
773 void set_src_id(
unsigned int id) { cmn.
set_src_id(
id); }
775 unsigned int get_src_id()
const {
return cmn.
get_src_id(); }
777 void set_qos(uint8_t qos) { cmn.
set_qos(qos); }
779 unsigned int get_qos()
const {
return cmn.
get_qos(); }
807 void set_txn_id(
unsigned int id) { cmn.
set_txn_id(
id); }
809 unsigned int get_txn_id()
const {
return cmn.
get_txn_id(); }
811 void set_src_id(
unsigned int id) { cmn.
set_src_id(
id); }
813 unsigned int get_src_id()
const {
return cmn.
get_src_id(); }
815 void set_qos(uint8_t qos) { cmn.
set_qos(qos); }
817 unsigned int get_qos()
const {
return cmn.
get_qos(); }
847 void set_txn_id(
unsigned int id) { cmn.
set_txn_id(
id); }
849 unsigned int get_txn_id()
const {
return cmn.
get_txn_id(); }
851 void set_src_id(
unsigned int id) { cmn.
set_src_id(
id); }
853 unsigned int get_src_id()
const {
return cmn.
get_src_id(); }
855 void set_qos(uint8_t qos) { cmn.
set_qos(qos); }
857 unsigned int get_qos()
const {
return cmn.
get_qos(); }
892 using chi_phase = tlm::tlm_phase;
899 typedef chi_phase tlm_phase_type;
912 template <
typename TYPES = chi::chi_protocol_types>
using chi_fw_transport_if = tlm::tlm_fw_transport_if<TYPES>;
919 template <
typename TRANS = tlm::tlm_
generic_payload>
927 virtual void b_snoop(TRANS& trans, sc_core::sc_time& t) = 0;
933 template <
typename TYPES = chi::chi_protocol_types>
937 #if SC_VERSION_MAJOR<3
938 using type_index = sc_core::sc_type_index;
940 using type_index = std::type_index;
948 sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND>
950 :
public tlm::tlm_base_initiator_socket<BUSWIDTH, chi_fw_transport_if<TYPES>, chi_bw_transport_if<TYPES>, N, POL> {
969 const char*
kind()
const override {
return "chi_trx_initiator_socket"; }
970 #if SYSTEMC_VERSION >= 20181013
975 type_index get_protocol_types() const override { return typeid(TYPES); }
983 template <
unsigned int BUSWIDTH = 32,
typename TYPES = chi_protocol_types,
int N = 1,
984 sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND>
986 :
public tlm::tlm_base_target_socket<BUSWIDTH, chi_fw_transport_if<TYPES>, chi_bw_transport_if<TYPES>, N, POL> {
1005 const char*
kind()
const override {
return "chi_trx_target_socket"; }
1006 #if SYSTEMC_VERSION >= 20181013
1011 type_index get_protocol_types()
const override {
return typeid(TYPES); }
1018 template <
typename EXT>
inline bool is_valid(EXT& ext) {
return is_valid_msg(&ext) ==
nullptr; }
1020 template <
typename EXT>
bool is_valid(EXT* ext) {
return is_valid_msg(ext) ==
nullptr; }
1022 template <
typename EXT>
char const* is_valid_msg(EXT* ext);
1025 switch(req_e->req.get_opcode()) {
1026 case chi::req_optype_e::CleanUnique:
1027 case chi::req_optype_e::MakeUnique:
1028 case chi::req_optype_e::Evict :
1029 case chi::req_optype_e::StashOnceUnique:
1030 case chi::req_optype_e::StashOnceSepUnique:
1031 case chi::req_optype_e::StashOnceShared:
1032 case chi::req_optype_e::StashOnceSepShared:
1033 case chi::req_optype_e::CleanShared:
1034 case chi::req_optype_e::CleanSharedPersist:
1035 case chi::req_optype_e::CleanSharedPersistSep:
1036 case chi::req_optype_e::CleanInvalid:
1037 case chi::req_optype_e::MakeInvalid:
1038 case chi::req_optype_e::WriteNoSnpZero:
1039 case chi::req_optype_e::WriteUniqueZero:
1041 case chi::req_optype_e::MakeReadUnique:
1042 switch(req_e->resp.get_opcode()) {
1043 case chi::rsp_optype_e::Comp:
1044 case chi::rsp_optype_e::CompPersist:
1045 case chi::rsp_optype_e::CompCMO:
1046 case chi::rsp_optype_e::CompStashDone:
1059 return req_e->req.get_opcode()>=chi::req_optype_e::AtomicStoreAdd && req_e->req.get_opcode()<=chi::req_optype_e::AtomicCompare;
1063 if(req_e->req.get_order()==2) {
1064 switch(req_e->req.get_opcode()) {
1065 case chi::req_optype_e::ReadNoSnp:
1066 case chi::req_optype_e::ReadNoSnpSep:
1067 case chi::req_optype_e::ReadOnce :
1068 case chi::req_optype_e::ReadOnceCleanInvalid:
1069 case chi::req_optype_e::ReadOnceMakeInvalid:
1070 case chi::req_optype_e::WriteNoSnpFull:
1071 case chi::req_optype_e::WriteNoSnpFullCleanInv:
1072 case chi::req_optype_e::WriteNoSnpFullCleanSh:
1073 case chi::req_optype_e::WriteNoSnpFullCleanShPerSep:
1074 case chi::req_optype_e::WriteNoSnpPtl:
1075 case chi::req_optype_e::WriteNoSnpPtlCleanInv:
1076 case chi::req_optype_e::WriteNoSnpPtlCleanSh:
1077 case chi::req_optype_e::WriteNoSnpPtlCleanShPerSep:
1078 case chi::req_optype_e::WriteUniqueFull:
1079 case chi::req_optype_e::WriteUniqueFullCleanSh:
1080 case chi::req_optype_e::WriteUniqueFullCleanShPerSep:
1081 case chi::req_optype_e::WriteUniqueFullStash:
1082 case chi::req_optype_e::WriteUniquePtl:
1083 case chi::req_optype_e::WriteUniquePtlCleanSh:
1084 case chi::req_optype_e::WriteUniquePtlCleanShPerSep:
1085 case chi::req_optype_e::WriteUniquePtlStash:
1086 case chi::req_optype_e::WriteUniqueZero:
1091 return is_atomic(req_e);
1104 template <>
struct enable_for_enum<rsp_resperrtype_e> {
static const bool enable =
true; };
1106 template <>
inline req_optype_e into<req_optype_e>(
typename std::underlying_type<req_optype_e>::type t) {
1107 assert(t <=
static_cast<std::underlying_type<req_optype_e>::type
>(req_optype_e::ILLEGAL));
1108 return static_cast<req_optype_e
>(t);
1111 template <>
inline snp_optype_e into<snp_optype_e>(
typename std::underlying_type<snp_optype_e>::type t) {
1112 assert(t <=
static_cast<std::underlying_type<snp_optype_e>::type
>(snp_optype_e::ILLEGAL));
1113 return static_cast<snp_optype_e
>(t);
1116 template <>
inline dat_optype_e into<dat_optype_e>(
typename std::underlying_type<dat_optype_e>::type t) {
1117 assert(t <=
static_cast<std::underlying_type<dat_optype_e>::type
>(dat_optype_e::NCBWrDataCompAck));
1118 return static_cast<dat_optype_e
>(t);
1121 template <>
inline dat_resptype_e into<dat_resptype_e>(
typename std::underlying_type<dat_resptype_e>::type t) {
1122 assert(t <=
static_cast<std::underlying_type<dat_resptype_e>::type
>(dat_resptype_e::CopyBackWrData_SD_PD));
1123 return static_cast<dat_resptype_e
>(t);
1126 template <>
inline rsp_optype_e into<rsp_optype_e>(
typename std::underlying_type<rsp_optype_e>::type t) {
1127 assert(t >=
static_cast<typename std::underlying_type<rsp_optype_e>::type
>(rsp_optype_e::RespLCrdReturn) &&
1128 t <
static_cast<std::underlying_type<rsp_optype_e>::type
>(rsp_optype_e::INVALID));
1129 return static_cast<rsp_optype_e
>(t);
1132 template <>
inline rsp_resptype_e into<rsp_resptype_e>(
typename std::underlying_type<rsp_resptype_e>::type t) {
1133 assert(t <=
static_cast<std::underlying_type<rsp_resptype_e>::type
>(rsp_resptype_e::SnpResp_SD));
1134 return static_cast<rsp_resptype_e
>(t);
1137 template <>
inline rsp_resperrtype_e into<rsp_resperrtype_e>(
typename std::underlying_type<rsp_resperrtype_e>::type t) {
1138 assert(t <=
static_cast<std::underlying_type<rsp_resperrtype_e>::type
>(rsp_resperrtype_e::NDERR));
1139 return static_cast<rsp_resperrtype_e
>(t);
1148 sc_assert(txn_id <= 4096);
1149 this->txn_id = txn_id;
1177 inline void request::set_tgt_id(uint8_t
id) { tgt_id = id; }
1178 inline uint8_t request::get_tgt_id()
const {
return tgt_id; }
1182 inline void request::set_lp_id(uint8_t
id) { lp_id = id; }
1183 inline uint8_t request::get_lp_id()
const {
return lp_id; }
1187 inline void request::set_return_txn_id(uint8_t
id) { return_txn_id = id; }
1188 inline uint8_t request::get_return_txn_id()
const {
return return_txn_id; }
1191 inline void request::set_stash_lp_id(uint8_t
id) { stash_lp_id = id; }
1192 inline uint8_t request::get_stash_lp_id()
const {
return stash_lp_id; }
1196 inline void request::set_size(uint8_t sz) {
1200 inline uint8_t request::get_size()
const {
return size; }
1203 inline void request::set_max_flit(uint8_t data_id) { max_flit = data_id; }
1204 inline uint8_t request::get_max_flit()
const {
return max_flit; }
1208 inline void request::set_mem_attr(uint8_t mem_attr) {
1209 assert(mem_attr < 16);
1210 this->mem_attr = mem_attr;
1212 inline uint8_t request::get_mem_attr()
const {
return mem_attr; }
1214 inline void request:: set_device(
bool is_device) {
if(is_device) this->mem_attr |= 2 ;
else this->mem_attr &= ~2U;}
1215 inline bool request::is_device()
const {
return this->mem_attr & 2; }
1216 inline void request:: set_ewa(
bool is_device) {
if(is_device) this->mem_attr |= 1 ;
else this->mem_attr &= ~1U;}
1217 inline bool request::is_ewa()
const {
return this->mem_attr & 1; }
1218 inline void request:: set_allocate(
bool is_device) {
if(is_device) this->mem_attr |= 8 ;
else this->mem_attr &= ~8U;}
1219 inline bool request::is_allocate()
const {
return this->mem_attr & 8; }
1220 inline void request:: set_cacheable(
bool is_device) {
if(is_device) this->mem_attr |= 4 ;
else this->mem_attr &= ~4U;}
1221 inline bool request::is_cacheable()
const {
return this->mem_attr & 4; }
1225 inline void request::set_pcrd_type(uint8_t pcrd_type) { this->pcrd_type = pcrd_type; }
1226 inline uint8_t request::get_pcrd_type()
const {
return pcrd_type; }
1229 inline void request::set_endian(
bool endian) { this->endian = endian; }
1230 inline bool request::is_endian()
const {
return this->endian; }
1234 inline void request::set_order(uint8_t order) { this->order = order; }
1235 inline uint8_t request::get_order()
const {
return this->order; }
1239 inline void request::set_trace_tag(
bool trace_tag) { this->trace_tag = trace_tag; }
1240 inline bool request::is_trace_tag()
const {
return trace_tag; }
1242 inline void request::set_opcode(req_optype_e opcode) { this->opcode = opcode; }
1243 inline req_optype_e request::get_opcode()
const {
return opcode; }
1246 inline void request::set_return_n_id(uint16_t return_n_id) { this->return_n_id = return_n_id; }
1247 inline uint16_t request::get_return_n_id()
const {
return return_n_id; }
1250 inline void request::set_stash_n_id(uint16_t stash_n_id) { this->stash_n_id = stash_n_id; }
1251 inline uint16_t request::get_stash_n_id()
const {
return stash_n_id; }
1255 inline void request::set_stash_n_id_valid(
bool stash_n_id_valid) { this->stash_n_id_valid = stash_n_id_valid; }
1256 inline bool request::is_stash_n_id_valid()
const {
return stash_n_id_valid; }
1259 inline void request::set_stash_lp_id_valid(
bool stash_lp_id_valid) { this->stash_lp_id_valid = stash_lp_id_valid; }
1260 inline bool request::is_stash_lp_id_valid()
const {
return stash_lp_id_valid; }
1264 inline void request::set_non_secure(
bool ns) { this->ns = ns; }
1265 inline bool request::is_non_secure()
const {
return ns; }
1269 inline void request::set_exp_comp_ack(
bool exp_comp_ack) { this->exp_comp_ack = exp_comp_ack; }
1270 inline bool request::is_exp_comp_ack()
const {
return exp_comp_ack; }
1273 inline void request::set_allow_retry(
bool allow_retry) { this->allow_retry = allow_retry; }
1274 inline bool request::is_allow_retry()
const {
return allow_retry; }
1277 inline void request::set_snp_attr(
bool snp_attr) { this->snp_attr = snp_attr; }
1278 inline bool request::is_snp_attr()
const {
return snp_attr; }
1282 inline void request::set_excl(
bool excl) { this->excl = excl; }
1283 inline bool request::is_excl()
const {
return this->excl; }
1287 inline void request::set_snoop_me(
bool snoop_me) { this->snoop_me = snoop_me; }
1288 inline bool request::is_snoop_me()
const {
return snoop_me; }
1292 inline void request::set_likely_shared(
bool likely_shared) { this->likely_shared = likely_shared; }
1293 inline bool request::is_likely_shared()
const {
return likely_shared; }
1297 inline void request::set_rsvdc(uint32_t rsvdc) { this->rsvdc = rsvdc; }
1298 inline uint32_t request::get_rsvdc()
const {
return rsvdc; }
1300 inline void request::set_tag_op(uint8_t tag_op){ this->tag_op = tag_op; }
1301 inline uint8_t request::get_tag_op()
const {
return tag_op; }
1302 inline void request::set_tag_group_id(uint32_t tag_group_id){ this->tag_group_id = tag_group_id; }
1303 inline uint32_t request::get_tag_group_id()
const {
return tag_group_id; }
1304 inline void request::set_mpam(uint16_t mpam){ this->mpam = mpam; }
1305 inline uint16_t request::get_mpam()
const {
return mpam; }
1311 inline void snp_request::set_fwd_txn_id(uint8_t fwd_txn_id) { this->fwd_txn_id = fwd_txn_id; }
1312 inline uint8_t snp_request::get_fwd_txn_id()
const {
return fwd_txn_id; }
1315 inline void snp_request::set_stash_lp_id(uint8_t stash_lp_id) { this->stash_lp_id = stash_lp_id; }
1316 inline uint8_t snp_request::get_stash_lp_id()
const {
return stash_lp_id; }
1319 inline void snp_request::set_stash_lp_id_valid(
bool stash_lp_id_valid) { this->stash_lp_id_valid = stash_lp_id_valid; }
1320 inline bool snp_request::is_stash_lp_id_valid()
const {
return stash_lp_id_valid; }
1323 inline void snp_request::set_vm_id_ext(uint8_t vm_id_ext) { this->vm_id_ext = vm_id_ext; }
1324 inline uint8_t snp_request::get_vm_id_ext()
const {
return vm_id_ext; }
1327 inline void snp_request::set_fwd_n_id(uint16_t fwd_n_id) { this->fwd_n_id = fwd_n_id; }
1328 inline uint16_t snp_request::get_fwd_n_id()
const {
return fwd_n_id; }
1330 inline void snp_request::set_opcode(snp_optype_e opcode) {
1332 this->opcode = opcode;
1334 inline snp_optype_e snp_request::get_opcode()
const {
return opcode; }
1338 inline void snp_request::set_non_secure(
bool non_secure)
1340 this->ns = non_secure;
1342 inline bool snp_request::is_non_secure() const
1349 inline void snp_request::set_do_not_goto_sd(
bool do_not_goto_sd) { this->do_not_goto_sd = do_not_goto_sd; }
1350 inline bool snp_request::is_do_not_goto_sd()
const {
return do_not_goto_sd; }
1354 inline void snp_request::set_do_not_data_pull(
bool do_not_data_pull) { this->do_not_data_pull = do_not_data_pull; }
1355 inline bool snp_request::is_do_not_data_pull()
const {
return do_not_data_pull; }
1359 inline void snp_request::set_ret_to_src(
bool ret_to_src) { this->ret_to_src = ret_to_src; }
1360 inline bool snp_request::is_ret_to_src()
const {
return ret_to_src; }
1364 inline void snp_request::set_trace_tag(
bool trace_tag) { this->trace_tag = trace_tag; }
1365 inline bool snp_request::is_trace_tag()
const {
return trace_tag; }
1373 inline void data::set_db_id(uint8_t db_id) { this->db_id = db_id; }
1374 inline uint8_t data::get_db_id()
const {
return db_id; }
1378 inline void data::set_resp_err(rsp_resperrtype_e resp_err) { this->resp_err = resp_err; }
1379 inline rsp_resperrtype_e data::get_resp_err()
const {
return resp_err; }
1382 inline void data::set_resp(dat_resptype_e resp) { this->resp = resp; }
1383 inline dat_resptype_e data::get_resp()
const {
return resp; }
1386 inline void data::set_fwd_state(uint8_t fwd_state) { this->fwd_state = fwd_state; }
1387 inline uint8_t data::get_fwd_state()
const {
return fwd_state; }
1391 inline void data::set_data_pull(uint8_t data_pull) { this->data_pull = data_pull; }
1392 inline uint8_t data::get_data_pull()
const {
return data_pull; }
1395 inline void chi::data::set_data_source(uint8_t data_source) { this->data_source = data_source; }
1396 inline uint8_t data::get_data_source()
const {
return data_source; }
1400 inline void data::set_cc_id(uint8_t cc_id) { this->cc_id = cc_id; }
1401 inline uint8_t data::get_cc_id()
const {
return cc_id; }
1404 inline void data::set_data_id(uint8_t data_id) { this->data_id = data_id; }
1405 inline uint8_t data::get_data_id()
const {
return data_id; }
1408 inline void data::set_poison(uint8_t poison) { this->poison = poison; }
1409 inline uint8_t data::get_poison()
const {
return poison; }
1412 inline void data::set_tgt_id(uint16_t tgt_id) { this->tgt_id = tgt_id; }
1413 inline uint16_t data::get_tgt_id()
const {
return tgt_id; }
1417 inline void data::set_home_n_id(uint16_t home_n_id) { this->home_n_id = home_n_id; }
1418 inline uint16_t data::get_home_n_id()
const {
return home_n_id; }
1422 inline void data::set_rsvdc(uint32_t rsvdc) { this->rsvdc = rsvdc; }
1423 inline uint32_t data::get_rsvdc()
const {
return rsvdc; }
1426 inline void data::set_data_check(uint64_t data_check) { this->data_check = data_check; }
1427 inline uint64_t data::get_data_check()
const {
return data_check; }
1429 inline void data::set_opcode(dat_optype_e opcode) { this->opcode = opcode; }
1430 inline dat_optype_e data::get_opcode()
const {
return opcode; }
1434 inline void data::set_trace_tag(
bool trace_tag) { this->trace_tag = trace_tag; }
1435 inline bool data::is_trace_tag()
const {
return trace_tag; }
1437 inline void data::set_tag_op(uint8_t tag_op) { this->tag_op = tag_op; }
1438 inline uint8_t data::get_tag_op()
const {
return tag_op; }
1439 inline void data::set_tag(uint64_t tag) { this->tag = tag; }
1440 inline uint64_t data::get_tag()
const {
return tag; }
1441 inline void data::set_tu(uint16_t tu) { this->tu = tu; }
1442 inline uint16_t data::get_tu()
const {
return tu; }
1450 inline void response::set_db_id(uint8_t db_id) { this->db_id = db_id; }
1451 inline uint8_t response::get_db_id()
const {
return db_id; }
1454 inline void response::set_pcrd_type(uint8_t pcrd_type) { this->pcrd_type = pcrd_type; }
1455 inline uint8_t response::get_pcrd_type()
const {
return pcrd_type; }
1459 inline void response::set_resp_err(rsp_resperrtype_e resp_err) { this->resp_err = resp_err; }
1460 inline rsp_resperrtype_e response::get_resp_err()
const {
return resp_err; }
1463 inline void response::set_resp(rsp_resptype_e resp) { this->resp = resp; }
1464 inline rsp_resptype_e response::get_resp()
const {
return resp; }
1467 inline void response::set_fwd_state(uint8_t fwd_state) { this->fwd_state = fwd_state; }
1468 inline uint8_t response::get_fwd_state()
const {
return fwd_state; }
1472 inline void response::set_data_pull(
bool data_pull) { this->data_pull = data_pull; }
1473 inline bool response::get_data_pull()
const {
return data_pull; }
1476 inline void response::set_tgt_id(uint16_t tgt_id) { this->tgt_id = tgt_id; }
1477 inline uint16_t response::get_tgt_id()
const {
return tgt_id; }
1478 inline void response::set_opcode(rsp_optype_e opcode) { this->opcode = opcode; }
1479 inline rsp_optype_e response::get_opcode()
const {
return opcode; }
1481 inline void response::set_tag_op(uint8_t tag_op) { this->tag_op = tag_op; }
1482 inline uint8_t response::get_tag_op()
const{
return tag_op; }
1483 inline void response::set_tag_group_id(uint32_t tag_group_id) { this->tag_group_id = tag_group_id; }
1484 inline uint32_t response::get_tag_group_id()
const{
return tag_group_id; }
1487 inline void response::set_trace_tag(
bool trace_tag) { this->trace_tag = trace_tag; }
1488 inline 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)
DECLARE_EXTENDED_PHASE(BEGIN_PARTIAL_DATA)
E into(typename std::underlying_type< E >::type t)
tlm::tlm_fw_transport_if< TYPES > chi_fw_transport_if
alias declaration for the forward interface
tlm::tlm_generic_payload chi_payload
aliases for payload and phase types
const char * to_char(E t)
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
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
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
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
const char * kind() const override
get the kind of this sc_object
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
const char * kind() const override
get the kind of this sc_object
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
chi_target_socket(const char *name)
constructor with instance name
void set_src_id(unsigned int)
unsigned int get_src_id() const
common & operator=(const common &o)
reset all data member to their default
common()=default
the constructori
void set_txn_id(unsigned int)
void set_qos(uint8_t qos)
unsigned int get_qos() const
unsigned int get_txn_id() const