|
CIRCT 24.0.0git
|
TODO: make this a proper backend (as much as possible). More...
#include <RpcServer.h>

Classes | |
| class | Impl |
Public Member Functions | |
| RpcServer (Context &ctxt) | |
| ~RpcServer () | |
| Context & | getContext () |
| Get the context. | |
| void | setManifest (int esiVersion, const std::vector< uint8_t > &compressedManifest) |
| Set the manifest and version. | |
| ReadChannelPort & | registerReadPort (const std::string &name, const std::string &type) |
| Register a read or write port which communicates over RPC. | |
| WriteChannelPort & | registerWritePort (const std::string &name, const std::string &type) |
| void | messageConsumed (ReadChannelPort &port) |
| Report that the simulation has consumed one message read from port (which must have been returned by registerReadPort), in the order they were read. | |
| void | stop (uint32_t timeoutMS=0) |
| void | run (int port=-1) |
| int | getPort () |
Private Attributes | |
| Context & | ctxt |
| std::unique_ptr< Impl > | impl |
TODO: make this a proper backend (as much as possible).
Definition at line 26 of file RpcServer.h.
| RpcServer::RpcServer | ( | Context & | ctxt | ) |
Definition at line 1381 of file RpcServer.cpp.
|
default |
|
inline |
Get the context.
Definition at line 32 of file RpcServer.h.
| int RpcServer::getPort | ( | ) |
Definition at line 1423 of file RpcServer.cpp.
| void RpcServer::messageConsumed | ( | ReadChannelPort & | port | ) |
Report that the simulation has consumed one message read from port (which must have been returned by registerReadPort), in the order they were read.
This returns a credit to the client which sent it (if it's still connected) so it may send another message. Non-blocking.
Definition at line 1405 of file RpcServer.cpp.
| ReadChannelPort & RpcServer::registerReadPort | ( | const std::string & | name, |
| const std::string & | type ) |
Register a read or write port which communicates over RPC.
Frames which arrive for a read port before it's connected are held until it is.
Write ports apply backpressure: tryWrite() returns false, and write() blocks, while the channel's in-flight limit (messages queued here plus messages sent but not yet consumed by the client) is reached. write() throws if the port is disconnected meanwhile. The simulation should use tryWrite(): blocking it can deadlock, since the client may need it to make progress before consuming anything.
Definition at line 1391 of file RpcServer.cpp.
| WriteChannelPort & RpcServer::registerWritePort | ( | const std::string & | name, |
| const std::string & | type ) |
Definition at line 1398 of file RpcServer.cpp.
| void RpcServer::run | ( | int | port = -1 | ) |
Definition at line 1411 of file RpcServer.cpp.
| void RpcServer::setManifest | ( | int | esiVersion, |
| const std::vector< uint8_t > & | compressedManifest ) |
Set the manifest and version.
There is a race condition here in that the RPC server can be started and a connection from the client could happen before the manifest is set. TODO: rework the DPI API to require that the manifest gets set first.
Definition at line 1384 of file RpcServer.cpp.
| void RpcServer::stop | ( | uint32_t | timeoutMS = 0 | ) |
Definition at line 1417 of file RpcServer.cpp.
|
private |
Definition at line 78 of file RpcServer.h.
|
private |
Definition at line 79 of file RpcServer.h.