You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/CIR.md
+270-6
Original file line number
Diff line number
Diff line change
@@ -15,10 +15,19 @@ AIE/IRON as a prototyping phase with the goal of generalizing it as a
15
15
configurable framework to handle for example MLIR AIR and spensors (to be
16
16
sensored on-line).
17
17
18
-
Since most of ACDC software stack is MLIR-based, we are using [ClangIR](https://github.com/llvm/clangir) to generate some MLIR from C/C++. ClangIR is a
19
-
fork of Clang generating MLIR CIR dialect during its code generation and sounds
20
-
like the most promising approach since it is in the process of being up-streamed
21
-
to Clang/LLVM/MLIR and it is backed by several companies.
18
+
Since most of ACDC software stack is MLIR-based, we are using
19
+
[ClangIR](https://github.com/llvm/clangir) to generate some MLIR from
20
+
C/C++. ClangIR is a fork of Clang generating MLIR CIR dialect during its code
21
+
generation and sounds like the most promising approach since it is in the
22
+
process of being up-streamed to Clang/LLVM/MLIR and it is backed by several
23
+
companies.
24
+
25
+
This project requires the compiler flow in ClangIR going from MLIR CIR to the
26
+
MLIR standard dialects which is unfortunately quite less implemented than the
27
+
direct ClangIR CIR → LLVMIR lowering. This explains that most of the efforts in
28
+
the `aie++` project have been diverted into the implementation of the CIR→MLIR
29
+
flow itself. There are also some fundamental limitations in the MLIR standard
30
+
dialects themselves which have to be overcome.
22
31
23
32
The current AIE++ prototype has 2 components:
24
33
@@ -43,13 +52,54 @@ There is no end-to-end working flow or integration with
43
52
There is a script running the compilation flow for the device part of the
44
53
program and leaving a local file for each intermediate phase for inspection.
45
54
46
-
A typical use case is:
55
+
A simple program like [`example.cpp`](../test/CIR/aie++/example.cpp):
56
+
57
+
```c++
58
+
#include"aie++.hpp"
59
+
60
+
intmain() {
61
+
aie::device<aie::npu1> d;
62
+
auto t = d.tile<1, 4>();
63
+
auto b = t.buffer<int, 8192>();
64
+
t.program([&] { b[3] = 14; });
65
+
d.tile<2, 3>().program([] {});
66
+
d.run();
67
+
}
68
+
```
69
+
can be compiled with [`aie++-compile.sh`](../utils/aie++-compile.sh):
0 commit comments