package rfsm

  1. Overview
  2. Docs
A toolset for describing and simulating StateChart-like state diagrams

Install

Dune Dependency

Authors

Maintainers

Sources

rfsm-v1.6-alpha-3.tbz
sha256=eb9583d2a7e354f00f4e0f6b2ea34f2825c92a15a21b708e03fa72c570104ab6
sha512=baff3194770f85efc55e813bbf5e515e1d0d4fae44c492fc6c15ba4834cc41fae5ecb842de1b1fdea10bafe19b4b72320b829d862aeefc6d58845270d8b3088f

Description

A toolset for describing and simulating StateChart-like state diagrams

Published: 23 Aug 2019

README

RFSM

RFSM is a toolset for describing and simulating StateChart-like state diagrams. The toolset is composed of

  • an Ocaml library

  • a command-line compiler (rfsmc)

RFSM tools take

  • a description of a system as a set of StateChart-like state diagrams

  • a description of stimuli to be used as input for this system

and generate

  • a graphical representation of the system (to be viewed with Graphviz for example)

  • execution traces as .vcd files (to be viewed with Gtkwave for example)

Additionnaly, dedicated backends can generate system descriptions in

  • CTask (a C dialect with primitives for describing tasks and event-based synchronisation)

  • SystemC

  • VHDL

for simulation of implementation.

The rfmsc compiler is intended to be used from the command line. Graphical User Interfaces are provided separately:

Documentation

The compiler user manual can be found here

The library API is documented here

Installation

The latest stable version is provided as a ready-to-install OPAM package. Just type

opam install rfsm

Compiling and running examples

Some examples are provided in the directories single and multi (the former concerns systems built from a single state diagram, the latter systems built from several diagrams).

For compiling and running an example

  • get a copy of the source tree and go to the selected example directory

    • git clone https://github.com/jserot/rfsm

    • cd rfsm/examples/single/chrono (for example)

  • build the top Makefile by invoking: rfsmmake main.pro (this supposes that the rfsm package has been properly installed; in particular that the rfsmc and rfsmmake executables are available on your path)

  • the generated Makefile contains a set of rules to

    • generate and view the graphical representation of the system (make dot)

    • simulate the behavior the system and view the execution traces (make sim)

    • generate code describing the system in C (make ctask.code), SystemC (make systemc.code) and VHDL (make vhdl.code)

Viewing the graphical representations (.dot files) and the execution traces (.vcd files) is carried out by calling external programs called $DOTVIEWER and $VCDVIEWER in the Makefile. Default values are provided in the file <opam_prefix>/share/rfsm/platform, where <opam_prefix> is the root of the opam tree where the rfsm package has been installed. These values will probably to be adjusted according to your system.

The generated SystemC (resp. VHDL) code is written in sub-directory ./systemc (resp. ./vhdl). Also generated in these directories is a dedicated Makefile for compiling and running the generated code and viewing the results. This Makefile is derived from a template located in directory <opam_prefix>/share/rfsm/templates/. These templates will also probably have to be adjusted to suit your local SystemC or VHDL installation.

Some examples also contain a ./ml sub-directory. The ocaml source code located in these sub-directories illustrates the use of the rfsm library. The code can be compiled and run by simply typing make (provided, again, that the rfsm package has been properly installed).

Dependencies (5)

  1. lascar = "0.6-alpha"
  2. ocamlgraph
  3. ocaml >= "4.06"
  4. menhir >= "2.0" & < "20211215"
  5. dune >= "1.11"

Dev Dependencies

None

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.