DS1701 Posted January 8, 2019 Report Share Posted January 8, 2019 I'm learning simple socket with 2 examples: ex1: https://www.doulos.com/knowhow/systemc/tlm2/tutorial__3/tlm2_getting_started_3.cpp ex2: in lib : systemc-2.3.3\examples\tlm\common\include\models\SimpleBusLT.h I know that : //Initiator tlm_utils::simple_initiator_socket<Initiator> initiator_socket; ... tlmTrans.set_data_length(emdata_length); tlmTrans.set_data_ptr(emdata_ptr); initiator_socket->b_transport(tlmTrans, localTime); ... //Target tlm_utils::simple_target_socket<Target> target_socket; ... target_socket.register_b_transport(this, &Target::b_transport); ... virtual void b_transport(tlm::tlm_generic_payload& trans, sc_time& delay) { //receive data from tlmTrans Initiator } I only understand "register_b_transport" function. But I see others function , Can you explain it? and how to use? //Initiator initiator_socket.register_invalidate_direct_mem_ptr(this, &Initiator::invalidateDMIPointers); ... //Target target_socket.register_b_transport(this, &Target::initiatorBTransport); target_socket.register_transport_dbg(this, &Target::transportDebug); target_socket.register_get_direct_mem_ptr(this, &Target::getDMIPointer); Quote Link to comment Share on other sites More sharing options...
Eyck Posted January 8, 2019 Report Share Posted January 8, 2019 As you might know TLM2.0 defines forward and backward interfaces. Those have default implementations in the simple initiator/target sockets. They are fine for many case (e.g. get_direct_mem_ptr() denies DMI) but if you need to change/customize the behavior you can register appropriate functions here. Best regards Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.