The ForSyDe DevTools project provides a compiler and visualiser for ForSyDe Shallow, a modelling framework written in Haskell. The project was conducted as part of the course IL2232 Embedded Systems Design Project at KTH Royal Institute of Technology, under the supervision of Professor Ingo Sander, who served as the project client.
A pre-study related to this project was conducted as part of the II2211 Research Methodology and Scientific Writing for Embedded Systems course, where a literature review was carried out to investigate existing approaches to developing a compiler which translates ForSyDe models. This pre-study can be found under the docs.
The original algorithm for generating code from SDF (Synchronous Data Flow) models written in ForSyDe can be found in this paper.
The ForSyDe DevTools compiler and LSP have been developed using a specific version of the GHC API as the frontend; the current version of GHC being used is 9.10.2. Thus, stack is required to build the devtools. We suggest using ghcup to install it. Using your system's package manager should work too.
The ForSyDe DevTools compiler requires the OpenBLAS and LAPACK external libraries. These must be installed separately using your system's package manager. On Debian-based systems, use the command:
apt install libblas-dev liblapack-dev
With all dependencies resolved, you can install forsyde-devtools by cloning this repository and running stack install to build and install the compiler and language server.
git clone https://github.com/sthaeron/forsyde-devtools.git
cd forsyde-devtools
stack install
This installs the compiler and LSP to ~/.local/bin. Make sure this directory is in your shell path. Check by running echo $PATH. If it is not included, add export PATH="$HOME/.local/bin:$PATH" to your shell configuration file. Then reinitialise your terminal shell. If you have successfully installed the devtools in your shell's path, you should be able to run the following commands:
stack exec forsyde-compiler-exe -- --help
stack exec forsyde-lsp-exe -- --help
For more information on how to use the compiler and LSP provided by the ForSyDe DevTools project, refer to the user guide.
First, install the compiler and LSP as described in the previous section. Then, install the KLighD Diagrams and Haskell VSCode extensions. You will also need npm, at least version 11.11.*, to build and package the extension. We recommend installing npm through the following guide.
To build and install the VSCode extension, from the root of the forsyde-devtools repo, run the commands:
cd ./vscode-ext
npm install
npm run compile
npm run package
code --install-extension forsyde-vscode-extension-0.1.0.vsix
cd ..For more information on how to setup and use the visualiser VSCode extension provided by the ForSyDe DevTools project, refer to the user guide.
To contribute to the project we recommend using Nix to setup your Haskell development environment. You can install Nix onto your system with the following instructions at nixos.org. This project makes use of nix flakes which need to be manually enabled by adding the following to your nix.conf:
experimental-features = nix-command flakes
Automatically entering and exiting the Haskell development environment can be accomplished by installing the utilities direnv and nix-direnv. Upon entering the project directory or changing the .envrc file you will be prompted to run the command direnv allow, which will allow for the automatic loading and unloading of the nix flake.
The compiler and LSP can be individually built and run using the nix build and nix run commands, such as:
nix build
nix run ".#forsyde-lsp" -- --help
nix run ".#forsyde-compiler" -- examples/model/SDF_example_008.hs --stdoutFor more information about contributing refer to our contribution docs.
- Michel Delli Abo
- Samuel Miksits
- Klara Modin
- Mohammad Afif Ramadhan
- Sebastian Thaeron
- Zicong Zhang
We would like to thank:
- Professor Ingo Sander – for supervising, mentoring, and giving us the opportunity to contribute to his research project.
- The Real-Time and Embedded Systems Group at Kiel University – for their time, support, and assistance related to the KIELER research project.
- Lecturer Elias Flening – for teaching and mentoring us in project management during the course IL2232 Embedded Systems Design Project at KTH.
- Associate Professor Jiantong Li and Associate Professor Johnny Öberg – for teaching us research methodology and scientific writing in the course II2211 Research Methodology and Scientific Writing for Embedded Systems at KTH.