17 #ifndef _TILELINK_TL_TLM_H_
18 #define _TILELINK_TL_TLM_H_
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);
41 template <typename E, typename ULT = typename std::underlying_type<E>::type,
42 typename X =
typename std::enable_if<std::is_enum<E>::value && !std::is_convertible<E, ULT>::value,
bool>::type>
44 return static_cast<typename std::underlying_type<E>::type
>(t);
51 template <
typename E>
const char*
to_char(E t);
58 template <typename E, typename std::enable_if<enable_for_enum<E>::value,
bool>::type>
59 inline std::ostream& operator<<(std::ostream& os, E e) {
64 std::ostream& operator<<(std::ostream& os, tlm::tlm_generic_payload
const& t);
69 AccessAckData = 0x061,
71 PutPartialData = 0x181,
73 ArithmeticData = 0x182,
96 uint8_t get_param()
const;
97 void set_param(uint8_t);
99 uint64_t get_source()
const;
100 void set_source(uint64_t);
102 uint64_t get_sink()
const;
103 void set_sink(uint64_t);
105 bool is_corrupt()
const;
106 void set_corrupt(
bool =
true);
108 bool is_denied()
const;
109 void set_denied(
bool =
true);
118 tlm::tlm_extension_base*
clone()
const override;
123 void copy_from(tlm::tlm_extension_base
const& ext)
override;
135 using tl_phase = tlm::tlm_phase;
142 typedef tl_phase tlm_phase_type;
158 virtual void b_snoop(TRANS& trans, sc_core::sc_time& t) = 0;
161 template <
typename TYPES = tl_protocol_types>
using tlu_fw_transport_if = tlm::tlm_fw_transport_if<TYPES>;
163 template <
typename TYPES = tl_protocol_types>
using tlu_bw_transport_if = tlm::tlm_bw_transport_if<TYPES>;
165 template <
typename TYPES = tl_protocol_types>
using tlc_fw_transport_if = tlm::tlm_fw_transport_if<TYPES>;
169 template <
typename TYPES = tl_protocol_types>
176 template <
unsigned int BUSWIDTH = 32,
typename TYPES =
tl_protocol_types,
int N = 1,
177 sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND>
179 :
public tlm::tlm_base_initiator_socket<BUSWIDTH, tlu_fw_transport_if<TYPES>, tlu_bw_transport_if<TYPES>, N, POL> {
197 const char*
kind()
const override {
return "tlu_initiator_socket"; }
199 #if SYSTEMC_VERSION >= 20181013
201 sc_core::sc_type_index get_protocol_types()
const override {
return typeid(TYPES); }
207 template <
unsigned int BUSWIDTH = 32,
typename TYPES = tl_protocol_types,
int N = 1,
208 sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND>
209 struct tlu_target_socket :
public tlm::tlm_base_target_socket<BUSWIDTH, tlu_fw_transport_if<TYPES>, tlu_bw_transport_if<TYPES>, N, POL> {
227 const char*
kind()
const override {
return "tlu_target_socket"; }
229 #if SYSTEMC_VERSION >= 20181013
231 sc_core::sc_type_index get_protocol_types()
const override {
return typeid(TYPES); }
237 template <
unsigned int BUSWIDTH = 32,
typename TYPES = tl_protocol_types,
int N = 1,
238 sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND>
240 :
public tlm::tlm_base_initiator_socket<BUSWIDTH, tlc_fw_transport_if<TYPES>, tlc_bw_transport_if<TYPES>, N, POL> {
258 const char*
kind()
const override {
return "tlc_initiator_socket"; }
259 #if SYSTEMC_VERSION >= 20181013
264 sc_core::sc_type_index get_protocol_types() const override { return typeid(TYPES); }
270 template <
unsigned int BUSWIDTH = 32,
typename TYPES = tl_protocol_types,
int N = 1,
271 sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND>
272 struct tlc_target_socket :
public tlm::tlm_base_target_socket<BUSWIDTH, tlc_fw_transport_if<TYPES>, tlc_bw_transport_if<TYPES>, N, POL> {
290 const char*
kind()
const override {
return "tlc_target_socket"; }
292 #if SYSTEMC_VERSION >= 20181013
297 sc_core::sc_type_index get_protocol_types() const override { return typeid(TYPES); }
308 inline opcode_e tilelink_extension::get_opcode()
const {
return opcode; }
310 inline void tilelink_extension::set_opcode(
opcode_e opcode) { this->opcode = opcode; }
312 inline uint8_t tilelink_extension::get_param()
const {
return param; }
314 inline void tilelink_extension::set_param(uint8_t param) { this->param = param; }
316 inline uint64_t tilelink_extension::get_source()
const {
return source; }
318 inline void tilelink_extension::set_source(uint64_t source) { this->source = source; }
320 inline uint64_t tilelink_extension::get_sink()
const {
return sink; }
322 inline void tilelink_extension::set_sink(uint64_t sink) { this->sink = sink; }
324 inline bool tilelink_extension::is_corrupt()
const {
return corrupt; }
326 inline void tilelink_extension::set_corrupt(
bool corrupt) { this->corrupt = corrupt; }
328 inline bool tilelink_extension::is_denied()
const {
return denied; }
330 inline void tilelink_extension::set_denied(
bool denied) { this->denied = denied; }
virtual void b_snoop(TRANS &trans, sc_core::sc_time &t)=0
snoop access to a snooped master
TLM2.0 components modeling APB.
opcode_e
opcodes of Tilelink.. The encode the opcode (opcode_e[2:0]) and the applicable channels (opcode_e[8] ...
tlm::tlm_generic_payload tl_payload
aliases for payload and phase types
DECLARE_EXTENDED_PHASE(ACK)
E into(typename std::underlying_type< E >::type t)
tlm::tlm_bw_transport_if< TYPES > tlu_bw_transport_if
alias declaration for the backward interface:
tlm::tlm_fw_transport_if< TYPES > tlu_fw_transport_if
alias declaration for the forward interface
constexpr ULT to_int(E t)
const char * to_char(E t)
tlm::tlm_fw_transport_if< TYPES > tlc_fw_transport_if
alias declaration for the ACE forward interface
void copy_from(tlm::tlm_extension_base const &ext) override
deep copy all values from ext
tlm::tlm_extension_base * clone() const override
the clone function to create deep copies of
The AXI protocol traits class. Since the protocoll defines additional non-ignorable phases a dedicate...
const char * kind() const override
get the kind of this sc_object
tlc_initiator_socket()
default constructor using a generated instance name
tlc_initiator_socket(const char *name)
constructor with instance name
tlm::tlm_base_initiator_socket< BUSWIDTH, tlc_fw_transport_if< TYPES >, tlc_bw_transport_if< TYPES >, N, POL > base_type
base type alias
tlm::tlm_base_target_socket< BUSWIDTH, tlc_fw_transport_if< TYPES >, tlc_bw_transport_if< TYPES >, N, POL > base_type
base type alias
tlc_target_socket(const char *name)
constructor with instance name
tlc_target_socket()
default constructor using a generated instance name
const char * kind() const override
get the kind of this sc_object
tlu_initiator_socket(const char *name)
constructor with instance name
tlm::tlm_base_initiator_socket< BUSWIDTH, tlu_fw_transport_if< TYPES >, tlu_bw_transport_if< TYPES >, N, POL > base_type
base type alias
const char * kind() const override
get the kind of this sc_object
tlu_initiator_socket()
default constructor using a generated instance name
tlm::tlm_base_target_socket< BUSWIDTH, tlu_fw_transport_if< TYPES >, tlu_bw_transport_if< TYPES >, N, POL > base_type
base type alias
tlu_target_socket()
default constructor using a generated instance name
tlu_target_socket(const char *name)
constructor with instance name
const char * kind() const override
get the kind of this sc_object