Abstract
The ForSyDe methodology aims to push system design to a higher level of abstraction by combining the functional programming paradigm with the theory of Models of Computation (MoCs). A key concept of ForSyDe is the use of higher-order functions as process constructors to create processes. This leads to well-defined and well-structured ForSyDe models and gives a solid base for formal analysis. The book chapter introduces the basic concepts of the ForSyDe modeling framework and presents libraries for several MoCs and MoC interfaces for the modeling of heterogeneous systems, including support for the modeling of run-time reconfigurable processes.
The formal nature of ForSyDe enables transformational design refinement using both semantic-preserving and nonsemantic-preserving design transformations. The chapter also introduces a general synthesis concept based on process constructors, which is exemplified by means of a hardware synthesis tool for synchronous ForSyDe models. Most examples in the chapter are modeled with the Haskell version of ForSyDe. However, to illustrate that ForSyDe is language-independent, the chapter also contains a short overview of SystemC-ForSyDe.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Abbreviations
- ASK:
-
Amplitude Shift Key
- CPS:
-
Cyber-Physical System
- EDA:
-
Electronic Design Automation
- ForSyDe:
-
Formal System Design
- HSCD:
-
Hardware/Software Codesign
- MoC:
-
Model of Computation
- RTL:
-
Register Transfer Level
- SLD:
-
System-Level Design
References
Acosta A (2007) Hardware synthesis in ForSyDe. Master’s thesis, School for Information and Communication Technology, Royal Institute of Technology (KTH), Stockholm. KTH/ICT/ECS-2007-81
Attarzadeh Niaki S, Jakobsen M, Sulonen T, Sander I (2012) Formal heterogeneous system modeling with SystemC. In: Forum on specification and design languages (FDL 2012), Vienna, pp 160–167
Baaij C, Kooijman M, Kuper J, Boeijink A, Gerards M (2010) Cλash: structural descriptions of synchronous hardware using Haskell. In: 2010 13th Euromicro conference on digital system design: architectures, methods and tools (DSD), pp 714–721
Bauer FL, Möller B, Partsch H, Pepper P (1989) Formal program construction by transformations – computer-aided, intuition guided programming. IEEE Trans Softw Eng 15(2):165–180
Benveniste A, Berry G (1991) The synchronous approach to reactive and real-time systems. Proc IEEE 79(9):1270–1282
Benveniste A, Caspi P, Edwards SA, Halbwachs N, Le Guernic P, Simone RD (2003) The synchronous languages 12 years later. Proc IEEE 91(1):64–83
Berry G, Gonthier G: The Esterel synchronous programming language: design, semantics, implementation. Sci Comput Program 19(2):87–152 (1992)
Bird RS (1986) An introduction to the theory of lists. Technical monograph PRG-56 edn. Oxford University Computing Laboratory
Bird RS (1988) Lectures on constructive functional programming. Technical Monograph PRG-69 edn. Oxford University Computing Laboratory
Bjesse P, Claessen K, Sheeran M, Singh S (1998) Lava: hardware design in Haskell. In: International conference on functional programming, Baltimore, pp 174–184
Blindell GH, Menne C, Sander I (2014) Synthesizing code for GPGPUs from abstract formal models. In: Forum on specification and design languages (FDL 2014), Munich
Boussinot F, De Simone R (1991) The Esterel language. Proc IEEE 79(9):1293–1304
Cole M (1989) Algorithmic skeletons: structured management of parallel computation. Research monographs in parallel and distributed computing. Pitman, London
Derler P, Lee E, Sangiovanni-Vincentelli A (2012) Modeling cyber-physical systems. Proc IEEE 100(1):13–28
Dömer R, Gerstlauer A, Gajski D (2002) SpecC language reference manual, version 2.0
Edwards S, Lavagno L, Lee EA, Sangiovanni-Vincentelli A (1997) Design of embedded systems: formal models, validation, and synthesis. Proc IEEE 85(3):366–390
Eker J, Janneck J, Lee E, Liu J, Liu X, Ludvig J, Neuendorffer S, Sachs S, Xiong Y: Taming heterogeneity – the Ptolemy approach. Proc IEEE 91(1):127–144 (2003)
Falk J, Haubelt C, Teich J (2006) Efficient representation and simulation of model-based designs in SystemC. In: Proceedings of the forum on specification and design languages (FDL), vol 6, pp 129–134
ForSyDe: Formal system design. https://forsyde.ict.kth.se/
Gajski DD, Ramachandran L (1994) Introduction to high-level synthesis. IEEE Des Test Comput 11(4):44–54
Gajski DD, Dutt ND, Wu ACH, Lin SYL (1992) High-level synthesis. Kluwer Academic, Boston
Gill A, Bull T, Kimmell G, Perrins E, Komp E, Werling B (2010) Introducing kansas Lava. In: Morazán M, Scholz SB (eds) Implementation and application of functional languages. Lecture notes in computer science, vol 6041. Springer, Berlin/Heidelberg, pp 18–35
Halbwachs N, Caspi P, Raymond P, Pilaud D (1991) The synchronous data flow programming language Lustre. Proc IEEE 79(9):1305–1320
Herrera F, Villar E (2008) A framework for heterogeneous specification and design of electronic embedded systems in SystemC. ACM Trans Des Autom Electron Syst 12(3): 22:1–22:31
Herrholz A, Oppenheimer F, Hartmann PA, Schallenberg A, Nebel W, Grimm C, Damm M, Haase J, Brame J, Herrera F, Villar E, Sander I, Jantsch A, Fouilliart AM, Martinez M (2007) The ANDRES project: analysis and design of run-time reconfigurable, heterogeneous systems. In: International conference on field programmable logic and applications (FPL’07), pp 396–401
IEEE Standard for Standard SystemC Language Reference Manual. IEEE Std 1666–2011 (Revision of IEEE Std 1666–2005), pp. 1–638. http://ieeexplore.ieee.org/document/6134619/
Jantsch A (2005) Models of embedded computation. In: Zurawski R (ed) Embedded systems handbook. CRC Press, Boca Raton. Invited contribution
Keutzer K, Malik S, Newton AR, Rabaey JM, Sangiovanni-Vincentelli A (2000) System-level design: orthogonolization of concerns and platform-based design. IEEE Trans Comput-Aided Des Integr Circuits Syst 19(12):1523–1543
Lee EA, Messerschmitt DG (1987) Synchronous data flow. Proc IEEE 75(9):1235–1245
Lee EA, Sangiovanni-Vincentelli A (1998) A framework for comparing models of computation. IEEE Trans Comput-Aided Des Integr Circuits Syst 17(12):1217–1229
Li Y, Leeser M (2000) HML, a novel hardware description language and its translation to VHDL. IEEE Trans VLSI 8(1):1–8
Lu Z, Sander I, Jantsch A (2002) A case study of hardware and software synthesis in ForSyDe. In: Proceedings of the 15th international symposium on system synthesis, Kyoto, pp 86–91
Luk W, Wu T (1994) Towards a declarative framework for hardware-software codesign. In: Proceedings of the third international workshop on hardware/software codesign, Grenoble, pp 181–188
Mainland G, Morrisett G (2010) Nikola: embedding compiled GPU functions in Haskell. In: Proceedings of the third ACM Haskell symposium on Haskell, Haskell ’10. ACM, New York
Matthews J, Cook B, Launchbury J (1998) Microprocessor specification in HAWK. In: International conference on computer languages (ICCL’98), pp 90–101
McKinley PK, Sadjadi SM, Kasten EP, Cheng BH (2004) Composing adaptive software. IEEE Comput 37(7):56–64
Micheli GD (1994) Synthesis and optimization of digital circuits. McGraw-Hill, New York
Milner R (1978) A theory of type polymorphism in programming. J Comput Syst Sci 17:348–375
Milner R, Tofte M, Harper R, MacQueen D (1997) The definition of standard ML – revised. MIT, Cambridge
Mycroft A, Sharp R (2000) Hardware/software co-design using functional languages. In: Proceedings of tools and algorithms for the construction and analysis of systems (TACAS). LNCS, vol 2031. Springer, pp 236–251
Partsch HA (1990) Specification and transformation of programs. Springer, New York
Pettorossi A, Proietti M (1996) Rules and strategies for transforming functional and logic programs. ACM Comput Surv 28(2):361–414
Plosila J (1999) Self-timed circuit design – the action systems approach. PhD thesis, University of Turku, Turku
Ptolemaeus C (ed) (2014) System design, modeling, and simulation using Ptolemy II. Ptolemy.org. http://ptolemy.org/books/Systems
Raudvere T, Sander I, Jantsch A (2008) Application and verification of local non-semantic-preserving transformations in system design. IEEE Trans Comput-Aided Des Integr Circuits Syst 27(6):1091–1103
Reekie H (1995) Realtime signal processing. PhD thesis, School of Electrical Engineering, University of Technology at Sydney
Rosvall K, Sander I (2014) A constraint-based design space exploration framework for real-time applications on MPSoCs. In: Design automation and test in Europe (DATE ’14), Dresden
Sander I (2003) System modeling and design refinement in ForSyDe. PhD thesis, Royal Institute of Technology, Stockholm
Sander I, Jantsch A (2004) System modeling and transformational design refinement in ForSyDe. IEEE Trans Comput-Aided Des Integr Circuits Syst 23(1):17–32
Sander I, Jantsch A (2008) Modelling adaptive systems in ForSyDe. Electron Not Theor Comput Sci (ENTCS) 200(2):39–54
Sangiovanni-Vincentelli A (2007) Quo vadis, SLD? Reasoning about the trends and challenges of system level design. Proc IEEE 95(3):467–506
Schneider K (2009) The synchronous programming language Quartz. Internal report 375, Department of Computer Science, University of Kaiserslautern, Kaiserslautern
Seceleanu T (2001) Systematic design of synchronous digital circuits. PhD thesis, University of Turku, Turku
Sharp R, Mycroft A (2001) A higher level language for hardware synthesis. In: Proceedings of 11th advanced research working conference on correct hardware design and verification methods (CHARME). LNCS, vol 2144. Springer, pp 228–243
Sheard T, Jones SP (2002) Template meta-programming for Haskell. ACM SIGPLAN Not 37(12):60–75
Singh S, James-Roxby P (2001) Lava and JBits: from HDL to bitstream in seconds. In: Proceedings of the 9th annual IEEE symposium on field-programmable custom computing machines, FCCM ’01, pp 91–100
Skillicorn DB (1994) Foundations of parallel programming. Cambridge international series on parallel computation. Cambridge University Press, Cambridge/New York
Skillicorn DB, Talia D (1998) Models and languages for parallel computation. ACM Comput Surv 30(2):123–169
Standard SystemC AMS extensions 2.0 language reference manual (2013)
Svensson J, Sheeran M, Claessen K (2011) Obsidian: a domain specific embedded language for parallel programming of graphics processors. In: Scholz SB, Chitil O (eds) Implementation and application of functional languages. Lecture notes in computer science, vol 5836. Springer, Berlin/Heidelberg, pp 156–173
The Haskell language. http://www.haskell.org
Voeten J (2001) On the fundamental limitataions of transformational design. ACM Trans Des Autom Electron Syst 6(4):533–552
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Appendix: Introduction to Haskell
Appendix: Introduction to Haskell
This section gives a short introduction to functional languages and Haskell to give readers who are not familiar with functional programming additional background information. For more information on Haskell, visit the Haskell home page [61].
A functional program is a function that receives the program’s input as argument and delivers the program’s output as result. The main function of a program is defined in terms of other functions, which can be composed of still other functions until at the bottom of the functional hierarchy the functions are language primitives. Haskell is a pure functional language, where each function is free from side-effects. This means given the same inputs, which in case of ForSyDe could be a set of input signals, a Haskell function will always produce identical outputs. Thus the whole functional program is free from side-effects and thus behaves totally deterministic. Since all functions are free from side-effects, the order of evaluation is only given by data dependencies. But this means also that there may exist several possible orders for the execution of a functional program.
Considering the function
the data dependencies imply that the functions h(x) and g(y) have to be evaluated before u((h(x), g(y)) can be evaluated. However, since there is no data dependency between the functions h and g, there are the following possible orders of execution:
-
h(x) is evaluated before g(y);
-
g(y) is evaluated before h(x);
-
h(x) and g(y) are evaluated in parallel.
Thus functional programs contain implicit parallelism, which is very useful when dealing with embedded system applications, since they typically have a considerable amount of built-in parallelism. Of course it is also possible to parallelize imperative languages like C++, but it is much more difficult to extract parallelism from programs in such languages, since the flow of control is also expressed by the order of statements.
In addition to common data types, such as Bool, Int, and Double, Haskell also defines lists and tuples. An example for a list is [1,2,3,4] :: [Integer], which is a list of integers. The notation “::” means “has type.” An example for a tuple, which is a structure of different types is (’A’, 3) :: (Char, Integer) where the first element is a character and the second one is an integer. Haskell has adopted the Hindley-Milner type system [38], which is not only strongly typed but also uses type inference to determine the type of every expression instead of relying on explicit-type declarations.
Haskell is based on the lambda-calculus and allows to write functions in curried form, where the arguments are written by juxtaposition. The following Haskell function add is written in curried form.
add :: Num a => a -> a -> a add x y = x + y
Since ‘->’ associates from right to left, the type of add can also be read as
add :: Num a => a -> (a -> a)
This means that given the first argument, which is of a numeric type a, it returns a function from a to a. This enables partial application of a curried function. New functions can then be defined by applying the first argument, e.g.,
inc x = add 1 dec x = dec 1
These functions only have one argument and the following type
inc :: Num a => a -> a dec :: Num a => a -> a
Another powerful concept in functional languages is the higher-order function , which is adopted in ForSyDe for process constructors. A higher-order function is a function that takes functions as argument and/or produces a function as output. An example of a higher-order function is map, which takes a function and a list as argument and applies (“maps”) the function f on each value in the list. The function map is defined as follows
map f [] = [] -- Pattern 1 (empty list) map f (x:xs) = f x : map f xs -- Pattern 2 (all other lists)
The higher-order function map uses an additional feature of Haskell, which is called pattern matching and is illustrated by the evaluation of map (+1) [1,2,3].
map (+1) [1,2,3] | ||
⇒ | map (+1) (1:[2,3]) | Pattern 2 matches |
⇒ | 1+1: map (+1) [2,3] | Evaluation of Pattern 2 |
⇒ | 2: map (+1) (2:[3]) | Pattern 2 matches |
⇒ | 2: 2+1: map (+1) [3] | Evaluation of Pattern 2 |
⇒ | 2: 3: map (+1) (3:[]) | Pattern 2 matches |
⇒ | 2: 3: 3+1: map (+1) [] | Evaluation of Pattern 2 |
⇒ | 2: 3: 4: map (+1) [] | Pattern 1 matches |
⇒ | 2: 3: 4: [] | Evaluation of Pattern 2 |
⇒ | [2,3,4] |
During an evaluation the patterns are tested from the top to the bottom. If a pattern, the left-hand side, matches, the corresponding right-hand side is evaluated. The expression map (+1) [1,2,3] does not match the first pattern since the list is not empty ([]). The second pattern matches, since (x:xs) matches a list that is constructed of a single value and a list. Since the second pattern matches, the right-hand side of this pattern is evaluated. This procedure is repeated recursively until the first pattern matches, where the right-hand side does not include a new function call. As this example shows, lists are constructed and processed from head to tail.
The higher-order function map can now be used with all functions and lists that fulfill the type declaration for map, which Haskell infers as
map :: (a -> b) -> [a] -> [b]
Another important higher-order function is function composition, which is expressed by the composition operator ‘.’.
(.) :: (b -> c) -> (a -> b) -> (a -> c) f . g = \x -> f (g x)
This definition uses “lambda abstractions” and is read as follows. The higher-order function f . g produces a function that takes a value x as argument and produces the value f(g(x)). The expression f = (+3) . (*4) creates a function f that performs f(x) = 4x + 3. Function composition is extremely useful in ForSyDe since it allows to merge processes in a structured way.
Haskell allows to define own data types using a data declaration. It allows for recursive and polymorphic declarations. A data type for a list could be recursively defined as
data AList a = Empty | Cons a (AList a)
The declaration has two data constructors. The data constructor Empty constructs the empty list and Cons constructs a list by adding a value of type a to a list. Thus Cons 1 (Cons 2 (Cons 3 Empty)) constructs a list of numbers. The term type constructor denotes a constructor that yields a type. In this case AList is a type constructor. As mentioned before, the list data type is predefined in Haskell. Here [] corresponds to Empty and : to Cons. [a] corresponds to AList a. The ForSyDe Signal is defined in the same way as the data type AList, see Sect. 4.2.1.
Rights and permissions
Copyright information
© 2017 Springer Science+Business Media Dordrecht
About this entry
Cite this entry
Sander, I., Jantsch, A., Attarzadeh-Niaki, SH. (2017). ForSyDe: System Design Using a Functional Language and Models of Computation. In: Ha, S., Teich, J. (eds) Handbook of Hardware/Software Codesign. Springer, Dordrecht. https://doi.org/10.1007/978-94-017-7267-9_5
Download citation
DOI: https://doi.org/10.1007/978-94-017-7267-9_5
Published:
Publisher Name: Springer, Dordrecht
Print ISBN: 978-94-017-7266-2
Online ISBN: 978-94-017-7267-9
eBook Packages: EngineeringReference Module Computer Science and Engineering