1
1
# AIRCC - The AIR Compiler Driver
2
2
3
3
## Overview
4
- ` aircc.py ` is a compiler driver processing air programs. It takes the AIR MLIR
4
+ ` aircc.py ` is a compiler driver processing air programs. It takes the ` AIR ` MLIR
5
5
dialect as input and produces AIE binaries plus host library code as output.
6
6
7
7
## Usage
@@ -36,7 +36,7 @@ optional arguments:
36
36
```
37
37
38
38
Python:
39
- ```
39
+ ``` Python
40
40
import air.compiler.aircc.main as aircc
41
41
42
42
# same as command line options above, but as a python list
@@ -47,31 +47,31 @@ aircc.run(air_module, aircc_options)
47
47
48
48
## Compilation pipeline
49
49
50
- aircc.py runs several code transformations and tools to generate executable
51
- code from AIR dialect.
50
+ ` aircc.py ` runs several code transformations and tools to generate executable
51
+ code from ` AIR ` dialect.
52
52
53
53
The first steps are to:
54
- - Run herd placement (` air-place-herds ` ) using the aircc.py commmand line options
55
- - Run AIR dialect to AIR dialect conversion (` air-to-aie ` )
54
+ - Run herd placement (` air-place-herds ` ) using the ` aircc.py ` commmand line options
55
+ - Run ` AIR ` dialect to ` AIE ` dialect conversion (` air-to-aie ` )
56
56
57
- The ` air-to-aie ` pass will generate an AIE dialect MLIR module for each AIR
58
- dialect partition in the program and will add runtime metadata to the AIR
57
+ The ` air-to-aie ` pass will generate an ` AIE ` dialect MLIR module for each ` AIR `
58
+ dialect partition in the program and will add runtime metadata to the ` AIR `
59
59
dialect program.
60
60
61
61
### Lowering of control code
62
62
63
- The AIR dialect program is lowered to control code with the following pipeline:
64
- - Run ` air-to-std ` to generate AIRRt dialect from AIR dialect.
65
- - Run ` airrt-to-llvm ` to lower AIRRt dialect to LLVM dialect
63
+ The ` AIR ` dialect program is lowered to control code with the following pipeline:
64
+ - Run ` air-to-std ` to generate ` AIRRt ` dialect from ` AIR ` dialect.
65
+ - Run ` airrt-to-llvm ` to lower ` AIRRt ` dialect to ` LLVM ` dialect
66
66
- Bufferize any remaing tensors
67
- - Lower standard dialects (linalg, scf, memref, ...) to LLVM dialect
68
- - Translate LLVM dialect to LLVM IR (` aie-translate ` )
67
+ - Lower standard dialects (` linalg ` , ` scf ` , ` memref ` , ...) to ` LLVM ` dialect
68
+ - Translate ` LLVM ` dialect to LLVM IR (` aie-translate ` )
69
69
- Compile LLVM IR to object code (` opt ` and ` clang ` )
70
70
71
71
### Lowering of AIE code
72
72
73
- For each AIE dialect module generated by the ` air-to-aie ` pass, aircc will:
74
- - Run ` aiecc.py ` on the AIE dialect module. This generates an AIE elf file for
73
+ For each ` AIE ` dialect module generated by the ` air-to-aie ` pass, ` aircc ` will:
74
+ - Run ` aiecc.py ` on the ` AIE ` dialect module. This generates an AIE ` . elf` file for
75
75
every core in every herd in the partition and generates C++ code to configure the
76
76
partition at runtime (using the ` -aie-generate-xaiev2 ` option).
77
77
- Generate a C++ wrapper defining a namespace to hold each partition's
@@ -81,13 +81,12 @@ runtime and to user programs. An example is shown below.
81
81
The generated C++ wrappers are compiled and linked with the controlled code
82
82
generated by the MLIR passes into a single library. This can be a shared library
83
83
to be loaded at runtime or a static library linked into an executable. The AIE
84
- elf files are not part of the generated library and must be available to load
84
+ ` . elf` files are not part of the generated library and must be available to load
85
85
into memory at runtime.
86
86
87
- Example C++ wrapper generated by aircc.py:
88
- ```
89
- namespace air {
90
- namespace partitions {
87
+ Example C++ wrapper generated by ` aircc.py ` :
88
+ ``` c++
89
+ namespace air ::partitions {
91
90
92
91
// One namespace for each partition in the
93
92
// program using the MLIR symbol names
@@ -99,4 +98,4 @@ namespace partition_1 {
99
98
}
100
99
101
100
}
102
- }
101
+ ```
0 commit comments