CMStack is a high-level language and compiler which produces an IR for translation to hetereogenous hardware.
If you would like to generate the lexer and parser, please refer to the "To generate lexer and parser directly" section below. Otherwise, you only need Python 3.4.3 or higher, in order to successfully run the compiler. If you would like to view the graphical representations of the compiler-generated dataflow graphs, Graphviz - graph visualization software - is needed. Please refer to the respective online resources in order to install them on your environment.
In addition, code generation depends on loopy as a submodule. After cloning this repository, you will need to run the following commands in order to install loopy:
- git submodule update --init --recursive
- cd loopy/
- pip3 install -r requirements.txt --user
- python3 setup.py install --user
If you run into any issues installing loopy, refer to their documentation here
To run the compiler on cdlang code, run the following command:
$ python3 cmstack/cmstack_entry.py cmlang --input <path/to/cdlang/file.cm>
To run the compiler using an onnx protobuf file as input, run the following command:
$ python3 cmstack/cmstack_entry.py onnx --input <path/to/onnx/model.onnx>
Both of these commands generate a protobuf intermediate representation of the rDFG.
In order to generate C code using the rDFG, you can run the following command:
$ python3 cmstack/cmstack_entry.py c --input <path/to/rdfg.pb> > <cfilename>.c
This compiler was developed by Sean Kinzer, a PhD student at UC San Diego. For any inquiries, please contact skinzer@eng.ucsd.edu.