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.
- 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 Scholar
- Bluespec, Inc. Bluespec SystemVerilog Version 3.8 Reference Guide, 2006.Google Scholar
- 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 Scholar
- 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 ScholarCross Ref
- IEEE Standards Board. IEEE Standard Hardware Description Language Based on the Verilog Hardware Description Language. Number 1364--1995 in IEEE Standards. IEEE, 1995.Google Scholar
- IEEE Standards Board. IEEE Standard Verilog Hardware Description Language. Number 1364--2001 in IEEE Standards. IEEE, 2001.Google Scholar
- IEEE Standards Board. IEEE Standard for SystemVerilog-Unified Hardware Design, Specification, and Verification Language. Number 1800--2005 in IEEE Standards. IEEE, 2005.Google Scholar
- IEEE Standards Board. IEEE Standard for Verilog Hardware Description Language. Number 1364--2005 in IEEE Standards. IEEE, 2005.Google Scholar
- IEEE Standards Board. IEEE Standard for Verilog Register Transfer Level Synthesis. Number 1364.1--2002 (IEC 62142:2005) in IEEE Standards. IEEE, 2005.Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Sun Microsystems. Opensparc t1 processor file: mul64.v. http://opensparc-t1.sunsource.net/nonav/source/verilog/html/mul64.v.Google Scholar
- Flemming Nielson and Hanne Riis Nielson. Two-level semantics and code generation. Theoretical Computer Science, 56(1):59--133, 1988. Google ScholarDigital Library
- Opencores.org. Or1200's 32x32 multiply for asic. http://www.opencores.org/cvsweb.shtml/or1k/or1200/rtl/verilog/or1200 amultp2 32x32.v.Google Scholar
- 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 Scholar
- Walid Taha. Multi-Stage Programming: Its Theory and Applications. PhD thesis, Oregon Graduate Institute of Science and Technology, 1999. available from {15}. Google ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- Terese. Term Rewriting Systems. Cambridge University Press, 2003.Google Scholar
Index Terms
- Synthesizable high level hardware descriptions: using statically typed two-level languages to guarantee verilog synthesizability
Recommendations
Synthesizable High Level Hardware Descriptions
AbstractModern 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 ...
HML, a novel hardware description language and its translation to VHDL
We present hardware ML (HML), an innovative hardware description language (HDL) based on the functional programming language SML. Features of HML not found in other HDL's include polymorphic types and advanced type checking and type inference ...
A unified model for co-simulation and co-synthesis of mixed hardware/software systems
EDTC '95: Proceedings of the 1995 European conference on Design and TestThis paper presents a methodology for a unified co-simulation and co-synthesis of hardware-software systems. This approach addresses the modeling of communication between the hardware and software modules at different abstraction levels and for ...
Comments