skip to main content
10.1145/1328408.1328416acmconferencesArticle/Chapter ViewAbstractPublication PagespepmConference Proceedingsconference-collections
research-article

Synthesizable high level hardware descriptions: using statically typed two-level languages to guarantee verilog synthesizability

Published:07 January 2008Publication History

ABSTRACT

Modern hardware description languages support code-generation constructs like generate/endgenerate in Verilog. These constructs are intended to describe regular or parameterized hardware designs and, when used effectively, can make hardware descriptions shorter, more understandable, and more reusable. In practice, however, designers avoid these constructs because it is difficult to understand and predict the properties of the generated code. Is the generated code even type safe? Is it synthesizable? What physical resources (e.g. combinatorial gates and flip-flops) does it require? It is often impossible to answer these questions without first generating the fully-expanded code. In the Verilog and VHDL communities, this generation process is referred to as elaboration.

This paper proposes a disciplined approach to elaboration in Verilog. By viewing Verilog as a statically typed two-level language, we are able to reflect the distinction between values that are known at elaboration time and values that are part of the circuit computation. This distinction is crucial for determining whether abstractions such as iteration and module parameters are used in a synthesizable manner. To illustrate this idea, we develop a core calculus for Verilog that we call Featherweight Verilog (FV) and an associated static type system. We formally define a preprocessing step analogous to the elaboration phase of Verilog, and the kinds of errors that can occur during this phase. Finally, we show that a well-typed design cannot cause preprocessing errors, and that the result of its expansion is always a synthesizable circuit.

References

  1. Henk P. Barendregt. The Lambda Calculus: Its Syntax and Semantics, volume 103 of Studies in Logic and the Foundations of Mathematics. North-Holland, Amsterdam, 1984.Google ScholarGoogle Scholar
  2. Bluespec, Inc. Bluespec SystemVerilog Version 3.8 Reference Guide, 2006.Google ScholarGoogle Scholar
  3. Jennifer Gillenwater, Gregory Malecha, Cherif Salama, Angela Yun Zhu, Walid Taha, Jim Grundy, and John O'Leary. Synthesizable High Level Hardware Descriptions. Technical report, Rice University and Intel Strategic CAD Labs, http://www.resourceaware.org/twiki/pub/RAP/VPP/FV-TR.pdf, 2007.Google ScholarGoogle Scholar
  4. Carsten K. Gomard and Neil D. Jones. A partial evaluator for the untyped lambda-calculus. Journal of Functional Programming, 1(1):21--69, 1991.Google ScholarGoogle ScholarCross RefCross Ref
  5. IEEE Standards Board. IEEE Standard Hardware Description Language Based on the Verilog Hardware Description Language. Number 1364--1995 in IEEE Standards. IEEE, 1995.Google ScholarGoogle Scholar
  6. IEEE Standards Board. IEEE Standard Verilog Hardware Description Language. Number 1364--2001 in IEEE Standards. IEEE, 2001.Google ScholarGoogle Scholar
  7. IEEE Standards Board. IEEE Standard for SystemVerilog-Unified Hardware Design, Specification, and Verification Language. Number 1800--2005 in IEEE Standards. IEEE, 2005.Google ScholarGoogle Scholar
  8. IEEE Standards Board. IEEE Standard for Verilog Hardware Description Language. Number 1364--2005 in IEEE Standards. IEEE, 2005.Google ScholarGoogle Scholar
  9. IEEE Standards Board. IEEE Standard for Verilog Register Transfer Level Synthesis. Number 1364.1--2002 (IEC 62142:2005) in IEEE Standards. IEEE, 2005.Google ScholarGoogle Scholar
  10. Oleg Kiselyov, Kedar Swadi, and Walid Taha. A methodology for generating verified combinatorial circuits. In the International Workshop on Embedded Software (EMSOFT'04), LNCS, Pisa, Italy, 2004. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Eugene E. Kohlbecker, Daniel P. Friedman, Matthias Felleisen, and Bruce Duba. Hygienic macro expansion. ACM Conference on LISP and Functional Programming, pages 151--161, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Sun Microsystems. Opensparc t1 processor file: mul64.v. http://opensparc-t1.sunsource.net/nonav/source/verilog/html/mul64.v.Google ScholarGoogle Scholar
  13. Flemming Nielson and Hanne Riis Nielson. Two-level semantics and code generation. Theoretical Computer Science, 56(1):59--133, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Opencores.org. Or1200's 32x32 multiply for asic. http://www.opencores.org/cvsweb.shtml/or1k/or1200/rtl/verilog/or1200 amultp2 32x32.v.Google ScholarGoogle Scholar
  15. Oregon Graduate Institute Technical Reports. P.O. Box 91000, Portland, OR 97291--1000, USA. Available online from: ftp://cse.ogi.edu/pub/tech-reports/README.html.Google ScholarGoogle Scholar
  16. Walid Taha. Multi-Stage Programming: Its Theory and Applications. PhD thesis, Oregon Graduate Institute of Science and Technology, 1999. available from {15}. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Walid Taha, Stephan Ellner, and Hongwei Xi. Generating imperative, heap--bounded programs in a functional setting. In Proceedings of the Third International Conference on Embedded Software, Philadelphia, PA, 2003.Google ScholarGoogle Scholar
  18. Walid Taha and Patricia Johann. Staged notational definitions. In Krzysztof Czarnecki, Frank Pfenning, and Yannis Smaragdakis, editors, Generative Programming and Component Engineering (GPCE), Lecture Notes in Computer Science. Springer-Verlag, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Terese. Term Rewriting Systems. Cambridge University Press, 2003.Google ScholarGoogle Scholar

Index Terms

  1. Synthesizable high level hardware descriptions: using statically typed two-level languages to guarantee verilog synthesizability

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in
          • Published in

            cover image ACM Conferences
            PEPM '08: Proceedings of the 2008 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation
            January 2008
            214 pages
            ISBN:9781595939777
            DOI:10.1145/1328408

            Copyright © 2008 ACM

            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 ACM 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]

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 7 January 2008

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • research-article

            Acceptance Rates

            Overall Acceptance Rate66of120submissions,55%

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader