The RSP packet interface is responsible for establishing the
TCP/IP connection to and from the GDB server class,
GdbServerSC
and transferring RSP packets to
and from the server. Packets are represented by their own class,
RspPacket
.
The class diagram in Figure 4.3 shows the relationship between these components.
The main GdbServerSC
class is responsible for
creating both the RspConnection
instance and
the RspPacket
instance. In the RSP protocol
there is only ever one packet active at any time, so a single instance
suffices. It is passed by pointer to
RspConnection
for use when getting and putting
packets on the TCP/IP connection.
The RSP connection is written in plain C++. There is no need for
SystemC functionality. Indeed the use of system library routines to
establish sockets and listen for new connections does not sit
comfortably within the SystemC paradigm. A wait
in the system library context suspends the entire process pending
action, whereas wait
in the SystemC context
merely suspends the current thread.
This does not cause any practical problem with the synchronous GDB RSP interface. The TCP/IP connection is only used when the target is suspended, so there is no need for SystemC to be active.