CIRCT 20.0.0git
|
Connect to an ESI simulation. More...
#include <Trace.h>
Classes | |
struct | Impl |
Public Types | |
enum | Mode { Write , Discard } |
![]() | |
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. | |
~TraceAccelerator () override | |
Impl & | getImpl () |
![]() | |
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 string and instantiate the accelerator. | |
Protected Member Functions | |
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. | |
virtual Service * | createService (Service::Type service, AppIDPath idPath, 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 | |
std::unique_ptr< Impl > | impl |
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. | |
TraceAccelerator::TraceAccelerator | ( | Context & | ctxt, |
Mode | mode, | ||
std::filesystem::path | manifestJson, | ||
std::filesystem::path | traceFile | ||
) |
Create a trace-based accelerator backend.
mode | The mode of operation. See Mode. |
manifestJson | The path to the manifest JSON file. |
traceFile | The 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.
|
override |
Definition at line 147 of file Trace.cpp.
References esi::AcceleratorConnection::disconnect().
|
static |
Parse the connection string and instantiate the accelerator.
Format is: "<mode>:<manifest path>[:<traceFile>]".
Definition at line 108 of file Trace.cpp.
References esi::AcceleratorConnection::ctxt, Discard, and Write.
|
overrideprotectedvirtual |
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 251 of file Trace.cpp.
References getImpl(), 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 335 of file Trace.cpp.
References getImpl().
TraceAccelerator::Impl & TraceAccelerator::getImpl | ( | ) |
Definition at line 39 of file Trace.cpp.
References impl.
Referenced by createEngine(), and createService().
|
private |
Definition at line 80 of file Trace.h.
Referenced by getImpl(), and TraceAccelerator().