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>
66 enum class req_optype_e : uint8_t {
87 CleanSharedPersistSep = 0x13,
89 WriteEvictFull = 0x15,
91 WriteCleanFull = 0x17,
92 WriteUniquePtl = 0x18,
93 WriteUniqueFull = 0x19,
97 WriteNoSnpFull = 0x1D,
99 WriteUniqueFullStash = 0x20,
100 WriteUniquePtlStash = 0x21,
101 StashOnceShared = 0x22,
102 StashOnceUnique = 0x23,
103 ReadOnceCleanInvalid = 0x24,
104 ReadOnceMakeInvalid = 0x25,
105 ReadNotSharedDirty = 0x26,
106 CleanSharedPersist = 0x27,
107 AtomicStoreAdd = 0x28,
108 AtomicStoreClr = 0x29,
109 AtomicStoreEor = 0x2A,
110 AtomicStoreSet = 0x2B,
111 AtomicStoreSmax = 0x2C,
112 AtomicStoreSmin = 0x2D,
113 AtomicStoreUmax = 0x2E,
114 AtomicStoreUmin = 0x2F,
115 AtomicLoadAdd = 0x30,
116 AtomicLoadClr = 0x31,
117 AtomicLoadEor = 0x32,
118 AtomicLoadSet = 0x33,
119 AtomicLoadSmax = 0x34,
120 AtomicLoadSmin = 0x35,
121 AtomicLoadUmax = 0x36,
122 AtomicLoadUmin = 0x37,
124 AtomicCompare = 0x39,
128 MakeReadUnique = 0x41,
129 WriteEvictOrEvict = 0x42,
130 WriteUniqueZero = 0x43,
131 WriteNoSnpZero = 0x44,
133 StashOnceSepShared = 0x47,
134 StashOnceSepUnique = 0x48,
136 ReadPreferUnique = 0x4c,
138 WriteNoSnpFullCleanSh = 0x50,
139 WriteNoSnpFullCleanInv = 0x51,
140 WriteNoSnpFullCleanShPerSep = 0x52,
142 WriteUniqueFullCleanSh = 0x54,
144 WriteUniqueFullCleanShPerSep = 0x56,
146 WriteBackFullCleanSh = 0x58,
147 WriteBackFullCleanInv = 0x59,
148 WriteBackFullCleanShPerSep = 0x5A,
150 WriteCleanFullCleanSh = 0x5c,
152 WriteCleanFullCleanShPerSep = 0x5e,
154 WriteNoSnpPtlCleanSh = 0x60,
155 WriteNoSnpPtlCleanInv = 0x61,
156 WriteNoSnpPtlCleanShPerSep = 0x62,
158 WriteUniquePtlCleanSh = 0x64,
160 WriteUniquePtlCleanShPerSep = 0x66,
166 enum class snp_optype_e : uint8_t {
167 SnpLCrdReturn = 0x00,
171 SnpNotSharedDirty = 0x04,
172 SnpUniqueStash = 0x05,
173 SnpMakeInvalidStash = 0x06,
175 SnpCleanShared = 0x08,
176 SnpCleanInvalid = 0x09,
177 SnpMakeInvalid = 0x0A,
178 SnpStashUnique = 0x0B,
179 SnpStashShared = 0x0c,
185 SnpNotSharedDirtyFwd = 0x14,
186 SnpPreferUnique = 0x15,
187 SnpPreferUniqueFwd = 0x16,
195 enum class dat_optype_e : uint8_t {
196 DataLCrdReturn = 0x0,
198 CopyBackWrData = 0x2,
199 NonCopyBackWrData = 0x3,
201 SnpRespDataPtl = 0x5,
202 SnpRespDataFwded = 0x6,
203 WriteDataCancel = 0x7,
205 NCBWrDataCompAck = 0xC,
210 SnpRespData_UC = 0x1,
211 SnpRespData_UD = 0x1,
212 SnpRespData_SC = 0x1,
213 SnpRespData_SD = 0x1,
214 SnpRespData_I_PD = 0x1,
215 SnpRespData_UC_PD = 0x1,
216 SnpRespData_SC_PD = 0x1,
217 SnpRespDataPtl_I_PD = 0x5,
218 SnpRespDataPtl_UD = 0x5,
220 SnpRespData_I_Fwded_SC = 0x6,
221 SnpRespData_I_Fwded_SD_PD = 0x6,
222 SnpRespData_SC_Fwded_SC = 0x6,
223 SnpRespData_SC_Fwded_SD_PD = 0x6,
224 SnpRespData_SD_Fwded_SC = 0x6,
225 SnpRespData_I_PD_Fwded_I = 0x6,
226 SnpRespData_I_PD_Fwded_SC = 0x6,
227 SnpRespData_SC_PD_Fwded_I = 0x6,
228 SnpRespData_SC_PD_Fwded_SC = 0x6
232 enum class dat_resptype_e : uint8_t {
237 CompData_UD_PD = 0b110,
238 CompData_SD_PD = 0b111,
239 DataSepResp_I = 0b000,
240 DataSepResp_SC = 0b001,
241 DataSepResp_UC = 0b010,
242 RespSepData_I = 0b000,
243 RespSepData_SC = 0b001,
244 RespSepData_UC = 0b010,
246 SnpRespData_I = 0b000,
247 SnpRespData_UC = 0b010,
248 SnpRespData_UD = 0b010,
249 SnpRespData_SC = 0b001,
250 SnpRespData_SD = 0b011,
251 SnpRespData_I_PD = 0b100,
252 SnpRespData_UC_PD = 0b110,
253 SnpRespData_SC_PD = 0b101,
254 SnpRespDataPtl_I_PD = 0b100,
255 SnpRespDataPtl_UD = 0b010,
262 CopyBackWrData_I = 0b000,
263 CopyBackWrData_UC = 0b010,
264 CopyBackWrData_SC = 0b001,
265 CopyBackWrData_UD_PD = 0b110,
266 CopyBackWrData_SD_PD = 0b111,
267 NonCopyBackWrData = 0b000,
268 NCBWrDataCompAck = 0b000
272 enum class rsp_optype_e : uint8_t {
273 RespLCrdReturn = 0x0,
290 CompStashDone = 0x11,
297 enum class rsp_resptype_e : uint8_t {
310 SnpRespData_I = 0b000,
311 SnpRespData_UC = 0b010,
312 SnpRespData_UD = 0b010,
313 SnpRespData_SC = 0b001,
314 SnpRespData_SD = 0b011,
315 SnpRespData_I_PD = 0b100,
316 SnpRespData_UC_PD = 0b110,
317 SnpRespData_SC_PD = 0b101,
318 SnpRespDataPtl_I_PD = 0b100,
319 SnpRespDataPtl_UD = 0b010,
322 enum class rsp_resperrtype_e : uint8_t {
329 enum 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},
532 bool endian{
false}, trace_tag{
false};
533 uint16_t return_n_id{0}, stash_n_id{0};
534 req_optype_e opcode{req_optype_e::ReqLCrdReturn};
535 bool stash_n_id_valid{
false}, stash_lp_id_valid{
false}, ns{
false}, exp_comp_ack{
false}, allow_retry{
false},
536 snp_attr{
false}, excl{
false}, snoop_me{
false}, likely_shared{
false};
537 uint32_t rsvdc{0}, tag_group_id{0};
549 void set_fwd_txn_id(uint8_t);
550 uint8_t get_fwd_txn_id()
const;
552 void set_stash_lp_id(uint8_t);
553 uint8_t get_stash_lp_id()
const;
556 void set_stash_lp_id_valid(
bool =
true);
557 bool is_stash_lp_id_valid()
const;
559 void set_vm_id_ext(uint8_t);
560 uint8_t get_vm_id_ext()
const;
562 void set_opcode(snp_optype_e opcode);
563 snp_optype_e get_opcode()
const;
565 void set_fwd_n_id(uint16_t);
566 uint16_t get_fwd_n_id()
const;
569 void set_non_secure(
bool =
true);
570 bool is_non_secure()
const;
573 void set_do_not_goto_sd(
bool =
true);
574 bool is_do_not_goto_sd()
const;
577 void set_do_not_data_pull(
bool =
true);
578 bool is_do_not_data_pull()
const;
581 void set_ret_to_src(
bool);
582 bool is_ret_to_src()
const;
585 void set_trace_tag(
bool =
true);
586 bool is_trace_tag()
const;
589 uint8_t fwd_txn_id{0}, stash_lp_id{0}, vm_id_ext{0};
590 bool stash_lp_id_valid{
false};
592 uint16_t fwd_n_id{0};
593 bool ns{
false}, do_not_goto_sd{
false}, do_not_data_pull{
false}, ret_to_src{
false}, trace_tag{
false};
603 void set_db_id(uint8_t);
604 uint8_t get_db_id()
const;
606 void set_opcode(dat_optype_e opcode);
607 dat_optype_e get_opcode()
const;
609 void set_resp_err(rsp_resperrtype_e);
610 rsp_resperrtype_e get_resp_err()
const;
612 void set_resp(dat_resptype_e);
613 dat_resptype_e get_resp()
const;
616 void set_fwd_state(uint8_t);
617 uint8_t get_fwd_state()
const;
620 void set_data_pull(uint8_t);
621 uint8_t get_data_pull()
const;
624 void set_data_source(uint8_t);
625 uint8_t get_data_source()
const;
628 void set_cc_id(uint8_t);
629 uint8_t get_cc_id()
const;
631 void set_data_id(uint8_t);
632 uint8_t get_data_id()
const;
634 void set_poison(uint8_t);
635 uint8_t get_poison()
const;
637 void set_tgt_id(uint16_t);
638 uint16_t get_tgt_id()
const;
641 void set_home_n_id(uint16_t);
642 uint16_t get_home_n_id()
const;
645 void set_rsvdc(uint32_t);
646 uint32_t get_rsvdc()
const;
648 void set_data_check(uint64_t);
649 uint64_t get_data_check()
const;
652 void set_trace_tag(
bool);
653 bool is_trace_tag()
const;
656 void set_tag_op(uint8_t);
657 uint8_t get_tag_op()
const;
659 void set_tag(uint64_t);
660 uint64_t get_tag()
const;
662 void set_tu(uint16_t);
663 uint16_t get_tu()
const;
667 rsp_resperrtype_e resp_err{rsp_resperrtype_e::OK};
668 dat_resptype_e resp{dat_resptype_e::CompData_I};
669 uint8_t fwd_state{0}, data_pull{0}, data_source{0}, cc_id{0}, data_id{0}, poison{0};
670 uint16_t tgt_id{0}, home_n_id{0};
671 dat_optype_e opcode{dat_optype_e::DataLCrdReturn};
673 uint64_t data_check{0};
677 bool trace_tag{
false};
687 void set_db_id(uint8_t);
688 uint8_t get_db_id()
const;
690 void set_pcrd_type(uint8_t);
691 uint8_t get_pcrd_type()
const;
693 void set_opcode(rsp_optype_e opcode);
694 rsp_optype_e get_opcode()
const;
696 void set_resp_err(rsp_resperrtype_e);
697 rsp_resperrtype_e get_resp_err()
const;
699 void set_resp(rsp_resptype_e);
700 rsp_resptype_e get_resp()
const;
703 void set_fwd_state(uint8_t);
704 uint8_t get_fwd_state()
const;
706 void set_data_pull(
bool);
707 bool get_data_pull()
const;
709 void set_tgt_id(uint16_t);
710 uint16_t get_tgt_id()
const;
713 void set_tag_op(uint8_t);
714 uint8_t get_tag_op()
const;
717 void set_tag_group_id(uint32_t);
718 uint32_t get_tag_group_id()
const;
720 void set_trace_tag(
bool);
721 bool is_trace_tag()
const;
724 uint8_t db_id{0}, pcrd_type{0}, fwd_state{0};
725 rsp_resperrtype_e resp_err{rsp_resperrtype_e::OK};
726 bool data_pull{
false};
727 rsp_optype_e opcode{rsp_optype_e::INVALID};
728 rsp_resptype_e resp{rsp_resptype_e::SnpResp_I};
729 uint32_t tag_group_id{0};
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};
767 void set_txn_id(
unsigned int id) { cmn.
set_txn_id(
id); }
769 unsigned int get_txn_id()
const {
return cmn.
get_txn_id(); }
771 void set_src_id(
unsigned int id) { cmn.
set_src_id(
id); }
773 unsigned int get_src_id()
const {
return cmn.
get_src_id(); }
775 void set_qos(uint8_t qos) { cmn.
set_qos(qos); }
777 unsigned int get_qos()
const {
return cmn.
get_qos(); }
805 void set_txn_id(
unsigned int id) { cmn.
set_txn_id(
id); }
807 unsigned int get_txn_id()
const {
return cmn.
get_txn_id(); }
809 void set_src_id(
unsigned int id) { cmn.
set_src_id(
id); }
811 unsigned int get_src_id()
const {
return cmn.
get_src_id(); }
813 void set_qos(uint8_t qos) { cmn.
set_qos(qos); }
815 unsigned int get_qos()
const {
return cmn.
get_qos(); }
845 void set_txn_id(
unsigned int id) { cmn.
set_txn_id(
id); }
847 unsigned int get_txn_id()
const {
return cmn.
get_txn_id(); }
849 void set_src_id(
unsigned int id) { cmn.
set_src_id(
id); }
851 unsigned int get_src_id()
const {
return cmn.
get_src_id(); }
853 void set_qos(uint8_t qos) { cmn.
set_qos(qos); }
855 unsigned int get_qos()
const {
return cmn.
get_qos(); }
890 using chi_phase = tlm::tlm_phase;
897 typedef chi_phase tlm_phase_type;
910 template <
typename TYPES = chi::chi_protocol_types>
using chi_fw_transport_if = tlm::tlm_fw_transport_if<TYPES>;
917 template <
typename TRANS = tlm::tlm_
generic_payload>
925 virtual void b_snoop(TRANS& trans, sc_core::sc_time& t) = 0;
931 template <
typename TYPES = chi::chi_protocol_types>
940 sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND>
942 :
public tlm::tlm_base_initiator_socket<BUSWIDTH, chi_fw_transport_if<TYPES>, chi_bw_transport_if<TYPES>, N, POL> {
961 const char*
kind()
const override {
return "chi_trx_initiator_socket"; }
962 #if SYSTEMC_VERSION >= 20181013
967 sc_core::sc_type_index get_protocol_types() const override { return typeid(TYPES); }
975 template <
unsigned int BUSWIDTH = 32,
typename TYPES = chi_protocol_types,
int N = 1,
976 sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND>
978 :
public tlm::tlm_base_target_socket<BUSWIDTH, chi_fw_transport_if<TYPES>, chi_bw_transport_if<TYPES>, N, POL> {
997 const char*
kind()
const override {
return "chi_trx_target_socket"; }
998 #if SYSTEMC_VERSION >= 20181013
1003 sc_core::sc_type_index get_protocol_types()
const override {
return typeid(TYPES); }
1010 template <
typename EXT>
inline bool is_valid(EXT& ext) {
return is_valid(&ext); }
1012 template <
typename EXT>
bool is_valid(EXT* ext);
1015 switch(req_e->req.get_opcode()) {
1016 case chi::req_optype_e::CleanUnique:
1017 case chi::req_optype_e::MakeUnique:
1018 case chi::req_optype_e::Evict :
1019 case chi::req_optype_e::StashOnceUnique:
1020 case chi::req_optype_e::StashOnceSepUnique:
1021 case chi::req_optype_e::StashOnceShared:
1022 case chi::req_optype_e::StashOnceSepShared:
1023 case chi::req_optype_e::CleanShared:
1024 case chi::req_optype_e::CleanSharedPersist:
1025 case chi::req_optype_e::CleanSharedPersistSep:
1026 case chi::req_optype_e::CleanInvalid:
1027 case chi::req_optype_e::MakeInvalid:
1028 case chi::req_optype_e::WriteNoSnpZero:
1029 case chi::req_optype_e::WriteUniqueZero:
1031 case chi::req_optype_e::MakeReadUnique:
1032 switch(req_e->resp.get_opcode()) {
1033 case chi::rsp_optype_e::Comp:
1034 case chi::rsp_optype_e::CompPersist:
1035 case chi::rsp_optype_e::CompCMO:
1036 case chi::rsp_optype_e::CompStashDone:
1044 return req_e->req.get_opcode()>=chi::req_optype_e::AtomicStoreAdd && req_e->req.get_opcode()<=chi::req_optype_e::AtomicCompare;
1048 if(req_e->req.get_order()==2) {
1049 switch(req_e->req.get_opcode()) {
1050 case chi::req_optype_e::ReadNoSnp:
1051 case chi::req_optype_e::ReadNoSnpSep:
1052 case chi::req_optype_e::ReadOnce :
1053 case chi::req_optype_e::ReadOnceCleanInvalid:
1054 case chi::req_optype_e::ReadOnceMakeInvalid:
1055 case chi::req_optype_e::WriteNoSnpFull:
1056 case chi::req_optype_e::WriteNoSnpFullCleanInv:
1057 case chi::req_optype_e::WriteNoSnpFullCleanSh:
1058 case chi::req_optype_e::WriteNoSnpFullCleanShPerSep:
1059 case chi::req_optype_e::WriteNoSnpPtl:
1060 case chi::req_optype_e::WriteNoSnpPtlCleanInv:
1061 case chi::req_optype_e::WriteNoSnpPtlCleanSh:
1062 case chi::req_optype_e::WriteNoSnpPtlCleanShPerSep:
1063 case chi::req_optype_e::WriteUniqueFull:
1064 case chi::req_optype_e::WriteUniqueFullCleanSh:
1065 case chi::req_optype_e::WriteUniqueFullCleanShPerSep:
1066 case chi::req_optype_e::WriteUniqueFullStash:
1067 case chi::req_optype_e::WriteUniquePtl:
1068 case chi::req_optype_e::WriteUniquePtlCleanSh:
1069 case chi::req_optype_e::WriteUniquePtlCleanShPerSep:
1070 case chi::req_optype_e::WriteUniquePtlStash:
1071 case chi::req_optype_e::WriteUniqueZero:
1074 return is_atomic(req_e);
1087 template <>
struct enable_for_enum<rsp_resperrtype_e> {
static const bool enable =
true; };
1089 template <>
inline req_optype_e into<req_optype_e>(
typename std::underlying_type<req_optype_e>::type t) {
1090 assert(t <=
static_cast<std::underlying_type<req_optype_e>::type
>(req_optype_e::ILLEGAL));
1091 return static_cast<req_optype_e
>(t);
1094 template <>
inline snp_optype_e into<snp_optype_e>(
typename std::underlying_type<snp_optype_e>::type t) {
1095 assert(t <=
static_cast<std::underlying_type<snp_optype_e>::type
>(snp_optype_e::ILLEGAL));
1096 return static_cast<snp_optype_e
>(t);
1099 template <>
inline dat_optype_e into<dat_optype_e>(
typename std::underlying_type<dat_optype_e>::type t) {
1100 assert(t <=
static_cast<std::underlying_type<dat_optype_e>::type
>(dat_optype_e::NCBWrDataCompAck));
1101 return static_cast<dat_optype_e
>(t);
1104 template <>
inline dat_resptype_e into<dat_resptype_e>(
typename std::underlying_type<dat_resptype_e>::type t) {
1105 assert(t <=
static_cast<std::underlying_type<dat_resptype_e>::type
>(dat_resptype_e::CopyBackWrData_SD_PD));
1106 return static_cast<dat_resptype_e
>(t);
1109 template <>
inline rsp_optype_e into<rsp_optype_e>(
typename std::underlying_type<rsp_optype_e>::type t) {
1110 assert(t >=
static_cast<typename std::underlying_type<rsp_optype_e>::type
>(rsp_optype_e::RespLCrdReturn) &&
1111 t <
static_cast<std::underlying_type<rsp_optype_e>::type
>(rsp_optype_e::INVALID));
1112 return static_cast<rsp_optype_e
>(t);
1115 template <>
inline rsp_resptype_e into<rsp_resptype_e>(
typename std::underlying_type<rsp_resptype_e>::type t) {
1116 assert(t <=
static_cast<std::underlying_type<rsp_resptype_e>::type
>(rsp_resptype_e::SnpResp_SD));
1117 return static_cast<rsp_resptype_e
>(t);
1120 template <>
inline rsp_resperrtype_e into<rsp_resperrtype_e>(
typename std::underlying_type<rsp_resperrtype_e>::type t) {
1121 assert(t <=
static_cast<std::underlying_type<rsp_resperrtype_e>::type
>(rsp_resperrtype_e::NDERR));
1122 return static_cast<rsp_resperrtype_e
>(t);
1131 sc_assert(txn_id <= 1024);
1132 this->txn_id = txn_id;
1160 inline void request::set_tgt_id(uint8_t
id) { tgt_id = id; }
1161 inline uint8_t request::get_tgt_id()
const {
return tgt_id; }
1165 inline void request::set_lp_id(uint8_t
id) { lp_id = id; }
1166 inline uint8_t request::get_lp_id()
const {
return lp_id; }
1170 inline void request::set_return_txn_id(uint8_t
id) { return_txn_id = id; }
1171 inline uint8_t request::get_return_txn_id()
const {
return return_txn_id; }
1174 inline void request::set_stash_lp_id(uint8_t
id) { stash_lp_id = id; }
1175 inline uint8_t request::get_stash_lp_id()
const {
return stash_lp_id; }
1179 inline void request::set_size(uint8_t sz) {
1183 inline uint8_t request::get_size()
const {
return size; }
1186 inline void request::set_max_flit(uint8_t data_id) { max_flit = data_id; }
1187 inline uint8_t request::get_max_flit()
const {
return max_flit; }
1191 inline void request::set_mem_attr(uint8_t mem_attr) {
1192 assert(mem_attr < 16);
1193 this->mem_attr = mem_attr;
1195 inline uint8_t request::get_mem_attr()
const {
return mem_attr; }
1197 inline void request:: set_device(
bool is_device) {
if(is_device) this->mem_attr |= 2 ;
else this->mem_attr &= ~2U;}
1198 inline bool request::is_device()
const {
return this->mem_attr & 2; }
1199 inline void request:: set_ewa(
bool is_device) {
if(is_device) this->mem_attr |= 1 ;
else this->mem_attr &= ~1U;}
1200 inline bool request::is_ewa()
const {
return this->mem_attr & 1; }
1201 inline void request:: set_allocate(
bool is_device) {
if(is_device) this->mem_attr |= 8 ;
else this->mem_attr &= ~8U;}
1202 inline bool request::is_allocate()
const {
return this->mem_attr & 8; }
1203 inline void request:: set_cacheable(
bool is_device) {
if(is_device) this->mem_attr |= 4 ;
else this->mem_attr &= ~4U;}
1204 inline bool request::is_cacheable()
const {
return this->mem_attr & 4; }
1208 inline void request::set_pcrd_type(uint8_t pcrd_type) { this->pcrd_type = pcrd_type; }
1209 inline uint8_t request::get_pcrd_type()
const {
return pcrd_type; }
1212 inline void request::set_endian(
bool endian) { this->endian = endian; }
1213 inline bool request::is_endian()
const {
return this->endian; }
1217 inline void request::set_order(uint8_t order) { this->order = order; }
1218 inline uint8_t request::get_order()
const {
return this->order; }
1222 inline void request::set_trace_tag(
bool trace_tag) { this->trace_tag = trace_tag; }
1223 inline bool request::is_trace_tag()
const {
return trace_tag; }
1225 inline void request::set_opcode(req_optype_e opcode) { this->opcode = opcode; }
1226 inline req_optype_e request::get_opcode()
const {
return opcode; }
1229 inline void request::set_return_n_id(uint16_t return_n_id) { this->return_n_id = return_n_id; }
1230 inline uint16_t request::get_return_n_id()
const {
return return_n_id; }
1233 inline void request::set_stash_n_id(uint16_t stash_n_id) { this->stash_n_id = stash_n_id; }
1234 inline uint16_t request::get_stash_n_id()
const {
return stash_n_id; }
1238 inline void request::set_stash_n_id_valid(
bool stash_n_id_valid) { this->stash_n_id_valid = stash_n_id_valid; }
1239 inline bool request::is_stash_n_id_valid()
const {
return stash_n_id_valid; }
1242 inline void request::set_stash_lp_id_valid(
bool stash_lp_id_valid) { this->stash_lp_id_valid = stash_lp_id_valid; }
1243 inline bool request::is_stash_lp_id_valid()
const {
return stash_lp_id_valid; }
1247 inline void request::set_non_secure(
bool ns) { this->ns = ns; }
1248 inline bool request::is_non_secure()
const {
return ns; }
1252 inline void request::set_exp_comp_ack(
bool exp_comp_ack) { this->exp_comp_ack = exp_comp_ack; }
1253 inline bool request::is_exp_comp_ack()
const {
return exp_comp_ack; }
1256 inline void request::set_allow_retry(
bool allow_retry) { this->allow_retry = allow_retry; }
1257 inline bool request::is_allow_retry()
const {
return allow_retry; }
1260 inline void request::set_snp_attr(
bool snp_attr) { this->snp_attr = snp_attr; }
1261 inline bool request::is_snp_attr()
const {
return snp_attr; }
1265 inline void request::set_excl(
bool excl) { this->excl = excl; }
1266 inline bool request::is_excl()
const {
return this->excl; }
1270 inline void request::set_snoop_me(
bool snoop_me) { this->snoop_me = snoop_me; }
1271 inline bool request::is_snoop_me()
const {
return snoop_me; }
1275 inline void request::set_likely_shared(
bool likely_shared) { this->likely_shared = likely_shared; }
1276 inline bool request::is_likely_shared()
const {
return likely_shared; }
1280 inline void request::set_rsvdc(uint32_t rsvdc) { this->rsvdc = rsvdc; }
1281 inline uint32_t request::get_rsvdc()
const {
return rsvdc; }
1283 inline void request::set_tag_op(uint8_t tag_op){ this->tag_op = tag_op; }
1284 inline uint8_t request::get_tag_op()
const {
return tag_op; }
1285 inline void request::set_tag_group_id(uint32_t tag_group_id){ this->tag_group_id = tag_group_id; }
1286 inline uint32_t request::get_tag_group_id()
const {
return tag_group_id; }
1287 inline void request::set_mpam(uint16_t mpam){ this->mpam = mpam; }
1288 inline uint16_t request::get_mpam()
const {
return mpam; }
1294 inline void snp_request::set_fwd_txn_id(uint8_t fwd_txn_id) { this->fwd_txn_id = fwd_txn_id; }
1295 inline uint8_t snp_request::get_fwd_txn_id()
const {
return fwd_txn_id; }
1298 inline void snp_request::set_stash_lp_id(uint8_t stash_lp_id) { this->stash_lp_id = stash_lp_id; }
1299 inline uint8_t snp_request::get_stash_lp_id()
const {
return stash_lp_id; }
1302 inline void snp_request::set_stash_lp_id_valid(
bool stash_lp_id_valid) { this->stash_lp_id_valid = stash_lp_id_valid; }
1303 inline bool snp_request::is_stash_lp_id_valid()
const {
return stash_lp_id_valid; }
1306 inline void snp_request::set_vm_id_ext(uint8_t vm_id_ext) { this->vm_id_ext = vm_id_ext; }
1307 inline uint8_t snp_request::get_vm_id_ext()
const {
return vm_id_ext; }
1310 inline void snp_request::set_fwd_n_id(uint16_t fwd_n_id) { this->fwd_n_id = fwd_n_id; }
1311 inline uint16_t snp_request::get_fwd_n_id()
const {
return fwd_n_id; }
1313 inline void snp_request::set_opcode(snp_optype_e opcode) {
1315 this->opcode = opcode;
1317 inline snp_optype_e snp_request::get_opcode()
const {
return opcode; }
1321 inline void snp_request::set_non_secure(
bool non_secure)
1323 this->ns = non_secure;
1325 inline bool snp_request::is_non_secure() const
1332 inline void snp_request::set_do_not_goto_sd(
bool do_not_goto_sd) { this->do_not_goto_sd = do_not_goto_sd; }
1333 inline bool snp_request::is_do_not_goto_sd()
const {
return do_not_goto_sd; }
1337 inline void snp_request::set_do_not_data_pull(
bool do_not_data_pull) { this->do_not_data_pull = do_not_data_pull; }
1338 inline bool snp_request::is_do_not_data_pull()
const {
return do_not_data_pull; }
1342 inline void snp_request::set_ret_to_src(
bool ret_to_src) { this->ret_to_src = ret_to_src; }
1343 inline bool snp_request::is_ret_to_src()
const {
return ret_to_src; }
1347 inline void snp_request::set_trace_tag(
bool trace_tag) { this->trace_tag = trace_tag; }
1348 inline bool snp_request::is_trace_tag()
const {
return trace_tag; }
1356 inline void data::set_db_id(uint8_t db_id) { this->db_id = db_id; }
1357 inline uint8_t data::get_db_id()
const {
return db_id; }
1361 inline void data::set_resp_err(rsp_resperrtype_e resp_err) { this->resp_err = resp_err; }
1362 inline rsp_resperrtype_e data::get_resp_err()
const {
return resp_err; }
1365 inline void data::set_resp(dat_resptype_e resp) { this->resp = resp; }
1366 inline dat_resptype_e data::get_resp()
const {
return resp; }
1369 inline void data::set_fwd_state(uint8_t fwd_state) { this->fwd_state = fwd_state; }
1370 inline uint8_t data::get_fwd_state()
const {
return fwd_state; }
1374 inline void data::set_data_pull(uint8_t data_pull) { this->data_pull = data_pull; }
1375 inline uint8_t data::get_data_pull()
const {
return data_pull; }
1378 inline void chi::data::set_data_source(uint8_t data_source) { this->data_source = data_source; }
1379 inline uint8_t data::get_data_source()
const {
return data_source; }
1383 inline void data::set_cc_id(uint8_t cc_id) { this->cc_id = cc_id; }
1384 inline uint8_t data::get_cc_id()
const {
return cc_id; }
1387 inline void data::set_data_id(uint8_t data_id) { this->data_id = data_id; }
1388 inline uint8_t data::get_data_id()
const {
return data_id; }
1391 inline void data::set_poison(uint8_t poison) { this->poison = poison; }
1392 inline uint8_t data::get_poison()
const {
return poison; }
1395 inline void data::set_tgt_id(uint16_t tgt_id) { this->tgt_id = tgt_id; }
1396 inline uint16_t data::get_tgt_id()
const {
return tgt_id; }
1400 inline void data::set_home_n_id(uint16_t home_n_id) { this->home_n_id = home_n_id; }
1401 inline uint16_t data::get_home_n_id()
const {
return home_n_id; }
1405 inline void data::set_rsvdc(uint32_t rsvdc) { this->rsvdc = rsvdc; }
1406 inline uint32_t data::get_rsvdc()
const {
return rsvdc; }
1409 inline void data::set_data_check(uint64_t data_check) { this->data_check = data_check; }
1410 inline uint64_t data::get_data_check()
const {
return data_check; }
1412 inline void data::set_opcode(dat_optype_e opcode) { this->opcode = opcode; }
1413 inline dat_optype_e data::get_opcode()
const {
return opcode; }
1417 inline void data::set_trace_tag(
bool trace_tag) { this->trace_tag = trace_tag; }
1418 inline bool data::is_trace_tag()
const {
return trace_tag; }
1420 inline void data::set_tag_op(uint8_t tag_op) { this->tag_op = tag_op; }
1421 inline uint8_t data::get_tag_op()
const {
return tag_op; }
1422 inline void data::set_tag(uint64_t tag) { this->tag = tag; }
1423 inline uint64_t data::get_tag()
const {
return tag; }
1424 inline void data::set_tu(uint16_t tu) { this->tu = tu; }
1425 inline uint16_t data::get_tu()
const {
return tu; }
1433 inline void response::set_db_id(uint8_t db_id) { this->db_id = db_id; }
1434 inline uint8_t response::get_db_id()
const {
return db_id; }
1437 inline void response::set_pcrd_type(uint8_t pcrd_type) { this->pcrd_type = pcrd_type; }
1438 inline uint8_t response::get_pcrd_type()
const {
return pcrd_type; }
1442 inline void response::set_resp_err(rsp_resperrtype_e resp_err) { this->resp_err = resp_err; }
1443 inline rsp_resperrtype_e response::get_resp_err()
const {
return resp_err; }
1446 inline void response::set_resp(rsp_resptype_e resp) { this->resp = resp; }
1447 inline rsp_resptype_e response::get_resp()
const {
return resp; }
1450 inline void response::set_fwd_state(uint8_t fwd_state) { this->fwd_state = fwd_state; }
1451 inline uint8_t response::get_fwd_state()
const {
return fwd_state; }
1455 inline void response::set_data_pull(
bool data_pull) { this->data_pull = data_pull; }
1456 inline bool response::get_data_pull()
const {
return data_pull; }
1459 inline void response::set_tgt_id(uint16_t tgt_id) { this->tgt_id = tgt_id; }
1460 inline uint16_t response::get_tgt_id()
const {
return tgt_id; }
1461 inline void response::set_opcode(rsp_optype_e opcode) { this->opcode = opcode; }
1462 inline rsp_optype_e response::get_opcode()
const {
return opcode; }
1464 inline void response::set_tag_op(uint8_t tag_op) { this->tag_op = tag_op; }
1465 inline uint8_t response::get_tag_op()
const{
return tag_op; }
1466 inline void response::set_tag_group_id(uint32_t tag_group_id) { this->tag_group_id = tag_group_id; }
1467 inline uint32_t response::get_tag_group_id()
const{
return tag_group_id; }
1470 inline void response::set_trace_tag(
bool trace_tag) { this->trace_tag = trace_tag; }
1471 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)
std::ostream & operator<<(std::ostream &os, E e)
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