CIRCT 21.0.0git
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
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:
Inheritance graph
[legend]
Collaboration diagram for esi::Engine:
Collaboration graph
[legend]

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 ChannelPortrequestPort (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< ChannelPortcreatePort (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
 
AcceleratorConnectionconn
 

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.

◆ ~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.

Definition at line 49 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 411 of file Engines.cpp.

References createPort(), and ownedPorts.

Member Data Documentation

◆ conn

AcceleratorConnection& esi::Engine::conn
protected

Definition at line 64 of file Engines.h.

◆ connected

bool esi::Engine::connected
protected

Definition at line 63 of file Engines.h.

Referenced by connect(), esiaccel.types.FunctionPort::connect(), and disconnect().

◆ ownedPorts

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

Definition at line 68 of file Engines.h.

Referenced by requestPort().


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