-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
aie-rt/driver/src/common/xaie_helper.c
Lines 1036 to 1039 in 1a403e2
| static inline u8 _XAie_GetRowfromRegOff(XAie_DevInst *DevInst, u64 RegOff) | |
| { | |
| return RegOff &(u64)(~(ULONG_MAX << DevInst->DevProp.RowShift)); | |
| } |
The provided function is intended to extract the
row information from RegOff. However, the current implementation incorrectly extracts only the lower 8 bits (RegOff[7:0]) instead of the intended range, RegOff[ColShift:RowShift].
The correct version is something like this:
static inline u8 _XAie_GetRowfromRegOff(XAie_DevInst *DevInst, u64 RegOff)
{
u64 Mask = (u64)(((1U << DevInst->DevProp.ColShift) - 1U) &
~((1U << DevInst->DevProp.RowShift) - 1U));
return (u8)((RegOff & Mask) >> (u64)(DevInst->DevProp.RowShift));
}I believe the above logic has been misplaced and currently resides in _XAie_GetColfromRegOff. The _XAie_GetColfromRegOff function should also be updated to the following:
static inline u8 _XAie_GetColfromRegOff(XAie_DevInst *DevInst, u64 RegOff)
{
return (u8)(RegOff >> (u64)(DevInst->DevProp.ColShift));
}Metadata
Metadata
Assignees
Labels
No labels