Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.o
*.so*
driver/include
2 changes: 1 addition & 1 deletion driver/src/common/xaie_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1756,7 +1756,7 @@ AieRC XAie_AddCustomTxnOp(XAie_DevInst *DevInst, u8 OpNumber, void* Args, size_t

/* check memory allocation before increase Cmd vector */
char* tmpBuff = malloc(size);
if(tmpBuff == 0U) {
if(tmpBuff == NULL) {
XAIE_ERROR("Fail to malloc %d size memory for DataPtr\n", size);
return XAIE_ERR;
}
Expand Down
10 changes: 2 additions & 8 deletions driver/src/common/xaie_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,8 @@
/* Generate value with a set bit at given Index */
#define BIT(Index) (1 << (Index))

/*
* __attribute is not supported for windows. remove it conditionally.
*/
#ifdef _MSC_VER
#define XAIE_PACK_ATTRIBUTE
#else
#define XAIE_PACK_ATTRIBUTE __attribute__((packed, aligned(4)))
#endif
/* Suppress warning of unused parameter */
#define UNUSED(_x) (_x = _x)

/* Data structure to capture the dma status */
typedef struct {
Expand Down
3 changes: 2 additions & 1 deletion driver/src/common/xaie_txn.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ typedef enum {
XAIE_IO_CUSTOM_OP_TCT = XAIE_IO_CUSTOM_OP_BEGIN,
XAIE_IO_CUSTOM_OP_DDR_PATCH,
XAIE_IO_CUSTOM_OP_NEXT,
XAIE_IO_CUSTOM_OP_MAX = UCHAR_MAX,
/* add new op here */
XAIE_IO_CUSTOM_OP_MAX
} XAie_TxnOpcode;

struct XAie_TxnCmd {
Expand Down
2 changes: 0 additions & 2 deletions driver/src/core/xaie_core_aie.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
*
******************************************************************************/
/***************************** Include Files *********************************/
#include <unistd.h>

#include "xaie_core_aie.h"
#include "xaie_events_aie.h"
#include "xaie_feature_config.h"
Expand Down
2 changes: 1 addition & 1 deletion driver/src/core/xaie_elfloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ AieRC XAie_LoadElfPartial(XAie_DevInst *DevInst, XAie_LocType Loc,
return XAIE_INVALID_ARGS;
}

Fd = fopen(ElfPtr, "r");
Fd = fopen(ElfPtr, "rb");
if(Fd == XAIE_NULL) {
XAIE_ERROR("Unable to open elf file, %d: %s\n",
errno, strerror(errno));
Expand Down
1 change: 0 additions & 1 deletion driver/src/device/xaie_device_aie.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@ AieRC _XAie_RequestTiles(XAie_DevInst *DevInst, XAie_BackendTilesArray *Args)
AieRC _XAie_SetColumnClk(XAie_DevInst *DevInst, XAie_BackendColumnReq *Args)
{
AieRC RC;
u8 flag;
u32 StartBit, EndBit;

u32 PartEndCol = DevInst->StartCol + DevInst->NumCols - 1;
Expand Down
7 changes: 1 addition & 6 deletions driver/src/device/xaie_device_aieml.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,13 @@
******************************************************************************/
u8 _XAieMl_GetTTypefromLoc(XAie_DevInst *DevInst, XAie_LocType Loc)
{
u8 ColType;

if(Loc.Col >= DevInst->NumCols) {
XAIE_ERROR("Invalid column: %d\n", Loc.Col);
return XAIEGBL_TILE_TYPE_MAX;
}

if(Loc.Row == 0U) {
ColType = (DevInst->StartCol + Loc.Col) % 4U;
if((ColType == 0U) || (ColType == 1U)) {
if((DevInst->StartCol + Loc.Col) == 0U) {
return XAIEGBL_TILE_TYPE_SHIMPL;
}

Expand Down Expand Up @@ -431,8 +428,6 @@ static AieRC _XAieMl_PmSetShimClk(XAie_DevInst *DevInst,
AieRC _XAieMl_SetColumnClk(XAie_DevInst *DevInst, XAie_BackendColumnReq *Args)
{
AieRC RC;
u32 ColClockStatus;

u32 StartBit, EndBit;
u32 PartEndCol = DevInst->StartCol + DevInst->NumCols - 1;

Expand Down
10 changes: 5 additions & 5 deletions driver/src/global/xaiegbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ AieRC XAie_CfgInitialize(XAie_DevInst *InstPtr, XAie_Config *ConfigPtr)
InstPtr->MemTileNumRows = ConfigPtr->MemTileNumRows;
InstPtr->AieTileRowStart = ConfigPtr->AieTileRowStart;
InstPtr->AieTileNumRows = ConfigPtr->AieTileNumRows;
InstPtr->EccStatus = XAIE_ENABLE;
//InstPtr->EccStatus = XAIE_ENABLE;
InstPtr->EccStatus = XAIE_DISABLE; // IPU
InstPtr->TxnList.Next = NULL;

RC = _XAie_RscMgrInit(InstPtr);
Expand All @@ -196,7 +197,7 @@ AieRC XAie_CfgInitialize(XAie_DevInst *InstPtr, XAie_Config *ConfigPtr)
memcpy(&InstPtr->PartProp, &ConfigPtr->PartProp,
sizeof(ConfigPtr->PartProp));

RC = XAie_IOInit(InstPtr);
RC = XAie_IOInit(InstPtr, ConfigPtr->Backend);
if(RC != XAIE_OK) {
return RC;
}
Expand Down Expand Up @@ -998,12 +999,11 @@ AieRC XAie_PerfUtilization(XAie_DevInst *DevInst, XAie_PerfInst *PerfInst)
PartRange.Num = DevInst->NumCols;
XAIE_DBG("Start Col: %d\tnum: %d\n", PartRange.Start, PartRange.Num);
PerfInst->Range = &PartRange;
} else if (PerfInst->Range->Num <= 0U ||
} else if (PerfInst->Range->Num == 0U ||
PerfInst->Range->Num > DevInst->NumCols) {
XAIE_ERROR("Invalid range!\n");
return XAIE_INVALID_ARGS;
} else if(PerfInst->Range->Start < 0U ||
PerfInst->Range->Start >= DevInst->NumCols) {
} else if(PerfInst->Range->Start >= DevInst->NumCols) {
XAIE_ERROR("Invalid range!\n");
return XAIE_INVALID_ARGS;
}
Expand Down
4 changes: 3 additions & 1 deletion driver/src/global/xaiegbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ typedef enum {
XAIE_IO_BACKEND_DEBUG, /* IO debug backend */
XAIE_IO_BACKEND_LINUX, /* Linux kernel backend */
XAIE_IO_BACKEND_SOCKET, /* Socket backend */
XAIE_IO_BACKEND_AMDAIR, /* Use with amdair driver */
XAIE_IO_BACKEND_MAX
} XAie_BackendType;

Expand Down Expand Up @@ -182,6 +183,7 @@ typedef struct {
u8 AieTileRowStart;
u8 AieTileNumRows;
XAie_PartitionProp PartProp;
XAie_BackendType Backend;
} XAie_Config;

/*
Expand Down Expand Up @@ -763,7 +765,7 @@ static inline void XAie_SetupConfigPartProp(XAie_Config *ConfigPtr, u32 Nid,
* more memory from the user application for resource management.
*
*******************************************************************************/
#define XAie_InstDeclare(Inst, ConfigPtr) XAie_DevInst Inst = { 0 }
#define XAie_InstDeclare(Inst, ConfigPtr) XAie_DevInst Inst = {}

/*****************************************************************************/
/**
Expand Down
9 changes: 9 additions & 0 deletions driver/src/global/xaiegbl_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ typedef uint64_t u64;

#define __FORCE_INLINE__ __attribute__((always_inline))

/*
* __attribute is not supported for windows. remove it conditionally.
*/
#ifdef _MSC_VER
#define XAIE_PACK_ATTRIBUTE
#else
#define XAIE_PACK_ATTRIBUTE __attribute__((packed, aligned(4)))
#endif

/************************** Variable Definitions *****************************/
/************************** Function Prototypes *****************************/
#endif /* end of protection macro */
Expand Down
2 changes: 1 addition & 1 deletion driver/src/interrupt/xaie_interrupt_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ static AieRC XAie_ErrorHandlingReserveRsc(XAie_DevInst *DevInst)
}

for(u32 i = 0; i < ShimUserRscNum; i++) {
ShimRscsBc[i].Loc = (XAie_LocType)XAie_TileLoc((u8)i, 0);
ShimRscsBc[i].Loc = XAie_TileLoc((u8)i, 0);
ShimRscsBc[i].Mod = (u32)XAIE_PL_MOD;
ShimRscsBc[i].RscType = (u32)XAIE_BCAST_CHANNEL_RSC;
}
Expand Down
Loading