Download OSCI TLM-2.0 USER MANUAL

Transcript
OSCI TLM-2.0 USER MANUAL
5.3.4
Multi-sockets
5.3.4.1
Introduction
The multi-sockets are a variation on the tagged simple sockets that permit a single socket to be bound to
multiple sockets on other components. In contrast to the tagged simple sockets, which identify through which
socket an incoming call arrives, a multi-socket callback is able to identify from which socket on another
component an incoming interface method call arrives, using the multi-port index number as the tag. Unlike
the other convenience sockets, the multi-sockets also support hierarchical child-to-parent socket binding on
both the initiator and target side.
The implementation of multi-sockets in the TLM-2.0 kit uses the boost libraries. The user should download
the boost libraries from www.boost.org and add the appropriate directory to the compiler include path.
5.3.4.2
Class definition
namespace tlm_utils {
template <
typename MODULE,
unsigned int BUSWIDTH = 32,
typename TYPES = tlm::tlm_base_protocol_types,
unsigned int N=0,
sc_core::sc_port_policy POL = sc_core::SC_ONE_OR_MORE_BOUND
>
class multi_passthrough_initiator_socket : public multi_init_base< BUSWIDTH, TYPES, N, POL>
{
public:
typedef typename TYPES::tlm_payload_type
transaction_type;
typedef typename TYPES::tlm_phase_type
phase_type;
typedef tlm::tlm_sync_enum
sync_enum_type;
typedef multi_init_base<BUSWIDTH, TYPES, N, POL> base_type;
typedef typename base_type::base_target_socket_type
base_target_socket_type;
multi_passthrough_initiator_socket(const char* name);
~multi_passthrough_initiator_socket();
void register_nb_transport_bw(
MODULE* mod,
sync_enum_type (MODULE::*cb)(int, transaction_type&, phase_type&, sc_core::sc_time&));
void register_invalidate_direct_mem_ptr(
MODULE* mod,
void (MODULE::*cb)(int, sc_dt::uint64, sc_dt::uint64));
// Override virtual functions of the tlm_initiator_socket:
64
Copyright © 2007-2008 by the Open SystemC Initiative (OSCI)