skip to main content
10.1145/3122955.3122970acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Hardware software co-design in Haskell

Published: 07 September 2017 Publication History

Abstract

We present a library in Haskell for programming Field Programmable Gate Arrays (FPGAs), including hardware software co-design. Code for software (in C) and hardware (in VHDL) is generated from a single program, along with the code to support communication between hardware and software. We present type-based techniques for the simultaneous implementation of more than one embedded domain specific language (EDSL). We build upon a generic representation of imperative programs that is loosely coupled to instruction and expression types, allowing the individual parts to be developed and improved separately. Code generation is implemented as a series of translations between progressively smaller, typed EDSLs, safeguarding against errors that arise in untyped translations. Initial case studies show promising performance.

References

[1]
H. Apfelmus. 2017. The Operational Monad Tutorial (Blog Post). http://apfelmus.nfshost.com/articles/operational-monad.html. (2017).
[2]
Markus Aronsson, Emil Axelsson, and Mary Sheeran. 2015. Stream Processing for Embedded Domain Specific Languages. In Revised Selected Papers from 26th Int. Symp. on Implementation and Application of Functional Languages (IFL). ACM.
[3]
Joshua Auerbach et al. 2012. A Compiler and Runtime for Heterogeneous Computing. In Proc. 49th Design Automation Conference (DAC). ACM.
[4]
E. Axelsson. 2016. Compilation as a Typed EDSL-to-EDSL Transformation (Blog post). http://fun-discoveries.blogspot.se/2016/03/ . (2016).
[5]
E. Axelsson and A. Persson. 2015. Programmable Signatures. In Trends in Functional Programming, Revised Selected Papers. Springer.
[6]
Christiaan Baaij, Matthijs Kooijman, Jan Kuper, Arjan Boeijink, and Marco Gerards. 2010. C λaSH: structural descriptions of synchronous hardware using Haskell. In Proc. 13th Euromicro Conference on Digital System Design: Architectures, Methods and Tools (DSD). IEEE.
[7]
Jonathan Bachrach et al. 2012. Chisel: Constructing Hardware in a Scala Embedded Language. In Proc. 49th Design Automation Conference (DAC). ACM.
[8]
P. Bjesse, K. Claessen, M. Sheeran, and S. Singh. 1998. Lava: Hardware Design in Haskell. In Proc. Third Int. Conf. on Functional Programming (ICFP). ACM.
[9]
Jan Bracker and Andy Gill. 2014. Sunroof: A Monadic DSL for Generating JavaScript. In Proc. 16th Int. Symp. on Practical Aspects of Declarative Languages. Springer International Publishing, 65–80.
[10]
Sally Browning and Philip Weaver. 2010. Designing tunable, verifiable cryptographic hardware using Cryptol. In Design and Verification of Microprocessor Systems for High-Assurance Applications. Springer, 89–143.
[11]
K. Claessen, M. Sheeran, and S. Singh. 2003. Using Lava to design and verify recursive and periodic sorters. IJSTTT 4, 3 (2003).
[12]
Nirav Dave. 2011. A Unified Model for Hardware/Software Codesign. Ph.D. Dissertation. EECS Dept., MIT.
[13]
Peter Gammie. 2013. Synchronous Digital Circuits As Functional Programs. ACM Comput. Surv. 46, 2, Article 21 (Nov. 2013), 27 pages.
[14]
N. George, D. Novo, T. Rompf, M. Odersky, and P. Ienne. 2013. Making domainspecific hardware synthesis tools cost-efficient. In 2013 International Conference on Field-Programmable Technology (FPT). 120–127.
[15]
Dan R. Ghica, Alex Smith, and Satnam Singh. 2011. Geometry of Synthesis IV: Compiling Affine Recursion into Static Hardware. In Proc. 16th Int. Conf. on Functional Programming (ICFP). ACM.
[16]
Andy Gill et al. 2010. Introducing Kansas Lava. In Proc. 21st Int. Conf. on Implementation and Application of Functional Languages (IFL). Springer-Verlag.
[17]
Patrick C. Hickey, Lee Pike, Trevor Elliott, James Bielman, and John Launchbury. 2014. Building Embedded Systems with Embedded DSLs (Experience Report). In Proc. 19th Int. Conf. on Functional Programming (ICFP). ACM.
[18]
Myron King. 2013. A Methodology for Hardware-Software Codesign. Ph.D. Dissertation. EECS Dept., MIT.
[19]
K. Moriarty. 2017. Password-Based Cryptography Specification Version 2.1. (2017). https://tools.ietf.org/html/rfc2898
[20]
Robert Morris and Ken Thompson. 1979. Password Security: A Case History. Commun. ACM 22, 11 (Nov. 1979), 594–597.
[21]
Alan Mycroft and Richard Sharp. 2001. Hardware/Software Co-design Using Functional Languages. Springer-Verlag, 236–251.
[22]
M. Naylor and S. Moore. 2015. A generic synthesisable test bench. In ACM/IEEE Int. Conf. on Formal Methods and Models for Codesign (MEMOCODE). 128–137.
[23]
Matthew Naylor, Colin Runciman, and Jason Reich. 2009. The Reduceron home page, fetched May 2017. (2009). https://www.cs.york.ac.uk/fp/reduceron/
[24]
Rishiyur Nikhil. 2004. Bluespec System Verilog: efficient, correct RTL from high level specifications. In ACM/IEEE Int. Conf. on Formal Methods and Models for Co-Design (MEMOCODE). IEEE, 69–70.
[25]
M. Puschel et al. 2005. SPIRAL: Code Generation for DSP Transforms. In Proc. IEEE, Vol. 93. Issue 2.
[26]
Josef David Svenningsson and Bo Joel Svensson. 2013. Simple and Compositional Reification of Monadic Embedded Languages. Proc. 18th Int. Conf. on Functional Programming (ICFP) (2013).
[27]
Bo Joel Svensson. 2017. OpenCL Reduction on the ZYNQ. (2017). http://svenssonjoel. github.io/writing/zynqreduce.pdf
[28]
Wouter Swierstra. 2008. Data Types à La Carte. J. Funct. Program. 18, 4 (July 2008).
[29]
David Tarditi, Sidd Puri, and Jose Oglesby. 2006. Accelerator: Using Data Parallelism to Program GPUs for General-purpose Uses. SIGPLAN Not. 41, 11 (Oct. 2006), 325–335.
[30]
J Teich. 2012. Hardware Software Codesign: the Past, the Present, and Predicting the Future. Proc. of the IEEE 100 (2012).
[31]
The OpenSSL Project. 2003. OpenSSL: The Open Source toolkit for SSL/TLS. (April 2003). www.openssl.org .
[32]
Michael Vollmer, Bo Joel Svensson, Eric Holk, and Ryan R. Newton. 2015. Metaprogramming and Auto-tuning in the Search for High Performance GPU Code. In Proc. 4th Int. Workshop on Functional High-Performance Computing (FHPC). ACM.
[33]
J.J. Vossen. 2016. Offloading Haskell functions onto an FPGA. Master’s thesis. Univ. Twente.
[34]
Kuangya Zhai, Richard Townsend, Lianne Lairmore, Martha A. Kim, and Stephen A. Edwards. 2015. Hardware Synthesis from a Recursive Functional Language. In Proc. 10th Int. Conf. on Hardware/Software Codesign and System Synthesis (CODES). IEEE.
[35]
Hamid Reza Zohouri, Naoya Maruyama, Satoshi Matsuoka, and Aaron Smith. 2016. Evaluating and Optimizing OpenCL Kernels for High Performance Computing with FPGAs. In Proc. SuperComputing Conference. IEEE.

