17#ifndef _TILELINK_TL_TLM_H_
18#define _TILELINK_TL_TLM_H_
29template <
typename Enum>
struct enable_for_enum {
static const bool value =
false; };
35template <
typename E>
inline E
into(
typename std::underlying_type<E>::type t);
41template <typename E, typename ULT = typename std::underlying_type<E>::type,
42 typename X =
typename std::enable_if<std::is_enum<E>::value && !std::is_convertible<E, ULT>::value,
bool>::type>
44 return static_cast<typename std::underlying_type<E>::type
>(t);
51template <
typename E>
const char*
to_char(E t);
58template <typename E, typename std::enable_if<enable_for_enum<E>::value,
bool>::type>
59inline std::ostream& operator<<(std::ostream& os, E e) {
64std::ostream& operator<<(std::ostream& os, tlm::tlm_generic_payload
const& t);
69 AccessAckData = 0x061,
71 PutPartialData = 0x181,
73 ArithmeticData = 0x182,
112struct tilelink_extension :
public tlm::tlm_extension<tilelink_extension> {
116 param_e get_param()
const;
117 void set_param(param_e);
119 uint64_t get_source()
const;
120 void set_source(uint64_t);
122 uint64_t get_sink()
const;
123 void set_sink(uint64_t);
125 bool is_corrupt()
const;
126 void set_corrupt(
bool =
true);
128 bool is_denied()
const;
129 void set_denied(
bool =
true);
131 tilelink_extension() =
default;
133 tilelink_extension(
opcode_e opc, param_e p)
137 tilelink_extension(
const tilelink_extension& o) =
default;
142 tlm::tlm_extension_base*
clone()
const override;
147 void copy_from(tlm::tlm_extension_base
const& ext)
override;
154 param_e param{CAP_2T};
159using tl_phase = tlm::tlm_phase;
166 typedef tl_phase tlm_phase_type;
182 virtual void b_snoop(TRANS& trans, sc_core::sc_time& t) = 0;
193template <
typename TYPES = tl_protocol_types>
200template <
unsigned int BUSWIDTH = 32,
typename TYPES =
tl_protocol_types,
int N = 1,
201 sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND>
203:
public tlm::tlm_base_initiator_socket<BUSWIDTH, tlu_fw_transport_if<TYPES>, tlu_bw_transport_if<TYPES>, N, POL> {
221 const char*
kind()
const override {
return "tlu_initiator_socket"; }
223#if SYSTEMC_VERSION >= 20181013 && SYSTEMC_VERSION < 20241015
228 sc_core::sc_type_index get_protocol_types()
const override {
return typeid(TYPES); }
234template <
unsigned int BUSWIDTH = 32,
typename TYPES =
tl_protocol_types,
int N = 1,
235 sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND>
236struct tlu_target_socket :
public tlm::tlm_base_target_socket<BUSWIDTH, tlu_fw_transport_if<TYPES>, tlu_bw_transport_if<TYPES>, N, POL> {
254 const char*
kind()
const override {
return "tlu_target_socket"; }
256#if SYSTEMC_VERSION >= 20181013 && SYSTEMC_VERSION < 20241015
261 sc_core::sc_type_index get_protocol_types()
const override {
return typeid(TYPES); }
267template <
unsigned int BUSWIDTH = 32,
typename TYPES =
tl_protocol_types,
int N = 1,
268 sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND>
270:
public tlm::tlm_base_initiator_socket<BUSWIDTH, tlc_fw_transport_if<TYPES>, tlc_bw_transport_if<TYPES>, N, POL> {
288 const char*
kind()
const override {
return "tlc_initiator_socket"; }
289#if SYSTEMC_VERSION >= 20181013 && SYSTEMC_VERSION < 20241015
294 sc_core::sc_type_index get_protocol_types()
const override {
return typeid(TYPES); }
300template <
unsigned int BUSWIDTH = 32,
typename TYPES =
tl_protocol_types,
int N = 1,
301 sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND>
302struct tlc_target_socket :
public tlm::tlm_base_target_socket<BUSWIDTH, tlc_fw_transport_if<TYPES>, tlc_bw_transport_if<TYPES>, N, POL> {
320 const char*
kind()
const override {
return "tlc_target_socket"; }
322#if SYSTEMC_VERSION >= 20181013 && SYSTEMC_VERSION < 20241015
327 sc_core::sc_type_index get_protocol_types()
const override {
return typeid(TYPES); }
338inline opcode_e tilelink_extension::get_opcode()
const {
return opcode; }
340inline void tilelink_extension::set_opcode(
opcode_e opcode) { this->opcode = opcode; }
342inline param_e tilelink_extension::get_param()
const {
return param; }
344inline void tilelink_extension::set_param(param_e param) { this->param = param; }
346inline uint64_t tilelink_extension::get_source()
const {
return source; }
348inline void tilelink_extension::set_source(uint64_t source) { this->source = source; }
350inline uint64_t tilelink_extension::get_sink()
const {
return sink; }
352inline void tilelink_extension::set_sink(uint64_t sink) { this->sink = sink; }
354inline bool tilelink_extension::is_corrupt()
const {
return corrupt; }
356inline void tilelink_extension::set_corrupt(
bool corrupt) { this->corrupt = corrupt; }
358inline bool tilelink_extension::is_denied()
const {
return denied; }
360inline void tilelink_extension::set_denied(
bool denied) { this->denied = denied; }
365 auto const* tl_ext =
dynamic_cast<const tilelink_extension*
>(&ext);
virtual void b_snoop(TRANS &trans, sc_core::sc_time &t)=0
snoop access to a snooped master
SCV components for AXI/ACE.
tlm::tlm_bw_transport_if< TYPES > tlu_bw_transport_if
alias declaration for the backward interface:
const char * to_char(E t)
tlm::tlm_generic_payload tl_payload
aliases for payload and phase types
tlm::tlm_fw_transport_if< TYPES > tlu_fw_transport_if
alias declaration for the forward interface
DECLARE_EXTENDED_PHASE(ACK)
E into(typename std::underlying_type< E >::type t)
tlm::tlm_fw_transport_if< TYPES > tlc_fw_transport_if
alias declaration for the ACE forward interface
opcode_e
opcodes of Tilelink.. The encode the opcode (opcode_e[2:0]) and the applicable channels (opcode_e[8] ...
constexpr ULT to_int(E t)
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
tlm::tlm_base_target_socket< BUSWIDTH, tlc_fw_transport_if< TYPES >, tlc_bw_transport_if< TYPES >, N, POL > base_type
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
tlu_initiator_socket()
default constructor using a generated instance name
const char * kind() const override
get the kind of this sc_object
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