Skip to main content
Log in

Synthesizable High Level Hardware Descriptions

  • Published:
New Generation Computing Aims and scope Submit manuscript

Abstract

Modern hardware description languages support code generation constructs like generate/endgenerate in Verilog. These constructs are used 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 abstractions, 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.*1 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 generative constructs, such as iteration and module parameters, are used in a synthesizable manner. This allows us to develop a static type system that guarantees synthesizability. The type system achieves safety by performing additional checking on generative constructs and array indices. To illustrate this approach, 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 elaboration is always a synthesizable circuit.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Barendregt, H P., The Lambda Calculus: Its Syntax and Semantics, volume 103 of Studies in Logic and the Foundations of Mathematics, North-Holland, Amsterdam, 1984.

  2. Bluespec, Inc., Bluespec System Verilog Version 3.8 Reference Guide, 2006.

  3. Gomard, C. K. and Jones, N. D., “A partial evaluator for the untyped lambda-calculus,” Journal of Functional Programming, 1, 1, pp. 21-69, 1991.

    Article  MATH  MathSciNet  Google Scholar 

  4. IEEE Standards Board, IEEE Standard Hardware Description Language Based on the Verilog Hardware Description Language, Number 1364-1995 in IEEE Standards, IEEE, 1995.

  5. IEEE Standards Board, IEEE Standard Verilog Hardware Description Language, Number 1364-2001 in IEEE Standards, IEEE, 2001.

  6. IEEE Standards Board, IEEE Standard for System Verilog-Unified Hardware Design, Specification, and Verification Language, Number 1800-2005 in IEEE Standards, IEEE, 2005.

  7. IEEE Standards Board, IEEE Standard for Verilog Hardware Description Language, Number 1364-2005 in IEEE Standards, IEEE, 2005.

  8. IEEE Standards Board, IEEE Standard for Verilog Register Transfer Level Synthesis, Number 1364, 1-2002 (IEC 62142:2005) in IEEE Standards, IEEE, 2005.

  9. Kiselyov, O., Swadi, K and Taha, W., “A methodology for generating verified combinatorial circuits” in the International Workshop on Embedded Software (EMSOFT '04), LNCS, ACM, Pisa, Italy, 2004.

  10. Kohlbecker, E. E., Friedman, D. P., Felleisen, M and Duba, B., “Hygienic macro expansion” ACM Conference on LISP and Functional Programming, pp. 151-161, 1986.

  11. Sun Microsystems, Opensparc t1 processor file: mul64.v. http://opensparc-t1.sunsource.net/nonav/source/verilog/html/mul64.v.

  12. Nielson, F. and Nielson, H. R., “Two-level semantics and code generation,” Theoretical Computer Science, 56, 1, pp. 59-133, 1988.

    Article  MATH  MathSciNet  Google Scholar 

  13. Opencores.org., Or1200's 32x32 multiply for asic., http://www.opencores.org/cvsweb.shtml/or1k/or1200/rtl/verilog/or1200 amultp2 32x32.v.

  14. 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.

  15. Taha, W., Multi-Stage Programming: Its Theory and Applications, Ph.D. thesis, Oregon Graduate Institute of Science and Technology, 1999, available from 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.

  16. Taha, W, Ellner, S. and Xi, H., “Generating imperative, heapbounded programs in a functional setting,” in Proc. of the Third International Conference on Embedded Software, Philadelphia, PA, 2003.

  17. Taha, W. and Johann, P., “Staged notational definitions,” in Generative Programming and Component Engineering (GPCE) (Czarnecki, K., Pfenning, F. and Smaragdakis, Y. eds.), LNCS, Springer-Verlag, 2003.

  18. Terese, Term Rewriting Systems, Cambridge University Press, 2003.

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Walid Taha.

Additional information

An earlier version was presented at PEPM’08. This manuscript includes performance evaluation, complete proofs, and various improvements. This work was supported by the National Science Foundation (NSF) SoD awards 0439017, 0720857, 0747431 and the Semiconductor Research Consortium (SRC) Task ID: 1403.001 (Intel custom project).

About this article

Cite this article

Gillenwater, J., Malecha, G., Salama, C. et al. Synthesizable High Level Hardware Descriptions. New Gener. Comput. 28, 339–369 (2010). https://doi.org/10.1007/s00354-008-0093-1

Download citation

  • Received:

  • Revised:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00354-008-0093-1

Keywords

Navigation