Xilinx/mlir-aie

AIETargetModel.h: Function descriptions don't match their behaviour

AndraBisca opened this issue · 1 comments

Assuming that tile(0,0) is in the bottom-left corner of the AIE array, the function descriptions below don't match their output. For example, isWest "Returns true if src is West of dst" but the test srcCol == dstCol + 1 indicates that srcCol is larger than dstCol, which means that it is dst that is West of src. Similar for the other functions.

https://github.com/Xilinx/mlir-aie/blob/2d91dff5383ff8d607220c1d87f7cd84b4e8d65e/include/aie/Dialect/AIE/IR/AIETargetModel.h#L121C3-L139C4

/// Return true if src is West of dst
  bool isWest(int srcCol, int srcRow, int dstCol, int dstRow) const {
    return srcCol == dstCol + 1 && srcRow == dstRow;
  }

  /// Return true if src is East of dst
  bool isEast(int srcCol, int srcRow, int dstCol, int dstRow) const {
    return srcCol == dstCol - 1 && srcRow == dstRow;
  }

  /// Return true if src is North of dst
  bool isNorth(int srcCol, int srcRow, int dstCol, int dstRow) const {
    return srcCol == dstCol && srcRow == dstRow - 1;
  }

  /// Return true if src is South of dst
  bool isSouth(int srcCol, int srcRow, int dstCol, int dstRow) const {
    return srcCol == dstCol && srcRow == dstRow + 1;
  }

These functions are used in #974.