|
scc 2026.07
SystemC components library
|
Bidirectional bridge for tunneling loosely timed TLM traffic over a TCP connection. More...
#include <tcp4tlm_bridge.h>


Classes | |
| struct | timed_task |
Public Types | |
| typedef tcp4tlm::connection< tcp4tlm::response_message, tcp4tlm::request_message > | connection_type |
| typedef std::shared_ptr< connection_type > | con_ptr |
Public Member Functions | |
| SC_HAS_PROCESS (tcp4tlm_bridge) | |
| tcp4tlm_bridge (sc_core::sc_module_name name, size_t no_of_ports=0) | |
| void | server_send_completed (con_ptr &con, bool established=false) override |
| void | server_receive_completed (con_ptr &con, const tcp4tlm::request_message *const result) override |
| void | start_server () |
| void | wait4connection () |
| bool | is_connection_established () |
| void | end_connection () |
| sc_core::sc_event const & | get_shutdown_event () const |
Public Attributes | |
| cci::cci_param< bool > | is_connection_server {"is_connection_server", false} |
| cci::cci_param< std::string > | other_host_name {"other_host_name", ""} |
| cci::cci_param< unsigned > | other_host_port {"other_host_port", 0} |
| cci::cci_param< unsigned > | this_host_port {"this_host_port", 32000u} |
| cci::cci_param< bool > | wall_time_simulation_speed {"wall_time_simulation_speed", false} |
| cci::cci_param< bool > | write_no_response {"write_no_response", false} |
| cci::cci_param< bool > | no_systemc_sync {"no_systemc_sync", false} |
| tlm_utils::simple_target_socket< tcp4tlm_bridge, ::scc::LT > | tsckt |
| tlm_utils::simple_initiator_socket< tcp4tlm_bridge, ::scc::LT > | isckt |
| sc_core::sc_vector< sc_core::sc_out< bool > > | signals {"signals"} |
Protected Types | |
| using | callback_task = std::packaged_task<bool(void)> |
Protected Member Functions | |
| void | btransport_cb (tlm::tlm_generic_payload &, sc_core::sc_time &) |
| unsigned | transport_dbg_cb (tlm::tlm_generic_payload &) |
| virtual void | do_access (tlm::tlm_generic_payload &gp, sc_core::sc_time &delay, bool debug=false) |
| void | timing_thread () |
| void | process_task_que () |
| void | process_timed_task_que () |
| void | end_of_elaboration () override |
| void | start_of_simulation () override |
| void | end_of_simulation () override |
| Protected Member Functions inherited from scc::tcp4tlm::server< tcp4tlm::request_message, tcp4tlm::response_message > | |
| const connection< tcp4tlm::response_message, tcp4tlm::request_message >::acceptor_t & | get_acceptor () |
| server (std::size_t thread_pool_size=4) | |
| long | set_acceptor_endpoint (std::shared_ptr< boost::asio::ip::tcp::acceptor > &a, unsigned short port) |
| void | start_server (unsigned short port, char *name=NULL) |
| void | request_shutdown () |
| bool | is_shutdown_requested () |
| void | shutdown_server () |
| virtual boost::asio::io_context & | get_io_service () |
| bool | is_server_running () |
| void | create_new_session () |
| Protected Member Functions inherited from scc::tcp4tlm::i_server< tcp4tlm::request_message, tcp4tlm::response_message > | |
| virtual void | server_send_completed (std::shared_ptr< connection< tcp4tlm::response_message, tcp4tlm::request_message > > &con, bool established=false)=0 |
| virtual void | server_receive_completed (std::shared_ptr< connection< tcp4tlm::response_message, tcp4tlm::request_message > > &con, const tcp4tlm::request_message *const result)=0 |
| Protected Member Functions inherited from scc::tcp4tlm::client< tcp4tlm::request_message, tcp4tlm::response_message > | |
| void | setup_endpoint (boost::asio::ip::tcp::endpoint &ep) |
| bool | is_local_socket (boost::asio::ip::tcp::socket &socket) |
| void | configure (std::string host, unsigned port_nr) |
| void | connect () |
| bool | is_remote_connected () |
| connection< tcp4tlm::request_message, tcp4tlm::response_message > & | client_connection (unsigned short retry_count=0) |
Protected Attributes | |
| scc::async_queue< timed_task > | task_que |
| scc::peq< callback_task > | timed_task_que |
| std::mutex | con_est_mtx |
| std::condition_variable | con_est_sig |
| std::atomic< bool > | con_est {false} |
| sc_core::sc_event | shutdown_evt |
| rigtorp::SPSCQueue< sc_core::sc_time > | next_time_stamp |
| unsigned long long | sync |
| std::shared_ptr< tcp4tlm::response_message > | resp_msg |
| tlm_utils::tlm_quantumkeeper | quantumkeeper |
| tlm::scc::tlm_mm< tlm::tlm_base_protocol_types, false > | mm |
| Protected Attributes inherited from scc::tcp4tlm::client< tcp4tlm::request_message, tcp4tlm::response_message > | |
| std::string | host |
| unsigned short | port |
| unsigned short | retry_count |
| boost::asio::io_context | io_service |
| connection< tcp4tlm::request_message, tcp4tlm::response_message >::ptr | trace_conn |
| std::atomic< bool > | is_connected |
| bool | local_connection |
Bidirectional bridge for tunneling loosely timed TLM traffic over a TCP connection.
The bridge is both a SystemC/TLM component and a TCP endpoint. Its target socket accepts local TLM generic payloads and serializes them into tcp4tlm FlatBuffer messages which are sent to a peer bridge. Conversely, incoming BusOpMsg requests are converted back into TLM generic payloads, scheduled in SystemC time, and forwarded through the initiator socket to the local model.
Two bridge instances form a bidirectional connection. Depending on the is_connection_server parameter, an instance either waits for a peer endpoint notification or actively connects to the configured peer and sends its own listening endpoint via NotifyEndpointMsg. Once connected, the bridge exchanges BusOpMsg, BusDataMsg, response, SyncMsg, SigOpMsg, and NotifyShutdownMsg messages to carry bus accesses, read data, status responses, simulation time synchronization, signal updates, and orderly shutdown.
TLM reads wait for a BusDataMsg response and copy the returned data into the original payload. TLM writes send the payload data and either wait for a status response or complete immediately when write_no_response is enabled. Debug transport is represented as a BusOpMsg with debug access type.
The timing threads coordinate message execution with SystemC simulation time. In simulated-time mode, remote timestamps drive local advancement. In wall-time mode, the bridge can pace simulation against elapsed wall clock time. The no_systemc_sync parameter bypasses timestamp-based task scheduling.
Definition at line 69 of file tcp4tlm_bridge.h.
|
protected |
Definition at line 127 of file tcp4tlm_bridge.h.
| typedef std::shared_ptr<connection_type> scc::tcp4tlm_bridge::con_ptr |
Definition at line 97 of file tcp4tlm_bridge.h.
| typedef tcp4tlm::connection<tcp4tlm::response_message, tcp4tlm::request_message> scc::tcp4tlm_bridge::connection_type |
Definition at line 96 of file tcp4tlm_bridge.h.
| scc::tcp4tlm_bridge::tcp4tlm_bridge | ( | sc_core::sc_module_name | name, |
| size_t | no_of_ports = 0 ) |
Definition at line 40 of file tcp4tlm_bridge.cpp.
|
virtual |
Definition at line 90 of file tcp4tlm_bridge.cpp.
|
protected |
Definition at line 175 of file tcp4tlm_bridge.cpp.
|
protectedvirtual |
Definition at line 177 of file tcp4tlm_bridge.cpp.
|
inline |
Definition at line 200 of file tcp4tlm_bridge.h.
|
overrideprotected |
Definition at line 101 of file tcp4tlm_bridge.cpp.
|
overrideprotected |
Definition at line 128 of file tcp4tlm_bridge.cpp.
|
inline |
Definition at line 124 of file tcp4tlm_bridge.h.
|
inline |
Definition at line 120 of file tcp4tlm_bridge.h.
|
protected |
Definition at line 457 of file tcp4tlm_bridge.cpp.
|
protected |
Definition at line 473 of file tcp4tlm_bridge.cpp.
|
override |
Definition at line 343 of file tcp4tlm_bridge.cpp.
|
inlineoverride |
Definition at line 99 of file tcp4tlm_bridge.h.
|
overrideprotected |
Definition at line 106 of file tcp4tlm_bridge.cpp.
|
inline |
Definition at line 107 of file tcp4tlm_bridge.h.
|
protected |
Definition at line 263 of file tcp4tlm_bridge.cpp.
|
protected |
Definition at line 169 of file tcp4tlm_bridge.cpp.
|
inline |
Definition at line 112 of file tcp4tlm_bridge.h.
|
protected |
Definition at line 136 of file tcp4tlm_bridge.h.
|
protected |
Definition at line 134 of file tcp4tlm_bridge.h.
|
protected |
Definition at line 135 of file tcp4tlm_bridge.h.
| cci::cci_param<bool> scc::tcp4tlm_bridge::is_connection_server {"is_connection_server", false} |
this governs the sequence of connection:
Definition at line 78 of file tcp4tlm_bridge.h.
| tlm_utils::simple_initiator_socket<tcp4tlm_bridge, ::scc::LT> scc::tcp4tlm_bridge::isckt |
Definition at line 88 of file tcp4tlm_bridge.h.
|
protected |
Definition at line 151 of file tcp4tlm_bridge.h.
|
protected |
Definition at line 138 of file tcp4tlm_bridge.h.
| cci::cci_param<bool> scc::tcp4tlm_bridge::no_systemc_sync {"no_systemc_sync", false} |
Definition at line 84 of file tcp4tlm_bridge.h.
| cci::cci_param<std::string> scc::tcp4tlm_bridge::other_host_name {"other_host_name", ""} |
Definition at line 79 of file tcp4tlm_bridge.h.
| cci::cci_param<unsigned> scc::tcp4tlm_bridge::other_host_port {"other_host_port", 0} |
Definition at line 80 of file tcp4tlm_bridge.h.
|
protected |
Definition at line 150 of file tcp4tlm_bridge.h.
|
protected |
Definition at line 149 of file tcp4tlm_bridge.h.
|
protected |
Definition at line 137 of file tcp4tlm_bridge.h.
| sc_core::sc_vector<sc_core::sc_out<bool> > scc::tcp4tlm_bridge::signals {"signals"} |
Definition at line 90 of file tcp4tlm_bridge.h.
|
protected |
Definition at line 139 of file tcp4tlm_bridge.h.
|
protected |
Definition at line 132 of file tcp4tlm_bridge.h.
| cci::cci_param<unsigned> scc::tcp4tlm_bridge::this_host_port {"this_host_port", 32000u} |
Definition at line 81 of file tcp4tlm_bridge.h.
|
protected |
Definition at line 133 of file tcp4tlm_bridge.h.
| tlm_utils::simple_target_socket<tcp4tlm_bridge, ::scc::LT> scc::tcp4tlm_bridge::tsckt |
Definition at line 86 of file tcp4tlm_bridge.h.
| cci::cci_param<bool> scc::tcp4tlm_bridge::wall_time_simulation_speed {"wall_time_simulation_speed", false} |
Definition at line 82 of file tcp4tlm_bridge.h.
| cci::cci_param<bool> scc::tcp4tlm_bridge::write_no_response {"write_no_response", false} |
Definition at line 83 of file tcp4tlm_bridge.h.