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_BINMLIR_TRANSLATE_BINLLC_BINTECKYL_BIN
Tests can then be built by (optionally) creating a build directory, invoking cmake and running make as follows:
mkdir buildcd buildcmake ..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:
cmakeversion 3.10.2clangversion 10.0.0clang++version 10.0.0llcversion 10.0.0ldversion 2.30mlir_optbuilt from llvm-project submodulemlir_translatebuilt from llvm-project submoduleteckylbuilt from teckyl submodule