POLSCA used to be called Phism. There are still references to Phism in this repository. We will potentially fix them in the future.
Phism is an HLS tool: it transforms C programs to hardware designs.
Phism leverages MLIR and enjoys the progressive lowering idea to build the full compilation pipeline. The ability to apply a full range of compilation transformations in an organized, layered way is what Phism stands out from other tools.
Phism optimises hardware design generation through polyhedral modelling, a powerful technique that especially good at transforming statically scheduled nested loops for better parallelism and locality.
Please find how to setup the prerequisites here.
Phism uses Polygeist to process C/C++ code into MLIR. But before we built Polygeist, we need to build the LLVM package within Polygeist (polygeist/llvm-project
). This LLVM package will be shared by Polygeist, Polymer (later), and Phism.
First of all, make sure you've initialized all the submodules.
git submodule update --init --recursive
You may see many submodules being synced -- don't worry, they are simply required by Pluto, the polyhedral optimizer that Phism uses.
To build LLVM, Just run the following script. It should take care of everything you need.
./scripts/build-llvm.sh
It is another one-liner:
./scripts/build-polygeist.sh
Polymer provides the functionality to interact MLIR code with polyhedral scheduler.
There is also a script for you -
./scripts/build-polymer.sh
Finally, you're all prepared to build Phism! Just type in the following commands:
./scripts/build-phism.sh
It should run the Phism regression test in the end. And if all the tests passed, hooray!
This doc gives an introduction on how to run Phism with docker.
Polybench is the major benchmark we look at. It contains 30 different examples covering programs that can be potentially optimised by polyhedral transformation. The benchmark suite is located at example/polybench, and you can find our report here.