Skip to content

Commit

Permalink
Row and col fields in txn address takes no more than 5 bits (#1762)
Browse files Browse the repository at this point in the history
  • Loading branch information
erwei-xilinx committed Sep 10, 2024
1 parent 00bd68c commit 3903d97
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/Dialect/AIEX/IR/AIEXDialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,15 +650,13 @@ LogicalResult AIEX::DMAStartBdChainOp::verify() {
uint32_t AIEX::NpuControlPacketOp::getRowFromAddr() {
const auto &targetModel = AIE::getTargetModel(*this);
uint32_t addr = getAddress();
uint32_t rowInt =
(addr & (0xff << targetModel.getRowShift())) >> targetModel.getRowShift();
uint32_t rowInt = (addr >> targetModel.getRowShift()) & 0x1f;
return rowInt;
}

uint32_t AIEX::NpuControlPacketOp::getColumnFromAddr() {
const auto &targetModel = AIE::getTargetModel(*this);
uint32_t addr = getAddress();
uint32_t colInt = (addr & (0xff << targetModel.getColumnShift())) >>
targetModel.getColumnShift();
uint32_t colInt = (addr >> targetModel.getColumnShift()) & 0x1f;
return colInt;
}

0 comments on commit 3903d97

Please sign in to comment.