[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.1145/1480945.1480963acmconferencesArticle/Chapter ViewAbstractPublication PagespepmConference Proceedingsconference-collections
research-article

Static consistency checking for verilog wire interconnects: using dependent types to check the sanity of verilog descriptions

Published: 19 January 2009 Publication History

Abstract

The Verilog hardware description language has padding semantics that allow designers to write descriptions where wires of different bit widths can be interconnected. However, many of these connections are nothing more than bugs inadvertently introduced by the designer and often result in circuits that behave incorrectly or use more resources than required. A similar problem occurs when wires are incorrectly indexed by values (or ranges) that exceed their bounds. These two problems are exacerbated by generate blocks. While desirable for reusability and conciseness, the use of generate blocks to describe circuit families only makes the situation worse as it hides such inconsistencies making them harder to detect. Inconsistencies in the generated code are only exposed after elaboration when the code is fully-expanded.
In this paper we show that these inconsistencies can be pinned down prior to elaboration using static analysis.We combine dependent types and constraint generation to reduce the problem of detecting the aforementioned inconsistencies to a satisfiability problem. Once reduced, the problem can easily be solved with a standard satisfiability modulo theories (SMT) solver. In addition, this technique allows us to detect unreachable code when it resides in a block guarded by an unsatisfiable set of constraints. To illustrate these ideas, we develop a type system for Featherweight Verilog (FV), a core calculus of structural Verilog with generative constructs and previously defined elaboration semantics. We prove that a well-typed FV description will always elaborate into an inconsistency-free description. We also provide a freely-available implementation demonstrating our approach.

References

[1]
B. Dutertre and L. de Moura. The Yices SMT solver. Tool paper at http://yices.csl.sri.com/tool-paper.pdf, August 2006.
[2]
Jennifer Gillenwater, Gregory Malecha, Cherif Salama, Angela Yun Zhu, Walid Taha, Jim Grundy, and John O'Leary. Synthesizable high level hardware descriptions: using statically typed two-level languages to guarantee Verilog synthesizability. In PEPM '08: Proceedings of the 2008 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation, pages 41--50, New York, NY, USA, 2008. ACM.
[3]
Carsten K. Gomard and Neil D. Jones. A partial evaluator for the untyped lambda-calculus. Journal of Functional Programming, 1(1):21--69, 1991.
[4]
Brian Hackett, Manuvir Das, Daniel Wang, and Zhe Yang. Modular checking for buffer overflows in the large. In ICSE'06: Proceedings of the 28th international conference on Software engineering, pages 232--241, New York, NY, USA, 2006. ACM.
[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 Verilog Hardware Description Language. Number 1364-2005 in IEEE Standards. IEEE, 2005.
[7]
David Larochelle and David Evans. Statically detecting likely buffer overflow vulnerabilities. In SSYM'01: Proceedings of the 10th conference on USENIX Security Symposium, pages 14--14, Berkeley, CA, USA, 2001. USENIX Association.
[8]
Flemming Nielson and Hanne Riis Nielson. Two-level semantics and code generation. Theoretical Computer Science, 56(1):59--133, 1988.
[9]
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.
[10]
Cherif Salama, Gregory Malecha, Walid Taha, Jim Grundy, and John O'Leary. Static consistency checking for Verilog wire interconnects. Technical report, Rice University and Intel Strategic CAD Labs, http://www.resource-aware.org/twiki/pub/RAP/VPP/FVTR2.pdf, 2008.
[11]
Walid Taha. Multi-Stage Programming: Its Theory and Applications. PhD thesis, Oregon Graduate Institute of Science and Technology, 1999. available from (9).
[12]
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.
[13]
PolySpace Technologies. http://www.polyspace.com.
[14]
Arnaud Venet and Guillaume P. Brat. Precise and efficient static array bound checking for large embedded C programs. InWilliam Pugh and Craig Chambers, editors, PLDI, pages 231--242. ACM, 2004.
[15]
Hongwei Xi and Frank Pfenning. Eliminating array bound checking through dependent types. In Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 249--257, Montreal, June 1998.

Cited By

View all
  • (2010)Lightweight modular stagingACM SIGPLAN Notices10.1145/1942788.186831446:2(127-136)Online publication date: 10-Oct-2010
  • (2010)Lightweight modular stagingProceedings of the ninth international conference on Generative programming and component engineering10.1145/1868294.1868314(127-136)Online publication date: 10-Oct-2010

Index Terms

  1. Static consistency checking for verilog wire interconnects: using dependent types to check the sanity of verilog descriptions

          Recommendations

          Comments

          Please enable JavaScript to view thecomments powered by Disqus.

          Information & Contributors

          Information

          Published In

          cover image ACM Conferences
          PEPM '09: Proceedings of the 2009 ACM SIGPLAN workshop on Partial evaluation and program manipulation
          January 2009
          208 pages
          ISBN:9781605583273
          DOI:10.1145/1480945
          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]

          Sponsors

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          Published: 19 January 2009

          Permissions

          Request permissions for this article.

          Check for updates

          Author Tags

          1. dead code elimination
          2. dependent types
          3. static array bounds checking
          4. verilog elaboration
          5. verilog wire width consistency

          Qualifiers

          • Research-article

          Conference

          PEPM '09
          Sponsor:
          PEPM '09: Partial Evaluation and Program Manipulation
          January 19 - 20, 2009
          GA, Savannah, USA

          Acceptance Rates

          Overall Acceptance Rate 66 of 120 submissions, 55%

          Contributors

          Other Metrics

          Bibliometrics & Citations

          Bibliometrics

          Article Metrics

          • Downloads (Last 12 months)10
          • Downloads (Last 6 weeks)0
          Reflects downloads up to 31 Dec 2024

          Other Metrics

          Citations

          Cited By

          View all
          • (2010)Lightweight modular stagingACM SIGPLAN Notices10.1145/1942788.186831446:2(127-136)Online publication date: 10-Oct-2010
          • (2010)Lightweight modular stagingProceedings of the ninth international conference on Generative programming and component engineering10.1145/1868294.1868314(127-136)Online publication date: 10-Oct-2010

          View Options

          Login options

          View options

          PDF

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader

          Media

          Figures

          Other

          Tables

          Share

          Share

          Share this Publication link

          Share on social media