Overview

ForSyDe-Shallow is the first and most long-lived incarnation of the ForSyDe modeling concepts, as a shallow-embedded domain specific language (EDSL) in the functional programming language Haskell. It is meant for modeling, simulation and early design validation of heterogeneous embedded and cyber-physical systems, and builds upon the concepts of models of computation (MoC) combined with Haskell’s function purity and higher-order functions.

Crash Course in ForSyDe Modeling

  • A ForSyDe system is modeled as a hierarchical network of concurrent processes.
  • Each process operates with the semantics dictated by a chosen MoC (e.g. Synchronous, Synchronous Dataflow, Scenario Aware Dataflow, Continuous Time, etc.)
  • Processes can only communicate with other processes through signals.
  • Processes of different MoCs communicate via domain interfaces.

Process

A process takes /m/ input signals as argument and produces /n/ output signals. ForSyDe processes are deterministic.

  • A process is always designed by means of a process constructor
  • The process constructor defines the model of computation and the communication interface of the process
  • The process constructor takes side-effect free functions and variables as arguments and returns a process

The process constructor mooreSY constructs a Moore FSM process belonging to the synchronous MoC.

Process Constructor

There are three main categories of process constructors, which exist in all models of computation:

  • Combinational process has no internal state
  • Delay process delays input
  • Sequential processes have an internal state and contain a delay process

The concept of process constructor separates communication from computation thus:

  • the constructor abstracts communication and interface
  • the function captures computation

This concept also forces the designer to develop a structured formal model that allows for formal analysis, and subsequently enables transformational refinement, implementation mapping and formal verification further down the design process.

Quick Start

There are several ways to acquire and use the ForSyDe-Shallow libraries, however we recommend the following procedure.

  1. Follow these instructions to setup Haskell and get started with it.
  2. Use the command
    stack ghci --package forsyde-shallow
    

    to start a Haskell session with the interpreter ghci in a terminal, where you with the flag --package forsyde-shallow instruct the Haskell package manager stack to download the ForSyDe-Shallow library from the Haskell package repository HackageDB. The first time you execute this command will take some time, since both the Haskell compiler and the ForSyDe-Shallow library need to be installed.

  3. You can now within the interpreter session of ghci load the ForSyDe-Shallow libraries and use the provided functions and constructors to test their behavior, for example:
    > :m +ForSyDe.Shallow
    > let s = signal [1..4] :: Signal Int
    > mooreSY (+) (*2) 0 s
    {0,2,6,12,20}
    

    The example above implements a Moore finite state machine that calculates the running sum and multiplies the output with 2.

For a more detailed step-by-step tutorial on ForSyDe-Shallow, please follow the getting started example.

Documentation and resources

Here you can find links to further documentation resources: