Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
fifield committed Sep 10, 2024
1 parent bd9c793 commit fefb486
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 25 deletions.
3 changes: 1 addition & 2 deletions include/aie-c/Translation.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ MLIR_CAPI_EXPORTED AieRtControl getAieRtControl(AieTargetModel tm);
MLIR_CAPI_EXPORTED void freeAieRtControl(AieRtControl aieCtl);
MLIR_CAPI_EXPORTED void aieRtStartTransaction(AieRtControl aieCtl);
MLIR_CAPI_EXPORTED void aieRtDmaUpdateBdAddr(AieRtControl aieCtl, int col,
int row, size_t addr,
size_t bdId);
int row, size_t addr, size_t bdId);
MLIR_CAPI_EXPORTED void aieRtExportSerializedTransaction(AieRtControl aieCtl);

#ifdef __cplusplus
Expand Down
6 changes: 3 additions & 3 deletions include/aie/Targets/AIERT.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static_assert(XAIE_OK == 0);
#define TRY_XAIE_API_FATAL_ERROR(API, ...) \
do { \
LLVM_DEBUG(llvm::dbgs() << "trying XAIE API: " << #API << " with args: "); \
LLVM_DEBUG(SHOW_AIERT_ARGS(llvm::dbgs(), __VA_ARGS__)); \
LLVM_DEBUG(SHOW_AIERT_ARGS(llvm::dbgs(), __VA_ARGS__)); \
LLVM_DEBUG(llvm::dbgs() << "\n"); \
if (auto r = API(__VA_ARGS__)) \
llvm::report_fatal_error(llvm::Twine(#API " failed with ") + \
Expand All @@ -131,7 +131,7 @@ static_assert(XAIE_OK == 0);
#define TRY_XAIE_API_EMIT_ERROR(OP, API, ...) \
do { \
LLVM_DEBUG(llvm::dbgs() << "trying XAIE API: " << #API << " with args: "); \
LLVM_DEBUG(SHOW_AIERT_ARGS(llvm::dbgs(), __VA_ARGS__)); \
LLVM_DEBUG(SHOW_AIERT_ARGS(llvm::dbgs(), __VA_ARGS__)); \
LLVM_DEBUG(llvm::dbgs() << "\n"); \
if (auto r = API(__VA_ARGS__)) \
return OP.emitOpError() << #API " failed with " << AIERCTOSTR.at(r); \
Expand All @@ -140,7 +140,7 @@ static_assert(XAIE_OK == 0);
#define TRY_XAIE_API_LOGICAL_RESULT(API, ...) \
do { \
LLVM_DEBUG(llvm::dbgs() << "trying XAIE API: " << #API << " with args: "); \
LLVM_DEBUG(SHOW_AIERT_ARGS(llvm::dbgs(), __VA_ARGS__)); \
LLVM_DEBUG(SHOW_AIERT_ARGS(llvm::dbgs(), __VA_ARGS__)); \
LLVM_DEBUG(llvm::dbgs() << "\n"); \
if (auto r = API(__VA_ARGS__)) { \
llvm::errs() << #API " failed with " << AIERCTOSTR.at(r); \
Expand Down
2 changes: 1 addition & 1 deletion lib/CAPI/Translation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void freeAieRtControl(AieRtControl aieCtl) {
}

void aieRtDmaUpdateBdAddr(AieRtControl aieCtl, int col, int row, size_t addr,
size_t bdId) {
size_t bdId) {
AIERTControl *ctl = unwrap(aieCtl);
ctl->dmaUpdateBdAddr(col, row, addr, bdId);
}
Expand Down
28 changes: 14 additions & 14 deletions lib/Targets/AIERT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ LogicalResult AIERTControl::setIOBackend(bool aieSim, bool xaieDebug) {
}

LogicalResult AIERTControl::configureLocksInBdBlock(XAie_DmaDesc &dmaTileBd,
Block &block,
XAie_LocType &tileLoc) {
Block &block,
XAie_LocType &tileLoc) {
LLVM_DEBUG(llvm::dbgs() << "\nstart configuring bds\n");
std::optional<int> acqValue, relValue, acqLockId, relLockId;
bool acqEn = false;
Expand Down Expand Up @@ -164,9 +164,9 @@ LogicalResult AIERTControl::configureLocksInBdBlock(XAie_DmaDesc &dmaTileBd,
}

LogicalResult AIERTControl::configureBdInBlock(XAie_DmaDesc &dmaTileBd,
Block &block,
XAie_LocType &tileLoc, int bdId,
std::optional<int> nextBdId) {
Block &block,
XAie_LocType &tileLoc, int bdId,
std::optional<int> nextBdId) {
std::optional<int> packetType;
std::optional<int> packetID;

Expand Down Expand Up @@ -309,9 +309,10 @@ LogicalResult AIERTControl::configureBdInBlock(XAie_DmaDesc &dmaTileBd,
return success();
};

LogicalResult AIERTControl::pushToBdQueueAndEnable(
Operation &op, XAie_LocType &tileLoc, int chNum,
const DMAChannelDir &channelDir, int bdId, int repeatCount) {
LogicalResult
AIERTControl::pushToBdQueueAndEnable(Operation &op, XAie_LocType &tileLoc,
int chNum, const DMAChannelDir &channelDir,
int bdId, int repeatCount) {
XAie_DmaDirection direction =
channelDir == DMAChannelDir::S2MM ? DMA_S2MM : DMA_MM2S;
auto enTokenIssue = tileLoc.Row == 0 && direction == DMA_S2MM;
Expand All @@ -326,7 +327,7 @@ LogicalResult AIERTControl::pushToBdQueueAndEnable(
};

LogicalResult AIERTControl::configureLocksAndBd(Block &block,
XAie_LocType tileLoc) {
XAie_LocType tileLoc) {
DMABDOp bd = *block.getOps<DMABDOp>().begin();
assert(bd.getBdId().has_value() &&
"DMABDOp must have assigned bd_id; did you forget to run "
Expand Down Expand Up @@ -571,7 +572,7 @@ LogicalResult AIERTControl::addCoreEnable(DeviceOp &targetOp) {
}

LogicalResult AIERTControl::addAieElf(uint8_t col, uint8_t row,
const StringRef elfPath, bool aieSim) {
const StringRef elfPath, bool aieSim) {
TRY_XAIE_API_LOGICAL_RESULT(XAie_CoreDisable, &devInst,
XAie_TileLoc(col, row));
TRY_XAIE_API_LOGICAL_RESULT(XAie_DmaChannelResetAll, &devInst,
Expand All @@ -591,8 +592,8 @@ LogicalResult AIERTControl::addAieElf(uint8_t col, uint8_t row,
}

LogicalResult AIERTControl::addAieElfs(DeviceOp &targetOp,
const StringRef workDirPath,
bool aieSim) {
const StringRef workDirPath,
bool aieSim) {
for (auto tileOp : targetOp.getOps<TileOp>())
if (tileOp.isShimNOCorPLTile()) {
// Resets no needed with V2 kernel driver
Expand All @@ -619,8 +620,7 @@ LogicalResult AIERTControl::addAieElfs(DeviceOp &targetOp,
return success();
}

void AIERTControl::dmaUpdateBdAddr(int col, int row, size_t addr,
size_t bdId) {
void AIERTControl::dmaUpdateBdAddr(int col, int row, size_t addr, size_t bdId) {
auto tileLoc = XAie_TileLoc(col, row);
TRY_XAIE_API_FATAL_ERROR(XAie_DmaUpdateBdAddr, &devInst, tileLoc, addr, bdId);
}
Expand Down
7 changes: 4 additions & 3 deletions lib/Targets/AIETargetCDODirect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,10 @@ parseTransactionBinary(const std::vector<uint8_t> &data,
return num_cols;
}

static LogicalResult
generateTxn(AIERTControl &ctl, const StringRef workDirPath, DeviceOp &targetOp,
bool aieSim, bool enableElfs, bool enableInit, bool enableCores) {
static LogicalResult generateTxn(AIERTControl &ctl, const StringRef workDirPath,
DeviceOp &targetOp, bool aieSim,
bool enableElfs, bool enableInit,
bool enableCores) {
if (enableElfs && !targetOp.getOps<CoreOp>().empty() &&
failed(ctl.addAieElfs(targetOp, workDirPath, aieSim)))
return failure();
Expand Down
3 changes: 1 addition & 2 deletions python/AIERTModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ PYBIND11_MODULE(_aiertx, m) {
})
.def(
"dma_update_bd_addr",
[](PyAIERTControl &self, int col, int row, size_t addr,
size_t bdId) {
[](PyAIERTControl &self, int col, int row, size_t addr, size_t bdId) {
aieRtDmaUpdateBdAddr(self.ctl, col, row, addr, bdId);
},
"col"_a, "row"_a, "addr"_a, "bd_id"_a);
Expand Down

0 comments on commit fefb486

Please sign in to comment.