xaiefal
Loading...
Searching...
No Matches
xaiefal::XAieRsc Class Reference

Base AI engine resource class. It defines resource operations and maintains resource state machine. More...

#include <xaiefal-rsc-base.hpp>

Inheritance diagram for xaiefal::XAieRsc:
xaiefal::XAieBroadcast xaiefal::XAieGroupEventHandle xaiefal::XAieSingleTileRsc xaiefal::XAieComboEvent xaiefal::XAieGroupEvent xaiefal::XAieMdmPerfCounter xaiefal::XAiePCEvent xaiefal::XAiePCRange xaiefal::XAiePerfCounter xaiefal::XAieStreamPortSelect xaiefal::XAieTraceCntr xaiefal::XAieTraceEvent xaiefal::XAieTracing xaiefal::XAieUserEvent

Public Member Functions

 XAieRsc ()=delete
 XAieRsc (std::shared_ptr< XAieDevHandle > DevHd)
 XAieRsc (std::shared_ptr< XAieDevHandle > DevHd, XAieRscType Type)
 XAieRsc (XAieDev &Dev)
virtual ~XAieRsc ()
AieRC setPreferredId (uint32_t id, bool isStaticAllocated=false)
uint32_t getPreferredId ()
AieRC reserve ()
AieRC release ()
AieRC free ()
AieRC start ()
AieRC stop ()
bool isInitialized () const
bool isReserved () const
bool isConfigured () const
bool isRunning () const
void getReservedRscs (std::vector< XAieUserRsc > &vOutRscs) const
AieRC getRscs (std::vector< XAieUserRsc > &vOutRscs)
AieRC setRscs (std::vector< XAieUserRsc > &vInRscs)
virtual XAieRscType getRscType () const
virtual XAieRscStat getRscStat (const std::string &GName) const
XAie_DevInst * dev ()
virtual uint32_t getAvailManagedRscs ()
virtual XAieRscType getManagedRscsType ()

Protected Attributes

XAieRscState State
XAieRscType Type
std::shared_ptr< XAieDevHandle > AieHd
uint32_t preferredId
uint32_t reservedId
std::vector< XAieUserRsc > vRscs

Detailed Description

Base AI engine resource class. It defines resource operations and maintains resource state machine.

Constructor & Destructor Documentation

◆ XAieRsc() [1/4]

xaiefal::XAieRsc::XAieRsc ( )
delete

◆ XAieRsc() [2/4]

xaiefal::XAieRsc::XAieRsc ( std::shared_ptr< XAieDevHandle > DevHd)
inline

◆ XAieRsc() [3/4]

xaiefal::XAieRsc::XAieRsc ( std::shared_ptr< XAieDevHandle > DevHd,
XAieRscType Type )
inline

◆ XAieRsc() [4/4]

xaiefal::XAieRsc::XAieRsc ( XAieDev & Dev)
inline

◆ ~XAieRsc()

virtual xaiefal::XAieRsc::~XAieRsc ( )
inlinevirtual

Member Function Documentation

◆ dev()

XAie_DevInst * xaiefal::XAieRsc::dev ( )
inline

This funtion returns AI engine device

◆ free()

AieRC xaiefal::XAieRsc::free ( )
inline

This function free the prereserved resource.

Once the prereserved resource is freed, the underline hardware resources are freed to be used by other entity but these hardware resources are still prereserved. That is if some enity tries to allocate for resource, the prereserved resources will not be allocated.

Returns
XAIE_OK for success, and error code for failure.

◆ getAvailManagedRscs()

virtual uint32_t xaiefal::XAieRsc::getAvailManagedRscs ( )
inlinevirtual

This function returns number of available child resources which is managed by this resource in AIEFAL

Reimplemented in xaiefal::XAieTraceCntr.

◆ getManagedRscsType()

virtual XAieRscType xaiefal::XAieRsc::getManagedRscsType ( )
inlinevirtual

This function returns the type of child resources which is managed by this resource in AIEFAL

Reimplemented in xaiefal::XAieTraceCntr.

◆ getPreferredId()

uint32_t xaiefal::XAieRsc::getPreferredId ( )
inline

This function returns the preferred ID

Returns
preferred Id of resource

◆ getReservedRscs()

