CIRCT 24.0.0git
Loading...
Searching...
No Matches
esi::backends::xrt::XrtAccelerator Class Reference

Connect to an ESI simulation. More...

#include <Xrt.h>

Inheritance diagram for esi::backends::xrt::XrtAccelerator:
Collaboration diagram for esi::backends::xrt::XrtAccelerator:

Classes

struct  Impl

Public Member Functions

 XrtAccelerator (Context &, std::string xclbin, std::string kernelName)
 Construct and connect to a cosim server.
 ~XrtAccelerator ()
bool reset () override
 Resets are not supported.
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.
virtual 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 void createEngine (const std::string &engineTypeName, AppIDPath idPath, const ServiceImplDetails &details, const HWClientDetails &clients)
 Create a new engine for channel communication with the accelerator.
virtual const BundleEngineMap & getEngineMapFor (AppIDPath id)
Accelerator & getAccelerator ()

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.
Protected Member Functions inherited from esi::AcceleratorConnection
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.
void clearOwnedObjects ()
 Drop accelerator-owned objects before a derived backend destroys resources that those objects may reference.

Private Attributes

std::unique_ptr< Impl > impl

Additional Inherited Members

Public Types inherited from esi::AcceleratorConnection
using Service = services::Service
Protected Attributes inherited from esi::AcceleratorConnection
std::map< AppIDPath, std::unique_ptr< Engine > > ownedEngines
 Collection of owned engines.
std::map< AppIDPath, BundleEngineMap > clientEngines
 Mapping of clients to their servicing engines.

Detailed Description

Connect to an ESI simulation.

Definition at line 31 of file Xrt.h.

Constructor & Destructor Documentation

◆ XrtAccelerator()

XrtAccelerator::XrtAccelerator ( Context & ctxt,
std::string xclbin,
std::string kernelName )

Construct and connect to a cosim server.

Definition at line 108 of file Xrt.cpp.

References esi::AcceleratorConnection::AcceleratorConnection(), esi::AcceleratorConnection::ctxt, and impl.

◆ ~XrtAccelerator()

XrtAccelerator::~XrtAccelerator ( )

Definition at line 113 of file Xrt.cpp.

References esi::AcceleratorConnection::disconnect().

Member Function Documentation

◆ connect()

std::unique_ptr< AcceleratorConnection > XrtAccelerator::connect ( Context & ctxt,
std::string connectionString )
static

Parse the connection std::string and instantiate the accelerator.

Connection std::string format: <xclbin>[SEP<device_id>] wherein <device_id> is in BDF format (e.g. "0000:3b:00.1"). SEP is ':' on Unix and ';' on Windows to avoid conflicts with Windows drive letters (e.g. "C:\path\to.xclbin") and BDF colons.

Definition at line 40 of file Xrt.cpp.

References esi::AcceleratorConnection::ctxt.

◆ createService()

Service * XrtAccelerator::createService ( Service::Type service,
AppIDPath idPath,
std::string implName,
const ServiceImplDetails & details,
const HWClientDetails & clients )
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 232 of file Xrt.cpp.

References esi::AcceleratorConnection::getService(), and impl.

◆ reset()

bool esi::backends::xrt::XrtAccelerator::reset ( )
inlineoverridevirtual

Resets are not supported.

Reimplemented from esi::AcceleratorConnection.

Definition at line 41 of file Xrt.h.

Member Data Documentation

◆ impl

std::unique_ptr<Impl> esi::backends::xrt::XrtAccelerator::impl
private

Definition at line 50 of file Xrt.h.

Referenced by createService(), and XrtAccelerator().


The documentation for this class was generated from the following files: