17 #include "axi_initiator.h"
18 #include <scc/report.h>
19 #include <tlm/scc/tlm_gp_shared.h>
20 #include <tlm/scc/tlm_id.h>
21 #include <tlm/scc/tlm_mm.h>
31 b_tsck.register_b_transport(
this, &axi_initiator_base::b_transport);
32 setup_cb = [
this](tlm::tlm_generic_payload& p) {
33 auto len = p.get_data_length();
35 ext->
set_size(scc::ilog2(std::min<size_t>(len, buswidth / 8)));
36 sc_assert(len < (buswidth / 8) || len % (buswidth / 8) == 0);
37 ext->set_length((len * 8 - 1) / buswidth);
43 void axi_initiator_base::b_transport(tlm::tlm_generic_payload& trans, sc_core::sc_time& delay) {
46 trans.update_original_from(*payload);
50 tlm::tlm_generic_payload* trans =
nullptr;
54 trans->set_auto_extension(ext);
57 trans->deep_copy_from(p);
58 tlm::scc::tlm_gp_mm::add_data_ptr(trans->get_data_length(), trans);
59 std::copy(p.get_data_ptr(), p.get_data_ptr() + p.get_data_length(), trans->get_data_ptr());
61 tlm::scc::setId(*trans,
id++);
axi_initiator class provides an input_socket for incoming TLM transactions. It attaches AXI extension...
tlm::tlm_generic_payload * create_axi_trans(tlm::tlm_generic_payload &p)
void transport(payload_type &trans, bool blocking) override
The forward transport function. It behaves blocking and is re-entrant.
payload_type * allocate()
get a plain tlm_payload_type without extensions
static tlm_mm & get()
accessor function of the singleton
TLM2.0 components modeling AHB.
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...