CIRCT
20.0.0git
|
Connect to an ESI simulation. More...
#include <Cosim.h>
Classes | |
struct | StubContainer |
Hack around C++ not having a way to forward declare a nested class. More... | |
Public Types | |
enum | ManifestMethod { Cosim , MMIO } |
Public Types inherited from esi::AcceleratorConnection | |
using | ServiceTable = std::map< std::string, services::Service * > |
using | Service = services::Service |
Public Member Functions | |
CosimAccelerator (Context &, std::string hostname, uint16_t port) | |
Construct and connect to a cosim server. More... | |
~CosimAccelerator () | |
void | setManifestMethod (ManifestMethod method) |
virtual std::map< std::string, ChannelPort & > | requestChannelsFor (AppIDPath, const BundleType *, const ServiceTable &) override |
Request the host side channel ports for a particular instance (identified by the AppID path). More... | |
Public Member Functions inherited from esi::AcceleratorConnection | |
AcceleratorConnection (Context &ctxt) | |
virtual | ~AcceleratorConnection () |
Context & | getCtxt () const |
Logger & | getLogger () const |
virtual void | disconnect () |
Disconnect from the accelerator cleanly. More... | |
AcceleratorServiceThread * | getServiceThread () |
Return a pointer to the accelerator 'service' thread (or threads). More... | |
template<typename ServiceClass > | |
ServiceClass * | getService (AppIDPath id={}, std::string implName={}, ServiceImplDetails details={}, HWClientDetails clients={}) |
Get a typed reference to a particular service type. More... | |
virtual Service * | getService (Service::Type service, AppIDPath id={}, std::string implName={}, ServiceImplDetails details={}, HWClientDetails clients={}) |
Calls createService and caches the result. More... | |
Accelerator * | takeOwnership (std::unique_ptr< Accelerator > accel) |
Assume ownership of an accelerator object. More... | |
Static Public Member Functions | |
static std::unique_ptr< AcceleratorConnection > | connect (Context &, std::string connectionString) |
Parse the connection std::string and instantiate the accelerator. More... | |
Protected Member Functions | |
virtual Service * | createService (Service::Type service, AppIDPath path, std::string implName, const ServiceImplDetails &details, const HWClientDetails &clients) override |
Called by getServiceImpl exclusively. More... | |
Private Attributes | |
StubContainer * | rpcClient |
std::set< std::unique_ptr< ChannelPort > > | channels |
std::map< AppIDPath, std::map< std::string, std::string > > | clientChannelAssignments |
ManifestMethod | manifestMethod = Cosim |
CosimAccelerator::CosimAccelerator | ( | Context & | ctxt, |
std::string | hostname, | ||
uint16_t | port | ||
) |
CosimAccelerator::~CosimAccelerator | ( | ) |
Definition at line 128 of file Cosim.cpp.
References channels, esi::AcceleratorConnection::disconnect(), and rpcClient.
|
static |
Parse the connection std::string and instantiate the accelerator.
Support the traditional 'host:port' syntax and a path to 'cosim.cfg' which is output by the cosimulation when it starts (which is useful when it chooses its own port).
Definition at line 68 of file Cosim.cpp.
References esiaccel.accelerator::ctxt, and esiaccel.accelerator::MMIO.
|
overrideprotectedvirtual |
Called by getServiceImpl
exclusively.
It wraps the pointer returned by this in a unique_ptr and caches it. Separate this from the wrapping/caching since wrapping/caching is an implementation detail.
Implements esi::AcceleratorConnection.
Definition at line 537 of file Cosim.cpp.
References clientChannelAssignments, esi::AcceleratorConnection::getCtxt(), manifestMethod, esiaccel.accelerator::MMIO, rpcClient, and esi::backends::cosim::CosimAccelerator::StubContainer::stub.
|
overridevirtual |
Request the host side channel ports for a particular instance (identified by the AppID path).
For convenience, provide the bundle type and direction of the bundle port.
Implements esi::AcceleratorConnection.
Definition at line 294 of file Cosim.cpp.
References channels, clientChannelAssignments, esi::backends::cosim::CosimAccelerator::StubContainer::getChannelDesc(), esi::BundleType::getChannels(), esi::BundlePort::isWrite(), rpcClient, esi::backends::cosim::CosimAccelerator::StubContainer::stub, and esi::AppIDPath::toStr().
void CosimAccelerator::setManifestMethod | ( | ManifestMethod | method | ) |
Definition at line 574 of file Cosim.cpp.
References manifestMethod.
|
private |
Definition at line 76 of file Cosim.h.
Referenced by requestChannelsFor(), and ~CosimAccelerator().
|
private |
Definition at line 79 of file Cosim.h.
Referenced by createService(), and requestChannelsFor().
|
private |
Definition at line 81 of file Cosim.h.
Referenced by createService(), and setManifestMethod().
|
private |
Definition at line 72 of file Cosim.h.
Referenced by CosimAccelerator(), createService(), requestChannelsFor(), and ~CosimAccelerator().