Cited By

View all
  • (2020)The essence of Bluespec: a core language for rule-based hardware designProceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3385412.3385965(243-257)Online publication date: 11-Jun-2020
  • (2019)Modeling and Simulation of Dynamic Applications Using Scenario-Aware DataflowACM Transactions on Design Automation of Electronic Systems10.1145/334299724:5(1-29)Online publication date: 21-Aug-2019
  • (2019)Safety at speed: in-place array algorithms from pure functional programs by safely re-using storageProceedings of the 8th ACM SIGPLAN International Workshop on Functional High-Performance and Numerical Computing10.1145/3331553.3342616(34-46)Online publication date: 18-Aug-2019
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
Haskell 2017: Proceedings of the 10th ACM SIGPLAN International Symposium on Haskell
September 2017
211 pages
ISBN:9781450351829
DOI:10.1145/3122955
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 52, Issue 10
    Haskell '17
    October 2017
    211 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/3156695
    • Editor:
    • Andy Gill
    Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 07 September 2017

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. domain specific language
  2. hardware software co-design

Qualifiers

  • Research-article

Conference

ICFP '17
Sponsor:

Acceptance Rates

Overall Acceptance Rate 57 of 143 submissions, 40%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)21
  • Downloads (Last 6 weeks)2
Reflects downloads up to 07 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2020)The essence of Bluespec: a core language for rule-based hardware designProceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3385412.3385965(243-257)Online publication date: 11-Jun-2020
  • (2019)Modeling and Simulation of Dynamic Applications Using Scenario-Aware DataflowACM Transactions on Design Automation of Electronic Systems10.1145/334299724:5(1-29)Online publication date: 21-Aug-2019
  • (2019)Safety at speed: in-place array algorithms from pure functional programs by safely re-using storageProceedings of the 8th ACM SIGPLAN International Workshop on Functional High-Performance and Numerical Computing10.1145/3331553.3342616(34-46)Online publication date: 18-Aug-2019
  • (2019)G2Q: Haskell constraint solvingProceedings of the 12th ACM SIGPLAN International Symposium on Haskell10.1145/3331545.3342590(44-57)Online publication date: 8-Aug-2019
  • (2019)Modeling and Simulation of Dynamic Applications Using Scenario-Aware DataflowACM Transactions on Design Automation of Electronic Systems10.1145/334299724:5(1-29)Online publication date: 21-Aug-2019

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media