17 #include "../../../interfaces/ahb/pe/ahb_target.h"
19 #include <scc/report.h>
23 using namespace sc_core;
32 ahb_target_b::ahb_target_b(
const sc_core::sc_module_name& nm, sc_core::sc_port_b<tlm::tlm_bw_transport_if<tlm_base_protocol_types>>& port,
33 size_t transfer_width)
36 add_attribute(wr_data_accept_delay);
37 add_attribute(rd_addr_accept_delay);
38 add_attribute(rd_data_beat_delay);
39 add_attribute(rd_resp_delay);
40 add_attribute(wr_resp_delay);
42 sensitive << clk_i.pos();
45 void ahb_target_b::end_of_elaboration() { clk_if =
dynamic_cast<sc_core::sc_clock*
>(clk_i.get_interface()); }
47 void ahb_target_b::b_transport(payload_type& trans, sc_time& t) {
49 trans.set_dmi_allowed(
false);
50 trans.set_response_status(tlm::TLM_OK_RESPONSE);
51 clk_if =
dynamic_cast<sc_core::sc_clock*
>(clk_i.get_interface());
53 t += clk_if->period() * latency;
57 tlm_sync_enum ahb_target_b::nb_transport_fw(payload_type& trans, phase_type& phase, sc_time& t) {
59 return tlm::TLM_COMPLETED;
62 bool ahb_target_b::get_direct_mem_ptr(payload_type& trans, tlm_dmi& dmi_data) {
63 trans.set_dmi_allowed(
false);
67 unsigned int ahb_target_b::transport_dbg(payload_type& trans) {
return 0; }
73 void ahb_target_b::send_resp_thread() {
void operation_resp(payload_type &trans, bool sync=false)
sc_core::sc_attribute< unsigned > rd_resp_delay
the latency between request and response phase. Will be overwritten by the return of the callback fun...
sc_core::sc_attribute< unsigned > wr_resp_delay
the latency between request and response phase. Will be overwritten by the return of the callback fun...
protocol engine implementations
TLM2.0 components modeling AHB.