scc 2026.07
SystemC components library
axi_tlm.h
1/*
2 * Copyright 2020 Arteris IP
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <array>
20#include <cstdint>
21#include <tlm>
22#include <type_traits>
23
25namespace axi {
26
27enum class flavor_e { AXI, ACEL, ACE };
28
32template <typename Enum> struct enable_for_enum { static const bool value = false; };
38template <typename E> inline E into(typename std::underlying_type<E>::type t);
44template <typename E, typename ULT = typename std::underlying_type<E>::type,
45 typename X = typename std::enable_if<std::is_enum<E>::value && !std::is_convertible<E, ULT>::value, bool>::type>
46inline constexpr ULT to_int(E t) {
47 return static_cast<typename std::underlying_type<E>::type>(t);
48}
49
54template <typename E> const char* to_char(E t);
61template <typename E, typename std::enable_if<enable_for_enum<E>::value, bool>::type>
62inline std::ostream& operator<<(std::ostream& os, E e) {
63 os << to_char(e);
64 return os;
65}
66
67std::ostream& operator<<(std::ostream& os, tlm::tlm_generic_payload const& t);
68
72enum class burst_e : uint8_t {
73 FIXED = 0,
74 INCR = 1,
75 WRAP = 2
76};
77
80enum class lock_e : uint8_t { NORMAL = 0x0, EXLUSIVE = 0x1, LOCKED = 0x2 };
84enum class domain_e : uint8_t { NON_SHAREABLE = 0x0, INNER_SHAREABLE = 0x1, OUTER_SHAREABLE = 0x2, SYSTEM = 0x3 };
88enum class bar_e : uint8_t {
89 RESPECT_BARRIER = 0x0,
93};
94
98enum class snoop_e : uint8_t {
99 // clang-format off
100 // non-snooping (domain==0 || domain==3, bar==0)
101 READ_NO_SNOOP = 0x10,
102 // Coherent (domain==1 || domain==2, bar==0)
103 READ_ONCE = 0x0,
104 READ_SHARED = 0x1,
105 READ_CLEAN = 0x2,
106 READ_NOT_SHARED_DIRTY = 0x3,
107 READ_ONCE_CLEAN_INVALID = 0x4, // ACE5
108 READ_ONCE_MAKE_INVALID = 0x5, // ACE5
109 READ_UNIQUE = 0x7,
110 CLEAN_UNIQUE = 0xb,
111 MAKE_UNIQUE = 0xc,
112 // Cache maintenance (domain==0 || domain==1 || domain==2, bar==0)
113 CLEAN_SHARED = 0x8,
114 CLEAN_INVALID = 0x9,
115 CLEAN_SHARED_PERSIST = 0xa, // ACE5
116 MAKE_INVALID = 0xd,
117 // DVM (domain==1 || domain==2, bar==0)
118 DVM_COMPLETE = 0xe,
119 DVM_MESSAGE = 0xf,
120 // Barrier (bar==1)
121 BARRIER = 0x40,
122 // non-snooping (domain==0 || domain==3, bar==0)
123 WRITE_NO_SNOOP = 0x30,
124 // Coherent (domain==1 || domain==2, bar==0)
125 WRITE_UNIQUE = 0x20,
126 WRITE_LINE_UNIQUE = 0x21,
127 // Memory update (domain==0 || domain==1 || domain==2, bar==0)
128 WRITE_CLEAN = 0x22,
129 WRITE_BACK = 0x23,
130 // (domain==1 || domain==2)
131 EVICT = 0x24,
132 WRITE_EVICT = 0x25,
133 CMO_ON_WRITE = 0x26, // ACE5Lite
134 // Cache Stash Transactions, ACE5Lite
135 WRITE_UNIQUE_PTL_STASH = 0x28,
136 WRITE_UNIQUE_FULL_STASH = 0x29,
137 STASH_ONCE_SHARED = 0x2c,
138 STASH_ONCE_UNIQUE = 0x2d,
139 STASH_TRANSLATION = 0x2e
140 // clang-format on
141};
142
143enum class atop_low_e { ADD = 0x0, CLR = 0x1, EOR = 0x2, SET = 0x3, SMAX = 0x4, SMIN = 0x5, UMAX = 0x6, UMIN = 0x7 };
144
145enum class atop_enc_e {
146 NonAtomic = 0x00,
147 AtomicStore = 0x10,
148 AtomicLoad = 0x20,
149 AtomicSwap = 0x30,
150 AtomicCompare = 0x31,
151};
155enum class resp_e : uint8_t { OKAY = 0x0, EXOKAY = 0x1, SLVERR = 0x2, DECERR = 0x3 };
159struct common {
161 common() = default;
163 void reset();
170 id = o.id;
171 user = o.user;
172 return *this;
173 }
174
177 enum class id_type { CTRL, DATA, RESP };
180 void set_id(unsigned int value);
183 unsigned int get_id() const;
187 void set_user(id_type chnl, unsigned int value);
190 unsigned int get_user(id_type chnl) const;
191
192protected:
193 unsigned id{0};
194 std::array<unsigned, 3> user{{0, 0, 0}};
195};
196
203struct request {
205 request() = default;
207 void reset();
212 void set_length(uint8_t);
217 uint8_t get_length() const;
222 void set_size(uint8_t);
227 uint8_t get_size() const;
232 void set_burst(burst_e);
237 burst_e get_burst() const;
242 void set_prot(uint8_t);
247 uint8_t get_prot() const;
252 void set_privileged(bool = true);
257 bool is_privileged() const;
262 void set_non_secure(bool = true);
267 bool is_non_secure() const;
272 void set_instruction(bool = true);
277 bool is_instruction() const;
282 void set_cache(uint8_t);
287 uint8_t get_cache() const;
292 void set_qos(uint8_t);
297 uint8_t get_qos() const;
302 void set_region(uint8_t);
307 uint8_t get_region() const;
312 void set_atop(uint8_t);
317 uint8_t get_atop() const;
322 void set_stash_nid(uint8_t);
327 uint8_t get_stash_nid() const;
332 bool is_stash_nid_en() const;
337 void set_stash_lpid(uint8_t);
342 uint8_t get_stash_lpid() const;
347 bool is_stash_lpid_en() const;
348
349protected:
356 length = o.length;
357 size = o.size;
358 burst = o.burst;
359 prot = o.prot;
360 qos = o.qos;
361 region = o.region;
362 domain = o.domain;
363 snoop = o.snoop;
364 barrier = o.barrier;
365 lock = o.lock;
366 cache = o.cache;
367 unique = o.unique;
368 atop = o.atop;
369 return *this;
370 }
371
372 enum { // bit masks
373 BUFFERABLE = 1,
374 CACHEABLE = 2,
375 RA = 4,
376 WA = 8,
377 EXCL = 1,
378 LOCKED = 2,
379 PRIVILEGED = 1,
380 SECURE = 2,
381 INSTRUCTION = 4
382 };
383 bool unique{false};
384 // sums up to sizeof(bool) +11 bytes + sizeof(response)= 16bytes
385 uint8_t length{0};
386 uint8_t size{0};
387 burst_e burst{burst_e::FIXED};
388 uint8_t prot{0};
389 uint8_t qos{0};
390 uint8_t region{0};
391 domain_e domain{domain_e::NON_SHAREABLE};
392 snoop_e snoop{snoop_e::READ_NO_SNOOP};
393 bar_e barrier{bar_e::RESPECT_BARRIER};
394 lock_e lock{lock_e::NORMAL};
395 uint8_t cache{0};
396 uint8_t atop{0};
397 uint16_t stash_nid{std::numeric_limits<uint16_t>::max()};
398 uint8_t stash_lpid{std::numeric_limits<uint8_t>::max()};
399};
400
403struct axi3 : public request {
409 axi3& operator=(const axi3& o) {
411 return *this;
412 }
413
417 void set_exclusive(bool = true);
422 bool is_exclusive() const;
427 void set_locked(bool = true);
432 bool is_locked() const;
437 void set_bufferable(bool = true);
442 bool is_bufferable() const;
447 void set_cacheable(bool = true);
452 bool is_cacheable() const;
457 void set_write_allocate(bool = true);
462 bool is_write_allocate() const;
467 void set_read_allocate(bool = true);
472 bool is_read_allocate() const;
473};
474
477struct axi4 : public request {
483 axi4& operator=(const axi4& o) {
485 return *this;
486 }
487
491 void set_exclusive(bool = true);
496 bool is_exclusive() const;
501 void set_bufferable(bool = true);
506 bool is_bufferable() const;
511 void set_modifiable(bool = true);
516 bool is_modifiable() const;
521 void set_other_allocate(bool = true);
526 bool is_other_allocate() const;
531 void set_allocate(bool = true);
536 bool is_allocate() const;
541 void set_cacheable(bool = true);
546 bool is_cacheable() const;
551 void set_read_allocate(bool = true);
556 bool is_read_allocate() const;
561 void set_write_allocate(bool = true);
566 bool is_write_allocate() const;
567};
568
571struct ace : public axi4 {
577 ace& operator=(const ace& o) {
579 return *this;
580 }
581
585 void set_domain(domain_e);
590 domain_e get_domain() const;
595 void set_snoop(snoop_e);
600 snoop_e get_snoop() const;
605 void set_barrier(bar_e);
610 bar_e get_barrier() const;
615 void set_unique(bool);
620 bool get_unique() const;
621};
622
625struct response {
626 response() = default;
632 response& operator=(const response& o) {
633 resp = o.resp;
634 return *this;
635 }
636
639 void reset();
645 static resp_e from_tlm_response_status(tlm::tlm_response_status);
651 static tlm::tlm_response_status to_tlm_response_status(resp_e);
656 void set_resp(resp_e);
661 resp_e get_resp() const;
666 bool is_okay() const;
670 void set_okay();
675 bool is_exokay() const;
679 void set_exokay();
684 bool is_slverr() const;
688 void set_slverr();
693 bool is_decerr() const;
697 void set_decerr();
698
699protected:
700 enum { // bit masks for CRESP
701 DATATRANSFER = 1,
702 SNOOPEERROR = 2,
703 PASSDIRTY = 4,
704 ISSHARED = 8,
705 WASUNIQUE = 16
706 };
707 uint8_t resp{static_cast<uint8_t>(resp_e::OKAY)};
708};
709
712struct ace_response : public response {
717 void set_cresp(uint8_t);
722 uint8_t get_cresp() const;
727 bool is_pass_dirty() const;
732 void set_pass_dirty(bool = true);
737 bool is_shared() const;
742 void set_shared(bool = true);
747 // CRRESP[0]
748 bool is_snoop_data_transfer() const;
753 void set_snoop_data_transfer(bool = true);
758 // CRRESP[1]
759 bool is_snoop_error() const;
764 void set_snoop_error(bool = true);
769 // CRRESP[4]
770 bool is_snoop_was_unique() const;
775 void set_snoop_was_unique(bool = true);
776};
777
780template <typename REQ, typename RESP = response>
781struct axi_extension : public common, // 2x 4byte
782 public REQ, // 11byte + 4byte
783 public RESP // 1byte
784{
788 axi_extension() = default;
797 virtual ~axi_extension() {}
801 void reset();
806 void reset(const REQ*);
816 const std::vector<response>& get_response_array() const;
821 std::vector<response>& get_response_array();
832
833private:
834 std::vector<response> response_arr{};
835 bool response_array_complete{false};
836};
840struct axi3_extension : public tlm::tlm_extension<axi3_extension>, public axi_extension<axi3> {
844 axi3_extension() = default;
851
855 tlm::tlm_extension_base* clone() const override;
860 void copy_from(tlm::tlm_extension_base const& ext) override;
861};
862
865struct axi4_extension : public tlm::tlm_extension<axi4_extension>, public axi_extension<axi4> {
869 axi4_extension() = default;
876
880 tlm::tlm_extension_base* clone() const override;
885 void copy_from(tlm::tlm_extension_base const& ext) override;
886};
887
890struct ace_extension : public tlm::tlm_extension<ace_extension>, public axi_extension<ace, ace_response> {
894 ace_extension() = default;
901
905 tlm::tlm_extension_base* clone() const override;
910 void copy_from(tlm::tlm_extension_base const& ext) override;
911};
912
913using axi_payload = tlm::tlm_generic_payload;
914using axi_phase = tlm::tlm_phase;
920 typedef axi_payload tlm_payload_type;
921 typedef axi_phase tlm_phase_type;
922};
923
926enum SC_API tlm_phase_enum {
927 UNINITIALIZED_PHASE = 0,
928 BEGIN_REQ = tlm::BEGIN_REQ,
929 END_REQ = tlm::END_REQ,
930 BEGIN_RESP = tlm::BEGIN_RESP,
931 END_RESP = tlm::END_RESP
932};
933DECLARE_EXTENDED_PHASE(BEGIN_PARTIAL_REQ);
934DECLARE_EXTENDED_PHASE(END_PARTIAL_REQ);
935DECLARE_EXTENDED_PHASE(BEGIN_PARTIAL_RESP);
936DECLARE_EXTENDED_PHASE(END_PARTIAL_RESP);
937DECLARE_EXTENDED_PHASE(ACK);
941template <typename TRANS = tlm::tlm_generic_payload> class bw_blocking_transport_if : public virtual sc_core::sc_interface {
942public:
948 virtual void b_snoop(TRANS& trans, sc_core::sc_time& t) = 0;
949};
950
951template <typename TYPES = axi_protocol_types> using axi_fw_transport_if = tlm::tlm_fw_transport_if<TYPES>;
953template <typename TYPES = axi_protocol_types> using axi_bw_transport_if = tlm::tlm_bw_transport_if<TYPES>;
955template <typename TYPES = axi_protocol_types> using ace_fw_transport_if = tlm::tlm_fw_transport_if<TYPES>;
959template <typename TYPES = axi_protocol_types>
960class ace_bw_transport_if : public tlm::tlm_bw_transport_if<TYPES>,
962
963#if SC_VERSION_MAJOR < 3
964using type_index = sc_core::sc_type_index;
965#else
966using type_index = std::type_index;
967#endif
968
972template <unsigned int BUSWIDTH = 32, typename TYPES = axi_protocol_types, int N = 1,
973 sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND>
975: public tlm::tlm_base_initiator_socket<BUSWIDTH, axi_fw_transport_if<TYPES>, axi_bw_transport_if<TYPES>, N, POL> {
977 using base_type = tlm::tlm_base_initiator_socket<BUSWIDTH, axi_fw_transport_if<TYPES>, axi_bw_transport_if<TYPES>, N, POL>;
983
987 explicit axi_initiator_socket(const char* name)
988 : base_type(name) {}
989
993 const char* kind() const override { return "axi_initiator_socket"; }
994 // not the right version but we assume TLM is always bundled with SystemC
995#if SYSTEMC_VERSION >= 20181013 || defined(NCSC) // ((TLM_VERSION_MAJOR > 2) || (TLM_VERSION==2 && TLM_VERSION_MINOR>0) ||(TLM_VERSION==2
996 // && TLM_VERSION_MINOR>0 && TLM_VERSION_PATCH>4))
997 type_index get_protocol_types() const override { return typeid(TYPES); }
998#endif
999};
1000
1003template <unsigned int BUSWIDTH = 32, typename TYPES = axi_protocol_types, int N = 1,
1004 sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND>
1005struct axi_target_socket : public tlm::tlm_base_target_socket<BUSWIDTH, axi_fw_transport_if<TYPES>, axi_bw_transport_if<TYPES>, N, POL> {
1007 using base_type = tlm::tlm_base_target_socket<BUSWIDTH, axi_fw_transport_if<TYPES>, axi_bw_transport_if<TYPES>, N, POL>;
1013
1017 explicit axi_target_socket(const char* name)
1018 : base_type(name) {}
1019
1023 const char* kind() const override { return "axi_target_socket"; }
1024 // not the right version but we assume TLM is always bundled with SystemC
1025#if SYSTEMC_VERSION >= 20181013 || defined(NCSC) // ((TLM_VERSION_MAJOR > 2) || (TLM_VERSION==2 && TLM_VERSION_MINOR>0) ||(TLM_VERSION==2
1026 // && TLM_VERSION_MINOR>0 && TLM_VERSION_PATCH>4))
1027 type_index get_protocol_types() const override { return typeid(TYPES); }
1028#endif
1029};
1030
1033template <unsigned int BUSWIDTH = 32, typename TYPES = axi_protocol_types, int N = 1,
1034 sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND>
1036: public tlm::tlm_base_initiator_socket<BUSWIDTH, ace_fw_transport_if<TYPES>, ace_bw_transport_if<TYPES>, N, POL> {
1038 using base_type = tlm::tlm_base_initiator_socket<BUSWIDTH, ace_fw_transport_if<TYPES>, ace_bw_transport_if<TYPES>, N, POL>;
1044
1048 explicit ace_initiator_socket(const char* name)
1049 : base_type(name) {}
1050
1054 const char* kind() const override { return "axi_initiator_socket"; }
1055#if SYSTEMC_VERSION >= 20181013 || defined(NCSC) // not the right version but we assume TLM is always bundled with SystemC
1060 type_index get_protocol_types() const override { return typeid(TYPES); }
1061#endif
1062};
1063
1066template <unsigned int BUSWIDTH = 32, typename TYPES = axi_protocol_types, int N = 1,
1067 sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND>
1068struct ace_target_socket : public tlm::tlm_base_target_socket<BUSWIDTH, ace_fw_transport_if<TYPES>, ace_bw_transport_if<TYPES>, N, POL> {
1070 using base_type = tlm::tlm_base_target_socket<BUSWIDTH, ace_fw_transport_if<TYPES>, ace_bw_transport_if<TYPES>, N, POL>;
1076
1080 explicit ace_target_socket(const char* name)
1081 : base_type(name) {}
1082
1086 const char* kind() const override { return "axi_target_socket"; }
1087 // not the right version but we assume TLM is always bundled with SystemC
1088#if SYSTEMC_VERSION >= 20181013 || defined(NCSC) // not the right version but we assume TLM is always bundled with SystemC
1093 type_index get_protocol_types() const override { return typeid(TYPES); }
1094#endif
1095};
1096/*****************************************************************************
1097 * free function easing handling of transactions and extensions
1098 *****************************************************************************/
1099
1100template <typename EXT> bool is_valid(EXT& ext) { return is_valid(&ext); }
1101
1102template <typename EXT> bool is_valid(EXT* ext) { return is_valid_msg(ext) == nullptr; }
1103
1104template <typename EXT> char const* is_valid_msg(EXT& ext) { return is_valid_msg(&ext); }
1105
1106template <typename EXT> char const* is_valid_msg(EXT* ext);
1107
1108inline bool is_dataless(axi::ace_extension const* ext) {
1109 if(!ext)
1110 return false;
1111 auto snp = ext->get_snoop();
1112 return snp == snoop_e::CLEAN_UNIQUE || snp == snoop_e::MAKE_UNIQUE || snp == snoop_e::CLEAN_SHARED || snp == snoop_e::CLEAN_INVALID ||
1113 snp == snoop_e::MAKE_INVALID || snp == snoop_e::EVICT || snp == snoop_e::STASH_ONCE_SHARED || snp == snoop_e::STASH_ONCE_UNIQUE;
1114}
1115
1116inline unsigned get_axi_id(axi::axi_protocol_types::tlm_payload_type const& trans) {
1117 if(auto e = trans.get_extension<axi::ace_extension>())
1118 return e->get_id();
1119 if(auto e = trans.get_extension<axi::axi4_extension>())
1120 return e->get_id();
1121 if(auto e = trans.get_extension<axi::axi3_extension>())
1122 return e->get_id();
1123 sc_assert(false && "transaction is not an axi or ace transaction");
1124 return std::numeric_limits<unsigned>::max();
1125}
1126
1127inline unsigned get_axi_id(axi::axi_protocol_types::tlm_payload_type const* trans) { return get_axi_id(*trans); }
1128
1136inline bool is_burst(const axi::axi_protocol_types::tlm_payload_type& trans) {
1137 if(auto e = trans.get_extension<axi::ace_extension>())
1138 return e->get_length() > 0;
1139 if(auto e = trans.get_extension<axi::axi4_extension>())
1140 return e->get_length() > 0;
1141 if(auto e = trans.get_extension<axi::axi3_extension>())
1142 return e->get_length() > 0;
1143 sc_assert(false && "transaction is not an axi or ace transaction");
1144 return false;
1145}
1146
1151inline bool is_burst(const axi::axi_protocol_types::tlm_payload_type* trans) { return is_burst(*trans); }
1157inline unsigned get_burst_length(const request& r) { return r.get_length() + 1; }
1163inline unsigned get_burst_length(const request* r) { return r->get_length() + 1; }
1169inline unsigned get_burst_length(const axi::axi_protocol_types::tlm_payload_type& trans) {
1170 if(auto e = trans.get_extension<axi::ace_extension>())
1171 return e->get_length() + 1;
1172 if(auto e = trans.get_extension<axi::axi4_extension>())
1173 return e->get_length() + 1;
1174 if(auto e = trans.get_extension<axi::axi3_extension>())
1175 return e->get_length() + 1;
1176 sc_assert(false && "transaction is not an axi or ace transaction");
1177 return 0;
1178}
1179
1184inline unsigned get_burst_length(const axi::axi_protocol_types::tlm_payload_type* trans) { return get_burst_length(*trans); }
1190inline unsigned get_burst_size(const request& r) { return 1 << r.get_size(); }
1196inline unsigned get_burst_size(const request* r) { return 1 << r->get_size(); }
1202inline unsigned get_burst_size(const axi::axi_protocol_types::tlm_payload_type& trans) {
1203 if(auto e = trans.get_extension<axi::ace_extension>())
1204 return 1 << e->get_size();
1205 if(auto e = trans.get_extension<axi::axi4_extension>())
1206 return 1 << e->get_size();
1207 if(auto e = trans.get_extension<axi::axi3_extension>())
1208 return 1 << e->get_size();
1209 sc_assert(false && "transaction is not an axi or ace transaction");
1210 return 0;
1211}
1212
1217inline unsigned get_burst_size(const axi::axi_protocol_types::tlm_payload_type* trans) { return get_burst_size(*trans); }
1218
1219inline burst_e get_burst_type(const axi::axi_protocol_types::tlm_payload_type& trans) {
1220 if(auto e = trans.get_extension<axi::ace_extension>())
1221 return e->get_burst();
1222 if(auto e = trans.get_extension<axi::axi4_extension>())
1223 return e->get_burst();
1224 if(auto e = trans.get_extension<axi::axi3_extension>())
1225 return e->get_burst();
1226 sc_assert(false && "transaction is not an axi or ace transaction");
1227 return burst_e::FIXED;
1228}
1229inline burst_e get_burst_type(const axi::axi_protocol_types::tlm_payload_type* trans) { return get_burst_type(*trans); }
1230
1231inline unsigned get_cache(const axi::axi_protocol_types::tlm_payload_type& trans) {
1232 if(auto e = trans.get_extension<axi::ace_extension>())
1233 return e->get_cache();
1234 if(auto e = trans.get_extension<axi::axi4_extension>())
1235 return e->get_cache();
1236 if(auto e = trans.get_extension<axi::axi3_extension>())
1237 return e->get_cache();
1238 sc_assert(false && "transaction is not an axi or ace transaction");
1239 return 0;
1240}
1241inline unsigned get_cache(const axi::axi_protocol_types::tlm_payload_type* trans) { return get_cache(*trans); }
1242
1243/*****************************************************************************
1244 * Implementation details
1245 *****************************************************************************/
1246template <> struct enable_for_enum<burst_e> { static const bool enable = true; };
1247template <> struct enable_for_enum<lock_e> { static const bool enable = true; };
1248template <> struct enable_for_enum<domain_e> { static const bool enable = true; };
1249template <> struct enable_for_enum<bar_e> { static const bool enable = true; };
1250template <> struct enable_for_enum<snoop_e> { static const bool enable = true; };
1251template <> struct enable_for_enum<resp_e> { static const bool enable = true; };
1252
1253template <> inline burst_e into<burst_e>(typename std::underlying_type<burst_e>::type t) {
1254 assert(t <= static_cast<std::underlying_type<burst_e>::type>(burst_e::WRAP));
1255 return static_cast<burst_e>(t);
1256}
1257
1258template <> inline lock_e into<lock_e>(typename std::underlying_type<lock_e>::type t) {
1259 assert(t <= static_cast<std::underlying_type<lock_e>::type>(lock_e::LOCKED));
1260 return static_cast<lock_e>(t);
1261}
1262
1263template <> inline domain_e into<domain_e>(typename std::underlying_type<domain_e>::type t) {
1264 assert(t <= static_cast<std::underlying_type<domain_e>::type>(domain_e::SYSTEM));
1265 return static_cast<domain_e>(t);
1266}
1267
1268template <> inline bar_e into<bar_e>(typename std::underlying_type<bar_e>::type t) {
1269 assert(t <= static_cast<std::underlying_type<bar_e>::type>(bar_e::SYNCHRONISATION_BARRIER));
1270 return static_cast<bar_e>(t);
1271}
1272
1273template <> inline snoop_e into<snoop_e>(typename std::underlying_type<snoop_e>::type t) {
1274 assert(t <= static_cast<std::underlying_type<snoop_e>::type>(snoop_e::WRITE_NO_SNOOP));
1275 return static_cast<snoop_e>(t);
1276}
1277
1278template <> inline resp_e into<resp_e>(typename std::underlying_type<resp_e>::type t) {
1279 assert(t <= static_cast<std::underlying_type<resp_e>::type>(resp_e::DECERR));
1280 return static_cast<resp_e>(t);
1281}
1282
1283inline void common::set_id(unsigned int id) { this->id = id; }
1284
1285inline unsigned int common::get_id() const { return id; }
1286
1287inline void common::set_user(id_type chnl, unsigned int user) { this->user[static_cast<size_t>(chnl)] = user; }
1288
1289inline unsigned int common::get_user(id_type chnl) const { return user[static_cast<size_t>(chnl)]; }
1290
1291inline void axi3::set_exclusive(bool exclusive) {
1292 uint8_t t = to_int(lock);
1293 if(exclusive)
1294 t |= EXCL;
1295 else
1296 t &= ~EXCL;
1297 lock = into<lock_e>(t);
1298}
1299
1300inline bool axi3::is_exclusive() const {
1301 uint8_t t = to_int(lock);
1302 return (t & EXCL) != 0;
1303}
1304
1305inline void axi3::set_locked(bool locked) {
1306 uint8_t t = to_int(lock);
1307 if(locked)
1308 t |= LOCKED;
1309 else
1310 t &= ~LOCKED;
1311 lock = into<lock_e>(t);
1312}
1313
1314inline bool axi3::is_locked() const {
1315 uint8_t t = to_int(lock);
1316 return (t & LOCKED) != 0;
1317}
1318
1319inline void axi3::set_bufferable(bool bufferable) {
1320 if(bufferable)
1321 cache |= BUFFERABLE;
1322 else
1323 cache &= ~BUFFERABLE;
1324}
1325
1326inline bool axi3::is_bufferable() const { return (cache & BUFFERABLE) != 0; }
1327
1328inline void axi3::set_cacheable(bool cacheable) {
1329 if(cacheable)
1330 cache |= CACHEABLE;
1331 else
1332 cache &= ~CACHEABLE;
1333}
1334
1335inline bool axi3::is_cacheable() const { return (cache & CACHEABLE) != 0; }
1336
1337inline void axi3::set_write_allocate(bool wa) {
1338 if(wa)
1339 cache |= WA;
1340 else
1341 cache &= ~WA;
1342}
1343
1344inline bool axi3::is_write_allocate() const { return (cache & WA) != 0; }
1345
1346inline void axi3::set_read_allocate(bool ra) {
1347 if(ra)
1348 cache |= RA;
1349 else
1350 cache &= ~RA;
1351}
1352
1353inline bool axi3::is_read_allocate() const { return (cache & RA) != 0; }
1354
1355inline void axi4::set_exclusive(bool exclusive) { lock = exclusive ? lock_e::EXLUSIVE : lock_e::NORMAL; }
1356
1357inline bool axi4::is_exclusive() const { return lock == lock_e::EXLUSIVE; }
1358
1359inline void axi4::set_bufferable(bool bufferable) {
1360 if(bufferable)
1361 cache |= BUFFERABLE;
1362 else
1363 cache &= ~BUFFERABLE;
1364}
1365
1366inline bool axi4::is_bufferable() const { return (cache & BUFFERABLE) != 0; }
1367
1368inline void axi4::set_modifiable(bool cacheable) {
1369 if(cacheable)
1370 cache |= CACHEABLE;
1371 else
1372 cache &= ~CACHEABLE;
1373}
1374
1375inline bool axi4::is_modifiable() const { return (cache & CACHEABLE) != 0; }
1376
1377inline void axi4::set_allocate(bool roa) {
1378 if(roa)
1379 cache |= WA;
1380 else
1381 cache &= ~WA;
1382}
1383
1384inline bool axi4::is_allocate() const { return (cache & WA) != 0; }
1385
1386inline void axi4::set_other_allocate(bool woa) {
1387 if(woa)
1388 cache |= RA;
1389 else
1390 cache &= ~RA;
1391}
1392
1393inline bool axi4::is_other_allocate() const { return (cache & RA) != 0; }
1394
1395inline void axi4::set_cacheable(bool cacheable) {
1396 if(cacheable)
1397 cache |= CACHEABLE;
1398 else
1399 cache &= ~CACHEABLE;
1400}
1401
1402inline bool axi4::is_cacheable() const { return (cache & CACHEABLE) != 0; }
1403
1404inline void axi4::set_write_allocate(bool roa) {
1405 if(roa)
1406 cache |= WA;
1407 else
1408 cache &= ~WA;
1409}
1410
1411inline bool axi4::is_write_allocate() const { return (cache & WA) != 0; }
1412
1413inline void axi4::set_read_allocate(bool woa) {
1414 if(woa)
1415 cache |= RA;
1416 else
1417 cache &= ~RA;
1418}
1419
1420inline bool axi4::is_read_allocate() const { return (cache & RA) != 0; }
1421
1422inline void request::reset() {
1423 length = 0;
1424 size = 0;
1425 burst = burst_e::FIXED;
1426 prot = 0;
1427 qos = 0;
1428 region = 0;
1429 domain = domain_e::NON_SHAREABLE;
1430 snoop = snoop_e::READ_NO_SNOOP;
1431 barrier = bar_e::RESPECT_BARRIER;
1432 lock = lock_e::NORMAL;
1433 cache = 0;
1434 unique = false;
1435 atop = 0;
1436}
1437
1438inline void request::set_length(uint8_t length) { this->length = length; }
1439
1440inline uint8_t request::get_length() const { return length; }
1441
1442inline void request::set_size(uint8_t size) {
1443 assert(size < 10);
1444 this->size = size;
1445}
1446
1447inline uint8_t request::get_size() const { return size; }
1448
1449inline void request::set_burst(burst_e burst) { this->burst = burst; }
1450
1451inline burst_e request::get_burst() const { return burst; }
1452
1453inline void request::set_prot(uint8_t prot) {
1454 assert(prot < 8);
1455 this->prot = prot;
1456}
1457
1458inline uint8_t request::get_prot() const { return prot; }
1459
1460inline void request::set_privileged(bool privileged) {
1461 prot &= ~PRIVILEGED;
1462 if(privileged)
1463 prot |= PRIVILEGED;
1464}
1465
1466inline bool request::is_privileged() const { return (prot & PRIVILEGED) != 0; }
1467
1468inline void request::set_non_secure(bool non_sec) {
1469 prot &= ~SECURE;
1470 if(non_sec)
1471 prot |= SECURE;
1472}
1473
1474inline bool request::is_non_secure() const { return (prot & SECURE) != 0; }
1475
1476inline void request::set_instruction(bool instr) {
1477 prot &= ~INSTRUCTION;
1478 if(instr)
1479 prot |= INSTRUCTION;
1480}
1481
1482inline bool request::is_instruction() const { return (prot & INSTRUCTION) != 0; }
1483
1484inline void request::set_qos(uint8_t qos) { this->qos = qos; }
1485
1486inline uint8_t request::get_qos() const { return qos; }
1487
1488inline void request::set_region(uint8_t region) { this->region = region; }
1489
1490inline uint8_t request::get_region() const { return region; }
1491
1492inline void request::set_cache(uint8_t cache) {
1493 assert(cache < 16);
1494 this->cache = cache;
1495}
1496
1497inline uint8_t request::get_cache() const { return cache; }
1498
1499inline void ace::set_domain(domain_e domain) { this->domain = domain; }
1500
1501inline domain_e ace::get_domain() const { return domain; }
1502
1503inline void ace::set_snoop(snoop_e snoop) { this->snoop = snoop; }
1504
1505inline snoop_e ace::get_snoop() const { return snoop; }
1506
1507inline void ace::set_barrier(bar_e bar) { this->barrier = bar; }
1508
1509inline bar_e ace::get_barrier() const { return barrier; }
1510
1511inline void ace::set_unique(bool uniq) { this->unique = uniq; }
1512
1513inline bool ace::get_unique() const { return unique; }
1514
1515inline void request::set_atop(uint8_t atop) { this->atop = atop; }
1516
1517inline uint8_t request::get_atop() const { return atop; }
1518
1519inline void request::set_stash_nid(uint8_t stash_nid) { this->stash_nid = stash_nid; }
1520
1521inline uint8_t request::get_stash_nid() const { return stash_nid < 0x800 ? stash_nid : 0; }
1522
1523inline bool request::is_stash_nid_en() const { return stash_nid < 0x800; }
1524
1525inline void request::set_stash_lpid(uint8_t stash_lpid) { this->stash_lpid = stash_lpid; }
1526
1527inline uint8_t request::get_stash_lpid() const { return stash_lpid < 0x20 ? stash_lpid : 0; }
1528
1529inline bool request::is_stash_lpid_en() const { return stash_lpid < 0x20; }
1530
1531inline void response::reset() { resp = static_cast<uint8_t>(resp_e::OKAY); }
1532
1533inline resp_e response::from_tlm_response_status(tlm::tlm_response_status st) {
1534 switch(st) {
1535 case tlm::TLM_OK_RESPONSE:
1536 return resp_e::OKAY;
1537 case tlm::TLM_INCOMPLETE_RESPONSE:
1538 case tlm::TLM_ADDRESS_ERROR_RESPONSE:
1539 return resp_e::DECERR;
1540 default:
1541 return resp_e::SLVERR;
1542 }
1543}
1544
1545inline tlm::tlm_response_status response::to_tlm_response_status(resp_e resp) {
1546 switch(to_int(resp) & 0x3) {
1547 case to_int(resp_e::OKAY):
1548 return tlm::TLM_OK_RESPONSE;
1549 case to_int(resp_e::EXOKAY):
1550 return tlm::TLM_OK_RESPONSE;
1551 case to_int(resp_e::DECERR):
1552 return tlm::TLM_ADDRESS_ERROR_RESPONSE;
1553 default:
1554 return tlm::TLM_GENERIC_ERROR_RESPONSE;
1555 }
1556}
1557
1558inline void response::set_resp(resp_e resp) { this->resp = static_cast<uint8_t>(resp); }
1559
1560inline resp_e response::get_resp() const { // @suppress("No return")
1561 switch(resp & 0x3) {
1562 case 0:
1563 return resp_e::OKAY;
1564 case 1:
1565 return resp_e::EXOKAY;
1566 case 2:
1567 return resp_e::SLVERR;
1568 default:
1569 return resp_e::DECERR;
1570 }
1571}
1572
1573inline bool response::is_okay() const { return resp == static_cast<uint8_t>(resp_e::OKAY); }
1574
1575inline void response::set_okay() { resp = static_cast<uint8_t>(resp_e::OKAY); }
1576
1577inline bool response::is_exokay() const { return resp == static_cast<uint8_t>(resp_e::EXOKAY); }
1578
1579inline void response::set_exokay() { resp = static_cast<uint8_t>(resp_e::EXOKAY); }
1580
1581inline bool response::is_slverr() const { return resp == static_cast<uint8_t>(resp_e::SLVERR); }
1582
1583inline void response::set_slverr() { resp = static_cast<uint8_t>(resp_e::SLVERR); }
1584
1585inline bool response::is_decerr() const { return resp == static_cast<uint8_t>(resp_e::DECERR); }
1586
1587inline void response::set_decerr() { resp = static_cast<uint8_t>(resp_e::DECERR); }
1588
1589inline void ace_response::set_cresp(uint8_t resp) { this->resp = resp & 0x1f; }
1590
1591inline uint8_t ace_response::get_cresp() const { return resp; }
1592
1593inline bool ace_response::is_pass_dirty() const { return (resp & PASSDIRTY) != 0; }
1594
1595inline void ace_response::set_pass_dirty(bool dirty) {
1596 if(dirty)
1597 resp |= PASSDIRTY;
1598 else
1599 resp &= ~PASSDIRTY;
1600}
1601
1602inline bool ace_response::is_shared() const { return (resp & ISSHARED) != 0; }
1603
1604inline void ace_response::set_shared(bool shared) {
1605 if(shared)
1606 resp |= ISSHARED;
1607 else
1608 resp &= ~ISSHARED;
1609}
1610
1611inline bool ace_response::is_snoop_data_transfer() const { return (resp & DATATRANSFER) != 0; }
1612
1613inline void ace_response::set_snoop_data_transfer(bool snoop_data) {
1614 if(snoop_data)
1615 resp |= DATATRANSFER;
1616 else
1617 resp &= ~DATATRANSFER;
1618}
1619
1620inline bool ace_response::is_snoop_error() const { return (resp & SNOOPEERROR) != 0; }
1621
1622inline void ace_response::set_snoop_error(bool err) {
1623 if(err)
1624 resp |= SNOOPEERROR;
1625 else
1626 resp &= ~SNOOPEERROR;
1627}
1628
1629inline bool ace_response::is_snoop_was_unique() const { return (resp & WASUNIQUE) != 0; }
1630
1632 if(uniq)
1633 resp |= WASUNIQUE;
1634 else
1635 resp &= ~WASUNIQUE;
1636}
1637
1638template <typename REQ, typename RESP> axi_extension<REQ, RESP>::axi_extension(const axi_extension<REQ, RESP>* ext) {
1639 static_cast<common&>(*this) = *ext;
1640 static_cast<REQ&>(*this) = *ext;
1641 static_cast<response&>(*this) = *ext;
1642}
1643
1644template <typename REQ, typename RESP> void axi_extension<REQ, RESP>::reset() {
1645 common::reset();
1646 REQ::reset();
1648}
1649
1650template <typename REQ, typename RESP> void axi_extension<REQ, RESP>::reset(const REQ* control) {
1651 common::reset();
1652 static_cast<REQ&>(*this) = *control;
1654}
1655
1656template <typename REQ, typename RESP> inline void axi_extension<REQ, RESP>::add_to_response_array(response& arr) {
1657 response_arr.push_back(arr);
1658}
1659
1660template <typename REQ, typename RESP> inline const std::vector<response>& axi_extension<REQ, RESP>::get_response_array() const {
1661 return response_arr;
1662}
1663
1664template <typename REQ, typename RESP> inline std::vector<response>& axi_extension<REQ, RESP>::get_response_array() { return response_arr; }
1665
1666template <typename REQ, typename RESP> inline void axi_extension<REQ, RESP>::set_response_array_complete(bool complete) {
1667 response_array_complete = complete;
1668}
1669
1670template <typename REQ, typename RESP> inline bool axi_extension<REQ, RESP>::is_response_array_complete() {
1671 return response_array_complete;
1672}
1673
1674inline tlm::tlm_extension_base* axi3_extension::clone() const { return new axi3_extension(this); }
1675
1676inline void axi3_extension::copy_from(const tlm::tlm_extension_base& bext) {
1677 auto const* ext = dynamic_cast<const axi3_extension*>(&bext);
1678 assert(ext);
1679 static_cast<common&>(*this) = *ext;
1680 static_cast<axi_extension<axi3>&>(*this) = *ext;
1681 static_cast<response&>(*this) = *ext;
1682}
1683
1684inline tlm::tlm_extension_base* axi4_extension::clone() const { return new axi4_extension(this); }
1685
1686inline void axi4_extension::copy_from(const tlm::tlm_extension_base& bext) {
1687 auto const* ext = dynamic_cast<const axi4_extension*>(&bext);
1688 assert(ext);
1689 static_cast<common&>(*this) = *ext;
1690 static_cast<axi_extension<axi4>&>(*this) = *ext;
1691 static_cast<response&>(*this) = *ext;
1692}
1693
1694inline tlm::tlm_extension_base* ace_extension::clone() const { return new ace_extension(this); }
1695
1696inline void ace_extension::copy_from(const tlm::tlm_extension_base& bext) {
1697 auto const* ext = dynamic_cast<const ace_extension*>(&bext);
1698 assert(ext);
1699 static_cast<common&>(*this) = *ext;
1700 static_cast<axi_extension<ace, ace_response>&>(*this) = *ext;
1701 static_cast<response&>(*this) = *ext;
1702}
1703
1704} // namespace axi
virtual void b_snoop(TRANS &trans, sc_core::sc_time &t)=0
snoop access to a snooped master
TLM2.0 components modeling AHB.
const char * to_char(E t)
tlm::tlm_generic_payload axi_payload
aliases for payload and phase types
Definition axi_tlm.h:913
unsigned get_burst_length(const request &r)
Definition axi_tlm.h:1157
domain_e
Definition axi_tlm.h:84
E into(typename std::underlying_type< E >::type t)
bar_e
Definition axi_tlm.h:88
@ MEMORY_BARRIER
Normal access, respecting barriers.
Definition axi_tlm.h:90
@ SYNCHRONISATION_BARRIER
Normal access, ignoring barriers.
Definition axi_tlm.h:92
@ IGNORE_BARRIER
Memory barrier.
Definition axi_tlm.h:91
tlm::tlm_bw_transport_if< TYPES > axi_bw_transport_if
alias declaration for the backward interface:
Definition axi_tlm.h:953
burst_e
Definition axi_tlm.h:72
tlm::tlm_fw_transport_if< TYPES > ace_fw_transport_if
alias declaration for the ACE forward interface
Definition axi_tlm.h:955
tlm::tlm_fw_transport_if< TYPES > axi_fw_transport_if
alias declaration for the forward interface
Definition axi_tlm.h:951
snoop_e
Definition axi_tlm.h:98
constexpr ULT to_int(E t)
Definition axi_tlm.h:46
bool is_burst(const axi::axi_protocol_types::tlm_payload_type &trans)
Definition axi_tlm.h:1136
lock_e
Definition axi_tlm.h:80
resp_e
Definition axi_tlm.h:155
unsigned get_burst_size(const request &r)
Definition axi_tlm.h:1190
ace_extension()=default
the default constructor
ace_extension(const ace_extension *o)
the copy constructor
Definition axi_tlm.h:899
tlm::tlm_extension_base * clone() const override
the clone function to create deep copies of
Definition axi_tlm.h:1694
void copy_from(tlm::tlm_extension_base const &ext) override
deep copy all values from ext
Definition axi_tlm.h:1696
tlm::tlm_base_initiator_socket< BUSWIDTH, ace_fw_transport_if< TYPES >, ace_bw_transport_if< TYPES >, N, POL > base_type
base type alias
Definition axi_tlm.h:1038
ace_initiator_socket(const char *name)
constructor with instance name
Definition axi_tlm.h:1048
const char * kind() const override
get the kind of this sc_object
Definition axi_tlm.h:1054
ace_initiator_socket()
default constructor using a generated instance name
Definition axi_tlm.h:1042
void set_snoop_was_unique(bool=true)
set the response status bit WasUnique
Definition axi_tlm.h:1631
bool is_snoop_data_transfer() const
check the response status bit DataTransfer
Definition axi_tlm.h:1611
void set_cresp(uint8_t)
set the coherent response status
Definition axi_tlm.h:1589
bool is_snoop_was_unique() const
check the response status bit WasUnique
Definition axi_tlm.h:1629
void set_snoop_error(bool=true)
set the response status bit Error
Definition axi_tlm.h:1622
void set_pass_dirty(bool=true)
set the response status bit PassDirty
Definition axi_tlm.h:1595
uint8_t get_cresp() const
get the coherent response status
Definition axi_tlm.h:1591
bool is_pass_dirty() const
check the response status bit PassDirty (CRESP[2])
Definition axi_tlm.h:1593
bool is_shared() const
check the response status bit IsShared (CRESP[3])
Definition axi_tlm.h:1602
void set_shared(bool=true)
set the response status bit IsShared
Definition axi_tlm.h:1604
bool is_snoop_error() const
check the response status bit Error
Definition axi_tlm.h:1620
void set_snoop_data_transfer(bool=true)
set the response status bit DataTransfer
Definition axi_tlm.h:1613
ace_target_socket()
default constructor using a generated instance name
Definition axi_tlm.h:1074
const char * kind() const override
get the kind of this sc_object
Definition axi_tlm.h:1086
tlm::tlm_base_target_socket< BUSWIDTH, ace_fw_transport_if< TYPES >, ace_bw_transport_if< TYPES >, N, POL > base_type
base type alias
Definition axi_tlm.h:1070
ace_target_socket(const char *name)
constructor with instance name
Definition axi_tlm.h:1080
void set_barrier(bar_e)
set the AxBAR value
Definition axi_tlm.h:1507
bool get_unique() const
get the AxUNIQUE value return the unique value
Definition axi_tlm.h:1513
void set_domain(domain_e)
set the AxDOMAIN value
Definition axi_tlm.h:1499
bar_e get_barrier() const
get the AxBAR value return the barrier value
Definition axi_tlm.h:1509
void set_unique(bool)
set the AxUNIQUE value
Definition axi_tlm.h:1511
ace & operator=(const ace &o)
Definition axi_tlm.h:577
snoop_e get_snoop() const
get the AxSNOOP value return the snoop value
Definition axi_tlm.h:1505
domain_e get_domain() const
get the AxDOMAIN value return the domain value
Definition axi_tlm.h:1501
void set_snoop(snoop_e)
set the AxSNOOP value
Definition axi_tlm.h:1503
axi3_extension(const axi3_extension *o)
the copy constructor
Definition axi_tlm.h:849
tlm::tlm_extension_base * clone() const override
the clone function to create deep copies of
Definition axi_tlm.h:1674
axi3_extension()=default
the default constructor
void copy_from(tlm::tlm_extension_base const &ext) override
deep copy all values from ext
Definition axi_tlm.h:1676
bool is_bufferable() const
get the bufferable bit of AxCACHE (AxCACHE[0]) return the bufferable bit
Definition axi_tlm.h:1326
void set_cacheable(bool=true)
set the cacheable bit of AxCACHE (AxCACHE[1])
Definition axi_tlm.h:1328
void set_write_allocate(bool=true)
set the write_allocate bit of AxCACHE (AxCACHE[2])
Definition axi_tlm.h:1337
bool is_read_allocate() const
get the read_allocate bit of AxCACHE (AxCACHE[3]) return the read_allocate bit
Definition axi_tlm.h:1353
void set_locked(bool=true)
get the locked bit of AxLOCK (AxLOCK[1])
Definition axi_tlm.h:1305
void set_exclusive(bool=true)
get the exclusive bit of AxLOCK (AxLOCK[0])
Definition axi_tlm.h:1291
void set_read_allocate(bool=true)
set the read_allocate bit of AxCACHE (AxCACHE[3])
Definition axi_tlm.h:1346
void set_bufferable(bool=true)
set the bufferable bit of AxCACHE (AxCACHE[0])
Definition axi_tlm.h:1319
bool is_exclusive() const
get the exclusive bit of AxLOCK (AxLOCK[0]) return the exclusive bit
Definition axi_tlm.h:1300
bool is_write_allocate() const
get the write_allocate bit of AxCACHE (AxCACHE[2]) return the write_allocate bit
Definition axi_tlm.h:1344
bool is_cacheable() const
get the cacheable bit of AxCACHE (AxCACHE[1]) return the cacheable bit
Definition axi_tlm.h:1335
bool is_locked() const
get the locked bit of AxLOCK (AxLOCK[1]) return the locked bit
Definition axi_tlm.h:1314
axi3 & operator=(const axi3 &o)
Definition axi_tlm.h:409
axi4_extension()=default
the default constructor
axi4_extension(const axi4_extension *o)
the copy constructor
Definition axi_tlm.h:874
void copy_from(tlm::tlm_extension_base const &ext) override
deep copy all values from ext
Definition axi_tlm.h:1686
tlm::tlm_extension_base * clone() const override
the clone function to create deep copies of
Definition axi_tlm.h:1684
void set_allocate(bool=true)
set the write allocate/read other allocate bit of AxCACHE (AxCACHE[3])
Definition axi_tlm.h:1377
bool is_modifiable() const
get the modifiable bit of AxCACHE (AxCACHE[1]) return the modifiable bit
Definition axi_tlm.h:1375
void set_exclusive(bool=true)
get the exclusive bit of AxLOCK (AxLOCK[0])
Definition axi_tlm.h:1355
bool is_allocate() const
get the write allocate/read other allocate bit of AxCACHE (AxCACHE[3]) return the write_other_allocat...
Definition axi_tlm.h:1384
void set_modifiable(bool=true)
set the modifiable bit of AxCACHE (AxCACHE[1])
Definition axi_tlm.h:1368
void set_other_allocate(bool=true)
set the read allocate/write other allocate bit of AxCACHE (AxCACHE[2])
Definition axi_tlm.h:1386
bool is_bufferable() const
get the bufferable bit of AxCACHE (AxCACHE[0]) return the bufferable bit
Definition axi_tlm.h:1366
bool is_exclusive() const
get the exclusive bit of AxLOCK (AxLOCK[0]) return the exclusive bit
Definition axi_tlm.h:1357
bool is_write_allocate() const
get the write allocate/read other allocate bit of AxCACHE (AxCACHE[3]) return the write_other_allocat...
Definition axi_tlm.h:1411
bool is_read_allocate() const
get the read allocate/write other allocate bit of AxCACHE (AxCACHE[2]) return the read_other_allocate...
Definition axi_tlm.h:1420
axi4 & operator=(const axi4 &o)
Definition axi_tlm.h:483
bool is_other_allocate() const
get the read allocate/write other allocate bit of AxCACHE (AxCACHE[2]) return the read_other_allocate...
Definition axi_tlm.h:1393
bool is_cacheable() const
get the modifiable bit of AxCACHE (AxCACHE[1]) return the modifiable bit
Definition axi_tlm.h:1402
void set_bufferable(bool=true)
set the bufferable bit of AxCACHE (AxCACHE[0])
Definition axi_tlm.h:1359
void set_write_allocate(bool=true)
set the write allocate/read other allocate bit of AxCACHE (AxCACHE[3])
Definition axi_tlm.h:1404
void set_read_allocate(bool=true)
set the read allocate/write other allocate bit of AxCACHE (AxCACHE[2])
Definition axi_tlm.h:1413
void set_cacheable(bool=true)
set the modifiable bit of AxCACHE (AxCACHE[1])
Definition axi_tlm.h:1395
bool is_response_array_complete()
Definition axi_tlm.h:1670
axi_extension()=default
the default constructor
const std::vector< response > & get_response_array() const
return the read response array for constant instances
Definition axi_tlm.h:1660
void set_response_array_complete(bool=true)
set the flag indicating the all read responses are collected
Definition axi_tlm.h:1666
void add_to_response_array(response &)
add a read response to the response array
Definition axi_tlm.h:1656
void reset()
reset all data member to their default
Definition axi_tlm.h:1644
virtual ~axi_extension()
Definition axi_tlm.h:797
axi_initiator_socket()
default constructor using a generated instance name
Definition axi_tlm.h:981
axi_initiator_socket(const char *name)
constructor with instance name
Definition axi_tlm.h:987
const char * kind() const override
get the kind of this sc_object
Definition axi_tlm.h:993
tlm::tlm_base_initiator_socket< BUSWIDTH, axi_fw_transport_if< TYPES >, axi_bw_transport_if< TYPES >, N, POL > base_type
base type alias
Definition axi_tlm.h:977
The AXI protocol traits class. Since the protocoll defines additional non-ignorable phases a dedicate...
Definition axi_tlm.h:919
tlm::tlm_base_target_socket< BUSWIDTH, axi_fw_transport_if< TYPES >, axi_bw_transport_if< TYPES >, N, POL > base_type
base type alias
Definition axi_tlm.h:1007
const char * kind() const override
get the kind of this sc_object
Definition axi_tlm.h:1023
axi_target_socket(const char *name)
constructor with instance name
Definition axi_tlm.h:1017
axi_target_socket()
default constructor using a generated instance name
Definition axi_tlm.h:1011
void reset()
reset all data member to their default
void set_id(unsigned int value)
Definition axi_tlm.h:1283
unsigned int get_user(id_type chnl) const
Definition axi_tlm.h:1289
void set_user(id_type chnl, unsigned int value)
Definition axi_tlm.h:1287
common & operator=(const common &o)
copy assignment operator
Definition axi_tlm.h:169
common()=default
the constructor
unsigned int get_id() const
Definition axi_tlm.h:1285
void set_instruction(bool=true)
set the instruction bit of the AxPROT (AxPROT[2])
Definition axi_tlm.h:1476
uint8_t get_atop() const
get the raw AWATOP value return the unique value
Definition axi_tlm.h:1517
void set_length(uint8_t)
set the AxLEN value of the transaction, the value denotes the burst length - 1
Definition axi_tlm.h:1438
bool is_stash_lpid_en() const
check if AWSTASHLPID is valid return the valid value
Definition axi_tlm.h:1529
void set_qos(uint8_t)
set the AxQOS (quality of service) value
Definition axi_tlm.h:1484
uint8_t get_stash_lpid() const
get the raw AWSTASHLPID value return the unique value
Definition axi_tlm.h:1527
void set_cache(uint8_t)
set the AxCACHE value as POD, only value from 0..15 are allowed
Definition axi_tlm.h:1492
void set_region(uint8_t)
set the AxREGION value
Definition axi_tlm.h:1488
request & operator=(const request &o)
Definition axi_tlm.h:355
bool is_instruction() const
set the instruction bit of the AxPROT (AxPROT[2])
Definition axi_tlm.h:1482
burst_e get_burst() const
get the AxBURST value,
Definition axi_tlm.h:1451
uint8_t get_length() const
get the AxLEN value of the transaction, the value denotes the burst length - 1
Definition axi_tlm.h:1440
bool is_privileged() const
get the privileged bit of the AxPROT (AxPROT[0])
Definition axi_tlm.h:1466
void set_non_secure(bool=true)
set the non-secure bit of the AxPROT (AxPROT[1])
Definition axi_tlm.h:1468
void set_stash_lpid(uint8_t)
set the raw AWSTASHLPID value
Definition axi_tlm.h:1525
void set_burst(burst_e)
set the AxBURST value,
Definition axi_tlm.h:1449
bool is_non_secure() const
set the non-secure bit of the AxPROT (AxPROT[1])
Definition axi_tlm.h:1474
uint8_t get_region() const
get the AxREGION value
Definition axi_tlm.h:1490
void set_privileged(bool=true)
set the privileged bit of the AxPROT (AxPROT[0])
Definition axi_tlm.h:1460
bool is_stash_nid_en() const
check if AWSTASHNID is valid return the valid value
Definition axi_tlm.h:1523
void reset()
reset all data member to their default
Definition axi_tlm.h:1422
uint8_t get_qos() const
get the AxQOS (quality of service) value
Definition axi_tlm.h:1486
uint8_t get_stash_nid() const
get the raw AWSTASHNID value return the unique value
Definition axi_tlm.h:1521
void set_atop(uint8_t)
set the raw AWATOP value
Definition axi_tlm.h:1515
void set_size(uint8_t)
get the AxSIZE value of the transaction, the length is 2^size. It needs to be less than 10 (512 bit w...
Definition axi_tlm.h:1442
request()=default
the default constructor
uint8_t get_cache() const
get the AxCACHE value as POD
Definition axi_tlm.h:1497
uint8_t get_prot() const
set the AxPROT value as POD, only values from 0...7 are allowed
Definition axi_tlm.h:1458
void set_prot(uint8_t)
set the AxPROT value as POD, only values from 0...7 are allowed
Definition axi_tlm.h:1453
void set_stash_nid(uint8_t)
set the raw AWSTASHNID value
Definition axi_tlm.h:1519
uint8_t get_size() const
set the AxSIZE value of the transaction
Definition axi_tlm.h:1447
resp_e get_resp() const
get the response status as POD
Definition axi_tlm.h:1560
void set_okay()
set the response status to OKAY
Definition axi_tlm.h:1575
response & operator=(const response &o)
assignment operator
Definition axi_tlm.h:632
void set_decerr()
set the response status to DECERR
Definition axi_tlm.h:1587
bool is_decerr() const
check if the response status is DECERR
Definition axi_tlm.h:1585
void set_resp(resp_e)
set the response status as POD
Definition axi_tlm.h:1558
bool is_exokay() const
check if the response status is EXOKAY
Definition axi_tlm.h:1577
bool is_slverr() const
check if the response status is SLVERR
Definition axi_tlm.h:1581
void set_slverr()
set the response status to SLVERR
Definition axi_tlm.h:1583
bool is_okay() const
check if the response status is OKAY
Definition axi_tlm.h:1573
void reset()
reset all data member to their default
Definition axi_tlm.h:1531
static tlm::tlm_response_status to_tlm_response_status(resp_e)
converts a
Definition axi_tlm.h:1545
void set_exokay()
set the response status to EXOKAY
Definition axi_tlm.h:1579
static resp_e from_tlm_response_status(tlm::tlm_response_status)
converts the response status of a generic payload to a
Definition axi_tlm.h:1533