scc 2025.09
SystemC components library
ahb::pe::ahb_target_b Class Reference

#include <ahb_target.h>

Inheritance diagram for ahb::pe::ahb_target_b:
Collaboration diagram for ahb::pe::ahb_target_b:

Public Types

using payload_type = tlm::tlm_base_protocol_types::tlm_payload_type
using phase_type = tlm::tlm_base_protocol_types::tlm_phase_type

Public Member Functions

 SC_HAS_PROCESS (ahb_target_b)
void b_transport (payload_type &trans, sc_core::sc_time &t) override
tlm::tlm_sync_enum nb_transport_fw (payload_type &trans, phase_type &phase, sc_core::sc_time &t) override
bool get_direct_mem_ptr (payload_type &trans, tlm::tlm_dmi &dmi_data) override
unsigned int transport_dbg (payload_type &trans) override
void set_operation_cb (std::function< unsigned(payload_type &trans)> cb)
 Set the operation callback function.
void operation_resp (payload_type &trans, bool sync=false)

Public Attributes

sc_core::sc_in< bool > clk_i {"clk_i"}
sc_core::sc_attribute< unsigned > wr_data_accept_delay {"wr_data_accept_delay", 0}
 the latency between between BEGIN(_PARTIAL)_REQ and END(_PARTIAL)_REQ (AWVALID to AWREADY and WVALID to WREADY)
sc_core::sc_attribute< unsigned > rd_addr_accept_delay {"rd_addr_accept_delay", 0}
 the latency between between BEGIN_REQ and END_REQ (ARVALID to ARREADY)
sc_core::sc_attribute< unsigned > rd_data_beat_delay {"rd_data_beat_delay", 0}
 the latency between between END(_PARTIAL)_RESP and BEGIN(_PARTIAL)_RESP (RREADY to RVALID)
sc_core::sc_attribute< unsigned > rd_resp_delay {"rd_resp_delay", 0}
 the latency between request and response phase. Will be overwritten by the return of the callback function (if registered)
sc_core::sc_attribute< unsigned > wr_resp_delay {"wr_resp_delay", 0}
 the latency between request and response phase. Will be overwritten by the return of the callback function (if registered)

Protected Member Functions

 ahb_target_b (const sc_core::sc_module_name &nm, sc_core::sc_port_b< tlm::tlm_bw_transport_if< tlm::tlm_base_protocol_types > > &port, size_t transfer_width)
 ahb_target_b (ahb_target_b const &)=delete
 ahb_target_b (ahb_target_b &&)=delete
ahb_target_boperator= (ahb_target_b const &)=delete
ahb_target_boperator= (ahb_target_b &&)=delete
void send_resp_thread ()
void end_of_elaboration () override

Protected Attributes

sc_core::sc_port_b< tlm::tlm_bw_transport_if< tlm::tlm_base_protocol_types > > & socket_bw
sc_core::sc_semaphore sn_sem {1}
sc_core::sc_mutex wr
sc_core::sc_mutex rd
sc_core::sc_mutex sn
bool fast_resp {false}
bool fast_req {false}
std::function< unsigned(payload_type &trans)> operation_cb
scc::ordered_semaphore rd_resp {1}
scc::ordered_semaphore wr_resp {1}
sc_core::sc_clock * clk_if {nullptr}

Detailed Description

the target protocol engine base class

Definition at line 37 of file ahb_target.h.

Member Typedef Documentation

◆ payload_type

using ahb::pe::ahb_target_b::payload_type = tlm::tlm_base_protocol_types::tlm_payload_type

Definition at line 42 of file ahb_target.h.

◆ phase_type

using ahb::pe::ahb_target_b::phase_type = tlm::tlm_base_protocol_types::tlm_phase_type

Definition at line 43 of file ahb_target.h.

Constructor & Destructor Documentation

◆ ahb_target_b()

ahb::pe::ahb_target_b::ahb_target_b ( const sc_core::sc_module_name & nm,
sc_core::sc_port_b< tlm::tlm_bw_transport_if< tlm::tlm_base_protocol_types > > & port,
size_t transfer_width )
explicitprotected

the constructor. Protected as it should only be called by derived classes

Parameters
nmthe module name
port
transfer_width

Member Function Documentation

◆ b_transport()

void ahb_target_b::b_transport ( payload_type & trans,
sc_core::sc_time & t )
override

Definition at line 47 of file ahb_target.cpp.

◆ end_of_elaboration()

void ahb_target_b::end_of_elaboration ( )
overrideprotected

Definition at line 45 of file ahb_target.cpp.

◆ get_direct_mem_ptr()

bool ahb_target_b::get_direct_mem_ptr ( payload_type & trans,
tlm::tlm_dmi & dmi_data )
override

Definition at line 62 of file ahb_target.cpp.

◆ nb_transport_fw()

tlm_sync_enum ahb_target_b::nb_transport_fw ( payload_type & trans,
phase_type & phase,
sc_core::sc_time & t )
override

