CIRCT 24.0.0git
Loading...
Searching...
No Matches
esi::Engine Class Referenceabstract

Engines implement the actual channel communication between the host and the accelerator. More...

#include <Engines.h>

Inheritance diagram for esi::Engine:
Collaboration diagram for esi::Engine:

Public Member Functions

 Engine (AcceleratorConnection &conn)
virtual ~Engine ()=default
virtual void connect ()
 Start the engine, if applicable.
virtual void disconnect ()
 Stop the engine, if applicable.
virtual ChannelPort & requestPort (AppIDPath idPath, const std::string &channelName, BundleType::Direction dir, const Type *type)
 Get a port for a channel, from the cache if it exists or create it.

Protected Member Functions

virtual std::unique_ptr< ChannelPort > createPort (AppIDPath idPath, const std::string &channelName, BundleType::Direction dir, const Type *type)=0
 Each engine needs to know how to create a ports.

Protected Attributes

bool connected
AcceleratorConnection & conn

Private Attributes

std::map< std::pair< AppIDPath, std::string >, std::unique_ptr< ChannelPort > > ownedPorts

Detailed Description

Engines implement the actual channel communication between the host and the accelerator.

Engines can support multiple channels. They are low level of the ESI runtime API and are not intended to be used directly by users.

Definition at line 42 of file Engines.h.

Constructor & Destructor Documentation

◆ Engine()

esi::Engine::Engine ( AcceleratorConnection & conn)
inline

Definition at line 44 of file Engines.h.

References conn, and connected.

Referenced by esi::backends::cosim::CosimEngine::CosimEngine().

◆ ~Engine()

virtual esi::Engine::~Engine ( )
virtualdefault

Member Function Documentation

◆ connect()

virtual void esi::Engine::connect ( )
inlinevirtual

Start the engine, if applicable.

Definition at line 47 of file Engines.h.

References connected.

◆ createPort()

virtual std::unique_ptr< ChannelPort > esi::Engine::createPort ( AppIDPath idPath,
const std::string & channelName,
BundleType::Direction dir,
const Type * type )
protectedpure virtual

Each engine needs to know how to create a ports.

This method is called if a port doesn't exist in the engine cache.

Implemented in esi::backends::cosim::CosimEngine.

Referenced by requestPort().

◆ disconnect()

virtual void esi::Engine::disconnect ( )
inlinevirtual

Stop the engine, if applicable.

Guaranteed to be called (via the connection's disconnect()) while the Accelerator and its MMIO regions are still alive, so port teardown here may safely touch them. This method must be idempotent.

Definition at line 52 of file Engines.h.

References connected.

◆ requestPort()

ChannelPort & Engine::requestPort ( AppIDPath idPath,
const std::string & channelName,
BundleType::Direction dir,
const Type * type )
virtual

Get a port for a channel, from the cache if it exists or create it.

An engine may override this method if different behavior is desired.

Definition at line 510 of file Engines.cpp.

References createPort(), and ownedPorts.

Member Data Documentation

◆ conn

AcceleratorConnection& esi::Engine::conn
protected

Definition at line 67 of file Engines.h.

Referenced by Engine().

◆ connected

◆ ownedPorts

std::map<std::pair<AppIDPath, std::string>, std::unique_ptr<ChannelPort> > esi::Engine::ownedPorts
private

Definition at line 71 of file Engines.h.

Referenced by requestPort().


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