17 #include <axi/axi_tlm.h>
18 #include <tlm/scc/tlm_id.h>
19 #include <tlm/scc/scv/tlm_extension_recording_registry.h>
20 #include <tlm/scc/lwtr/lwtr4tlm2_extension_registry.h>
25 ar & field(
"id", e.
get_id());
26 ar & field(
"user[CTRL]", e.
get_user(axi::common::id_type::CTRL));
27 ar & field(
"user[DATA]", e.
get_user(axi::common::id_type::DATA));
28 ar & field(
"user[RESP]", e.
get_user(axi::common::id_type::RESP));
33 ar & field(
"exclusive", e.
is_exclusive() ?
"true" :
"false");
44 ar & field(
"id", e.
get_id());
45 ar & field(
"user[CTRL]", e.
get_user(axi::common::id_type::CTRL));
46 ar & field(
"user[DATA]", e.
get_user(axi::common::id_type::DATA));
47 ar & field(
"user[RESP]", e.
get_user(axi::common::id_type::RESP));
52 ar & field(
"exclusive", e.
is_exclusive() ?
"true" :
"false");
63 ar & field(
"id", e.
get_id());
64 ar & field(
"user[CTRL]", e.
get_user(axi::common::id_type::CTRL));
65 ar & field(
"user[DATA]", e.
get_user(axi::common::id_type::DATA));
66 ar & field(
"user[RESP]", e.
get_user(axi::common::id_type::RESP));
71 ar & field(
"exclusive", e.
is_exclusive() ?
"true" :
"false");
90 const std::array<std::string, 3> cmd2char{{
"tlm::TLM_READ_COMMAND",
"tlm::TLM_WRITE_COMMAND",
"tlm::TLM_IGNORE_COMMAND"}};
91 const std::array<std::string, 7> resp2char{
92 {
"tlm::TLM_OK_RESPONSE",
"tlm::TLM_INCOMPLETE_RESPONSE",
"tlm::TLM_GENERIC_ERROR_RESPONSE",
"tlm::TLM_ADDRESS_ERROR_RESPONSE",
"tlm::TLM_COMMAND_ERROR_RESPONSE",
"tlm::TLM_BURST_ERROR_RESPONSE",
"tlm::TLM_BYTE_ENABLE_ERROR_RESPONSE"}};
93 const std::array<std::string, 3> gp_option2char{{
"tlm::TLM_MIN_PAYLOAD",
"tlm::TLM_FULL_PAYLOAD",
"tlm::TLM_FULL_PAYLOAD_ACCEPTED"}};
94 const std::array<std::string, 5> phase2char{{
"tlm::UNINITIALIZED_PHASE",
"tlm::BEGIN_REQ",
"tlm::END_REQ",
"tlm::BEGIN_RESP",
"tlm::END_RESP"}};
95 const std::array<std::string, 4> dmi2char{
96 {
"tlm::DMI_ACCESS_NONE",
"tlm::DMI_ACCESS_READ",
"tlm::DMI_ACCESS_WRITE",
"tlm::DMI_ACCESS_READ_WRITE"}};
97 const std::array<std::string, 3> sync2char{{
"tlm::TLM_ACCEPTED",
"tlm::TLM_UPDATED",
"tlm::TLM_COMPLETED"}};
101 void recordBeginTx(::lwtr::tx_handle& handle, tlm::tlm_base_protocol_types::tlm_payload_type& trans)
override {
103 handle.record_attribute(
"trans", *ext);
105 void recordEndTx(::lwtr::tx_handle& handle, tlm::tlm_base_protocol_types::tlm_payload_type& trans)
override {
110 void recordBeginTx(::lwtr::tx_handle& handle, axi_protocol_types::tlm_payload_type& trans)
override {
112 handle.record_attribute(
"trans.axi3", *ext);
114 void recordEndTx(::lwtr::tx_handle& handle, axi_protocol_types::tlm_payload_type& trans)
override {
116 handle.record_attribute(
"trans.axi3.resp",
to_char(ext->get_resp()));
121 void recordBeginTx(::lwtr::tx_handle& handle, axi_protocol_types::tlm_payload_type& trans)
override {
123 handle.record_attribute(
"trans.axi4", *ext);
125 void recordEndTx(::lwtr::tx_handle& handle, axi_protocol_types::tlm_payload_type& trans)
override {
127 handle.record_attribute(
"trans.axi4.resp",
to_char(ext->get_resp()));
132 void recordBeginTx(::lwtr::tx_handle& handle, axi_protocol_types::tlm_payload_type& trans)
override {
134 handle.record_attribute(
"trans.ace", *ext);
136 void recordEndTx(::lwtr::tx_handle& handle, axi_protocol_types::tlm_payload_type& trans)
override {
138 handle.record_attribute(
"trans.ace.resp",
to_char(ext->get_resp()));
139 handle.record_attribute(
"trans.ace.cresp_PassDirty", ext->is_pass_dirty());
140 handle.record_attribute(
"trans.ace.cresp_IsShared", ext->is_shared());
141 handle.record_attribute(
"trans.ace.cresp_SnoopDataTransfer", ext->is_snoop_data_transfer());
142 handle.record_attribute(
"trans.ace.cresp_SnoopError", ext->is_snoop_error());
143 handle.record_attribute(
"trans.ace.cresp_SnoopWasUnique", ext->is_snoop_was_unique());
149 #if defined(__GNUG__)
150 __attribute__((constructor))
152 bool register_extensions() {
167 bool registered = register_extensions();
The TLM transaction extensions recorder interface.
The TLM transaction extensions recorder registry.
const char * to_char(E t)
TLM2.0 components modeling AHB.
const char * to_char(E t)
bool get_unique() const
get the AxUNIQUE value return the unique value
bar_e get_barrier() const
get the AxBAR value return the barrier value
snoop_e get_snoop() const
get the AxSNOOP value return the snoop value
domain_e get_domain() const
get the AxDOMAIN value return the domain value
bool is_bufferable() const
get the bufferable bit of AxCACHE (AxCACHE[0]) return the bufferable bit
bool is_read_allocate() const
get the read_allocate bit of AxCACHE (AxCACHE[3]) return the read_allocate bit
bool is_exclusive() const
get the exclusive bit of AxLOCK (AxLOCK[0]) return the exclusive bit
bool is_write_allocate() const
get the write_allocate bit of AxCACHE (AxCACHE[2]) return the write_allocate bit
bool is_cacheable() const
get the cacheable bit of AxCACHE (AxCACHE[1]) return the cacheable bit
bool is_modifiable() const
get the modifiable bit of AxCACHE (AxCACHE[1]) return the modifiable bit
bool is_allocate() const
get the write allocate/read other allocate bit of AxCACHE (AxCACHE[3]) return the write_other_allocat...
bool is_bufferable() const
get the bufferable bit of AxCACHE (AxCACHE[0]) return the bufferable bit
bool is_exclusive() const
get the exclusive bit of AxLOCK (AxLOCK[0]) return the exclusive bit
bool is_write_allocate() const
get the write allocate/read other allocate bit of AxCACHE (AxCACHE[3]) return the write_other_allocat...
bool is_read_allocate() const
get the read allocate/write other allocate bit of AxCACHE (AxCACHE[2]) return the read_other_allocate...
bool is_other_allocate() const
get the read allocate/write other allocate bit of AxCACHE (AxCACHE[2]) return the read_other_allocate...
unsigned int get_user(id_type chnl) const
unsigned int get_id() const
burst_e get_burst() const
get the AxBURST value,
uint8_t get_length() const
get the AxLEN value of the transaction, the value denotes the burst length - 1
uint8_t get_region() const
get the AxREGION value
uint8_t get_qos() const
get the AxQOS (quality of service) value
uint8_t get_cache() const
get the AxCACHE value as POD
uint8_t get_prot() const
set the AxPROT value as POD, only values from 0...7 are allowed
uint8_t get_size() const
set the AxSIZE value of the transaction