Definition at line 57 of file ahb_target.cpp.

◆ operation_resp()

void ahb_target_b::operation_resp ( payload_type & trans,
bool sync = false )
Parameters
trans
sync

Definition at line 69 of file ahb_target.cpp.

◆ send_resp_thread()

void ahb_target_b::send_resp_thread ( )
protected

Definition at line 73 of file ahb_target.cpp.

◆ set_operation_cb()

void ahb::pe::ahb_target_b::set_operation_cb ( std::function< unsigned(payload_type &trans)> cb)
inline

Set the operation callback function.

This callback is invoked once a transaction arrives. This function is not allowed to block and returns the latency of the operation i.e. the duration until the reponse phase starts

Todo
refine API
Parameters
cbthe callback function

Definition at line 87 of file ahb_target.h.

◆ transport_dbg()

unsigned int ahb_target_b::transport_dbg ( payload_type & trans)
override

Definition at line 67 of file ahb_target.cpp.

Member Data Documentation

◆ clk_i

sc_core::sc_in<bool> ahb::pe::ahb_target_b::clk_i {"clk_i"}

Definition at line 45 of file ahb_target.h.

◆ clk_if

sc_core::sc_clock* ahb::pe::ahb_target_b::clk_if {nullptr}
protected

Definition at line 125 of file ahb_target.h.

◆ fast_req

bool ahb::pe::ahb_target_b::fast_req {false}
protected

Definition at line 122 of file ahb_target.h.

◆ fast_resp

bool ahb::pe::ahb_target_b::fast_resp {false}
protected

Definition at line 121 of file ahb_target.h.

◆ operation_cb

std::function<unsigned(payload_type& trans)> ahb::pe::ahb_target_b::operation_cb
protected

Definition at line 123 of file ahb_target.h.

◆ rd

sc_core::sc_mutex ahb::pe::ahb_target_b::rd
protected

Definition at line 120 of file ahb_target.h.

◆ rd_addr_accept_delay

sc_core::sc_attribute<unsigned> ahb::pe::ahb_target_b::rd_addr_accept_delay {"rd_addr_accept_delay", 0}

the latency between between BEGIN_REQ and END_REQ (ARVALID to ARREADY)

Definition at line 54 of file ahb_target.h.

◆ rd_data_beat_delay

sc_core::sc_attribute<unsigned> ahb::pe::ahb_target_b::rd_data_beat_delay {"rd_data_beat_delay", 0}

the latency between between END(_PARTIAL)_RESP and BEGIN(_PARTIAL)_RESP (RREADY to RVALID)

Definition at line 58 of file ahb_target.h.

◆ rd_resp

scc::ordered_semaphore ahb::pe::ahb_target_b::rd_resp {1}
protected

Definition at line 124 of file ahb_target.h.

◆ rd_resp_delay

sc_core::sc_attribute<unsigned> ahb::pe::ahb_target_b::rd_resp_delay {"rd_resp_delay", 0}

the latency between request and response phase. Will be overwritten by the return of the callback function (if registered)

Definition at line 63 of file ahb_target.h.

◆ sn

sc_core::sc_mutex ahb::pe::ahb_target_b::sn
protected

Definition at line 120 of file ahb_target.h.

◆ sn_sem

sc_core::sc_semaphore ahb::pe::ahb_target_b::sn_sem {1}
protected

Definition at line 119 of file ahb_target.h.

◆ socket_bw

sc_core::sc_port_b<tlm::tlm_bw_transport_if<tlm::tlm_base_protocol_types> >& ahb::pe::ahb_target_b::socket_bw
protected

Definition at line 118 of file ahb_target.h.

◆ wr

sc_core::sc_mutex ahb::pe::ahb_target_b::wr
protected

Definition at line 120 of file ahb_target.h.

◆ wr_data_accept_delay

sc_core::sc_attribute<unsigned> ahb::pe::ahb_target_b::wr_data_accept_delay {"wr_data_accept_delay", 0}

the latency between between BEGIN(_PARTIAL)_REQ and END(_PARTIAL)_REQ (AWVALID to AWREADY and WVALID to WREADY)

Definition at line 50 of file ahb_target.h.

◆ wr_resp

scc::ordered_semaphore ahb::pe::ahb_target_b::wr_resp {1}
protected

Definition at line 124 of file ahb_target.h.

◆ wr_resp_delay

sc_core::sc_attribute<unsigned> ahb::pe::ahb_target_b::wr_resp_delay {"wr_resp_delay", 0}

the latency between request and response phase. Will be overwritten by the return of the callback function (if registered)

Definition at line 68 of file ahb_target.h.


The documentation for this class was generated from the following files:
  • /home/eyck/Projects/MINRES/SystemC-Components/src/interfaces/ahb/pe/ahb_target.h
  • /home/eyck/Projects/MINRES/SystemC-Components/src/interfaces/ahb/pe/ahb_target.cpp