CIRCT  20.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
esi::backends::trace::TraceAccelerator Class Reference

Connect to an ESI simulation. More...

#include <Trace.h>

Inheritance diagram for esi::backends::trace::TraceAccelerator:
Inheritance graph
[legend]
Collaboration diagram for esi::backends::trace::TraceAccelerator:
Collaboration graph
[legend]

Classes

struct  Impl
 

Public Types

enum  Mode { Write , Discard }
 
- Public Types inherited from esi::AcceleratorConnection
using ServiceTable = std::map< std::string, services::Service * >
 
using Service = services::Service
 

Public Member Functions

 TraceAccelerator (Context &, Mode mode, std::filesystem::path manifestJson, std::filesystem::path traceFile)
 Create a trace-based accelerator backend. More...
 
 ~TraceAccelerator () override
 
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 ()
 
ContextgetCtxt () const
 
LoggergetLogger () const
 
virtual void disconnect ()
 Disconnect from the accelerator cleanly. More...
 
AcceleratorServiceThreadgetServiceThread ()
 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 ServicegetService (Service::Type service, AppIDPath id={}, std::string implName={}, ServiceImplDetails details={}, HWClientDetails clients={})
 Calls createService and caches the result. More...
 
AcceleratortakeOwnership (std::unique_ptr< Accelerator > accel)
 Assume ownership of an accelerator object. More...
 

Static Public Member Functions

static std::unique_ptr< AcceleratorConnectionconnect (Context &, std::string connectionString)
 Parse the connection string and instantiate the accelerator. More...
 

Protected Member Functions

virtual ServicecreateService (Service::Type service, AppIDPath idPath, std::string implName, const ServiceImplDetails &details, const HWClientDetails &clients) override
 Called by getServiceImpl exclusively. More...
 

Private Attributes

std::unique_ptr< Implimpl
 

Detailed Description

Connect to an ESI simulation.

Definition at line 35 of file Trace.h.

Member Enumeration Documentation

◆ Mode

Enumerator
Write 
Discard 

Definition at line 37 of file Trace.h.

Constructor & Destructor Documentation

◆ TraceAccelerator()

TraceAccelerator::TraceAccelerator ( Context ctxt,
Mode  mode,
std::filesystem::path  manifestJson,
std::filesystem::path  traceFile 
)

Create a trace-based accelerator backend.

Parameters
modeThe mode of operation. See Mode.
manifestJsonThe path to the manifest JSON file.
traceFileThe path to the trace file. For 'Write' mode, this file is opened for writing. For 'Read' mode, this file is opened for reading.

Definition at line 141 of file Trace.cpp.

References impl.

◆ ~TraceAccelerator()

TraceAccelerator::~TraceAccelerator ( )
override

Definition at line 147 of file Trace.cpp.

References esi::AcceleratorConnection::disconnect().

Member Function Documentation

◆ connect()

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

Parse the connection string and instantiate the accelerator.

Format is: "<mode>:<manifest path>[:<traceFile>]".

Definition at line 108 of file Trace.cpp.

References esiaccel.accelerator::ctxt.

◆ createService()

Service * TraceAccelerator::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 149 of file Trace.cpp.

References impl.

◆ requestChannelsFor()

std::map< std::string, ChannelPort & > TraceAccelerator::requestChannelsFor ( AppIDPath  idPath,
const BundleType bundleType,
const ServiceTable  
)
overridevirtual

Request the host side channel ports for a particular instance (identified by the AppID path).

For convenience, provide the bundle type.

Implements esi::AcceleratorConnection.

Definition at line 260 of file Trace.cpp.

References impl.

Member Data Documentation

◆ impl

std::unique_ptr<Impl> esi::backends::trace::TraceAccelerator::impl
private

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