Skip to content

Commit

Permalink
fix aie.objectfifo.subview.access (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorendumoulin authored Jan 8, 2025
1 parent 5bc0fff commit 3e76420
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions tests/filecheck/dialects/aie/ops.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ aie.objectfifo @of1 (%1, { %2 }, 4 : i32) : !aie.objectfifo<memref<16xi32>>
// CHECK-NEXT: %{{.*}} = aie.objectfifo.acquire @of1(Consume, 1) : !aie.objectfifosubview<memref<16xi32>>
// CHECK-GENERIC-NEXT: %{{.*}} = "aie.objectfifo.acquire"() <{{{["]?}}objFifo_name{{["]?}} = @of1, {{["]?}}port{{["]?}} = 1 : i32, {{["]?}}size{{["]?}} = 1 : i32}> : () -> !aie.objectfifosubview<memref<16xi32>>

%5 = aie.objectfifo.subview.access %4[0] : !aie.objectfifosubview<memref<16xi32>> -> memref<16xi32>

// CHECK-NEXT: %{{.*}} = aie.objectfifo.subview.access %{{.*}}[0] : !aie.objectfifosubview<memref<16xi32>> -> memref<16xi32>
// CHECK-GENERIC-NEXT: %{{.*}} = "aie.objectfifo.subview.access"(%3) <{{{["]?}}index{{["]?}} = 0 : i32}> : (!aie.objectfifosubview<memref<16xi32>>) -> memref<16xi32>

aie.objectfifo.release @of1(Consume, 1)

// CHECK-NEXT: aie.objectfifo.release @of1(Consume, 1)
Expand Down
4 changes: 2 additions & 2 deletions xdsl_aie/dialects/aie.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ def parse(cls, parser: Parser) -> ObjectFifoRegisterExternalBuffersOp:
class ObjectFIFOSubviewAccessOp(IRDLOperation):
name = "aie.objectfifo.subview.access"

index = attr_def(IntegerAttr[IntegerType])
index = prop_def(IntegerAttr[IntegerType])
subview = operand_def(ObjectFIFOSubview[Attribute])
output = result_def(builtin.MemRefType)

Expand All @@ -1086,7 +1086,7 @@ def __init__(self, index: IntegerAttr[IntegerType], subview: Operation | SSAValu
subview.result.type.buffer.element_type, subview.result.type.buffer.shape
)
super().__init__(
attributes={"index": index}, operands=[subview], result_types=[result_type]
properties={"index": index}, operands=[subview], result_types=[result_type]
)

def print(self, printer: Printer):
Expand Down

0 comments on commit 3e76420

Please sign in to comment.