CIRCT 21.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 } |
![]() | |
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. | |
~CosimAccelerator () | |
void | setManifestMethod (ManifestMethod method) |
void | createEngine (const std::string &engineTypeName, AppIDPath idPath, const ServiceImplDetails &details, const HWClientDetails &clients) override |
Create a new engine for channel communication with the accelerator. | |
![]() | |
AcceleratorConnection (Context &ctxt) | |
virtual | ~AcceleratorConnection () |
Context & | getCtxt () const |
Logger & | getLogger () const |
virtual void | disconnect () |
Disconnect from the accelerator cleanly. | |
AcceleratorServiceThread * | getServiceThread () |
Return a pointer to the accelerator 'service' thread (or threads). | |
template<typename ServiceClass > | |
ServiceClass * | getService (AppIDPath id={}, std::string implName={}, ServiceImplDetails details={}, HWClientDetails clients={}) |
Get a typed reference to a particular service type. | |
virtual Service * | getService (Service::Type service, AppIDPath id={}, std::string implName={}, ServiceImplDetails details={}, HWClientDetails clients={}) |
Calls createService and caches the result. | |
Accelerator * | takeOwnership (std::unique_ptr< Accelerator > accel) |
Assume ownership of an accelerator object. | |
virtual const BundleEngineMap & | getEngineMapFor (AppIDPath id) |
Static Public Member Functions | |
static std::unique_ptr< AcceleratorConnection > | connect (Context &, std::string connectionString) |
Parse the connection std::string and instantiate the accelerator. | |
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. | |
![]() | |
void | registerEngine (AppIDPath idPath, std::unique_ptr< Engine > engine, const HWClientDetails &clients) |
If createEngine is overridden, this method should be called to register the engine and all of the channels it services. | |
Private Attributes | |
StubContainer * | rpcClient |
std::set< std::unique_ptr< ChannelPort > > | channels |
ManifestMethod | manifestMethod = Cosim |
Friends | |
class | CosimEngine |
Additional Inherited Members | |
![]() | |
std::map< AppIDPath, std::unique_ptr< Engine > > | ownedEngines |
Collection of owned engines. | |
std::map< AppIDPath, BundleEngineMap > | clientEngines |
Mapping of clients to their servicing engines. | |
CosimAccelerator::CosimAccelerator | ( | Context & | ctxt, |
std::string | hostname, | ||
uint16_t | port | ||
) |
CosimAccelerator::~CosimAccelerator | ( | ) |
Definition at line 129 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 69 of file Cosim.cpp.
References esi::AcceleratorConnection::ctxt, manifestMethod, and MMIO.
|
overridevirtual |
Create a new engine for channel communication with the accelerator.
The default is to call the global createEngine
to get an engine which has registered itself. Individual accelerator connection backends can override this to customize behavior.
Reimplemented from esi::AcceleratorConnection.
Definition at line 641 of file Cosim.cpp.
References esi::registry::createEngine(), and esi::AcceleratorConnection::registerEngine().
|
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 654 of file Cosim.cpp.
References Cosim, esi::AcceleratorConnection::getCtxt(), manifestMethod, MMIO, rpcClient, and esi::backends::cosim::CosimAccelerator::StubContainer::stub.
void CosimAccelerator::setManifestMethod | ( | ManifestMethod | method | ) |
Definition at line 673 of file Cosim.cpp.
References manifestMethod.
|
friend |
|
private |
Definition at line 76 of file Cosim.h.
Referenced by ~CosimAccelerator().
|
private |
Definition at line 78 of file Cosim.h.
Referenced by connect(), createService(), and setManifestMethod().
|
private |
Definition at line 72 of file Cosim.h.
Referenced by CosimAccelerator(), esi::backends::cosim::CosimEngine::createPort(), createService(), and ~CosimAccelerator().