Base AI engine resource class. It defines resource operations and maintains resource state machine.
More...
#include <xaiefal-rsc-base.hpp>
Base AI engine resource class. It defines resource operations and maintains resource state machine.
◆ XAieRsc() [1/4]
| xaiefal::XAieRsc::XAieRsc |
( |
| ) |
|
|
delete |
◆ XAieRsc() [2/4]
| xaiefal::XAieRsc::XAieRsc |
( |
std::shared_ptr< XAieDevHandle > | DevHd | ) |
|
|
inline |
◆ XAieRsc() [3/4]
◆ XAieRsc() [4/4]
| xaiefal::XAieRsc::XAieRsc |
( |
XAieDev & | Dev | ) |
|
|
inline |
◆ ~XAieRsc()
| virtual xaiefal::XAieRsc::~XAieRsc |
( |
| ) |
|
|
inlinevirtual |
◆ 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
-
| vOutRscs | vector to store the reserved resources |
◆ getRscs()
| AieRC xaiefal::XAieRsc::getRscs |
( |
std::vector< XAieUserRsc > & | vOutRscs | ) |
|
|
inline |
This function returns resources to be reserved.
- Parameters
-
| vOutRscs | vector 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 |
◆ 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
-
| id | requested id for resource |
| isStatticAllocated | to 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
-
| vInRscs | vector 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.
◆ AieHd
AI engine device instance
◆ preferredId
| uint32_t xaiefal::XAieRsc::preferredId |
|
protected |
◆ reservedId
| uint32_t xaiefal::XAieRsc::reservedId |
|
protected |
◆ State
◆ Type
◆ vRscs
The documentation for this class was generated from the following file: