Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phoenix v2024.1 #3

Open
wants to merge 12 commits into
base: xlnx_rel_v2024.1
Choose a base branch
from
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 @@ -1506,7 +1506,7 @@ AieRC XAie_BlockWrite32(XAie_DevInst *DevInst, u64 RegOff, const u32 *Data, u32
return XAIE_ERR;
}

Buf = memcpy((void *)Buf, (void *)Data, sizeof(u32) * Size);
Buf = memcpy((void *)Buf, (const void *)Data, sizeof(u32) * Size);
TxnInst->CmdBuf[TxnInst->NumCmds].Opcode = XAIE_IO_BLOCKWRITE;
TxnInst->CmdBuf[TxnInst->NumCmds].RegOff = RegOff;
TxnInst->CmdBuf[TxnInst->NumCmds].DataPtr = (u64)(uintptr_t)Buf;
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
4 changes: 2 additions & 2 deletions driver/src/core/xaie_elfloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ static AieRC _XAie_LoadProgMemSection(XAie_DevInst *DevInst, XAie_LocType Loc,
* memory out of Progsec will not result in a segmentation
* fault.
*/
return XAie_BlockWrite32(DevInst, Addr, (u32 *)SectionPtr,
return XAie_BlockWrite32(DevInst, Addr, (const u32 *)SectionPtr,
(Phdr->p_memsz + 4U - 1U) / 4U);
}

Expand Down Expand Up @@ -594,7 +594,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
5 changes: 1 addition & 4 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
7 changes: 4 additions & 3 deletions driver/src/global/xaiegbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,14 @@ 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;

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 @@ -1025,7 +1026,7 @@ 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;
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 @@ -98,6 +98,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 @@ -187,6 +188,7 @@ typedef struct {
u8 AieTileRowStart;
u8 AieTileNumRows;
XAie_PartitionProp PartProp;
XAie_BackendType Backend;
} XAie_Config;

/*
Expand Down Expand Up @@ -782,7 +784,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
Loading