void xaiefal::XAieRsc::getReservedRscs ( std::vector< XAieUserRsc > & vOutRscs) const
inline

This function returns resources reserved.

Parameters
vOutRscsvector to store the reserved resources

◆ getRscs()

AieRC xaiefal::XAieRsc::getRscs ( std::vector< XAieUserRsc > & vOutRscs)
inline

This function returns resources to be reserved.

Parameters
vOutRscsvector to store the resources
Returns
XAIE_OK for success, error code for failure

◆ getRscStat()

virtual XAieRscStat xaiefal::XAieRsc::getRscStat ( const std::string & GName) const
inlinevirtual

This function returns resources static for a specific group of this type of resource.

Parameters
GNameresource group name
Returns
resource group resource statistics of this type of resource of specific tiles/module

Reimplemented in xaiefal::XAieBroadcast, xaiefal::XAiePerfCounter, and xaiefal::XAieSingleTileRsc.

◆ getRscType()

virtual XAieRscType xaiefal::XAieRsc::getRscType ( ) const
inlinevirtual

This function returns resources type.

Returns
resource type

◆ isConfigured()

bool xaiefal::XAieRsc::isConfigured ( ) const
inline

This function checks if resource has been configured.

Returns
true if resource configure in software is done, false otherwise.

◆ isInitialized()

bool xaiefal::XAieRsc::isInitialized ( ) const
inline

This function checks if resource has been initialized.

Returns
true if resource has been initialized, false otherwise.

◆ isReserved()

bool xaiefal::XAieRsc::isReserved ( ) const
inline

This function checks if resource has been reserved.

Returns
true if resource has been reserved, false otherwise.

◆ isRunning()

bool xaiefal::XAieRsc::isRunning ( ) const
inline

This function checks if resource is in use.

Returns
true if resource is in use, falsei otherwise.

◆ release()

AieRC xaiefal::XAieRsc::release ( )
inline

This function releases the resource. Once the resource is released, the underline hardware resources belong to this resource will be released so that they can be allcated for other entity.

Returns
XAIE_OK for success, and error code for failure.

◆ reserve()

AieRC xaiefal::XAieRsc::reserve ( )
inline

This function reserves the resource. Once the resource is reserved, the underline hardware resources belong to this resource will be occupied until it is released.

If no prereserved hardware resources have been specified it allocates resources from SSW AIE driver.

If prereserved hardware resources have been specified, it will request to use the specified resources. If the resources are not statically allocated, SSW AIE driver will return failure.

Returns
XAIE_OK for success, and error code for failure.

◆ setPreferredId()

AieRC xaiefal::XAieRsc::setPreferredId ( uint32_t id,
bool isStaticAllocated = false )
inline

This function sets a resource's id to a requested id value. Resources that can have their id set always have XAIE_RSC_ID_ANY as a default value.

Parameters
idrequested id for resource
isStatticAllocatedto indicate if the resource has been allocated at static time.
Returns
XAIE_OK for success, and error code for failure.

◆ setRscs()

AieRC xaiefal::XAieRsc::setRscs ( std::vector< XAieUserRsc > & vInRscs)
inline

This function sets the resources

Parameters
vInRscsvector to set resources from
Returns
XAIE_OK for success, error code for failure

◆ start()

AieRC xaiefal::XAieRsc::start ( )
inline

This function starts using the resource by configuring the hardware registers. It needs to be called after the resource is reserved.

Returns
XAIE_OK for success, and error code for failure.

◆ stop()

AieRC xaiefal::XAieRsc::stop ( )
inline

This function stops using the resource by removing the config from hardware. But the resource are still occupied after this funtion.

Returns
XAIE_OK for success, and error code for failure.

Field Documentation

◆ AieHd

std::shared_ptr<XAieDevHandle> xaiefal::XAieRsc::AieHd
protected

AI engine device instance

◆ preferredId

uint32_t xaiefal::XAieRsc::preferredId
protected

preferred resource Id

◆ reservedId

uint32_t xaiefal::XAieRsc::reservedId
protected

reserved resource Id

◆ State

XAieRscState xaiefal::XAieRsc::State
protected

resource state

◆ Type

XAieRscType xaiefal::XAieRsc::Type
protected

resource type

◆ vRscs

std::vector<XAieUserRsc> xaiefal::XAieRsc::vRscs
protected

resources data


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