This repository contains MLIR-based compilation infrastructure and a suite of tests for a Computing-In-Memory device simulator.
See the 'sim_build' branch for additional simulation benchmarks, cross-compilation build config and evaluation results.
The provided tests are based on the following steps:
- MLIR code is generated from the functions defined in a Tensor Comprehensions (TC) file
- MLIR is lowered through CIM dialect (and others) and compiled to an object file
- A test application is compiled together with the MLIR object file and linked against CIM runtime library
- The test application calls the compiled TC functions through their MLIR C interfaces
git submodule init && git submodule update
Ensure that paths to the following executables are set correctly at the project root level CMakeLists.txt
:
MLIR_OPT_BIN
MLIR_TRANSLATE_BIN
LLC_BIN
TECKYL_BIN
Tests can then be built by (optionally) creating a build directory, invoking cmake
and running make
as follows:
mkdir build
cd build
cmake ..
make
The built tests application can be found in build/bin
directory.
Other build artifacts, e.g. generated MLIR files, can be found in build/tests/TEST_NAME
subdirectories.
Build tested with:
cmake
version 3.10.2clang
version 10.0.0clang++
version 10.0.0llc
version 10.0.0ld
version 2.30mlir_opt
built from llvm-project submodulemlir_translate
built from llvm-project submoduleteckyl
built from teckyl submodule