17 #include "ahb_target.h"
18 #include <scc/report.h>
22 using namespace sc_core;
31 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,
32 size_t transfer_width)
35 add_attribute(wr_data_accept_delay);
36 add_attribute(rd_addr_accept_delay);
37 add_attribute(rd_data_beat_delay);
38 add_attribute(rd_resp_delay);
39 add_attribute(wr_resp_delay);
41 sensitive << clk_i.pos();
44 void ahb_target_b::end_of_elaboration() { clk_if =
dynamic_cast<sc_core::sc_clock*
>(clk_i.get_interface()); }
46 void ahb_target_b::b_transport(payload_type& trans, sc_time& t) {
48 trans.set_dmi_allowed(
false);
49 trans.set_response_status(tlm::TLM_OK_RESPONSE);
50 clk_if =
dynamic_cast<sc_core::sc_clock*
>(clk_i.get_interface());
52 t += clk_if->period() * latency;
56 tlm_sync_enum ahb_target_b::nb_transport_fw(payload_type& trans, phase_type& phase, sc_time& t) {
58 return tlm::TLM_COMPLETED;
61 bool ahb_target_b::get_direct_mem_ptr(payload_type& trans, tlm_dmi& dmi_data) {
62 trans.set_dmi_allowed(
false);
66 unsigned int ahb_target_b::transport_dbg(payload_type& trans) {
return 0; }
72 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.